@coorpacademy/components 11.33.13-alpha.4 → 11.33.13-alpha.99.14
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-icon/index.js +3 -3
- package/es/atom/button-link-icon/index.js.map +1 -1
- package/es/atom/button-menu/index.d.ts.map +1 -1
- package/es/atom/button-menu/index.js +38 -51
- package/es/atom/button-menu/index.js.map +1 -1
- package/es/atom/button-menu/types.d.ts +3 -7
- package/es/atom/button-menu/types.d.ts.map +1 -1
- package/es/atom/button-menu/types.js +1 -1
- package/es/atom/button-menu/types.js.map +1 -1
- package/es/atom/button-menu/utils.d.ts +23 -0
- package/es/atom/button-menu/utils.d.ts.map +1 -0
- package/es/atom/button-menu/utils.js +24 -0
- package/es/atom/button-menu/utils.js.map +1 -0
- package/es/molecule/cm-popin/style.css +2 -1
- package/es/molecule/cm-popin/types.d.ts +1 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +1 -0
- package/es/organism/brand-learning-priorities/index.d.ts +1 -0
- package/es/organism/list-item/index.d.ts +3 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +11 -3
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-items/index.d.ts +1 -0
- package/es/organism/list-items/index.d.ts.map +1 -1
- package/es/organism/list-items/index.js +2 -1
- package/es/organism/list-items/index.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +1 -0
- package/es/template/app-player/player/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts +1 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +1 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +1 -0
- package/es/template/app-review/index.d.ts +1 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +1 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +1 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +4 -0
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +22 -3
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +1 -0
- package/es/template/back-office/brand-update/utils.d.ts +79 -0
- package/es/template/back-office/brand-update/utils.d.ts.map +1 -0
- package/es/template/back-office/brand-update/utils.js +60 -0
- package/es/template/back-office/brand-update/utils.js.map +1 -0
- package/es/template/common/dashboard/index.d.ts +2 -0
- package/es/template/common/search-page/index.d.ts +1 -0
- package/es/template/external-course/index.d.ts +1 -0
- package/es/variables/colors.css +6 -1
- package/es/variables/colors.d.ts +4 -0
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +5 -1
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button-link-icon/index.js +3 -3
- package/lib/atom/button-link-icon/index.js.map +1 -1
- package/lib/atom/button-menu/index.d.ts.map +1 -1
- package/lib/atom/button-menu/index.js +39 -52
- package/lib/atom/button-menu/index.js.map +1 -1
- package/lib/atom/button-menu/types.d.ts +3 -7
- package/lib/atom/button-menu/types.d.ts.map +1 -1
- package/lib/atom/button-menu/types.js +1 -1
- package/lib/atom/button-menu/types.js.map +1 -1
- package/lib/atom/button-menu/utils.d.ts +23 -0
- package/lib/atom/button-menu/utils.d.ts.map +1 -0
- package/lib/atom/button-menu/utils.js +28 -0
- package/lib/atom/button-menu/utils.js.map +1 -0
- package/lib/molecule/cm-popin/style.css +2 -1
- package/lib/molecule/cm-popin/types.d.ts +1 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +1 -0
- package/lib/organism/brand-learning-priorities/index.d.ts +1 -0
- package/lib/organism/list-item/index.d.ts +3 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +11 -3
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-items/index.d.ts +1 -0
- package/lib/organism/list-items/index.d.ts.map +1 -1
- package/lib/organism/list-items/index.js +2 -1
- package/lib/organism/list-items/index.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +1 -0
- package/lib/template/app-player/player/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts +1 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +1 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +1 -0
- package/lib/template/app-review/index.d.ts +1 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +1 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +1 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +4 -0
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +22 -3
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +1 -0
- package/lib/template/back-office/brand-update/utils.d.ts +79 -0
- package/lib/template/back-office/brand-update/utils.d.ts.map +1 -0
- package/lib/template/back-office/brand-update/utils.js +64 -0
- package/lib/template/back-office/brand-update/utils.js.map +1 -0
- package/lib/template/common/dashboard/index.d.ts +2 -0
- package/lib/template/common/search-page/index.d.ts +1 -0
- package/lib/template/external-course/index.d.ts +1 -0
- package/lib/variables/colors.css +6 -1
- package/lib/variables/colors.d.ts +4 -0
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +5 -1
- package/lib/variables/colors.js.map +1 -1
- package/package.json +2 -2
package/es/variables/colors.d.ts
CHANGED
|
@@ -12,6 +12,10 @@ export declare const COLORS: {
|
|
|
12
12
|
readonly cm_grey_700: "#1D1D2B";
|
|
13
13
|
readonly cm_yellow_400: "#bd7e00";
|
|
14
14
|
readonly brand: "#00B0FF";
|
|
15
|
+
readonly yellow_700: "#A38300";
|
|
16
|
+
readonly yellow_100: "#FFF9D1";
|
|
17
|
+
readonly red_700: "#A30000";
|
|
18
|
+
readonly red_100: "#FFD1D1";
|
|
15
19
|
};
|
|
16
20
|
export declare type Colors = typeof COLORS;
|
|
17
21
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/variables/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;CAkBT,CAAC;AAEX,oBAAY,MAAM,GAAG,OAAO,MAAM,CAAC"}
|
package/es/variables/colors.js
CHANGED
|
@@ -11,6 +11,10 @@ export const COLORS = {
|
|
|
11
11
|
cm_grey_500: '#515161',
|
|
12
12
|
cm_grey_700: '#1D1D2B',
|
|
13
13
|
cm_yellow_400: '#bd7e00',
|
|
14
|
-
brand: '#00B0FF'
|
|
14
|
+
brand: '#00B0FF',
|
|
15
|
+
yellow_700: '#A38300',
|
|
16
|
+
yellow_100: '#FFF9D1',
|
|
17
|
+
red_700: '#A30000',
|
|
18
|
+
red_100: '#FFD1D1'
|
|
15
19
|
};
|
|
16
20
|
//# sourceMappingURL=colors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","names":["COLORS","gray","negative","cm_negative_200","positive","cm_positive_200","white","cm_grey_400","cm_grey_800","cm_primary_blue","cm_grey_500","cm_grey_700","cm_yellow_400","brand"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n gray: '#EAEAEB',\n negative: '#ed3436',\n cm_negative_200: '#B81400',\n positive: '#35CC7F',\n cm_positive_200: '#05944F',\n white: '#ffffff',\n cm_grey_400: '#9999A8',\n cm_grey_800: '#171721',\n cm_primary_blue: '#0061FF',\n cm_grey_500: '#515161',\n cm_grey_700: '#1D1D2B',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,IAAI,EAAE,SAAS;EACfC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"colors.js","names":["COLORS","gray","negative","cm_negative_200","positive","cm_positive_200","white","cm_grey_400","cm_grey_800","cm_primary_blue","cm_grey_500","cm_grey_700","cm_yellow_400","brand","yellow_700","yellow_100","red_700","red_100"],"sources":["../../src/variables/colors.ts"],"sourcesContent":["export const COLORS = {\n gray: '#EAEAEB',\n negative: '#ed3436',\n cm_negative_200: '#B81400',\n positive: '#35CC7F',\n cm_positive_200: '#05944F',\n white: '#ffffff',\n cm_grey_400: '#9999A8',\n cm_grey_800: '#171721',\n cm_primary_blue: '#0061FF',\n cm_grey_500: '#515161',\n cm_grey_700: '#1D1D2B',\n cm_yellow_400: '#bd7e00',\n brand: '#00B0FF',\n yellow_700: '#A38300',\n yellow_100: '#FFF9D1',\n red_700: '#A30000',\n red_100: '#FFD1D1'\n} as const;\n\nexport type Colors = typeof COLORS;\n"],"mappings":"AAAA,OAAO,MAAMA,MAAM,GAAG;EACpBC,IAAI,EAAE,SAAS;EACfC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,QAAQ,EAAE,SAAS;EACnBC,eAAe,EAAE,SAAS;EAC1BC,KAAK,EAAE,SAAS;EAChBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,KAAK,EAAE,SAAS;EAChBC,UAAU,EAAE,SAAS;EACrBC,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
|
|
@@ -74,7 +74,7 @@ const ButtonLinkIcon = props => {
|
|
|
74
74
|
className: _style.default.tooltipContentWrapper
|
|
75
75
|
}, ariaLabel), [ariaLabel]);
|
|
76
76
|
const Button = (0, _react.useCallback)(() => link ? /*#__PURE__*/_react.default.createElement(_link.default, _extends({}, link, ariaLabel ? {
|
|
77
|
-
'data-for':
|
|
77
|
+
'data-for': dataName,
|
|
78
78
|
'data-tip': toolTipIsVisible
|
|
79
79
|
} : {}, {
|
|
80
80
|
className: styleButton,
|
|
@@ -83,7 +83,7 @@ const ButtonLinkIcon = props => {
|
|
|
83
83
|
onMouseEnter: handleMouseOver,
|
|
84
84
|
onMouseLeave: handleMouseLeave
|
|
85
85
|
}), contentView) : /*#__PURE__*/_react.default.createElement("button", _extends({}, ariaLabel ? {
|
|
86
|
-
'data-for':
|
|
86
|
+
'data-for': dataName,
|
|
87
87
|
'data-tip': toolTipIsVisible
|
|
88
88
|
} : {}, {
|
|
89
89
|
type: "button",
|
|
@@ -98,7 +98,7 @@ const ButtonLinkIcon = props => {
|
|
|
98
98
|
}), contentView), [link, ariaLabel, className, contentView, dataName, disabled, handleMouseLeave, handleMouseOver, handleOnClick, styleButton, toolTipIsVisible]);
|
|
99
99
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Button, null), ariaLabel ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
100
100
|
fontSize: 12,
|
|
101
|
-
anchorId:
|
|
101
|
+
anchorId: dataName,
|
|
102
102
|
toolTipIsVisible: toolTipIsVisible,
|
|
103
103
|
placement: tooltipPlacement,
|
|
104
104
|
TooltipContent: TooltipContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_buttonIcons","_icon","_link","_tooltip","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","faIcon","Icon","_getOr2","ICONS","createElement","className","style","buttonContent","iconName","getSizeStyle","size","small","responsive","defaultStyle","ButtonLinkIcon","props","disabled","dataName","ariaLabel","link","onClick","tooltipPlacement","toolTipIsVisible","setToolTipIsVisible","useState","timer","useRef","contentView","styleButton","classnames","handleOnClick","useCallback","handleMouseOver","current","clearTimeout","setTimeout","undefined","handleMouseLeave","TooltipContent","tooltipContentWrapper","Button","onMouseEnter","onMouseLeave","type","onMouseOver","Fragment","fontSize","anchorId","placement","closeToolTipInformationTextAriaLabel","propTypes","process","env","NODE_ENV","PropTypes","oneOf","string","_keys2","func","shape","href","download","bool","target","_default","exports"],"sources":["../../../src/atom/button-link-icon/index.js"],"sourcesContent":["import React, {useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport FaIcon from '../icon';\nimport Link from '../link';\nimport ToolTip from '../tooltip';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = (icon, faIcon) => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon && !faIcon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n {faIcon ? <FaIcon iconName={faIcon} /> : <Icon className={style.icon} />}\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.defaultStyle;\n }\n};\n\nconst ButtonLinkIcon = props => {\n const {\n size = 'default',\n disabled,\n icon,\n faIcon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className,\n tooltipPlacement = 'left'\n } = props;\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const timer = useRef();\n\n const contentView = getButtonContent(icon, faIcon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n className\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleMouseOver = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n setToolTipIsVisible(true);\n timer.current = undefined;\n }, 300);\n }, [timer, setToolTipIsVisible]);\n\n const handleMouseLeave = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n setToolTipIsVisible(false);\n }, [timer, setToolTipIsVisible]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{ariaLabel}</span>,\n [ariaLabel]\n );\n\n const Button = useCallback(\n () =>\n link ? (\n <Link\n {...link}\n {...(ariaLabel\n ? {\n 'data-for': 'button-icon',\n 'data-tip': toolTipIsVisible\n }\n : {})}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {contentView}\n </Link>\n ) : (\n <button\n {...(ariaLabel\n ? {\n 'data-for': 'button-icon',\n 'data-tip': toolTipIsVisible\n }\n : {})}\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}-${className}`}\n className={styleButton}\n onClick={handleOnClick}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n disabled={disabled}\n >\n {contentView}\n </button>\n ),\n [\n link,\n ariaLabel,\n className,\n contentView,\n dataName,\n disabled,\n handleMouseLeave,\n handleMouseOver,\n handleOnClick,\n styleButton,\n toolTipIsVisible\n ]\n );\n\n return (\n <>\n <Button />\n {ariaLabel ? (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={toolTipIsVisible}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={ariaLabel}\n />\n ) : null}\n </>\n );\n};\n\nButtonLinkIcon.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.string,\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 disabled: PropTypes.bool,\n className: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom'])\n};\n\nexport default ButtonLinkIcon;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,QAAA,GAAAL,sBAAA,CAAAF,OAAA;AAEA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CA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]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_buttonIcons","_icon","_link","_tooltip","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","getButtonContent","icon","faIcon","Icon","_getOr2","ICONS","createElement","className","style","buttonContent","iconName","getSizeStyle","size","small","responsive","defaultStyle","ButtonLinkIcon","props","disabled","dataName","ariaLabel","link","onClick","tooltipPlacement","toolTipIsVisible","setToolTipIsVisible","useState","timer","useRef","contentView","styleButton","classnames","handleOnClick","useCallback","handleMouseOver","current","clearTimeout","setTimeout","undefined","handleMouseLeave","TooltipContent","tooltipContentWrapper","Button","onMouseEnter","onMouseLeave","type","onMouseOver","Fragment","fontSize","anchorId","placement","closeToolTipInformationTextAriaLabel","propTypes","process","env","NODE_ENV","PropTypes","oneOf","string","_keys2","func","shape","href","download","bool","target","_default","exports"],"sources":["../../../src/atom/button-link-icon/index.js"],"sourcesContent":["import React, {useState, useCallback, useRef} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport FaIcon from '../icon';\nimport Link from '../link';\nimport ToolTip from '../tooltip';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = (icon, faIcon) => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon && !faIcon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n {faIcon ? <FaIcon iconName={faIcon} /> : <Icon className={style.icon} />}\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.defaultStyle;\n }\n};\n\nconst ButtonLinkIcon = props => {\n const {\n size = 'default',\n disabled,\n icon,\n faIcon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className,\n tooltipPlacement = 'left'\n } = props;\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n const timer = useRef();\n\n const contentView = getButtonContent(icon, faIcon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n className\n );\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const handleMouseOver = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n timer.current = setTimeout(() => {\n setToolTipIsVisible(true);\n timer.current = undefined;\n }, 300);\n }, [timer, setToolTipIsVisible]);\n\n const handleMouseLeave = useCallback(() => {\n timer.current && clearTimeout(timer.current);\n setToolTipIsVisible(false);\n }, [timer, setToolTipIsVisible]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{ariaLabel}</span>,\n [ariaLabel]\n );\n\n const Button = useCallback(\n () =>\n link ? (\n <Link\n {...link}\n {...(ariaLabel\n ? {\n 'data-for': dataName,\n 'data-tip': toolTipIsVisible\n }\n : {})}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {contentView}\n </Link>\n ) : (\n <button\n {...(ariaLabel\n ? {\n 'data-for': dataName,\n 'data-tip': toolTipIsVisible\n }\n : {})}\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n data-testid={`button-${dataName}-${className}`}\n className={styleButton}\n onClick={handleOnClick}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n disabled={disabled}\n >\n {contentView}\n </button>\n ),\n [\n link,\n ariaLabel,\n className,\n contentView,\n dataName,\n disabled,\n handleMouseLeave,\n handleMouseOver,\n handleOnClick,\n styleButton,\n toolTipIsVisible\n ]\n );\n\n return (\n <>\n <Button />\n {ariaLabel ? (\n <ToolTip\n fontSize={12}\n anchorId={dataName}\n toolTipIsVisible={toolTipIsVisible}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={ariaLabel}\n />\n ) : null}\n </>\n );\n};\n\nButtonLinkIcon.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.string,\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 disabled: PropTypes.bool,\n className: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom'])\n};\n\nexport default ButtonLinkIcon;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,QAAA,GAAAL,sBAAA,CAAAF,OAAA;AAEA,IAAAQ,MAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgC,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,C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,CAAC;AAEP,CAAC;AAEDJ,cAAc,CAACoC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACzB3C,IAAI,EAAE4C,kBAAS,CAACC,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;EACzD,YAAY,EAAED,kBAAS,CAACE,MAAM;EAC9B,WAAW,EAAEF,kBAAS,CAACE,MAAM;EAC7BzD,IAAI,EAAEuD,kBAAS,CAACC,KAAK,CAAC,IAAAE,MAAA,CAAA/E,OAAA,EAAKyB,kBAAK,CAAC,CAAC;EAClCH,MAAM,EAAEsD,kBAAS,CAACE,MAAM;EACxBpC,OAAO,EAAEkC,kBAAS,CAACI,IAAI;EACvBvC,IAAI,EAAEmC,kBAAS,CAACK,KAAK,CAAC;IACpBC,IAAI,EAAEN,kBAAS,CAACE,MAAM;IACtBK,QAAQ,EAAEP,kBAAS,CAACQ,IAAI;IACxBC,MAAM,EAAET,kBAAS,CAACC,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFvC,QAAQ,EAAEsC,kBAAS,CAACQ,IAAI;EACxBzD,SAAS,EAAEiD,kBAAS,CAACE,MAAM;EAC3BnC,gBAAgB,EAAEiC,kBAAS,CAACC,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACtE,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAvF,OAAA,GAEaoC,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AAgEjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -2,82 +2,69 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
+
var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
5
6
|
var _react = _interopRequireWildcard(require("react"));
|
|
6
7
|
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
7
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
9
|
var _buttonLink = _interopRequireDefault(require("../button-link"));
|
|
9
10
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
10
11
|
var _types = _interopRequireWildcard(require("./types"));
|
|
11
|
-
|
|
12
|
+
var _utils = require("./utils");
|
|
12
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
16
|
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); }
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
const buildCustomIconByTheme = icon => {
|
|
18
|
+
if (!icon) return;
|
|
19
|
+
const {
|
|
20
|
+
theme,
|
|
21
|
+
...iconProps
|
|
22
|
+
} = icon;
|
|
23
|
+
const custom = theme && _utils.THEMES[theme];
|
|
24
|
+
if (!custom) return iconProps;
|
|
25
|
+
const customProps = custom ? {
|
|
26
|
+
..._utils.DEFAULT_ICON_STYLE,
|
|
18
27
|
faIcon: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
customStyle: {
|
|
22
|
-
padding: 0
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const themes = {
|
|
27
|
-
publish: {
|
|
28
|
-
name: 'cloud-arrow-up'
|
|
29
|
-
},
|
|
30
|
-
archive: {
|
|
31
|
-
name: 'folder-open'
|
|
32
|
-
},
|
|
33
|
-
delete: {
|
|
34
|
-
name: 'trash',
|
|
35
|
-
color: '#B81400'
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
return themes[type] ? {
|
|
39
|
-
icon: {
|
|
40
|
-
...defaultIconStyle,
|
|
41
|
-
faIcon: {
|
|
42
|
-
...defaultIconStyle.faIcon,
|
|
43
|
-
...themes[type]
|
|
44
|
-
}
|
|
28
|
+
..._utils.DEFAULT_ICON_STYLE.faIcon,
|
|
29
|
+
...custom
|
|
45
30
|
}
|
|
46
31
|
} : null;
|
|
32
|
+
return {
|
|
33
|
+
...iconProps,
|
|
34
|
+
...customProps
|
|
35
|
+
};
|
|
47
36
|
};
|
|
48
37
|
const Button = props => {
|
|
49
38
|
const {
|
|
50
39
|
'data-name': dataName,
|
|
51
40
|
disabled,
|
|
52
41
|
label,
|
|
53
|
-
onClick,
|
|
42
|
+
onClick = _noop2.default,
|
|
54
43
|
type = 'default',
|
|
55
44
|
buttonLinkType,
|
|
56
45
|
icon,
|
|
57
|
-
customStyle = {}
|
|
46
|
+
customStyle = {},
|
|
47
|
+
...rest
|
|
58
48
|
} = props;
|
|
59
49
|
const styleButton = (0, _classnames.default)(_style.default.button, type === 'default' && _style.default.defaultStyle, type === 'defaultLeft' && _style.default.defaultLeft, type === 'dangerous' && _style.default.dangerous, type === 'dangerousLeft' && _style.default.dangerousLeft, disabled && _style.default.disabled);
|
|
60
50
|
const handleOnClick = (0, _react.useCallback)(() => onClick(), [onClick]);
|
|
61
|
-
const buttonLinkProps =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
customStyle
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
}, [label, buttonLinkType, handleOnClick, dataName, styleButton, customStyle, icon, disabled]);
|
|
80
|
-
return /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonLinkProps);
|
|
51
|
+
const buttonLinkProps = {
|
|
52
|
+
...rest,
|
|
53
|
+
'aria-label': label,
|
|
54
|
+
disabled,
|
|
55
|
+
label,
|
|
56
|
+
type: buttonLinkType,
|
|
57
|
+
onClick: handleOnClick,
|
|
58
|
+
'data-name': dataName,
|
|
59
|
+
className: styleButton,
|
|
60
|
+
customStyle: {
|
|
61
|
+
...customStyle
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const iconProps = buildCustomIconByTheme(icon);
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_buttonLink.default, _extends({}, buttonLinkProps, {
|
|
66
|
+
icon: iconProps
|
|
67
|
+
}));
|
|
81
68
|
};
|
|
82
69
|
Button.propTypes = process.env.NODE_ENV !== "production" ? _types.buttonPropTypes : {};
|
|
83
70
|
const ButtonMenu = props => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_map","_interopRequireDefault","_classnames","_buttonLink","_style","_types","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_map","_interopRequireDefault","_classnames","_buttonLink","_style","_types","_utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","buildCustomIconByTheme","icon","theme","iconProps","custom","THEMES","customProps","DEFAULT_ICON_STYLE","faIcon","Button","props","dataName","disabled","label","onClick","_noop2","type","buttonLinkType","customStyle","rest","styleButton","classnames","style","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","useCallback","buttonLinkProps","className","createElement","propTypes","process","env","NODE_ENV","buttonPropTypes","ButtonMenu","buttons","buildButton","index","key","buttonList","useMemo","map","convert","cap","buttonMenuContainer","_default","exports"],"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={style.buttonMenuContainer}>\n {buttonList}\n </div>\n );\n};\n\nButtonMenu.propTypes = propTypes;\n\nexport default ButtonMenu;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAmD,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,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AAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,cAAS;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAtE,OAAA,GAElB0D,UAAU","ignoreList":[]}
|
|
@@ -55,17 +55,13 @@ declare const propTypes: {
|
|
|
55
55
|
'aria-label': PropTypes.Requireable<string>;
|
|
56
56
|
};
|
|
57
57
|
export default propTypes;
|
|
58
|
-
export declare type
|
|
59
|
-
|
|
60
|
-
disabled?: boolean;
|
|
61
|
-
label: string;
|
|
62
|
-
onClick: () => void;
|
|
58
|
+
export declare type Theme = 'archived' | 'published' | 'deleted';
|
|
59
|
+
export declare type ButtonProps = Omit<ButtonLinkProps, 'type' | 'icon'> & {
|
|
63
60
|
type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
|
|
64
61
|
buttonLinkType?: ButtonLinkProps['type'];
|
|
65
62
|
icon?: IconType & {
|
|
66
|
-
theme
|
|
63
|
+
theme?: Theme;
|
|
67
64
|
};
|
|
68
|
-
customStyle?: Record<string, string | number>;
|
|
69
65
|
};
|
|
70
66
|
export declare type ButtonMenuProps = {
|
|
71
67
|
buttons: ButtonProps[];
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;CAY3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAId,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAE9E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;CAY3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAId,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,KAAK,GAAG,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;CACnC,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ const buttonPropTypes = exports.buttonPropTypes = {
|
|
|
14
14
|
buttonLinkType: _propTypes.default.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
15
15
|
icon: _propTypes.default.shape({
|
|
16
16
|
..._types.iconPropTypes,
|
|
17
|
-
theme: _propTypes.default.oneOf(['
|
|
17
|
+
theme: _propTypes.default.oneOf(['archived', 'published', 'deleted'])
|
|
18
18
|
}),
|
|
19
19
|
customStyle: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]))
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["_propTypes","_interopRequireDefault","require","_types","e","__esModule","default","buttonPropTypes","exports","PropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","iconPropTypes","theme","customStyle","objectOf","oneOfType","number","propTypes","buttons","arrayOf","_default"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType, iconPropTypes} from '../button-link/types';\n\nexport const buttonPropTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),\n buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape({\n ...iconPropTypes,\n theme: PropTypes.oneOf(['
|
|
1
|
+
{"version":3,"file":"types.js","names":["_propTypes","_interopRequireDefault","require","_types","e","__esModule","default","buttonPropTypes","exports","PropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","iconPropTypes","theme","customStyle","objectOf","oneOfType","number","propTypes","buttons","arrayOf","_default"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {ButtonLinkProps, IconType, iconPropTypes} from '../button-link/types';\n\nexport const buttonPropTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n label: PropTypes.string.isRequired,\n onClick: PropTypes.func.isRequired,\n type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),\n buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n icon: PropTypes.shape({\n ...iconPropTypes,\n theme: PropTypes.oneOf(['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,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAA8E,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvE,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC7B,WAAW,EAAEE,kBAAS,CAACC,MAAM;EAC7BC,QAAQ,EAAEF,kBAAS,CAACG,IAAI;EACxBC,KAAK,EAAEJ,kBAAS,CAACC,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAEN,kBAAS,CAACO,IAAI,CAACF,UAAU;EAClCG,IAAI,EAAER,kBAAS,CAACS,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;EAC/EC,cAAc,EAAEV,kBAAS,CAACS,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAC1FE,IAAI,EAAEX,kBAAS,CAACY,KAAK,CAAC;IACpB,GAAGC,oBAAa;IAChBC,KAAK,EAAEd,kBAAS,CAACS,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC;EAC7D,CAAC,CAAC;EACFM,WAAW,EAAEf,kBAAS,CAACgB,QAAQ,CAAChB,kBAAS,CAACiB,SAAS,CAAC,CAACjB,kBAAS,CAACC,MAAM,EAAED,kBAAS,CAACkB,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEpB,kBAAS,CAACqB,OAAO,CAACrB,kBAAS,CAACY,KAAK,CAACd,eAAe,CAAC,CAAC,CAACO,UAAU;EACvE,WAAW,EAAEL,kBAAS,CAACC,MAAM;EAC7B,YAAY,EAAED,kBAAS,CAACC;AAC1B,CAAC;AAAC,IAAAqB,QAAA,GAAAvB,OAAA,CAAAF,OAAA,GAEasB,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const DEFAULT_ICON_STYLE: {
|
|
2
|
+
position: "left";
|
|
3
|
+
faIcon: {
|
|
4
|
+
size: number;
|
|
5
|
+
color: "#515161";
|
|
6
|
+
customStyle: {
|
|
7
|
+
padding: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const THEMES: {
|
|
12
|
+
published: {
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
archived: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
deleted: {
|
|
19
|
+
name: string;
|
|
20
|
+
color: "#B81400";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB;;;;;;;;;CAO9B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;CAIlB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.THEMES = exports.DEFAULT_ICON_STYLE = void 0;
|
|
5
|
+
var _colors = require("../../variables/colors");
|
|
6
|
+
const DEFAULT_ICON_STYLE = exports.DEFAULT_ICON_STYLE = {
|
|
7
|
+
position: 'left',
|
|
8
|
+
faIcon: {
|
|
9
|
+
size: 14,
|
|
10
|
+
color: _colors.COLORS.cm_grey_500,
|
|
11
|
+
customStyle: {
|
|
12
|
+
padding: 0
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const THEMES = exports.THEMES = {
|
|
17
|
+
published: {
|
|
18
|
+
name: 'cloud-arrow-up'
|
|
19
|
+
},
|
|
20
|
+
archived: {
|
|
21
|
+
name: 'folder-open'
|
|
22
|
+
},
|
|
23
|
+
deleted: {
|
|
24
|
+
name: 'trash',
|
|
25
|
+
color: _colors.COLORS.cm_negative_200
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_colors","require","DEFAULT_ICON_STYLE","exports","position","faIcon","size","color","COLORS","cm_grey_500","customStyle","padding","THEMES","published","name","archived","deleted","cm_negative_200"],"sources":["../../../src/atom/button-menu/utils.ts"],"sourcesContent":["import {COLORS} from '../../variables/colors';\n\nexport const DEFAULT_ICON_STYLE = {\n position: 'left' as const,\n faIcon: {\n size: 14,\n color: COLORS.cm_grey_500,\n customStyle: {padding: 0}\n }\n};\n\nexport const THEMES = {\n published: {name: 'cloud-arrow-up'},\n archived: {name: 'folder-open'},\n deleted: {name: 'trash', color: COLORS.cm_negative_200}\n};\n"],"mappings":";;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,QAAQ,EAAE,MAAe;EACzBC,MAAM,EAAE;IACNC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAEC,cAAM,CAACC,WAAW;IACzBC,WAAW,EAAE;MAACC,OAAO,EAAE;IAAC;EAC1B;AACF,CAAC;AAEM,MAAMC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG;EACpBC,SAAS,EAAE;IAACC,IAAI,EAAE;EAAgB,CAAC;EACnCC,QAAQ,EAAE;IAACD,IAAI,EAAE;EAAa,CAAC;EAC/BE,OAAO,EAAE;IAACF,IAAI,EAAE,OAAO;IAAEP,KAAK,EAAEC,cAAM,CAACS;EAAe;AACxD,CAAC","ignoreList":[]}
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
.popin {
|
|
50
50
|
width: 400px;
|
|
51
|
+
box-sizing: border-box;
|
|
51
52
|
flex-grow: 0;
|
|
52
53
|
margin: 16px;
|
|
53
54
|
padding: 24px;
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
line-height: 24px;
|
|
112
113
|
letter-spacing: normal;
|
|
113
114
|
text-align: center;
|
|
114
|
-
color:
|
|
115
|
+
color: cm_grey_700;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
.buttonContainer {
|
|
@@ -207,6 +207,7 @@ declare const propTypes: {
|
|
|
207
207
|
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
208
208
|
title: PropTypes.Validator<string>;
|
|
209
209
|
subtitle: PropTypes.Requireable<string>;
|
|
210
|
+
'data-name': PropTypes.Requireable<string>;
|
|
210
211
|
provider: PropTypes.Requireable<PropTypes.InferProps<{
|
|
211
212
|
label: PropTypes.Requireable<string>;
|
|
212
213
|
type: PropTypes.Requireable<string>;
|
|
@@ -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,2BAA2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AAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IAC1D,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -62,6 +62,7 @@ declare namespace DraggableList {
|
|
|
62
62
|
}> | PropTypes.InferProps<{
|
|
63
63
|
title: PropTypes.Validator<string>;
|
|
64
64
|
subtitle: PropTypes.Requireable<string>;
|
|
65
|
+
'data-name': PropTypes.Requireable<string>;
|
|
65
66
|
provider: PropTypes.Requireable<PropTypes.InferProps<{
|
|
66
67
|
label: PropTypes.Requireable<string>;
|
|
67
68
|
type: PropTypes.Requireable<string>;
|
|
@@ -62,6 +62,7 @@ declare namespace BrandLearningPriorities {
|
|
|
62
62
|
}> | PropTypes.InferProps<{
|
|
63
63
|
title: PropTypes.Validator<string>;
|
|
64
64
|
subtitle: PropTypes.Requireable<string>;
|
|
65
|
+
'data-name': PropTypes.Requireable<string>;
|
|
65
66
|
provider: PropTypes.Requireable<PropTypes.InferProps<{
|
|
66
67
|
label: PropTypes.Requireable<string>;
|
|
67
68
|
type: PropTypes.Requireable<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ListItem;
|
|
2
|
-
declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton, tags, title, provider, selected, selectedColor, subtitle, dataColumns, order, "aria-label": ariaLabel, disabled, contentType, isBulkStyle, isOverflowHidden, onClick, leftIcon }: {
|
|
2
|
+
declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton, tags, title, provider, selected, selectedColor, subtitle, dataColumns, order, "aria-label": ariaLabel, disabled, contentType, isBulkStyle, isOverflowHidden, onClick, leftIcon, "data-name": dataName }: {
|
|
3
3
|
buttonLink: any;
|
|
4
4
|
secondButtonLink: any;
|
|
5
5
|
bulletPointMenuButton: any;
|
|
@@ -18,6 +18,7 @@ declare function ListItem({ buttonLink, secondButtonLink, bulletPointMenuButton,
|
|
|
18
18
|
isOverflowHidden?: boolean | undefined;
|
|
19
19
|
onClick?: import("lodash/fp").LodashNoop | undefined;
|
|
20
20
|
leftIcon: any;
|
|
21
|
+
"data-name": any;
|
|
21
22
|
}, context: any): JSX.Element;
|
|
22
23
|
declare namespace ListItem {
|
|
23
24
|
namespace contextTypes {
|
|
@@ -47,6 +48,7 @@ declare namespace ListItem {
|
|
|
47
48
|
const propTypes: {
|
|
48
49
|
title: PropTypes.Validator<string>;
|
|
49
50
|
subtitle: PropTypes.Requireable<string>;
|
|
51
|
+
'data-name': PropTypes.Requireable<string>;
|
|
50
52
|
provider: PropTypes.Requireable<PropTypes.InferProps<{
|
|
51
53
|
label: PropTypes.Requireable<string>;
|
|
52
54
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAaA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-item/index.js"],"names":[],"mappings":";AAaA;;;;;;;;;;;;;;;;;;;;8BAoIC"}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
+
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
6
|
+
var _split2 = _interopRequireDefault(require("lodash/fp/split"));
|
|
7
|
+
var _last2 = _interopRequireDefault(require("lodash/fp/last"));
|
|
5
8
|
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
|
|
6
9
|
var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
7
10
|
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
@@ -37,7 +40,8 @@ const ListItem = ({
|
|
|
37
40
|
isBulkStyle = false,
|
|
38
41
|
isOverflowHidden = false,
|
|
39
42
|
onClick = _noop2.default,
|
|
40
|
-
leftIcon
|
|
43
|
+
leftIcon,
|
|
44
|
+
'data-name': dataName
|
|
41
45
|
}, context) => {
|
|
42
46
|
const {
|
|
43
47
|
skin
|
|
@@ -73,11 +77,12 @@ const ListItem = ({
|
|
|
73
77
|
className: _style.default.order,
|
|
74
78
|
"aria-label": ariaLabel
|
|
75
79
|
}, order + 1) : null;
|
|
80
|
+
const extractedIndex = (0, _pipe2.default)((0, _split2.default)('-'), _last2.default)(dataName);
|
|
76
81
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
77
82
|
className: (0, _classnames.default)(_style.default.wrapper, isBulkStyle && _style.default.gridLayout, subtitle && _style.default.withSubtitle, disabled && _style.default.disabled, onClick !== _noop2.default && !disabled && _style.default.cursorPointer),
|
|
78
83
|
onClick: !disabled ? onClick : undefined,
|
|
79
84
|
style: selectedStyle,
|
|
80
|
-
"data-name":
|
|
85
|
+
"data-name": dataName
|
|
81
86
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
82
87
|
className: (0, _classnames.default)(_style.default.dataColumnsWrapper, isOverflowHidden && _style.default.hiddenOverflowX)
|
|
83
88
|
}, isPublished && contentType === 'certification' ? orderView : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -111,7 +116,9 @@ const ListItem = ({
|
|
|
111
116
|
faSize: 16,
|
|
112
117
|
wrapperSize: 16
|
|
113
118
|
}
|
|
114
|
-
}) : null, buttonLink ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonLink) : null, secondButtonLink ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, secondButtonLink) : null, !(0, _isEmpty2.default)(bulletPointMenuButton) ? /*#__PURE__*/_react.default.createElement(_bulletPointMenuButton.default, bulletPointMenuButton
|
|
119
|
+
}) : null, buttonLink ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, buttonLink) : null, secondButtonLink ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, secondButtonLink) : null, !(0, _isEmpty2.default)(bulletPointMenuButton) ? /*#__PURE__*/_react.default.createElement(_bulletPointMenuButton.default, _extends({}, bulletPointMenuButton, {
|
|
120
|
+
"data-name": `bullet-point-menu-button-${extractedIndex}`
|
|
121
|
+
})) : null));
|
|
115
122
|
};
|
|
116
123
|
ListItem.contextTypes = {
|
|
117
124
|
skin: _provider.default.childContextTypes.skin,
|
|
@@ -120,6 +127,7 @@ ListItem.contextTypes = {
|
|
|
120
127
|
ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
121
128
|
title: _propTypes.default.string.isRequired,
|
|
122
129
|
subtitle: _propTypes.default.string,
|
|
130
|
+
'data-name': _propTypes.default.string,
|
|
123
131
|
provider: _propTypes.default.shape({
|
|
124
132
|
label: _propTypes.default.string,
|
|
125
133
|
type: _propTypes.default.oneOf(['info', 'default', 'success', 'failure', 'warning', 'progress'])
|