@coorpacademy/components 11.35.3-forcedeploy9.5 → 11.36.1
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.js +2 -2
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-menu/index.d.ts +1 -1
- package/es/atom/button-menu/style.css +1 -1
- package/es/atom/button-menu/types.d.ts +2 -2
- package/es/atom/button-menu/types.js +1 -1
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/tag/style.css +1 -0
- package/es/molecule/brand-tabs/index.d.ts.map +1 -1
- package/es/molecule/brand-tabs/index.js +13 -6
- package/es/molecule/brand-tabs/index.js.map +1 -1
- package/es/molecule/brand-tabs/style.css +4 -5
- package/es/molecule/bullet-point-menu-button/index.d.ts +1 -1
- package/es/molecule/bullet-point-menu-button/types.d.ts +1 -1
- package/es/molecule/button-menu-action/index.d.ts +3 -1
- package/es/molecule/button-menu-action/index.d.ts.map +1 -1
- package/es/molecule/button-menu-action/index.js +34 -6
- package/es/molecule/button-menu-action/index.js.map +1 -1
- package/es/molecule/button-menu-action/style.css +36 -0
- package/es/molecule/button-menu-action/types.d.ts +6 -1
- package/es/molecule/button-menu-action/types.d.ts.map +1 -1
- package/es/molecule/button-menu-action/types.js +3 -1
- package/es/molecule/button-menu-action/types.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +8 -4
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +0 -2
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +1 -0
- package/es/molecule/expandible-actionable-table/index.d.ts +2 -2
- package/es/molecule/expandible-actionable-table/types.d.ts +2 -2
- package/es/molecule/icon-preview/index.d.ts.map +1 -1
- package/es/molecule/icon-preview/index.js +2 -1
- package/es/molecule/icon-preview/index.js.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +8 -4
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +8 -4
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +1 -1
- package/es/organism/header-with-actions/types.d.ts +1 -1
- package/es/organism/list-items/index.d.ts +8 -4
- package/es/organism/mooc-header/index.d.ts +1 -3
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +38 -39
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/mooc-header/style.css +15 -23
- package/es/organism/wizard-contents/index.d.ts +2 -2
- package/es/template/app-player/loading/index.d.ts +8 -4
- package/es/template/app-player/player/index.d.ts +16 -8
- package/es/template/app-player/player/slides/index.d.ts +8 -4
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +8 -4
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +8 -4
- package/es/template/app-review/index.d.ts +8 -4
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +8 -4
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +8 -4
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +27 -15
- package/es/template/common/dashboard/index.d.ts +16 -8
- package/es/template/common/search-page/index.d.ts +8 -4
- package/es/template/external-course/index.d.ts +8 -4
- package/es/template/skill-detail/all-courses.d.ts +0 -4
- package/es/template/skill-detail/all-courses.d.ts.map +1 -1
- package/es/template/skill-detail/all-courses.js.map +1 -1
- package/es/template/skill-detail/index.d.ts.map +1 -1
- package/es/template/skill-detail/index.js +1 -0
- package/es/template/skill-detail/index.js.map +1 -1
- package/es/template/skill-detail/style.css +42 -8
- package/lib/atom/button-link/index.js +2 -2
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-menu/index.d.ts +1 -1
- package/lib/atom/button-menu/style.css +1 -1
- package/lib/atom/button-menu/types.d.ts +2 -2
- package/lib/atom/button-menu/types.js +1 -1
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/tag/style.css +1 -0
- package/lib/molecule/brand-tabs/index.d.ts.map +1 -1
- package/lib/molecule/brand-tabs/index.js +13 -6
- package/lib/molecule/brand-tabs/index.js.map +1 -1
- package/lib/molecule/brand-tabs/style.css +4 -5
- package/lib/molecule/bullet-point-menu-button/index.d.ts +1 -1
- package/lib/molecule/bullet-point-menu-button/types.d.ts +1 -1
- package/lib/molecule/button-menu-action/index.d.ts +3 -1
- package/lib/molecule/button-menu-action/index.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/index.js +33 -5
- package/lib/molecule/button-menu-action/index.js.map +1 -1
- package/lib/molecule/button-menu-action/style.css +36 -0
- package/lib/molecule/button-menu-action/types.d.ts +6 -1
- package/lib/molecule/button-menu-action/types.d.ts.map +1 -1
- package/lib/molecule/button-menu-action/types.js +3 -1
- package/lib/molecule/button-menu-action/types.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +8 -4
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +0 -2
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +1 -0
- package/lib/molecule/expandible-actionable-table/index.d.ts +2 -2
- package/lib/molecule/expandible-actionable-table/types.d.ts +2 -2
- package/lib/molecule/icon-preview/index.d.ts.map +1 -1
- package/lib/molecule/icon-preview/index.js +2 -1
- package/lib/molecule/icon-preview/index.js.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +8 -4
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +8 -4
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +1 -1
- package/lib/organism/header-with-actions/types.d.ts +1 -1
- package/lib/organism/list-items/index.d.ts +8 -4
- package/lib/organism/mooc-header/index.d.ts +1 -3
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +37 -38
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/mooc-header/style.css +15 -23
- package/lib/organism/wizard-contents/index.d.ts +2 -2
- package/lib/template/app-player/loading/index.d.ts +8 -4
- package/lib/template/app-player/player/index.d.ts +16 -8
- package/lib/template/app-player/player/slides/index.d.ts +8 -4
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +8 -4
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +8 -4
- package/lib/template/app-review/index.d.ts +8 -4
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +8 -4
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +8 -4
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +27 -15
- package/lib/template/common/dashboard/index.d.ts +16 -8
- package/lib/template/common/search-page/index.d.ts +8 -4
- package/lib/template/external-course/index.d.ts +8 -4
- package/lib/template/skill-detail/all-courses.d.ts +0 -4
- package/lib/template/skill-detail/all-courses.d.ts.map +1 -1
- package/lib/template/skill-detail/all-courses.js.map +1 -1
- package/lib/template/skill-detail/index.d.ts.map +1 -1
- package/lib/template/skill-detail/index.js +1 -0
- package/lib/template/skill-detail/index.js.map +1 -1
- package/lib/template/skill-detail/style.css +42 -8
- package/package.json +2 -2
|
@@ -67,7 +67,7 @@ const ButtonLink = props => {
|
|
|
67
67
|
customStyle,
|
|
68
68
|
useTitle = true
|
|
69
69
|
} = 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,
|
|
70
|
+
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
71
|
const [hovered, setHovered] = useState(false);
|
|
72
72
|
const handleOnClick = useCallback(event => onClick(event), [onClick]);
|
|
73
73
|
const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);
|
|
@@ -103,8 +103,8 @@ const ButtonLink = props => {
|
|
|
103
103
|
return /*#__PURE__*/React.createElement(Link, _extends({}, link, useTitle && {
|
|
104
104
|
title: ariaLabel || label
|
|
105
105
|
}, {
|
|
106
|
-
style: customStyle,
|
|
107
106
|
className: styleButton,
|
|
107
|
+
style: customStyle,
|
|
108
108
|
"data-name": dataName,
|
|
109
109
|
"data-testid": dataTestId,
|
|
110
110
|
"aria-label": 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 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,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;EAAE,CAAC;EACjE,MAAMC,IAAI,GAAGH,IAAI,IAAIV,KAAK,CAACU,IAAI,CAAC;EAEhC,IAAI,CAACG,IAAI,IAAI,CAACF,MAAM,EAAE;IACpB,oBACEnB,KAAA,CAAAsB,aAAA;MAAKC,SAAS,EAAEZ,KAAK,CAACa;IAAc,gBAClCxB,KAAA,CAAAsB,aAAA;MAAMC,SAAS,EAAEZ,KAAK,CAACc;IAAM,GAAEX,OAAc,CAC1C,CAAC;EAEV;EAEA,MAAMY,aAAa,GAAG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AO,IAAIW,KAAK,EAAEV,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFkD,aAAa,CAAC,CACX,CAAC;EAEX;EAEA,oBACEnE,KAAA,CAAAsB,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","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 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;EAAE,CAAC;EACjE,MAAMC,IAAI,GAAGH,IAAI,IAAIV,KAAK,CAACU,IAAI,CAAC;EAEhC,IA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prop-types").Requireable<string>;
|
|
8
8
|
disabled: import("prop-types").Requireable<boolean>;
|
|
9
9
|
label: import("prop-types").Validator<string>;
|
|
10
|
-
onClick: import("prop-types").
|
|
10
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
11
11
|
type: import("prop-types").Requireable<string>;
|
|
12
12
|
buttonLinkType: import("prop-types").Requireable<string>;
|
|
13
13
|
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -4,7 +4,7 @@ export declare const buttonPropTypes: {
|
|
|
4
4
|
'data-name': PropTypes.Requireable<string>;
|
|
5
5
|
disabled: PropTypes.Requireable<boolean>;
|
|
6
6
|
label: PropTypes.Validator<string>;
|
|
7
|
-
onClick: PropTypes.
|
|
7
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
8
8
|
type: PropTypes.Requireable<string>;
|
|
9
9
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
10
10
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -30,7 +30,7 @@ declare const propTypes: {
|
|
|
30
30
|
'data-name': PropTypes.Requireable<string>;
|
|
31
31
|
disabled: PropTypes.Requireable<boolean>;
|
|
32
32
|
label: PropTypes.Validator<string>;
|
|
33
|
-
onClick: PropTypes.
|
|
33
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
34
|
type: PropTypes.Requireable<string>;
|
|
35
35
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
36
36
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -4,7 +4,7 @@ export const buttonPropTypes = {
|
|
|
4
4
|
'data-name': PropTypes.string,
|
|
5
5
|
disabled: PropTypes.bool,
|
|
6
6
|
label: PropTypes.string.isRequired,
|
|
7
|
-
onClick: PropTypes.func
|
|
7
|
+
onClick: PropTypes.func,
|
|
8
8
|
type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),
|
|
9
9
|
buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
10
10
|
icon: PropTypes.shape({
|
|
@@ -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
|
|
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;AAC3F,CAAC;AAED,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAErB,SAAS,CAACsB,OAAO,CAACtB,SAAS,CAACc,KAAK,CAACZ,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEP,SAAS,CAACG,MAAM;EAC7B,YAAY,EAAEH,SAAS,CAACG;AAC1B,CAAC;AAED,eAAeiB,SAAS","ignoreList":[]}
|
package/es/atom/tag/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-tabs/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/brand-tabs/index.js"],"names":[],"mappings":";AAmDA,oDAMC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _snakeCase from "lodash/fp/snakeCase";
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import Link from '../../atom/link';
|
|
5
|
-
import
|
|
6
|
+
import Tag from '../../atom/tag';
|
|
7
|
+
import { COLORS } from '../../variables/colors';
|
|
6
8
|
import style from './style.css';
|
|
7
9
|
const Tab = ({
|
|
8
10
|
tab,
|
|
@@ -19,6 +21,10 @@ const Tab = ({
|
|
|
19
21
|
const selectedStyle = isLightTab ? style.selectedlight : style.selected;
|
|
20
22
|
const unselectedStyle = isLightTab ? style.lighttab : style.tab;
|
|
21
23
|
const className = selected ? selectedStyle : unselectedStyle;
|
|
24
|
+
const tagSelectedStyle = {
|
|
25
|
+
backgroundColor: COLORS.primary_100,
|
|
26
|
+
color: COLORS.cm_primary_blue
|
|
27
|
+
};
|
|
22
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
29
|
"data-name": `brand_tab_${_snakeCase(title)}`,
|
|
24
30
|
className: className,
|
|
@@ -28,11 +34,12 @@ const Tab = ({
|
|
|
28
34
|
href: href
|
|
29
35
|
}, title), status ? /*#__PURE__*/React.createElement("div", {
|
|
30
36
|
className: style.statusItemWrapper
|
|
31
|
-
}, /*#__PURE__*/React.createElement(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Tag, _extends({}, selected && {
|
|
38
|
+
customStyle: tagSelectedStyle
|
|
39
|
+
}, {
|
|
40
|
+
size: "S",
|
|
41
|
+
label: status
|
|
42
|
+
}))) : null);
|
|
36
43
|
};
|
|
37
44
|
Tab.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
38
45
|
tab: PropTypes.shape({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Link","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Link","Tag","COLORS","style","Tab","tab","index","isLightTab","title","href","status","selected","onClick","selectedStyle","selectedlight","unselectedStyle","lighttab","className","tagSelectedStyle","backgroundColor","primary_100","color","cm_primary_blue","createElement","_snakeCase","key","statusItemWrapper","_extends","customStyle","size","label","propTypes","process","env","NODE_ENV","shape","children","string","bool","func","number","BrandTabs","props","tabs","type","tabsList","map","lightwrapper","wrapper","arrayOf","oneOf"],"sources":["../../../src/molecule/brand-tabs/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {snakeCase} from 'lodash/fp';\nimport Link from '../../atom/link';\nimport Tag from '../../atom/tag';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst Tab = ({tab, index, isLightTab}) => {\n const {title, href, status, selected, onClick} = tab;\n const selectedStyle = isLightTab ? style.selectedlight : style.selected;\n const unselectedStyle = isLightTab ? style.lighttab : style.tab;\n const className = selected ? selectedStyle : unselectedStyle;\n const tagSelectedStyle = {\n backgroundColor: COLORS.primary_100,\n color: COLORS.cm_primary_blue\n };\n return (\n <div\n data-name={`brand_tab_${snakeCase(title)}`}\n className={className}\n key={index}\n onClick={onClick}\n >\n <Link href={href}>{title}</Link>\n {status ? (\n <div className={style.statusItemWrapper}>\n <Tag\n {...(selected && {\n customStyle: tagSelectedStyle\n })}\n size=\"S\"\n label={status}\n />\n </div>\n ) : null}\n </div>\n );\n};\nTab.propTypes = {\n tab: PropTypes.shape({\n title: Link.propTypes.children,\n href: Link.propTypes.href,\n status: PropTypes.string,\n selected: PropTypes.bool,\n onClick: PropTypes.func\n }),\n index: PropTypes.number,\n isLightTab: PropTypes.bool\n};\n\nconst BrandTabs = props => {\n const {tabs, type = 'default'} = props;\n const isLightTab = type === 'light';\n const tabsList = tabs.map((tab, index) => Tab({tab, index, isLightTab}));\n\n return <div className={isLightTab ? style.lightwrapper : style.wrapper}>{tabsList}</div>;\n};\n\nBrandTabs.propTypes = {\n tabs: PropTypes.arrayOf(PropTypes.shape(Tab.propTypes)),\n type: PropTypes.oneOf(['default', 'light'])\n};\nexport default BrandTabs;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,GAAG,GAAGA,CAAC;EAACC,GAAG;EAAEC,KAAK;EAAEC;AAAU,CAAC,KAAK;EACxC,MAAM;IAACC,KAAK;IAAEC,IAAI;IAAEC,MAAM;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGP,GAAG;EACpD,MAAMQ,aAAa,GAAGN,UAAU,GAAGJ,KAAK,CAACW,aAAa,GAAGX,KAAK,CAACQ,QAAQ;EACvE,MAAMI,eAAe,GAAGR,UAAU,GAAGJ,KAAK,CAACa,QAAQ,GAAGb,KAAK,CAACE,GAAG;EAC/D,MAAMY,SAAS,GAAGN,QAAQ,GAAGE,aAAa,GAAGE,eAAe;EAC5D,MAAMG,gBAAgB,GAAG;IACvBC,eAAe,EAAEjB,MAAM,CAACkB,WAAW;IACnCC,KAAK,EAAEnB,MAAM,CAACoB;EA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KAAKF,GAAG,CAAC;IAACC,GAAG;IAAEC,KAAK;IAAEC;EAAU,CAAC,CAAC,CAAC;EAExE,oBAAOT,KAAA,CAAAyB,aAAA;IAAKN,SAAS,EAAEV,UAAU,GAAGJ,KAAK,CAAC4C,YAAY,GAAG5C,KAAK,CAAC6C;EAAQ,GAAEH,QAAc,CAAC;AAC1F,CAAC;AAEDJ,SAAS,CAACV,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACpBS,IAAI,EAAE5C,SAAS,CAACkD,OAAO,CAAClD,SAAS,CAACoC,KAAK,CAAC/B,GAAG,CAAC2B,SAAS,CAAC,CAAC;EACvDa,IAAI,EAAE7C,SAAS,CAACmD,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC;AAC5C,CAAC;AACD,eAAeT,SAAS","ignoreList":[]}
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.statusItemWrapper {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
height: 16px;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
.tab {
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
align-items: center;
|
|
41
40
|
justify-content: space-between;
|
|
42
41
|
padding: 8px 16px;
|
|
43
|
-
|
|
42
|
+
gap: 8px;
|
|
44
43
|
border-radius: 5px;
|
|
45
44
|
}
|
|
46
45
|
|
|
@@ -99,4 +98,4 @@
|
|
|
99
98
|
color: cm_primary_blue;
|
|
100
99
|
font-size: 14px;
|
|
101
100
|
font-weight: 600;
|
|
102
|
-
}
|
|
101
|
+
}
|
|
@@ -11,7 +11,7 @@ declare const BulletPointMenuButton: {
|
|
|
11
11
|
'data-name': import("prop-types").Requireable<string>;
|
|
12
12
|
disabled: import("prop-types").Requireable<boolean>;
|
|
13
13
|
label: import("prop-types").Validator<string>;
|
|
14
|
-
onClick: import("prop-types").
|
|
14
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
15
|
type: import("prop-types").Requireable<string>;
|
|
16
16
|
buttonLinkType: import("prop-types").Requireable<string>;
|
|
17
17
|
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -9,7 +9,7 @@ declare const propTypes: {
|
|
|
9
9
|
'data-name': PropTypes.Requireable<string>;
|
|
10
10
|
disabled: PropTypes.Requireable<boolean>;
|
|
11
11
|
label: PropTypes.Validator<string>;
|
|
12
|
-
onClick: PropTypes.
|
|
12
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
13
|
type: PropTypes.Requireable<string>;
|
|
14
14
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
15
15
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -45,7 +45,7 @@ declare const ButtonMenuAction: {
|
|
|
45
45
|
'data-name': import("prop-types").Requireable<string>;
|
|
46
46
|
disabled: import("prop-types").Requireable<boolean>;
|
|
47
47
|
label: import("prop-types").Validator<string>;
|
|
48
|
-
onClick: import("prop-types").
|
|
48
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
49
49
|
type: import("prop-types").Requireable<string>;
|
|
50
50
|
buttonLinkType: import("prop-types").Requireable<string>;
|
|
51
51
|
icon: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
@@ -75,6 +75,8 @@ declare const ButtonMenuAction: {
|
|
|
75
75
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
76
76
|
}>;
|
|
77
77
|
}>>;
|
|
78
|
+
type: import("prop-types").Requireable<string>;
|
|
79
|
+
primaryColor: import("prop-types").Requireable<string>;
|
|
78
80
|
};
|
|
79
81
|
};
|
|
80
82
|
export default ButtonMenuAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/button-menu-action/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/button-menu-action/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAGzD,QAAA,MAAM,gBAAgB;YAAW,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgErD,CAAC;AAIF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _noop from "lodash/fp/noop";
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useState, useRef } from 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
6
|
import ButtonLink from '../../atom/button-link';
|
|
6
7
|
import ButtonMenu from '../../atom/button-menu';
|
|
7
8
|
import propTypes from './types';
|
|
@@ -10,23 +11,31 @@ const ButtonMenuAction = props => {
|
|
|
10
11
|
const {
|
|
11
12
|
button,
|
|
12
13
|
menu,
|
|
13
|
-
menuWrapper
|
|
14
|
+
menuWrapper,
|
|
15
|
+
type = 'button',
|
|
16
|
+
primaryColor,
|
|
17
|
+
containerCustom
|
|
14
18
|
} = props;
|
|
15
19
|
const {
|
|
16
20
|
onClick = _noop
|
|
17
21
|
} = button;
|
|
18
22
|
const [visible, setVisible] = useState(false);
|
|
23
|
+
const containerRef = useRef(null);
|
|
19
24
|
const toggleVisibility = useCallback(() => {
|
|
20
25
|
onClick();
|
|
21
26
|
setVisible(prevState => !prevState);
|
|
22
27
|
}, [onClick]);
|
|
23
28
|
useEffect(() => {
|
|
24
|
-
const handleMouseDown =
|
|
29
|
+
const handleMouseDown = event => {
|
|
30
|
+
if (visible && containerRef.current && !containerRef.current.contains(event.target)) {
|
|
31
|
+
setVisible(false);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
25
34
|
document.addEventListener('mousedown', handleMouseDown);
|
|
26
35
|
return () => {
|
|
27
36
|
document.removeEventListener('mousedown', handleMouseDown);
|
|
28
37
|
};
|
|
29
|
-
}, []);
|
|
38
|
+
}, [visible, containerRef]);
|
|
30
39
|
const _menu = /*#__PURE__*/React.createElement("div", {
|
|
31
40
|
className: classnames(style.menuWrapper, visible && style.visible),
|
|
32
41
|
"data-name": "menu-wrapper",
|
|
@@ -35,8 +44,27 @@ const ButtonMenuAction = props => {
|
|
|
35
44
|
}, /*#__PURE__*/React.createElement(ButtonMenu, menu));
|
|
36
45
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
46
|
className: style.container,
|
|
38
|
-
"data-name": "button-menu-action-wrapper"
|
|
39
|
-
|
|
47
|
+
"data-name": "button-menu-action-wrapper",
|
|
48
|
+
style: containerCustom,
|
|
49
|
+
ref: containerRef
|
|
50
|
+
}, type === 'link' ? /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: style.currentOption,
|
|
52
|
+
"data-name": button['data-name'],
|
|
53
|
+
onClick: toggleVisibility,
|
|
54
|
+
"aria-expanded": visible,
|
|
55
|
+
"aria-haspopup": "true"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
style: {
|
|
58
|
+
color: visible ? primaryColor : undefined
|
|
59
|
+
}
|
|
60
|
+
}, button.label), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
61
|
+
icon: visible ? 'chevron-up' : 'chevron-down',
|
|
62
|
+
className: style.caret,
|
|
63
|
+
style: {
|
|
64
|
+
color: visible ? primaryColor : undefined
|
|
65
|
+
},
|
|
66
|
+
"aria-label": button['aria-label']
|
|
67
|
+
})) : /*#__PURE__*/React.createElement(ButtonLink, _extends({}, button, {
|
|
40
68
|
onClick: toggleVisibility
|
|
41
69
|
})), _menu);
|
|
42
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useState","classnames","ButtonLink","ButtonMenu","propTypes","style","ButtonMenuAction","props","button","menu","menuWrapper","onClick","_noop","visible","setVisible","toggleVisibility","prevState","handleMouseDown","document","addEventListener","removeEventListener","_menu","createElement","className","ariaLabel","customStyle","container","_extends","process","env","NODE_ENV"],"sources":["../../../src/molecule/button-menu-action/index.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState} from 'react';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonMenu from '../../atom/button-menu';\nimport propTypes, {ButtonMenuActionProps} from './types';\nimport style from './style.css';\n\nconst ButtonMenuAction = (props: ButtonMenuActionProps) => {\n const {button, menu, menuWrapper} = props;\n const {onClick = noop} = button;\n const [visible, setVisible] = useState(false);\n\n const toggleVisibility = useCallback(() => {\n onClick();\n setVisible(prevState => !prevState);\n }, [onClick]);\n\n useEffect(() => {\n const handleMouseDown = () => setVisible(false);\n document.addEventListener('mousedown', handleMouseDown);\n return () => {\n document.removeEventListener('mousedown', handleMouseDown);\n };\n }, []);\n\n const _menu = (\n <div\n className={classnames(style.menuWrapper, visible && style.visible)}\n data-name=\"menu-wrapper\"\n aria-label={menuWrapper?.ariaLabel}\n style={menuWrapper?.customStyle}\n >\n <ButtonMenu {...menu} />\n </div>\n );\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useState","useRef","classnames","FontAwesomeIcon","ButtonLink","ButtonMenu","propTypes","style","ButtonMenuAction","props","button","menu","menuWrapper","type","primaryColor","containerCustom","onClick","_noop","visible","setVisible","containerRef","toggleVisibility","prevState","handleMouseDown","event","current","contains","target","document","addEventListener","removeEventListener","_menu","createElement","className","ariaLabel","customStyle","container","ref","currentOption","color","undefined","label","icon","caret","_extends","process","env","NODE_ENV"],"sources":["../../../src/molecule/button-menu-action/index.tsx"],"sourcesContent":["import React, {useCallback, useEffect, useState, useRef} from 'react';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonMenu from '../../atom/button-menu';\nimport propTypes, {ButtonMenuActionProps} from './types';\nimport style from './style.css';\n\nconst ButtonMenuAction = (props: ButtonMenuActionProps) => {\n const {button, menu, menuWrapper, type = 'button', primaryColor, containerCustom} = props;\n const {onClick = noop} = button;\n const [visible, setVisible] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const toggleVisibility = useCallback(() => {\n onClick();\n setVisible(prevState => !prevState);\n }, [onClick]);\n\n useEffect(() => {\n const handleMouseDown = (event: MouseEvent) => {\n if (visible && containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setVisible(false);\n }\n };\n\n document.addEventListener('mousedown', handleMouseDown);\n return () => {\n document.removeEventListener('mousedown', handleMouseDown);\n };\n }, [visible, containerRef]);\n\n const _menu = (\n <div\n className={classnames(style.menuWrapper, visible && style.visible)}\n data-name=\"menu-wrapper\"\n aria-label={menuWrapper?.ariaLabel}\n style={menuWrapper?.customStyle}\n >\n <ButtonMenu {...menu} />\n </div>\n );\n\n return (\n <div\n className={style.container}\n data-name=\"button-menu-action-wrapper\"\n style={containerCustom}\n ref={containerRef}\n >\n {type === 'link' ? (\n <div\n className={style.currentOption}\n data-name={button['data-name']}\n onClick={toggleVisibility}\n aria-expanded={visible}\n aria-haspopup=\"true\"\n >\n <span style={{color: visible ? primaryColor : undefined}}>{button.label}</span>\n <FontAwesomeIcon\n icon={visible ? 'chevron-up' : 'chevron-down'}\n className={style.caret}\n style={{color: visible ? primaryColor : undefined}}\n aria-label={button['aria-label']}\n />\n </div>\n ) : (\n <ButtonLink {...button} onClick={toggleVisibility} />\n )}\n {_menu}\n </div>\n );\n};\n\nButtonMenu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AAM;IAAEM,OAAO,EAAEK;EAAiB,EAAE,CACrD,EACAU,KACE,CAAC;AAEV,CAAC;AAEDvB,gBAAgB,CAACF,SAAS,GAAAuC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGzC,SAAS;AAEtC,eAAeE,gBAAgB","ignoreList":[]}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
2
|
+
@value tablet from breakpoints;
|
|
3
|
+
@value colors: "../../variables/colors.css";
|
|
4
|
+
@value cm_grey_500 from colors;
|
|
5
|
+
|
|
1
6
|
.container {
|
|
2
7
|
display: flex;
|
|
3
8
|
flex-direction: column;
|
|
@@ -30,4 +35,35 @@
|
|
|
30
35
|
visibility: visible;
|
|
31
36
|
opacity: 1;
|
|
32
37
|
overflow-y: auto;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.currentOption {
|
|
42
|
+
position: relative;
|
|
43
|
+
padding: 0 20px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
color: cm_grey_500;
|
|
46
|
+
font-family: 'Gilroy';
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
font-weight: 600;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
height: 100%;
|
|
33
53
|
}
|
|
54
|
+
|
|
55
|
+
.caret {
|
|
56
|
+
width: 10px;
|
|
57
|
+
height: 10px;
|
|
58
|
+
transition: transform 0.3s;
|
|
59
|
+
color: cm_grey_500;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media tablet {
|
|
63
|
+
.currentOption {
|
|
64
|
+
padding: 0;
|
|
65
|
+
width: 100%;
|
|
66
|
+
left: 8px;
|
|
67
|
+
height: 40px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -44,7 +44,7 @@ declare const ButtonMenuActionPropTypes: {
|
|
|
44
44
|
'data-name': PropTypes.Requireable<string>;
|
|
45
45
|
disabled: PropTypes.Requireable<boolean>;
|
|
46
46
|
label: PropTypes.Validator<string>;
|
|
47
|
-
onClick: PropTypes.
|
|
47
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
48
|
type: PropTypes.Requireable<string>;
|
|
49
49
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
50
50
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -74,15 +74,20 @@ declare const ButtonMenuActionPropTypes: {
|
|
|
74
74
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
75
75
|
}>;
|
|
76
76
|
}>>;
|
|
77
|
+
type: PropTypes.Requireable<string>;
|
|
78
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
77
79
|
};
|
|
78
80
|
export default ButtonMenuActionPropTypes;
|
|
79
81
|
export declare type ButtonMenuActionProps = {
|
|
80
82
|
button: ButtonLinkProps;
|
|
81
83
|
menu: ButtonMenuProps;
|
|
84
|
+
type?: 'button' | 'link';
|
|
82
85
|
menuWrapper?: {
|
|
83
86
|
ariaLabel?: string;
|
|
84
87
|
customStyle?: Record<string, unknown>;
|
|
85
88
|
};
|
|
89
|
+
containerCustom?: Record<string, unknown>;
|
|
90
|
+
primaryColor?: string;
|
|
86
91
|
};
|
|
87
92
|
export declare type ButtonMenuActionPropsFixture = {
|
|
88
93
|
props: ButtonMenuActionProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/button-menu-action/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAA4B,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAClF,OAA4B,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAElF,QAAA,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/button-menu-action/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAA4B,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAClF,OAA4B,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAElF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW9B,CAAC;AACF,eAAe,yBAAyB,CAAC;AAEzC,oBAAY,qBAAqB,GAAG;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACvC,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IAAC,KAAK,EAAE,qBAAqB,CAAA;CAAC,CAAC"}
|
|
@@ -7,7 +7,9 @@ const ButtonMenuActionPropTypes = {
|
|
|
7
7
|
menuWrapper: PropTypes.shape({
|
|
8
8
|
ariaLabel: PropTypes.string,
|
|
9
9
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]))
|
|
10
|
-
})
|
|
10
|
+
}),
|
|
11
|
+
type: PropTypes.oneOf(['button', 'link']),
|
|
12
|
+
primaryColor: PropTypes.string
|
|
11
13
|
};
|
|
12
14
|
export default ButtonMenuActionPropTypes;
|
|
13
15
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ButtonLinkPropTypes","ButtonMenuPropTypes","ButtonMenuActionPropTypes","button","shape","isRequired","menu","menuWrapper","ariaLabel","string","customStyle","objectOf","oneOfType","number","object"],"sources":["../../../src/molecule/button-menu-action/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ButtonLinkPropTypes, {ButtonLinkProps} from '../../atom/button-link/types';\nimport ButtonMenuPropTypes, {ButtonMenuProps} from '../../atom/button-menu/types';\n\nconst ButtonMenuActionPropTypes = {\n button: PropTypes.shape(ButtonLinkPropTypes).isRequired,\n menu: PropTypes.shape(ButtonMenuPropTypes).isRequired,\n menuWrapper: PropTypes.shape({\n ariaLabel: PropTypes.string,\n customStyle: PropTypes.objectOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])\n )\n })\n};\nexport default ButtonMenuActionPropTypes;\n\nexport type ButtonMenuActionProps = {\n button: ButtonLinkProps;\n menu: ButtonMenuProps;\n menuWrapper?: {\n ariaLabel?: string;\n customStyle?: Record<string, unknown>;\n };\n};\n\nexport type ButtonMenuActionPropsFixture = {props: ButtonMenuActionProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,mBAAmB,MAAyB,8BAA8B;AACjF,OAAOC,mBAAmB,MAAyB,8BAA8B;AAEjF,MAAMC,yBAAyB,GAAG;EAChCC,MAAM,EAAEJ,SAAS,CAACK,KAAK,CAACJ,mBAAmB,CAAC,CAACK,UAAU;EACvDC,IAAI,EAAEP,SAAS,CAACK,KAAK,CAACH,mBAAmB,CAAC,CAACI,UAAU;EACrDE,WAAW,EAAER,SAAS,CAACK,KAAK,CAAC;IAC3BI,SAAS,EAAET,SAAS,CAACU,MAAM;IAC3BC,WAAW,EAAEX,SAAS,CAACY,QAAQ,CAC7BZ,SAAS,CAACa,SAAS,CAAC,CAACb,SAAS,CAACU,MAAM,EAAEV,SAAS,CAACc,MAAM,EAAEd,SAAS,CAACe,MAAM,CAAC,CAC5E;EACF,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ButtonLinkPropTypes","ButtonMenuPropTypes","ButtonMenuActionPropTypes","button","shape","isRequired","menu","menuWrapper","ariaLabel","string","customStyle","objectOf","oneOfType","number","object","type","oneOf","primaryColor"],"sources":["../../../src/molecule/button-menu-action/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ButtonLinkPropTypes, {ButtonLinkProps} from '../../atom/button-link/types';\nimport ButtonMenuPropTypes, {ButtonMenuProps} from '../../atom/button-menu/types';\n\nconst ButtonMenuActionPropTypes = {\n button: PropTypes.shape(ButtonLinkPropTypes).isRequired,\n menu: PropTypes.shape(ButtonMenuPropTypes).isRequired,\n menuWrapper: PropTypes.shape({\n ariaLabel: PropTypes.string,\n customStyle: PropTypes.objectOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])\n )\n }),\n type: PropTypes.oneOf(['button', 'link']),\n primaryColor: PropTypes.string\n};\nexport default ButtonMenuActionPropTypes;\n\nexport type ButtonMenuActionProps = {\n button: ButtonLinkProps;\n menu: ButtonMenuProps;\n type?: 'button' | 'link';\n menuWrapper?: {\n ariaLabel?: string;\n customStyle?: Record<string, unknown>;\n };\n containerCustom?: Record<string, unknown>;\n primaryColor?: string;\n};\n\nexport type ButtonMenuActionPropsFixture = {props: ButtonMenuActionProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,mBAAmB,MAAyB,8BAA8B;AACjF,OAAOC,mBAAmB,MAAyB,8BAA8B;AAEjF,MAAMC,yBAAyB,GAAG;EAChCC,MAAM,EAAEJ,SAAS,CAACK,KAAK,CAACJ,mBAAmB,CAAC,CAACK,UAAU;EACvDC,IAAI,EAAEP,SAAS,CAACK,KAAK,CAACH,mBAAmB,CAAC,CAACI,UAAU;EACrDE,WAAW,EAAER,SAAS,CAACK,KAAK,CAAC;IAC3BI,SAAS,EAAET,SAAS,CAACU,MAAM;IAC3BC,WAAW,EAAEX,SAAS,CAACY,QAAQ,CAC7BZ,SAAS,CAACa,SAAS,CAAC,CAACb,SAAS,CAACU,MAAM,EAAEV,SAAS,CAACc,MAAM,EAAEd,SAAS,CAACe,MAAM,CAAC,CAC5E;EACF,CAAC,CAAC;EACFC,IAAI,EAAEhB,SAAS,CAACiB,KAAK,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;EACzCC,YAAY,EAAElB,SAAS,CAACU;AAC1B,CAAC;AACD,eAAeP,yBAAyB","ignoreList":[]}
|
|
@@ -391,7 +391,7 @@ declare const propTypes: {
|
|
|
391
391
|
'data-name': PropTypes.Requireable<string>;
|
|
392
392
|
disabled: PropTypes.Requireable<boolean>;
|
|
393
393
|
label: PropTypes.Validator<string>;
|
|
394
|
-
onClick: PropTypes.
|
|
394
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
395
395
|
type: PropTypes.Requireable<string>;
|
|
396
396
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
397
397
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -421,6 +421,8 @@ declare const propTypes: {
|
|
|
421
421
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
422
422
|
}>;
|
|
423
423
|
}>>;
|
|
424
|
+
type: PropTypes.Requireable<string>;
|
|
425
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
424
426
|
}> | null | undefined>>;
|
|
425
427
|
}>>;
|
|
426
428
|
}> | PropTypes.InferProps<{
|
|
@@ -447,7 +449,7 @@ declare const propTypes: {
|
|
|
447
449
|
'data-name': PropTypes.Requireable<string>;
|
|
448
450
|
disabled: PropTypes.Requireable<boolean>;
|
|
449
451
|
label: PropTypes.Validator<string>;
|
|
450
|
-
onClick: PropTypes.
|
|
452
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
451
453
|
type: PropTypes.Requireable<string>;
|
|
452
454
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
453
455
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -524,7 +526,7 @@ declare const propTypes: {
|
|
|
524
526
|
'data-name': PropTypes.Requireable<string>;
|
|
525
527
|
disabled: PropTypes.Requireable<boolean>;
|
|
526
528
|
label: PropTypes.Validator<string>;
|
|
527
|
-
onClick: PropTypes.
|
|
529
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
528
530
|
type: PropTypes.Requireable<string>;
|
|
529
531
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
530
532
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -726,7 +728,7 @@ declare const propTypes: {
|
|
|
726
728
|
'data-name': PropTypes.Requireable<string>;
|
|
727
729
|
disabled: PropTypes.Requireable<boolean>;
|
|
728
730
|
label: PropTypes.Validator<string>;
|
|
729
|
-
onClick: PropTypes.
|
|
731
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
730
732
|
type: PropTypes.Requireable<string>;
|
|
731
733
|
buttonLinkType: PropTypes.Requireable<string>;
|
|
732
734
|
icon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -756,6 +758,8 @@ declare const propTypes: {
|
|
|
756
758
|
[x: string]: NonNullable<string | number | object | null | undefined> | null | undefined;
|
|
757
759
|
}>;
|
|
758
760
|
}>>;
|
|
761
|
+
type: PropTypes.Requireable<string>;
|
|
762
|
+
primaryColor: PropTypes.Requireable<string>;
|
|
759
763
|
}>>;
|
|
760
764
|
}> | null | undefined>>;
|
|
761
765
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,iBAAi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pD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAkCC;IA/BC;;;;;;;;MAQC;IAED,0DAAgE;IAsHlE,qBAiBC;IAED,qBAGC;IAED,sBAGC;IAED,0BASC;IAvJC,uEAA6D;IAyJ/D,mCAIC;IA5DD,oCAMC;IAGD,sCAIC;IA5DD,qBAGC;IAnCD,0BAMC;IAED,2BAYC;IAED,6BAOC;IASD,wCAuCC;IAGC,kBAA2B;IA6D7B,sBAuGC;CACF"}
|
|
@@ -19,7 +19,6 @@ import Provider from '../../../atom/provider';
|
|
|
19
19
|
import Card, { cardPropTypes } from '../../card';
|
|
20
20
|
import LearningPriorityCard from '../../learning-priority-card';
|
|
21
21
|
import Icon from '../../../atom/icon';
|
|
22
|
-
import { COLORS } from '../../../variables/colors';
|
|
23
22
|
import style from './style.css';
|
|
24
23
|
const ShowMoreLink = props => {
|
|
25
24
|
const {
|
|
@@ -297,7 +296,6 @@ class CardsList extends React.PureComponent {
|
|
|
297
296
|
color: dark,
|
|
298
297
|
preset: 's',
|
|
299
298
|
borderRadius: '8px',
|
|
300
|
-
backgroundColor: COLORS.neutral_75,
|
|
301
299
|
ariaLabel: ariaLabel.showMoreOnLeftAriaLabel
|
|
302
300
|
};
|
|
303
301
|
const arrows = /*#__PURE__*/React.createElement("div", {
|