@coorpacademy/components 11.36.5-alpha.2 → 11.36.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/button-link/index.d.ts +2 -0
- package/es/atom/button-link/index.d.ts.map +1 -1
- package/es/atom/button-link/index.js +6 -5
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/types.d.ts +3 -0
- package/es/atom/button-link/types.d.ts.map +1 -1
- package/es/atom/button-link/types.js +3 -1
- package/es/atom/button-link/types.js.map +1 -1
- package/es/atom/button-menu/index.d.ts +2 -0
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +9 -3
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/style.css +22 -0
- package/es/atom/button-menu/types.d.ts +5 -0
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +4 -2
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/es/atom/checkbox-with-title/index.js +2 -2
- package/es/atom/checkbox-with-title/index.js.map +1 -1
- package/es/atom/radio-with-title/index.d.ts +2 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +2 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/tag/index.d.ts +1 -1
- package/es/atom/tag/index.d.ts.map +1 -1
- package/es/atom/tag/index.js +3 -14
- package/es/atom/tag/index.js.map +1 -1
- package/es/atom/title/index.d.ts +2 -0
- package/es/molecule/bullet-point-menu-button/index.d.ts +1 -0
- package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/es/molecule/bullet-point-menu-button/types.d.ts +1 -0
- package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/es/molecule/button-menu-action/index.d.ts +5 -0
- package/es/molecule/button-menu-action/index.d.ts.map +1 -1
- package/es/molecule/button-menu-action/index.js +5 -2
- package/es/molecule/button-menu-action/index.js.map +1 -1
- package/es/molecule/button-menu-action/types.d.ts +9 -3
- package/es/molecule/button-menu-action/types.d.ts.map +1 -1
- package/es/molecule/button-menu-action/types.js +2 -1
- package/es/molecule/button-menu-action/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +24 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/index.d.ts +4 -0
- package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/es/molecule/expandible-actionable-table/types.d.ts +4 -0
- package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.js +2 -2
- package/es/molecule/multi-filter-panel/index.js.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +2 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +2 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +2 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +22 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +22 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.d.ts +2 -2
- package/es/organism/filter-checkbox-and-search/index.js +5 -5
- package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +3 -0
- package/es/organism/header-with-actions/index.d.ts.map +1 -1
- package/es/organism/header-with-actions/types.d.ts +3 -0
- package/es/organism/header-with-actions/types.d.ts.map +1 -1
- package/es/organism/icon-editor/index.d.ts +2 -0
- package/es/organism/icon-editor/index.d.ts.map +1 -1
- package/es/organism/icon-editor/types.d.ts +2 -0
- package/es/organism/icon-editor/types.d.ts.map +1 -1
- package/es/organism/list-items/index.d.ts +22 -0
- package/es/organism/mooc-header/index.d.ts +1 -0
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +7 -3
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +7 -0
- package/es/organism/rewards-form/index.d.ts +2 -0
- package/es/organism/select-opponents/index.d.ts +2 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +2 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/setup-header/index.d.ts +8 -0
- package/es/organism/title-and-input/index.d.ts +6 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +6 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +10 -0
- package/es/template/app-player/loading/index.d.ts +24 -0
- package/es/template/app-player/player/index.d.ts +48 -0
- package/es/template/app-player/player/slides/index.d.ts +24 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +24 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +24 -0
- package/es/template/app-review/index.d.ts +24 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +24 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +24 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-create/index.d.ts +8 -0
- package/es/template/back-office/brand-create/index.d.ts.map +1 -1
- package/es/template/back-office/brand-list/index.d.ts +8 -0
- package/es/template/back-office/brand-list/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +89 -0
- package/es/template/back-office/dashboard-preview/index.d.ts +8 -0
- package/es/template/back-office/layout/index.d.ts +8 -0
- package/es/template/back-office/layout/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.d.ts +48 -0
- package/es/template/common/search-page/index.d.ts +24 -0
- package/es/template/external-course/index.d.ts +24 -0
- package/lib/atom/button-link/index.d.ts +2 -0
- package/lib/atom/button-link/index.d.ts.map +1 -1
- package/lib/atom/button-link/index.js +6 -5
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/types.d.ts +3 -0
- package/lib/atom/button-link/types.d.ts.map +1 -1
- package/lib/atom/button-link/types.js +3 -1
- package/lib/atom/button-link/types.js.map +1 -1
- package/lib/atom/button-menu/index.d.ts +2 -0
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +9 -3
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/style.css +22 -0
- package/lib/atom/button-menu/types.d.ts +5 -0
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +4 -2
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/lib/atom/checkbox-with-title/index.js +2 -2
- package/lib/atom/checkbox-with-title/index.js.map +1 -1
- package/lib/atom/radio-with-title/index.d.ts +2 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +2 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/tag/index.d.ts +1 -1
- package/lib/atom/tag/index.d.ts.map +1 -1
- package/lib/atom/tag/index.js +3 -14
- package/lib/atom/tag/index.js.map +1 -1
- package/lib/atom/title/index.d.ts +2 -0
- package/lib/molecule/bullet-point-menu-button/index.d.ts +1 -0
- package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
- package/lib/molecule/bullet-point-menu-button/types.d.ts +1 -0
- package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/index.d.ts +5 -0
- package/lib/molecule/button-menu-action/index.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/index.js +5 -2
- package/lib/molecule/button-menu-action/index.js.map +1 -1
- package/lib/molecule/button-menu-action/types.d.ts +9 -3
- package/lib/molecule/button-menu-action/types.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/types.js +2 -1
- package/lib/molecule/button-menu-action/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +24 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/index.d.ts +4 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
- package/lib/molecule/expandible-actionable-table/types.d.ts +4 -0
- package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.js.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +2 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +2 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +2 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +22 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +22 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.d.ts +2 -2
- package/lib/organism/filter-checkbox-and-search/index.js +5 -5
- package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +3 -0
- package/lib/organism/header-with-actions/index.d.ts.map +1 -1
- package/lib/organism/header-with-actions/types.d.ts +3 -0
- package/lib/organism/header-with-actions/types.d.ts.map +1 -1
- package/lib/organism/icon-editor/index.d.ts +2 -0
- package/lib/organism/icon-editor/index.d.ts.map +1 -1
- package/lib/organism/icon-editor/types.d.ts +2 -0
- package/lib/organism/icon-editor/types.d.ts.map +1 -1
- package/lib/organism/list-items/index.d.ts +22 -0
- package/lib/organism/mooc-header/index.d.ts +1 -0
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +7 -3
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +7 -0
- package/lib/organism/rewards-form/index.d.ts +2 -0
- package/lib/organism/select-opponents/index.d.ts +2 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +2 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/setup-header/index.d.ts +8 -0
- package/lib/organism/title-and-input/index.d.ts +6 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +6 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +10 -0
- package/lib/template/app-player/loading/index.d.ts +24 -0
- package/lib/template/app-player/player/index.d.ts +48 -0
- package/lib/template/app-player/player/slides/index.d.ts +24 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +24 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +24 -0
- package/lib/template/app-review/index.d.ts +24 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +24 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +24 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-create/index.d.ts +8 -0
- package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-list/index.d.ts +8 -0
- package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +89 -0
- package/lib/template/back-office/dashboard-preview/index.d.ts +8 -0
- package/lib/template/back-office/layout/index.d.ts +8 -0
- package/lib/template/back-office/layout/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.d.ts +48 -0
- package/lib/template/common/search-page/index.d.ts +24 -0
- package/lib/template/external-course/index.d.ts +24 -0
- package/package.json +2 -2
|
@@ -38,6 +38,8 @@ declare const ButtonLink: {
|
|
|
38
38
|
customStyle: import("prop-types").Requireable<{
|
|
39
39
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
40
40
|
}>;
|
|
41
|
+
useTitle: import("prop-types").Requireable<boolean>;
|
|
42
|
+
customLabelClassName: import("prop-types").Requireable<string>;
|
|
41
43
|
};
|
|
42
44
|
};
|
|
43
45
|
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;AAqD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4IzC,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, customLabelClassName) => {
|
|
12
12
|
const {
|
|
13
13
|
type,
|
|
14
14
|
faIcon,
|
|
@@ -20,9 +20,9 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
|
|
|
20
20
|
const Icon = type && ICONS[type];
|
|
21
21
|
if (!Icon && !faIcon) {
|
|
22
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: style.buttonContent
|
|
23
|
+
className: (style.buttonContent, customLabelClassName)
|
|
24
24
|
}, /*#__PURE__*/React.createElement("span", {
|
|
25
|
-
className: style.label
|
|
25
|
+
className: (style.label, customLabelClassName)
|
|
26
26
|
}, content));
|
|
27
27
|
}
|
|
28
28
|
const iconComponent = faIcon ? /*#__PURE__*/React.createElement(FaIcon, {
|
|
@@ -65,7 +65,8 @@ const ButtonLink = props => {
|
|
|
65
65
|
onKeyDown = _noop,
|
|
66
66
|
className,
|
|
67
67
|
customStyle,
|
|
68
|
-
useTitle = true
|
|
68
|
+
useTitle = true,
|
|
69
|
+
customLabelClassName
|
|
69
70
|
} = props;
|
|
70
71
|
const styleButton = classnames(link && style.link, 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, disabled && style.disabled);
|
|
71
72
|
const [hovered, setHovered] = useState(false);
|
|
@@ -113,7 +114,7 @@ const ButtonLink = props => {
|
|
|
113
114
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
114
115
|
onMouseEnter: handleMouseOver,
|
|
115
116
|
onMouseLeave: handleMouseLeave
|
|
116
|
-
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor), renderToolTip());
|
|
117
|
+
}), getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor, customLabelClassName), renderToolTip());
|
|
117
118
|
}
|
|
118
119
|
return /*#__PURE__*/React.createElement("button", _extends({}, useTitle && {
|
|
119
120
|
title: ariaLabel || label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","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, {DEFAULT_ICON_COLOR, IconProps} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...({\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n } as IconProps)}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n link && style.link,\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n className={styleButton}\n style={customStyle}\n data-name={dataName}\n data-testid={dataTestId}\n onClick={handleOnClick}\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,IAAGC,kBAAkB,QAAkB,SAAS;AAC7D,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;E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oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","customLabelClassName","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, {DEFAULT_ICON_COLOR, IconProps} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string,\n customLabelClassName?: 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, customLabelClassName)}>\n <span className={(style.label, customLabelClassName)}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...({\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? null\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n } as IconProps)}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true,\n customLabelClassName\n } = props;\n const styleButton = classnames(\n link && style.link,\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n className={styleButton}\n style={customStyle}\n data-name={dataName}\n data-testid={dataTestId}\n onClick={handleOnClick}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(\n icon,\n content ?? label,\n hovered,\n hoverBackgroundColor,\n hoverColor,\n customLabelClassName\n )}\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,IAAGC,kBAAkB,QAA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UAAW;IACxBhC,KAAK,EAAE+D,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,IAElB7B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIY,KAAK,EAAEX,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFmD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC5B,SAAS,GAAAuE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGzE,SAAS;AAEhC,eAAe4B,UAAU","ignoreList":[]}
|
|
@@ -49,6 +49,8 @@ declare const propTypes: {
|
|
|
49
49
|
customStyle: PropTypes.Requireable<{
|
|
50
50
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
51
51
|
}>;
|
|
52
|
+
useTitle: PropTypes.Requireable<boolean>;
|
|
53
|
+
customLabelClassName: PropTypes.Requireable<string>;
|
|
52
54
|
};
|
|
53
55
|
export declare type FaIconType = {
|
|
54
56
|
name: string;
|
|
@@ -86,6 +88,7 @@ export declare type ButtonLinkProps = {
|
|
|
86
88
|
className?: string;
|
|
87
89
|
customStyle?: Record<string, string | number>;
|
|
88
90
|
useTitle?: boolean;
|
|
91
|
+
customLabelClassName?: string;
|
|
89
92
|
};
|
|
90
93
|
export declare type Fixture = {
|
|
91
94
|
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;AAU9C,eAAO,MAAM,aAAa;;;;;;;;;;;;CAIzB,CA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B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;KAClD,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -34,7 +34,9 @@ const propTypes = {
|
|
|
34
34
|
hoverColor: PropTypes.string,
|
|
35
35
|
disabled: PropTypes.bool,
|
|
36
36
|
className: PropTypes.string,
|
|
37
|
-
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
37
|
+
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
38
|
+
useTitle: PropTypes.bool,
|
|
39
|
+
customLabelClassName: PropTypes.string
|
|
38
40
|
};
|
|
39
41
|
export default propTypes;
|
|
40
42
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","objectOf","oneOfType","iconPropTypes","position","oneOf","type","_keys","faIcon","shape","propTypes","usage","label","content","node","tooltipText","tooltipPlacement","icon","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className"],"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 faIconPropTypes = {\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n backgroundColor: PropTypes.string,\n size: PropTypes.number,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport const iconPropTypes = {\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.shape(faIconPropTypes)\n};\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape(iconPropTypes),\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.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport type FaIconType = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, number | string>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIconType;\n};\n\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: PropTypes.ReactNodeLike;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\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, string | number>;\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,eAAe,GAAG;EACtBC,IAAI,EAAEH,SAAS,CAACI,MAAM,CAACC,UAAU;EACjCC,KAAK,EAAEN,SAAS,CAACI,MAAM;EACvBG,eAAe,EAAEP,SAAS,CAACI,MAAM;EACjCI,IAAI,EAAER,SAAS,CAACS,MAAM;EACtBC,WAAW,EAAEV,SAAS,CAACW,QAAQ,CAACX,SAAS,CAACY,SAAS,CAAC,CAACZ,SAAS,CAACI,MAAM,EAAEJ,SAAS,CAACS,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,OAAO,MAAMI,aAAa,GAAG;EAC3BC,QAAQ,EAAEd,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC5CC,IAAI,EAAEhB,SAAS,CAACe,KAAK,CAACE,KAAA,CAAKhB,KAAK,CAAC,CAAC;EAClCiB,MAAM,EAAElB,SAAS,CAACmB,KAAK,CAACjB,eAAe;AACzC,CAAC;AAED,MAAMkB,SAAS,GAAG;EAChBJ,IAAI,EAAEhB,SAAS,CAACe,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAChFM,KAAK,EAAErB,SAAS,CAACe,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;EACrDO,KAAK,EAAEtB,SAAS,CAACI,MAAM;EACvBmB,OAAO,EAAEvB,SAAS,CAACwB,IAAI;EACvB,YAAY,EAAExB,SAAS,CAACI,MAAM;EAC9BqB,WAAW,EAAEzB,SAAS,CAACI,MAAM;EAC7BsB,gBAAgB,EAAE1B,SAAS,CAACe,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EACrE,WAAW,EAAEf,SAAS,CAACI,MAAM;EAC7B,aAAa,EAAEJ,SAAS,CAACI,MAAM;EAC/BuB,IAAI,EAAE3B,SAAS,CAACmB,KAAK,CAACN,aAAa,CAAC;EACpCe,OAAO,EAAE5B,SAAS,CAAC6B,IAAI;EACvBC,IAAI,EAAE9B,SAAS,CAACmB,KAAK,CAAC;IACpBY,IAAI,EAAE/B,SAAS,CAACI,MAAM;IACtB4B,QAAQ,EAAEhC,SAAS,CAACiC,IAAI;IACxBC,MAAM,EAAElC,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFoB,oBAAoB,EAAEnC,SAAS,CAACI,MAAM;EACtCgC,UAAU,EAAEpC,SAAS,CAACI,MAAM;EAC5BiC,QAAQ,EAAErC,SAAS,CAACiC,IAAI;EACxBK,SAAS,EAAEtC,SAAS,CAACI,MAAM;EAC3BM,WAAW,EAAEV,SAAS,CAACW,QAAQ,CAACX,SAAS,CAACY,SAAS,CAAC,CAACZ,SAAS,CAACI,MAAM,EAAEJ,SAAS,CAACS,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","objectOf","oneOfType","iconPropTypes","position","oneOf","type","_keys","faIcon","shape","propTypes","usage","label","content","node","tooltipText","tooltipPlacement","icon","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","useTitle","customLabelClassName"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst faIconPropTypes = {\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n backgroundColor: PropTypes.string,\n size: PropTypes.number,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport const iconPropTypes = {\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.shape(faIconPropTypes)\n};\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape(iconPropTypes),\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.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n useTitle: PropTypes.bool,\n customLabelClassName: PropTypes.string\n};\n\nexport type FaIconType = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, number | string>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIconType;\n};\n\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: PropTypes.ReactNodeLike;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\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, string | number>;\n useTitle?: boolean;\n customLabelClassName?: string;\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,eAAe,GAAG;EACtBC,IAAI,EAAEH,SAAS,CAACI,MAAM,CAACC,UAAU;EACjCC,KAAK,EAAEN,SAAS,CAACI,MAAM;EACvBG,eAAe,EAAEP,SAAS,CAACI,MAAM;EACjCI,IAAI,EAAER,SAAS,CAACS,MAAM;EACtBC,WAAW,EAAEV,SAAS,CAACW,QAAQ,CAACX,SAAS,CAACY,SAAS,CAAC,CAACZ,SAAS,CAACI,MAAM,EAAEJ,SAAS,CAACS,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,OAAO,MAAMI,aAAa,GAAG;EAC3BC,QAAQ,EAAEd,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC5CC,IAAI,EAAEhB,SAAS,CAACe,KAAK,CAACE,KAAA,CAAKhB,KAAK,CAAC,CAAC;EAClCiB,MAAM,EAAElB,SAAS,CAACmB,KAAK,CAACjB,eAAe;AACzC,CAAC;AAED,MAAMkB,SAAS,GAAG;EAChBJ,IAAI,EAAEhB,SAAS,CAACe,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;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@@ -27,9 +27,11 @@ declare const ButtonMenu: {
|
|
|
27
27
|
customStyle: import("prop-types").Requireable<{
|
|
28
28
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
29
29
|
}>;
|
|
30
|
+
customLabelClassName: import("prop-types").Requireable<string>;
|
|
30
31
|
}> | null | undefined)[]>;
|
|
31
32
|
'data-name': import("prop-types").Requireable<string>;
|
|
32
33
|
'aria-label': import("prop-types").Requireable<string>;
|
|
34
|
+
enableScroll: import("prop-types").Requireable<boolean>;
|
|
33
35
|
};
|
|
34
36
|
};
|
|
35
37
|
export default ButtonMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AAkEjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -37,6 +37,7 @@ const Button = props => {
|
|
|
37
37
|
buttonLinkType,
|
|
38
38
|
icon,
|
|
39
39
|
customStyle = {},
|
|
40
|
+
customLabelClassName,
|
|
40
41
|
...rest
|
|
41
42
|
} = props;
|
|
42
43
|
const styleButton = classnames(style.button, type === 'default' && style.defaultStyle, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled);
|
|
@@ -52,7 +53,8 @@ const Button = props => {
|
|
|
52
53
|
className: styleButton,
|
|
53
54
|
customStyle: {
|
|
54
55
|
...customStyle
|
|
55
|
-
}
|
|
56
|
+
},
|
|
57
|
+
customLabelClassName
|
|
56
58
|
};
|
|
57
59
|
const iconProps = buildCustomIconByTheme(icon);
|
|
58
60
|
return /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonLinkProps, {
|
|
@@ -63,7 +65,8 @@ Button.propTypes = process.env.NODE_ENV !== "production" ? buttonPropTypes : {};
|
|
|
63
65
|
const ButtonMenu = props => {
|
|
64
66
|
const {
|
|
65
67
|
buttons,
|
|
66
|
-
'data-name': dataName
|
|
68
|
+
'data-name': dataName,
|
|
69
|
+
enableScroll = false
|
|
67
70
|
} = props;
|
|
68
71
|
const buildButton = useCallback((button, index) => {
|
|
69
72
|
return /*#__PURE__*/React.createElement(Button, _extends({}, button, {
|
|
@@ -75,9 +78,12 @@ const ButtonMenu = props => {
|
|
|
75
78
|
() => map.convert({
|
|
76
79
|
cap: false
|
|
77
80
|
})(buildButton, buttons), [buttons, buildButton]);
|
|
81
|
+
const containerStyle = classnames(style.buttonMenuContainer, {
|
|
82
|
+
[style.scrollable]: enableScroll
|
|
83
|
+
});
|
|
78
84
|
return /*#__PURE__*/React.createElement("div", {
|
|
79
85
|
"data-name": dataName,
|
|
80
|
-
className:
|
|
86
|
+
className: containerStyle
|
|
81
87
|
}, buttonList);
|
|
82
88
|
};
|
|
83
89
|
ButtonMenu.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","DEFAULT_ICON_STYLE","THEMES","buildCustomIconByTheme","icon","theme","iconProps","custom","customProps","faIcon","Button","props","dataName","disabled","label","onClick","_noop","type","buttonLinkType","customStyle","rest","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","buttonLinkProps","className","createElement","_extends","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","key","buttonList","convert","cap","buttonMenuContainer"],"sources":["../../../src/atom/button-menu/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\nimport {DEFAULT_ICON_STYLE, THEMES} from './utils';\n\nconst buildCustomIconByTheme = (icon: ButtonProps['icon']) => {\n if (!icon) return;\n\n const {theme, ...iconProps} = icon;\n const custom = theme && THEMES[theme];\n if (!custom) return iconProps;\n\n const customProps = custom\n ? {\n ...DEFAULT_ICON_STYLE,\n faIcon: {...DEFAULT_ICON_STYLE.faIcon, ...custom}\n }\n : null;\n\n return {\n ...iconProps,\n ...customProps\n };\n};\n\nconst Button = (props: ButtonProps) => {\n const {\n 'data-name': dataName,\n disabled,\n label,\n onClick = noop,\n type = 'default',\n buttonLinkType,\n icon,\n customStyle = {},\n ...rest\n } = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.defaultStyle,\n type === 'defaultLeft' && style.defaultLeft,\n type === 'dangerous' && style.dangerous,\n type === 'dangerousLeft' && style.dangerousLeft,\n disabled && style.disabled\n );\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const buttonLinkProps = {\n ...rest,\n 'aria-label': label,\n disabled,\n label,\n type: buttonLinkType,\n onClick: handleOnClick,\n 'data-name': dataName,\n className: styleButton,\n customStyle: {...customStyle}\n };\n\n const iconProps = buildCustomIconByTheme(icon);\n\n return <ButtonLink {...buttonLinkProps} icon={iconProps} />;\n};\n\nButton.propTypes = buttonPropTypes;\n\nconst ButtonMenu = (props: ButtonMenuProps) => {\n const {buttons, 'data-name': dataName} = props;\n const buildButton = useCallback((button: ButtonProps, index) => {\n return <Button {...button} key={button.label + index} />;\n }, []);\n\n const buttonList = useMemo(\n // @ts-expect-error (to avoid using map as any)\n () => map.convert({cap: false})(buildButton, buttons),\n [buttons, buildButton]\n );\n\n return (\n <div data-name={dataName} className={
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","DEFAULT_ICON_STYLE","THEMES","buildCustomIconByTheme","icon","theme","iconProps","custom","customProps","faIcon","Button","props","dataName","disabled","label","onClick","_noop","type","buttonLinkType","customStyle","customLabelClassName","rest","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","buttonLinkProps","className","createElement","_extends","process","env","NODE_ENV","ButtonMenu","buttons","enableScroll","buildButton","index","key","buttonList","convert","cap","containerStyle","buttonMenuContainer","scrollable"],"sources":["../../../src/atom/button-menu/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\nimport {DEFAULT_ICON_STYLE, THEMES} from './utils';\n\nconst buildCustomIconByTheme = (icon: ButtonProps['icon']) => {\n if (!icon) return;\n\n const {theme, ...iconProps} = icon;\n const custom = theme && THEMES[theme];\n if (!custom) return iconProps;\n\n const customProps = custom\n ? {\n ...DEFAULT_ICON_STYLE,\n faIcon: {...DEFAULT_ICON_STYLE.faIcon, ...custom}\n }\n : null;\n\n return {\n ...iconProps,\n ...customProps\n };\n};\n\nconst Button = (props: ButtonProps) => {\n const {\n 'data-name': dataName,\n disabled,\n label,\n onClick = noop,\n type = 'default',\n buttonLinkType,\n icon,\n customStyle = {},\n customLabelClassName,\n ...rest\n } = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.defaultStyle,\n type === 'defaultLeft' && style.defaultLeft,\n type === 'dangerous' && style.dangerous,\n type === 'dangerousLeft' && style.dangerousLeft,\n disabled && style.disabled\n );\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const buttonLinkProps = {\n ...rest,\n 'aria-label': label,\n disabled,\n label,\n type: buttonLinkType,\n onClick: handleOnClick,\n 'data-name': dataName,\n className: styleButton,\n customStyle: {...customStyle},\n customLabelClassName\n };\n\n const iconProps = buildCustomIconByTheme(icon);\n\n return <ButtonLink {...buttonLinkProps} icon={iconProps} />;\n};\n\nButton.propTypes = buttonPropTypes;\n\nconst ButtonMenu = (props: ButtonMenuProps) => {\n const {buttons, 'data-name': dataName, enableScroll = false} = props;\n const buildButton = useCallback((button: ButtonProps, index) => {\n return <Button {...button} key={button.label + index} />;\n }, []);\n\n const buttonList = useMemo(\n // @ts-expect-error (to avoid using map as any)\n () => map.convert({cap: false})(buildButton, buttons),\n [buttons, buildButton]\n );\n\n const containerStyle = classnames(style.buttonMenuContainer, {\n [style.scrollable]: enableScroll\n });\n\n return (\n <div data-name={dataName} className={containerStyle}>\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;AAEnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,IAAiCC,eAAe,QAAO,SAAS;AAChF,SAAQC,kBAAkB,EAAEC,MAAM,QAAO,SAAS;AAElD,MAAMC,sBAAsB,GAAIC,IAAyB,IAAK;EAC5D,IAAI,CAACA,IAAI,EAAE;EAEX,MAAM;IAACC,KAAK;IAAE,GAAGC;EAAS,CAAC,GAAGF,IAAI;EAClC,MAAMG,MAAM,GAAGF,KAAK,IAAIH,MAAM,CAACG,KAAK,CAAC;EACrC,IAAI,CAACE,MAAM,EAAE,OAAOD,SAAS;EAE7B,MAAME,WAAW,GAAGD,MAAM,GACtB;IACE,GAAGN,kBAAkB;IACrBQ,MAAM,EAAE;MAAC,GAAGR,kBAAkB,CAACQ,MAAM;MAAE,GAAGF;IAAM;EAClD,CAAC,GACD,IAAI;EAER,OAAO;IACL,GAAGD,SAAS;IACZ,GAAGE;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,MAAMoC,UAAU,GAAIzB,KAAsB,IAAK;EAC7C,MAAM;IAAC0B,OAAO;IAAE,WAAW,EAAEzB,QAAQ;IAAE0B,YAAY,GAAG;EAAK,CAAC,GAAG3B,KAAK;EACpE,MAAM4B,WAAW,GAAG7C,WAAW,CAAC,CAAC6B,MAAmB,EAAEiB,KAAK,KAAK;IAC9D,oBAAOhD,KAAA,CAAAuC,aAAA,CAACrB,MAAM,EAAAsB,QAAA,KAAKT,MAAM;MAAEkB,GAAG,EAAElB,MAAM,CAACT,KAAK,GAAG0B;IAAM,EAAE,CAAC;EAC1D,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,UAAU,GAAGjD,OAAO;EACxB;EACA,MAAME,GAAG,CAACgD,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACL,WAAW,EAAEF,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEE,WAAW,CACvB,CAAC;EAED,MAAMM,cAAc,GAAGjD,UAAU,CAACE,KAAK,CAACgD,mBAAmB,EAAE;IAC3D,CAAChD,KAAK,CAACiD,UAAU,GAAGT;EACtB,CAAC,CAAC;EAEF,oBACE9C,KAAA,CAAAuC,aAAA;IAAK,aAAWnB,QAAS;IAACkB,SAAS,EAAEe;EAAe,GACjDH,UACE,CAAC;AAEV,CAAC;AAEDN,UAAU,CAACrC,SAAS,GAAAkC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGpC,SAAS;AAEhC,eAAeqC,UAAU","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@value cm_negative_100 from colors;
|
|
4
4
|
@value cm_negative_300 from colors;
|
|
5
5
|
@value negative_100 from colors;
|
|
6
|
+
@value cm_grey_200 from colors;
|
|
6
7
|
|
|
7
8
|
.buttonMenuContainer {
|
|
8
9
|
display: flex;
|
|
@@ -10,8 +11,29 @@
|
|
|
10
11
|
gap: 8px;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
.scrollable {
|
|
15
|
+
max-height: 280px;
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
scrollbar-width: thin;
|
|
18
|
+
scrollbar-color: cm_grey_200 transparent;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.scrollable::-webkit-scrollbar {
|
|
22
|
+
width: 6px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.scrollable::-webkit-scrollbar-track {
|
|
26
|
+
background: transparent;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.scrollable::-webkit-scrollbar-thumb {
|
|
30
|
+
background-color: cm_grey_200;
|
|
31
|
+
border-radius: 3px;
|
|
32
|
+
}
|
|
33
|
+
|
|
13
34
|
.button {
|
|
14
35
|
width: auto;
|
|
36
|
+
min-height: 40px;
|
|
15
37
|
height: 40px;
|
|
16
38
|
font-family: Gilroy;
|
|
17
39
|
font-size: 14px;
|
|
@@ -24,6 +24,7 @@ export declare const buttonPropTypes: {
|
|
|
24
24
|
customStyle: PropTypes.Requireable<{
|
|
25
25
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
26
26
|
}>;
|
|
27
|
+
customLabelClassName: PropTypes.Requireable<string>;
|
|
27
28
|
};
|
|
28
29
|
declare const propTypes: {
|
|
29
30
|
buttons: PropTypes.Validator<(PropTypes.InferProps<{
|
|
@@ -50,9 +51,11 @@ declare const propTypes: {
|
|
|
50
51
|
customStyle: PropTypes.Requireable<{
|
|
51
52
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
52
53
|
}>;
|
|
54
|
+
customLabelClassName: PropTypes.Requireable<string>;
|
|
53
55
|
}> | null | undefined)[]>;
|
|
54
56
|
'data-name': PropTypes.Requireable<string>;
|
|
55
57
|
'aria-label': PropTypes.Requireable<string>;
|
|
58
|
+
enableScroll: PropTypes.Requireable<boolean>;
|
|
56
59
|
};
|
|
57
60
|
export default propTypes;
|
|
58
61
|
export declare type Theme = 'archived' | 'published' | 'deleted';
|
|
@@ -62,11 +65,13 @@ export declare type ButtonProps = Omit<ButtonLinkProps, 'type' | 'icon'> & {
|
|
|
62
65
|
icon?: IconType & {
|
|
63
66
|
theme?: Theme;
|
|
64
67
|
};
|
|
68
|
+
customLabelClassName?: string;
|
|
65
69
|
};
|
|
66
70
|
export declare type ButtonMenuProps = {
|
|
67
71
|
buttons: ButtonProps[];
|
|
68
72
|
'data-name'?: string;
|
|
69
73
|
'aria-label'?: string;
|
|
74
|
+
enableScroll?: boolean;
|
|
70
75
|
};
|
|
71
76
|
export declare type ButtonMenuPropsFixture = {
|
|
72
77
|
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;AACnC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAE9E,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAa3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAEzD,oBAAY,WAAW,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;IACjE,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC;IACjE,cAAc,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,QAAQ,GAAG;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAC,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC"}
|
|
@@ -11,12 +11,14 @@ export const buttonPropTypes = {
|
|
|
11
11
|
...iconPropTypes,
|
|
12
12
|
theme: PropTypes.oneOf(['archived', 'published', 'deleted'])
|
|
13
13
|
}),
|
|
14
|
-
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
14
|
+
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
15
|
+
customLabelClassName: PropTypes.string
|
|
15
16
|
};
|
|
16
17
|
const propTypes = {
|
|
17
18
|
buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,
|
|
18
19
|
'data-name': PropTypes.string,
|
|
19
|
-
'aria-label': PropTypes.string
|
|
20
|
+
'aria-label': PropTypes.string,
|
|
21
|
+
enableScroll: PropTypes.bool
|
|
20
22
|
};
|
|
21
23
|
export default propTypes;
|
|
22
24
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","iconPropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","theme","customStyle","objectOf","oneOfType","number","propTypes","buttons","arrayOf"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType, iconPropTypes} from '../button-link/types';\n\nexport const buttonPropTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),\n buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape({\n ...iconPropTypes,\n theme: PropTypes.oneOf(['archived', 'published', 'deleted'])\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nexport default propTypes;\n\nexport type Theme = 'archived' | 'published' | 'deleted';\n\nexport type ButtonProps = Omit<ButtonLinkProps, 'type' | 'icon'> & {\n type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';\n buttonLinkType?: ButtonLinkProps['type'];\n icon?: IconType & {theme?: Theme};\n};\n\nexport type ButtonMenuProps = {\n buttons: ButtonProps[];\n 'data-name'?: string;\n 'aria-label'?: string;\n};\n\nexport type ButtonMenuPropsFixture = {props: ButtonMenuProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,SAAmCC,aAAa,QAAO,sBAAsB;AAE7E,OAAO,MAAMC,eAAe,GAAG;EAC7B,WAAW,EAAEF,SAAS,CAACG,MAAM;EAC7BC,QAAQ,EAAEJ,SAAS,CAACK,IAAI;EACxBC,KAAK,EAAEN,SAAS,CAACG,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAER,SAAS,CAACS,IAAI;EACvBC,IAAI,EAAEV,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;EAC/EC,cAAc,EAAEZ,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAC1FE,IAAI,EAAEb,SAAS,CAACc,KAAK,CAAC;IACpB,GAAGb,aAAa;IAChBc,KAAK,EAAEf,SAAS,CAACW,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC;EAC7D,CAAC,CAAC;EACFK,WAAW,EAAEhB,SAAS,CAACiB,QAAQ,CAACjB,SAAS,CAACkB,SAAS,CAAC,CAAClB,SAAS,CAACG,MAAM,EAAEH,SAAS,CAACmB,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","iconPropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","theme","customStyle","objectOf","oneOfType","number","customLabelClassName","propTypes","buttons","arrayOf","enableScroll"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType, iconPropTypes} from '../button-link/types';\n\nexport const buttonPropTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),\n buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape({\n ...iconPropTypes,\n theme: PropTypes.oneOf(['archived', 'published', 'deleted'])\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n customLabelClassName: PropTypes.string\n};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n enableScroll: PropTypes.bool\n};\n\nexport default propTypes;\n\nexport type Theme = 'archived' | 'published' | 'deleted';\n\nexport type ButtonProps = Omit<ButtonLinkProps, 'type' | 'icon'> & {\n type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';\n buttonLinkType?: ButtonLinkProps['type'];\n icon?: IconType & {theme?: Theme};\n customLabelClassName?: string;\n};\n\nexport type ButtonMenuProps = {\n buttons: ButtonProps[];\n 'data-name'?: string;\n 'aria-label'?: string;\n enableScroll?: boolean;\n};\n\nexport type ButtonMenuPropsFixture = {props: ButtonMenuProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,SAAmCC,aAAa,QAAO,sBAAsB;AAE7E,OAAO,MAAMC,eAAe,GAAG;EAC7B,WAAW,EAAEF,SAAS,CAACG,MAAM;EAC7BC,QAAQ,EAAEJ,SAAS,CAACK,IAAI;EACxBC,KAAK,EAAEN,SAAS,CAACG,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAER,SAAS,CAACS,IAAI;EACvBC,IAAI,EAAEV,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;EAC/EC,cAAc,EAAEZ,SAAS,CAACW,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAC1FE,IAAI,EAAEb,SAAS,CAACc,KAAK,CAAC;IACpB,GAAGb,aAAa;IAChBc,KAAK,EAAEf,SAAS,CAACW,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC;EAC7D,CAAC,CAAC;EACFK,WAAW,EAAEhB,SAAS,CAACiB,QAAQ,CAACjB,SAAS,CAACkB,SAAS,CAAC,CAAClB,SAAS,CAACG,MAAM,EAAEH,SAAS,CAACmB,MAAM,CAAC,CAAC,CAAC;EAC1FC,oBAAoB,EAAEpB,SAAS,CAACG;AAClC,CAAC;AAED,MAAMkB,SAAS,GAAG;EAChBC,OAAO,EAAEtB,SAAS,CAACuB,OAAO,CAACvB,SAAS,CAACc,KAAK,CAACZ,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEP,SAAS,CAACG,MAAM;EAC7B,YAAY,EAAEH,SAAS,CAACG,MAAM;EAC9BqB,YAAY,EAAExB,SAAS,CAACK;AAC1B,CAAC;AAED,eAAegB,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/checkbox-with-title/index.js"],"names":[],"mappings":";AAQA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/checkbox-with-title/index.js"],"names":[],"mappings":";AAQA,4DAwDC"}
|
|
@@ -36,7 +36,7 @@ const CheckboxWithTitle = props => {
|
|
|
36
36
|
style: {
|
|
37
37
|
...customStyle
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
40
40
|
htmlFor: idCheckbox
|
|
41
41
|
}, /*#__PURE__*/React.createElement("input", {
|
|
42
42
|
type: "checkbox",
|
|
@@ -61,7 +61,7 @@ const CheckboxWithTitle = props => {
|
|
|
61
61
|
iconColor: 'transparent',
|
|
62
62
|
preset: "s",
|
|
63
63
|
customStyle: DEFAULT_ICON_STYLE
|
|
64
|
-
})))
|
|
64
|
+
}))), title ? /*#__PURE__*/React.createElement("span", {
|
|
65
65
|
// eslint-disable-next-line react/no-danger
|
|
66
66
|
dangerouslySetInnerHTML: {
|
|
67
67
|
__html: title
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FaIcon","style","DEFAULT_ICON_STYLE","padding","width","height","CheckboxWithTitle","props","title","name","checked","onChange","_noop","dataName","ariaLabel","icon","iconName","iconColor","preset","customStyle","idCheckbox","_uniqueId","handleChange","e","target","createElement","className","container","htmlFor","type","id","checkbox","label","dangerouslySetInnerHTML","__html","propTypes","process","env","NODE_ENV","string","bool","func","shape","objectOf","oneOfType","number"],"sources":["../../../src/atom/checkbox-with-title/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport FaIcon from '../icon';\nimport style from './style.css';\n\nconst DEFAULT_ICON_STYLE = {padding: '0', width: '20px', height: '20px'};\n\nconst CheckboxWithTitle = props => {\n const {\n title,\n name,\n checked,\n onChange = noop,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n icon = {iconName: 'check', iconColor: 'white', preset: 's'},\n customStyle = {}\n } = props;\n const {iconName, iconColor, preset} = icon;\n const idCheckbox = useMemo(() => uniqueId('input-checkbox-'), []);\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n return (\n <div className={style.container} style={{...customStyle}}>\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FaIcon","style","DEFAULT_ICON_STYLE","padding","width","height","CheckboxWithTitle","props","title","name","checked","onChange","_noop","dataName","ariaLabel","icon","iconName","iconColor","preset","customStyle","idCheckbox","_uniqueId","handleChange","e","target","createElement","className","container","htmlFor","type","id","checkbox","label","dangerouslySetInnerHTML","__html","propTypes","process","env","NODE_ENV","string","bool","func","shape","objectOf","oneOfType","number"],"sources":["../../../src/atom/checkbox-with-title/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport FaIcon from '../icon';\nimport style from './style.css';\n\nconst DEFAULT_ICON_STYLE = {padding: '0', width: '20px', height: '20px'};\n\nconst CheckboxWithTitle = props => {\n const {\n title,\n name,\n checked,\n onChange = noop,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n icon = {iconName: 'check', iconColor: 'white', preset: 's'},\n customStyle = {}\n } = props;\n const {iconName, iconColor, preset} = icon;\n const idCheckbox = useMemo(() => uniqueId('input-checkbox-'), []);\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n return (\n <div className={style.container} style={{...customStyle}}>\n <label htmlFor={idCheckbox}>\n <input\n type=\"checkbox\"\n id={idCheckbox}\n name={name}\n onChange={handleChange}\n checked={checked}\n className={style.checkbox}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n <div className={style.label}>\n {checked ? (\n <FaIcon\n className={style.icon}\n iconName={iconName}\n iconColor={iconColor}\n preset={preset}\n customStyle={DEFAULT_ICON_STYLE}\n />\n ) : (\n <FaIcon\n className={style.icon}\n iconName={'square'}\n iconColor={'transparent'}\n preset=\"s\"\n customStyle={DEFAULT_ICON_STYLE}\n />\n )}\n </div>\n </label>\n {title ? (\n <span\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n ) : null}\n </div>\n );\n};\n\nCheckboxWithTitle.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n checked: PropTypes.bool,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n iconName: PropTypes.string,\n iconColor: PropTypes.string,\n preset: PropTypes.string\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\nexport default CheckboxWithTitle;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,MAAM,MAAM,SAAS;AAC5B,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,kBAAkB,GAAG;EAACC,OAAO,EAAE,GAAG;EAAEC,KAAK,EAAE,MAAM;EAAEC,MAAM,EAAE;AAAM,CAAC;AAExE,MAAMC,iBAAiB,GAAGC,KAAK,IAAI;EACjC,MAAM;IACJC,KAAK;IACLC,IAAI;IACJC,OAAO;IACPC,QAAQ,GAAAC,KAAO;IACf,WAAW,EAAEC,QAAQ;IACrB,YAAY,EAAEC,SAAS;IACvBC,IAAI,GAAG;MAACC,QAAQ,EAAE,OAAO;MAAEC,SAAS,EAAE,OAAO;MAAEC,MAAM,EAAE;IAAG,CAAC;IAC3DC,WAAW,GAAG,CAAC;EACjB,CAAC,GAA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AEA,CACA,CAAC,EACPM,KAAK,gBACJX,KAAA,CAAA4B,aAAA;IACE;IACAQ,uBAAuB,EAAE;MAACC,MAAM,EAAE1B;IAAK;EAAE,CAC1C,CAAC,GACA,IACD,CAAC;AAEV,CAAC;AAEDF,iBAAiB,CAAC6B,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAC5B9B,KAAK,EAAET,SAAS,CAACwC,MAAM;EACvB9B,IAAI,EAAEV,SAAS,CAACwC,MAAM;EACtB7B,OAAO,EAAEX,SAAS,CAACyC,IAAI;EACvB7B,QAAQ,EAAEZ,SAAS,CAAC0C,IAAI;EACxB,YAAY,EAAE1C,SAAS,CAACwC,MAAM;EAC9B,WAAW,EAAExC,SAAS,CAACwC,MAAM;EAC7BxB,IAAI,EAAEhB,SAAS,CAAC2C,KAAK,CAAC;IACpB1B,QAAQ,EAAEjB,SAAS,CAACwC,MAAM;IAC1BtB,SAAS,EAAElB,SAAS,CAACwC,MAAM;IAC3BrB,MAAM,EAAEnB,SAAS,CAACwC;EACpB,CAAC,CAAC;EACFpB,WAAW,EAAEpB,SAAS,CAAC4C,QAAQ,CAAC5C,SAAS,CAAC6C,SAAS,CAAC,CAAC7C,SAAS,CAACwC,MAAM,EAAExC,SAAS,CAAC8C,MAAM,CAAC,CAAC;AAC3F,CAAC;AACD,eAAevC,iBAAiB","ignoreList":[]}
|
|
@@ -66,6 +66,8 @@ declare const RadioWithTitle: {
|
|
|
66
66
|
customStyle: import("prop-types").Requireable<{
|
|
67
67
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
68
68
|
}>;
|
|
69
|
+
useTitle: import("prop-types").Requireable<boolean>;
|
|
70
|
+
customLabelClassName: import("prop-types").Requireable<string>;
|
|
69
71
|
}>>;
|
|
70
72
|
required: import("prop-types").Requireable<boolean>;
|
|
71
73
|
}>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -64,6 +64,8 @@ export declare const propTypes: {
|
|
|
64
64
|
customStyle: PropTypes.Requireable<{
|
|
65
65
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
66
66
|
}>;
|
|
67
|
+
useTitle: PropTypes.Requireable<boolean>;
|
|
68
|
+
customLabelClassName: PropTypes.Requireable<string>;
|
|
67
69
|
}>>;
|
|
68
70
|
required: PropTypes.Requireable<boolean>;
|
|
69
71
|
}>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
package/es/atom/tag/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tag/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tag/index.js"],"names":[],"mappings":";AAsBA;;;;;;gBAgBC"}
|
package/es/atom/tag/index.js
CHANGED
|
@@ -17,35 +17,24 @@ const TAG_SIZE = {
|
|
|
17
17
|
M: style.medium,
|
|
18
18
|
L: style.large
|
|
19
19
|
};
|
|
20
|
-
const defaultIconProps = {
|
|
21
|
-
position: 'left',
|
|
22
|
-
preset: 's'
|
|
23
|
-
};
|
|
24
|
-
const renderIcon = iconProps => /*#__PURE__*/React.createElement(Icon, iconProps);
|
|
25
20
|
const Tag = ({
|
|
26
|
-
label
|
|
21
|
+
label,
|
|
27
22
|
type = 'default',
|
|
28
23
|
size = 'M',
|
|
29
24
|
customStyle = {},
|
|
30
25
|
icon = {}
|
|
31
26
|
}) => {
|
|
32
|
-
const {
|
|
33
|
-
iconName
|
|
34
|
-
} = icon;
|
|
35
27
|
const {
|
|
36
28
|
position,
|
|
37
29
|
...iconProps
|
|
38
|
-
} =
|
|
39
|
-
...defaultIconProps,
|
|
40
|
-
...icon
|
|
41
|
-
} : {};
|
|
30
|
+
} = icon;
|
|
42
31
|
return /*#__PURE__*/React.createElement("span", {
|
|
43
32
|
className: classnames(TAG_STYLES[type], TAG_SIZE[size]),
|
|
44
33
|
"data-name": `content-tag-${label}`,
|
|
45
34
|
style: customStyle
|
|
46
35
|
}, /*#__PURE__*/React.createElement("div", {
|
|
47
36
|
className: style.content
|
|
48
|
-
}, position === 'left'
|
|
37
|
+
}, position === 'left' ? /*#__PURE__*/React.createElement(Icon, iconProps) : null, /*#__PURE__*/React.createElement("div", null, label), position === 'right' ? /*#__PURE__*/React.createElement(Icon, iconProps) : null));
|
|
49
38
|
};
|
|
50
39
|
Tag.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
51
40
|
label: PropTypes.string,
|
package/es/atom/tag/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Icon","style","TAG_STYLES","default","defaultStyle","success","failure","warning","progress","info","TAG_SIZE","S","small","M","medium","L","large","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Icon","style","TAG_STYLES","default","defaultStyle","success","failure","warning","progress","info","TAG_SIZE","S","small","M","medium","L","large","Tag","label","type","size","customStyle","icon","position","iconProps","createElement","className","content","propTypes","process","env","NODE_ENV","string","oneOf","_keys","objectOf","oneOfType","number","shape"],"sources":["../../../src/atom/tag/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {keys} from 'lodash/fp';\nimport Icon from '../icon';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.defaultStyle,\n success: style.success,\n failure: style.failure,\n warning: style.warning,\n progress: style.progress,\n info: style.info\n};\n\nconst TAG_SIZE = {\n S: style.small,\n M: style.medium,\n L: style.large\n};\n\nconst Tag = ({label, type = 'default', size = 'M', customStyle = {}, icon = {}}) => {\n const {position, ...iconProps} = icon;\n\n return (\n <span\n className={classnames(TAG_STYLES[type], TAG_SIZE[size])}\n data-name={`content-tag-${label}`}\n style={customStyle}\n >\n <div className={style.content}>\n {position === 'left' ? <Icon {...iconProps} /> : null}\n <div>{label}</div>\n {position === 'right' ? <Icon {...iconProps} /> : null}\n </div>\n </span>\n );\n};\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES)),\n size: PropTypes.oneOf(['S', 'M', 'L']),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n icon: PropTypes.shape({...Icon.propTypes, position: PropTypes.oneOf(['left', 'right'])})\n};\n\nexport default Tag;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAG;EACjBC,OAAO,EAAEF,KAAK,CAACG,YAAY;EAC3BC,OAAO,EAAEJ,KAAK,CAACI,OAAO;EACtBC,OAAO,EAAEL,KAAK,CAACK,OAAO;EACtBC,OAAO,EAAEN,KAAK,CAACM,OAAO;EACtBC,QAAQ,EAAEP,KAAK,CAACO,QAAQ;EACxBC,IAAI,EAAER,KAAK,CAACQ;AACd,CAAC;AAED,MAAMC,QAAQ,GAAG;EACfC,CAAC,EAAEV,KAAK,CAACW,KAAK;EACdC,CAAC,EAAEZ,KAAK,CAACa,MAAM;EACfC,CAAC,EAAEd,KAAK,CAACe;AACX,CAAC;AAED,MAAMC,GAAG,GAAGA,CAAC;EAACC,KAAK;EAAEC,IAAI,GAAG,SAAS;EAAEC,IAAI,GAAG,GAAG;EAAEC,WAAW,GAAG,CAAC,CAAC;EAAEC,IAAI,GAAG,CAAC;AAAC,CAAC,KAAK;EAClF,MAAM;IAACC,QAAQ;IAAE,GAAGC;EAAS,CAAC,GAAGF,IAAI;EAErC,oBACEzB,KAAA,CAAA4B,aAAA;IACEC,SAAS,EAAE3B,UAA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
|
65
65
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
66
66
|
}>;
|
|
67
|
+
useTitle: PropTypes.Requireable<boolean>;
|
|
68
|
+
customLabelClassName: PropTypes.Requireable<string>;
|
|
67
69
|
}>>;
|
|
68
70
|
required: PropTypes.Requireable<boolean>;
|
|
69
71
|
};
|
|
@@ -31,6 +31,7 @@ declare const BulletPointMenuButton: {
|
|
|
31
31
|
customStyle: import("prop-types").Requireable<{
|
|
32
32
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
33
33
|
}>;
|
|
34
|
+
customLabelClassName: import("prop-types").Requireable<string>;
|
|
34
35
|
}> | null | undefined)[]>;
|
|
35
36
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
36
37
|
menuButtonClassName: import("prop-types").Requireable<string>;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgF/D,CAAC;AAIF,eAAe,qBAAqB,CAAC"}
|
|
@@ -29,6 +29,7 @@ declare const propTypes: {
|
|
|
29
29
|
customStyle: PropTypes.Requireable<{
|
|
30
30
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
31
31
|
}>;
|
|
32
|
+
customLabelClassName: PropTypes.Requireable<string>;
|
|
32
33
|
}> | null | undefined)[]>;
|
|
33
34
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
35
|
menuButtonClassName: PropTypes.Requireable<string>;
|