@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
|
@@ -68,7 +68,7 @@ const ButtonLinkIcon = props => {
|
|
|
68
68
|
className: style.tooltipContentWrapper
|
|
69
69
|
}, ariaLabel), [ariaLabel]);
|
|
70
70
|
const Button = useCallback(() => link ? /*#__PURE__*/React.createElement(Link, _extends({}, link, ariaLabel ? {
|
|
71
|
-
'data-for':
|
|
71
|
+
'data-for': dataName,
|
|
72
72
|
'data-tip': toolTipIsVisible
|
|
73
73
|
} : {}, {
|
|
74
74
|
className: styleButton,
|
|
@@ -77,7 +77,7 @@ const ButtonLinkIcon = props => {
|
|
|
77
77
|
onMouseEnter: handleMouseOver,
|
|
78
78
|
onMouseLeave: handleMouseLeave
|
|
79
79
|
}), contentView) : /*#__PURE__*/React.createElement("button", _extends({}, ariaLabel ? {
|
|
80
|
-
'data-for':
|
|
80
|
+
'data-for': dataName,
|
|
81
81
|
'data-tip': toolTipIsVisible
|
|
82
82
|
} : {}, {
|
|
83
83
|
type: "button",
|
|
@@ -92,7 +92,7 @@ const ButtonLinkIcon = props => {
|
|
|
92
92
|
}), contentView), [link, ariaLabel, className, contentView, dataName, disabled, handleMouseLeave, handleMouseOver, handleOnClick, styleButton, toolTipIsVisible]);
|
|
93
93
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, null), ariaLabel ? /*#__PURE__*/React.createElement(ToolTip, {
|
|
94
94
|
fontSize: 12,
|
|
95
|
-
anchorId:
|
|
95
|
+
anchorId: dataName,
|
|
96
96
|
toolTipIsVisible: toolTipIsVisible,
|
|
97
97
|
placement: tooltipPlacement,
|
|
98
98
|
TooltipContent: TooltipContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","useCallback","useRef","PropTypes","classnames","ICONS","FaIcon","Link","ToolTip","style","getButtonContent","icon","faIcon","Icon","_getOr","createElement","className","buttonContent","iconName","getSizeStyle","size","small","responsive","defaultStyle","ButtonLinkIcon","props","disabled","dataName","ariaLabel","link","onClick","tooltipPlacement","toolTipIsVisible","setToolTipIsVisible","timer","contentView","styleButton","handleOnClick","handleMouseOver","current","clearTimeout","setTimeout","undefined","handleMouseLeave","TooltipContent","tooltipContentWrapper","Button","_extends","onMouseEnter","onMouseLeave","type","onMouseOver","Fragment","fontSize","anchorId","placement","closeToolTipInformationTextAriaLabel","propTypes","process","env","NODE_ENV","oneOf","string","_keys","func","shape","href","download","bool","target"],"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':
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","useCallback","useRef","PropTypes","classnames","ICONS","FaIcon","Link","ToolTip","style","getButtonContent","icon","faIcon","Icon","_getOr","createElement","className","buttonContent","iconName","getSizeStyle","size","small","responsive","defaultStyle","ButtonLinkIcon","props","disabled","dataName","ariaLabel","link","onClick","tooltipPlacement","toolTipIsVisible","setToolTipIsVisible","timer","contentView","styleButton","handleOnClick","handleMouseOver","current","clearTimeout","setTimeout","undefined","handleMouseLeave","TooltipContent","tooltipContentWrapper","Button","_extends","onMouseEnter","onMouseLeave","type","onMouseOver","Fragment","fontSize","anchorId","placement","closeToolTipInformationTextAriaLabel","propTypes","process","env","NODE_ENV","oneOf","string","_keys","func","shape","href","download","bool","target"],"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,OAAOA,KAAK,IAAGC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,QAAO,OAAO;AAC1D,OAAOC,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,OAAOC,MAAM,MAAM,SAAS;AAC5B,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,OAAO,MAAM,YAAY;AAChC;AACA,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,gBAAgB,GAAGA,CAACC,IAAI,EAAEC,MAAM,KAAK;EACzC,MAAMC,IAAI,GAAGC,MAAA,CAAM,IAAI,EAAEH,IAAI,EAAEN,KAAK,CAAC;EAErC,IAAI,CAACQ,IAAI,IAAI,CAACD,MAAM,EAAE;IACpB,oBAAOb,KAAA,CAAAgB,aAAA;MAAKC,SAAS,EAAEP,KAAK,CAACQ;IAAc,CAAE,CAAC;EAChD;EAEA,oBACElB,KAAA,CAAAgB,aAAA;IAAKC,SAAS,EAAEP,KAAK,CAACQ;EAAc,GACjCL,MAAM,gBAAGb,KAAA,CAAAgB,aAAA,CAACT,MAAM;IAACY,QAAQ,EAAEN;EAAO,CAAE,CAAC,gBAAGb,KAAA,CAAAgB,aAAA,CA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,EAAEvB,SAAS,CAACiE,IAAI;EACxBpD,SAAS,EAAEb,SAAS,CAAC2D,MAAM;EAC3B/B,gBAAgB,EAAE5B,SAAS,CAAC0D,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACtE,CAAC;AAED,eAAerC,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"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _noop from "lodash/fp/noop";
|
|
1
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, { useMemo, useCallback } from 'react';
|
|
3
4
|
import map from 'lodash/fp/map';
|
|
@@ -5,72 +6,58 @@ import classnames from 'classnames';
|
|
|
5
6
|
import ButtonLink from '../button-link';
|
|
6
7
|
import style from './style.css';
|
|
7
8
|
import propTypes, { buttonPropTypes } from './types';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import { DEFAULT_ICON_STYLE, THEMES } from './utils';
|
|
10
|
+
const buildCustomIconByTheme = icon => {
|
|
11
|
+
if (!icon) return;
|
|
12
|
+
const {
|
|
13
|
+
theme,
|
|
14
|
+
...iconProps
|
|
15
|
+
} = icon;
|
|
16
|
+
const custom = theme && THEMES[theme];
|
|
17
|
+
if (!custom) return iconProps;
|
|
18
|
+
const customProps = custom ? {
|
|
19
|
+
...DEFAULT_ICON_STYLE,
|
|
11
20
|
faIcon: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
customStyle: {
|
|
15
|
-
padding: 0
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const themes = {
|
|
20
|
-
publish: {
|
|
21
|
-
name: 'cloud-arrow-up'
|
|
22
|
-
},
|
|
23
|
-
archive: {
|
|
24
|
-
name: 'folder-open'
|
|
25
|
-
},
|
|
26
|
-
delete: {
|
|
27
|
-
name: 'trash',
|
|
28
|
-
color: '#B81400'
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
return themes[type] ? {
|
|
32
|
-
icon: {
|
|
33
|
-
...defaultIconStyle,
|
|
34
|
-
faIcon: {
|
|
35
|
-
...defaultIconStyle.faIcon,
|
|
36
|
-
...themes[type]
|
|
37
|
-
}
|
|
21
|
+
...DEFAULT_ICON_STYLE.faIcon,
|
|
22
|
+
...custom
|
|
38
23
|
}
|
|
39
24
|
} : null;
|
|
25
|
+
return {
|
|
26
|
+
...iconProps,
|
|
27
|
+
...customProps
|
|
28
|
+
};
|
|
40
29
|
};
|
|
41
30
|
const Button = props => {
|
|
42
31
|
const {
|
|
43
32
|
'data-name': dataName,
|
|
44
33
|
disabled,
|
|
45
34
|
label,
|
|
46
|
-
onClick,
|
|
35
|
+
onClick = _noop,
|
|
47
36
|
type = 'default',
|
|
48
37
|
buttonLinkType,
|
|
49
38
|
icon,
|
|
50
|
-
customStyle = {}
|
|
39
|
+
customStyle = {},
|
|
40
|
+
...rest
|
|
51
41
|
} = props;
|
|
52
42
|
const styleButton = classnames(style.button, type === 'default' && style.defaultStyle, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled);
|
|
53
43
|
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
54
|
-
const buttonLinkProps =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
customStyle
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
}, [label, buttonLinkType, handleOnClick, dataName, styleButton, customStyle, icon, disabled]);
|
|
73
|
-
return /*#__PURE__*/React.createElement(ButtonLink, buttonLinkProps);
|
|
44
|
+
const buttonLinkProps = {
|
|
45
|
+
...rest,
|
|
46
|
+
'aria-label': label,
|
|
47
|
+
disabled,
|
|
48
|
+
label,
|
|
49
|
+
type: buttonLinkType,
|
|
50
|
+
onClick: handleOnClick,
|
|
51
|
+
'data-name': dataName,
|
|
52
|
+
className: styleButton,
|
|
53
|
+
customStyle: {
|
|
54
|
+
...customStyle
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const iconProps = buildCustomIconByTheme(icon);
|
|
58
|
+
return /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonLinkProps, {
|
|
59
|
+
icon: iconProps
|
|
60
|
+
}));
|
|
74
61
|
};
|
|
75
62
|
Button.propTypes = process.env.NODE_ENV !== "production" ? buttonPropTypes : {};
|
|
76
63
|
const ButtonMenu = props => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","DEFAULT_ICON_STYLE","THEMES","buildCustomIconByTheme","icon","theme","iconProps","custom","customProps","faIcon","Button","props","dataName","disabled","label","onClick","_noop","type","buttonLinkType","customStyle","rest","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","buttonLinkProps","className","createElement","_extends","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","key","buttonList","convert","cap","buttonMenuContainer"],"sources":["../../../src/atom/button-menu/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\nimport {DEFAULT_ICON_STYLE, THEMES} from './utils';\n\nconst buildCustomIconByTheme = (icon: ButtonProps['icon']) => {\n if (!icon) return;\n\n const {theme, ...iconProps} = icon;\n const custom = theme && THEMES[theme];\n if (!custom) return iconProps;\n\n const customProps = custom\n ? {\n ...DEFAULT_ICON_STYLE,\n faIcon: {...DEFAULT_ICON_STYLE.faIcon, ...custom}\n }\n : null;\n\n return {\n ...iconProps,\n ...customProps\n };\n};\n\nconst Button = (props: ButtonProps) => {\n const {\n 'data-name': dataName,\n disabled,\n label,\n onClick = noop,\n type = 'default',\n buttonLinkType,\n icon,\n customStyle = {},\n ...rest\n } = props;\n const styleButton = classnames(\n style.button,\n type === 'default' && style.defaultStyle,\n type === 'defaultLeft' && style.defaultLeft,\n type === 'dangerous' && style.dangerous,\n type === 'dangerousLeft' && style.dangerousLeft,\n disabled && style.disabled\n );\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const buttonLinkProps = {\n ...rest,\n 'aria-label': label,\n disabled,\n label,\n type: buttonLinkType,\n onClick: handleOnClick,\n 'data-name': dataName,\n className: styleButton,\n customStyle: {...customStyle}\n };\n\n const iconProps = buildCustomIconByTheme(icon);\n\n return <ButtonLink {...buttonLinkProps} icon={iconProps} />;\n};\n\nButton.propTypes = buttonPropTypes;\n\nconst ButtonMenu = (props: ButtonMenuProps) => {\n const {buttons, 'data-name': dataName} = props;\n const buildButton = useCallback((button: ButtonProps, index) => {\n return <Button {...button} key={button.label + index} />;\n }, []);\n\n const buttonList = useMemo(\n // @ts-expect-error (to avoid using map as any)\n () => map.convert({cap: false})(buildButton, buttons),\n [buttons, buildButton]\n );\n\n return (\n <div data-name={dataName} className={style.buttonMenuContainer}>\n {buttonList}\n </div>\n );\n};\n\nButtonMenu.propTypes = propTypes;\n\nexport default ButtonMenu;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,WAAW,QAAO,OAAO;AACjD,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,IAAiCC,eAAe,QAAO,SAAS;AAChF,SAAQC,kBAAkB,EAAEC,MAAM,QAAO,SAAS;AAElD,MAAMC,sBAAsB,GAAIC,IAAyB,IAAK;EAC5D,IAAI,CAACA,IAAI,EAAE;EAEX,MAAM;IAACC,KAAK;IAAE,GAAGC;EAAS,CAAC,GAAGF,IAAI;EAClC,MAAMG,MAAM,GAAGF,KAAK,IAAIH,MAAM,CAACG,KAAK,CAAC;EACrC,IAAI,CAACE,MAAM,EAAE,OAAOD,SAAS;EAE7B,MAAME,WAAW,GAAGD,MAAM,GACtB;IACE,GAAGN,kBAAkB;IACrBQ,MAAM,EAAE;MAAC,GAAGR,kBAAkB,CAACQ,MAAM;MAAE,GAAGF;IAAM;EAClD,CAAC,GACD,IAAI;EAER,OAAO;IACL,GAAGD,SAAS;IACZ,GAAGE;EACL,CAAC;AACH,CAAC;AAED,MAAME,MAAM,GAAIC,KAAkB,IAAK;EACrC,MAAM;IACJ,WAAW,EAAEC,QAAQ;IACrBC,QAAQ;IACRC,KAAK;IACLC,OAAO,GAAAC,KAAO;IACdC,IAAI,GAAG,SAAS;IAChBC,cAAc;IACdd,IAAI;IACJe,WAAW,GAAG,CAAC,CAAC;IAChB,GAAGC;EACL,CAAC,GAAGT,KAAK;EACT,MAAMU,WAAW,GAAGzB,UAAU,CAC5BE,KAAK,CAACwB,MAAM,EACZL,IAAI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N,MAAME,UAAU,GAAG/C,OAAO;EACxB;EACA,MAAME,GAAG,CAAC8C,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACL,WAAW,EAAED,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEC,WAAW,CACvB,CAAC;EAED,oBACE7C,KAAA,CAAAsC,aAAA;IAAK,aAAWlB,QAAS;IAACiB,SAAS,EAAE/B,KAAK,CAAC6C;EAAoB,GAC5DH,UACE,CAAC;AAEV,CAAC;AAEDL,UAAU,CAACpC,SAAS,GAAAiC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGnC,SAAS;AAEhC,eAAeoC,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"}
|
|
@@ -9,7 +9,7 @@ export const buttonPropTypes = {
|
|
|
9
9
|
buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
|
|
10
10
|
icon: PropTypes.shape({
|
|
11
11
|
...iconPropTypes,
|
|
12
|
-
theme: PropTypes.oneOf(['
|
|
12
|
+
theme: PropTypes.oneOf(['archived', 'published', 'deleted'])
|
|
13
13
|
}),
|
|
14
14
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
15
15
|
};
|
|
@@ -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.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","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.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,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,CAACF,UAAU;EAClCG,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":[]}
|
|
@@ -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,24 @@
|
|
|
1
|
+
import { COLORS } from '../../variables/colors';
|
|
2
|
+
export const DEFAULT_ICON_STYLE = {
|
|
3
|
+
position: 'left',
|
|
4
|
+
faIcon: {
|
|
5
|
+
size: 14,
|
|
6
|
+
color: COLORS.cm_grey_500,
|
|
7
|
+
customStyle: {
|
|
8
|
+
padding: 0
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export const THEMES = {
|
|
13
|
+
published: {
|
|
14
|
+
name: 'cloud-arrow-up'
|
|
15
|
+
},
|
|
16
|
+
archived: {
|
|
17
|
+
name: 'folder-open'
|
|
18
|
+
},
|
|
19
|
+
deleted: {
|
|
20
|
+
name: 'trash',
|
|
21
|
+
color: COLORS.cm_negative_200
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["COLORS","DEFAULT_ICON_STYLE","position","faIcon","size","color","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,SAAQA,MAAM,QAAO,wBAAwB;AAE7C,OAAO,MAAMC,kBAAkB,GAAG;EAChCC,QAAQ,EAAE,MAAe;EACzBC,MAAM,EAAE;IACNC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAEL,MAAM,CAACM,WAAW;IACzBC,WAAW,EAAE;MAACC,OAAO,EAAE;IAAC;EAC1B;AACF,CAAC;AAED,OAAO,MAAMC,MAAM,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;IAAEN,KAAK,EAAEL,MAAM,CAACc;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,2BAA2B,CAAC;AAElD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,QAAA,MAAM,SAAS
|
|
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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I,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"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _pipe from "lodash/fp/pipe";
|
|
2
|
+
import _split from "lodash/fp/split";
|
|
3
|
+
import _last from "lodash/fp/last";
|
|
1
4
|
import _get from "lodash/fp/get";
|
|
2
5
|
import _noop from "lodash/fp/noop";
|
|
3
6
|
import _map from "lodash/fp/map";
|
|
@@ -32,7 +35,8 @@ const ListItem = ({
|
|
|
32
35
|
isBulkStyle = false,
|
|
33
36
|
isOverflowHidden = false,
|
|
34
37
|
onClick = _noop,
|
|
35
|
-
leftIcon
|
|
38
|
+
leftIcon,
|
|
39
|
+
'data-name': dataName
|
|
36
40
|
}, context) => {
|
|
37
41
|
const {
|
|
38
42
|
skin
|
|
@@ -68,11 +72,12 @@ const ListItem = ({
|
|
|
68
72
|
className: style.order,
|
|
69
73
|
"aria-label": ariaLabel
|
|
70
74
|
}, order + 1) : null;
|
|
75
|
+
const extractedIndex = _pipe(_split('-'), _last)(dataName);
|
|
71
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
72
77
|
className: classnames(style.wrapper, isBulkStyle && style.gridLayout, subtitle && style.withSubtitle, disabled && style.disabled, onClick !== _noop && !disabled && style.cursorPointer),
|
|
73
78
|
onClick: !disabled ? onClick : undefined,
|
|
74
79
|
style: selectedStyle,
|
|
75
|
-
"data-name":
|
|
80
|
+
"data-name": dataName
|
|
76
81
|
}, /*#__PURE__*/React.createElement("div", {
|
|
77
82
|
className: classnames(style.dataColumnsWrapper, isOverflowHidden && style.hiddenOverflowX)
|
|
78
83
|
}, isPublished && contentType === 'certification' ? orderView : null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -106,7 +111,9 @@ const ListItem = ({
|
|
|
106
111
|
faSize: 16,
|
|
107
112
|
wrapperSize: 16
|
|
108
113
|
}
|
|
109
|
-
}) : null, buttonLink ? /*#__PURE__*/React.createElement(ButtonLink, buttonLink) : null, secondButtonLink ? /*#__PURE__*/React.createElement(ButtonLink, secondButtonLink) : null, !_isEmpty(bulletPointMenuButton) ? /*#__PURE__*/React.createElement(BulletPointMenuButton, bulletPointMenuButton
|
|
114
|
+
}) : null, buttonLink ? /*#__PURE__*/React.createElement(ButtonLink, buttonLink) : null, secondButtonLink ? /*#__PURE__*/React.createElement(ButtonLink, secondButtonLink) : null, !_isEmpty(bulletPointMenuButton) ? /*#__PURE__*/React.createElement(BulletPointMenuButton, _extends({}, bulletPointMenuButton, {
|
|
115
|
+
"data-name": `bullet-point-menu-button-${extractedIndex}`
|
|
116
|
+
})) : null));
|
|
110
117
|
};
|
|
111
118
|
ListItem.contextTypes = {
|
|
112
119
|
skin: Provider.childContextTypes.skin,
|
|
@@ -115,6 +122,7 @@ ListItem.contextTypes = {
|
|
|
115
122
|
ListItem.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
116
123
|
title: PropTypes.string.isRequired,
|
|
117
124
|
subtitle: PropTypes.string,
|
|
125
|
+
'data-name': PropTypes.string,
|
|
118
126
|
provider: PropTypes.shape({
|
|
119
127
|
label: PropTypes.string,
|
|
120
128
|
type: PropTypes.oneOf(['info', 'default', 'success', 'failure', 'warning', 'progress'])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","convert","classnames","Provider","Tag","FaIcon","ButtonLink","BulletPointMenuButton","COLORS","style","ListItem","buttonLink","secondButtonLink","bulletPointMenuButton","tags","title","provider","selected","selectedColor","subtitle","dataColumns","order","ariaLabel","disabled","contentType","isBulkStyle","isOverflowHidden","onClick","_noop","leftIcon","context","skin","primarySelectedColor","_get","mapUncapped","_map","cap","isPublished","selectedStyle","backgroundColor","tagSelectedStyle","color","tagsView","tag","index","type","createElement","key","className","_extends","customStyle","dataColumnsView","dataColumn","label","orderView","undefined","wrapper","gridLayout","withSubtitle","cursorPointer","dataColumnsWrapper","hiddenOverflowX","leftSection","iconName","gradientBackground","iconColor","preset","borderRadius","titleWrapper","titleProviderWrapper","_isEmpty","providerTag","settings","white","size","faSize","wrapperSize","contextTypes","childContextTypes","translate","propTypes","process","env","NODE_ENV","string","isRequired","shape","oneOf","bool","arrayOf","dataName","icon","position","func","buttonAriaLabel","menuAriaLabel","buttons","number","id"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map, noop, get} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport FaIcon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst ListItem = (\n {\n buttonLink,\n secondButtonLink,\n bulletPointMenuButton,\n tags,\n title,\n provider,\n selected,\n selectedColor,\n subtitle,\n dataColumns,\n order,\n 'aria-label': ariaLabel,\n disabled = false,\n contentType,\n isBulkStyle = false,\n isOverflowHidden = false,\n onClick = noop,\n leftIcon\n },\n context\n) => {\n const {skin} = context;\n const primarySelectedColor = selectedColor || get('common.primary', skin);\n const mapUncapped = map.convert({cap: false});\n let isPublished = false;\n\n const selectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySelectedColor} a(0.07))`)\n }\n : {};\n\n const tagSelectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySelectedColor} a(0.15))`),\n color: primarySelectedColor\n }\n : {};\n\n const tagsView = mapUncapped((tag, index) => {\n isPublished = tag.type === 'success';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} customStyle={tagSelectedStyle} />\n </div>\n );\n })(tags);\n\n const dataColumnsView = mapUncapped((dataColumn, index) => {\n return (\n <div key={index} className={style[dataColumn.className]}>\n {dataColumn.type ? <Tag {...dataColumn} /> : dataColumn.label}\n </div>\n );\n })(dataColumns);\n\n const orderView =\n order !== null && order !== undefined ? (\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n ) : null;\n\n return (\n <div\n className={classnames(\n style.wrapper,\n isBulkStyle && style.gridLayout,\n subtitle && style.withSubtitle,\n disabled && style.disabled,\n onClick !== noop && !disabled && style.cursorPointer\n )}\n onClick={!disabled ? onClick : undefined}\n style={selectedStyle}\n data-name={`modal-title-${title}`}\n >\n <div\n className={classnames(style.dataColumnsWrapper, isOverflowHidden && style.hiddenOverflowX)}\n >\n {isPublished && contentType === 'certification' ? orderView : null}\n <div className={style.leftSection}>\n {leftIcon ? (\n <div>\n <FaIcon\n iconName={leftIcon.iconName}\n gradientBackground={leftIcon.gradientBackground || true}\n iconColor={leftIcon.iconColor || primarySelectedColor}\n preset={leftIcon.preset || 'xl'}\n borderRadius={leftIcon.borderRadius || '25%'}\n />\n </div>\n ) : null}\n </div>\n <div className={style.titleWrapper}>\n <div className={style.titleProviderWrapper}>\n <div className={style.title} title={title}>\n {title}\n </div>\n {!isEmpty(provider) ? (\n <Tag label={provider.label} type={provider.type} className={style.providerTag} />\n ) : null}\n </div>\n {subtitle ? <div className={style.subtitle}>{subtitle}</div> : null}\n </div>\n {dataColumnsView}\n </div>\n\n <div className={style.settings}>\n {tagsView}\n {selected ? (\n <FaIcon\n iconName=\"circle-check\"\n iconColor={primarySelectedColor}\n backgroundColor={COLORS.white}\n size={{faSize: 16, wrapperSize: 16}}\n />\n ) : null}\n {buttonLink ? <ButtonLink {...buttonLink} /> : null}\n {secondButtonLink ? <ButtonLink {...secondButtonLink} /> : null}\n {!isEmpty(bulletPointMenuButton) ? (\n <BulletPointMenuButton {...bulletPointMenuButton} />\n ) : null}\n </div>\n </div>\n );\n};\n\nListItem.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nListItem.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n provider: PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['info', 'default', 'success', 'failure', 'warning', 'progress'])\n }),\n selected: PropTypes.bool,\n selectedColor: PropTypes.string,\n dataColumns: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default']),\n className: PropTypes.oneOf(['cell', 'title'])\n })\n ),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n secondButtonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default'])\n })\n ),\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n isBulkStyle: PropTypes.bool,\n isOverflowHidden: PropTypes.bool,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string,\n id: PropTypes.string,\n leftIcon: PropTypes.shape({\n iconName: PropTypes.string,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderRadius: PropTypes.string,\n preset: PropTypes.string,\n gradientBackground: PropTypes.bool,\n size: PropTypes.number,\n wrapperSize: PropTypes.number\n })\n};\n\nexport default ListItem;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,qBAAqB;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AM;IAC3B7C,eAAe,EAAEvC,SAAS,CAACoF,MAAM;IACjCjB,YAAY,EAAEnE,SAAS,CAACoF,MAAM;IAC9BlB,MAAM,EAAElE,SAAS,CAACoF,MAAM;IACxBpB,kBAAkB,EAAEhE,SAAS,CAACwF,IAAI;IAClCd,IAAI,EAAE1E,SAAS,CAACiG,MAAM;IACtBrB,WAAW,EAAE5E,SAAS,CAACiG;EACzB,CAAC;AACH,CAAC;AAED,eAAevF,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","convert","classnames","Provider","Tag","FaIcon","ButtonLink","BulletPointMenuButton","COLORS","style","ListItem","buttonLink","secondButtonLink","bulletPointMenuButton","tags","title","provider","selected","selectedColor","subtitle","dataColumns","order","ariaLabel","disabled","contentType","isBulkStyle","isOverflowHidden","onClick","_noop","leftIcon","dataName","context","skin","primarySelectedColor","_get","mapUncapped","_map","cap","isPublished","selectedStyle","backgroundColor","tagSelectedStyle","color","tagsView","tag","index","type","createElement","key","className","_extends","customStyle","dataColumnsView","dataColumn","label","orderView","undefined","extractedIndex","_pipe","_split","_last","wrapper","gridLayout","withSubtitle","cursorPointer","dataColumnsWrapper","hiddenOverflowX","leftSection","iconName","gradientBackground","iconColor","preset","borderRadius","titleWrapper","titleProviderWrapper","_isEmpty","providerTag","settings","white","size","faSize","wrapperSize","contextTypes","childContextTypes","translate","propTypes","process","env","NODE_ENV","string","isRequired","shape","oneOf","bool","arrayOf","icon","position","func","buttonAriaLabel","menuAriaLabel","buttons","number","id"],"sources":["../../../src/organism/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, map, noop, get, last, split, pipe} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Tag from '../../atom/tag';\nimport FaIcon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport BulletPointMenuButton from '../../molecule/bullet-point-menu-button';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst ListItem = (\n {\n buttonLink,\n secondButtonLink,\n bulletPointMenuButton,\n tags,\n title,\n provider,\n selected,\n selectedColor,\n subtitle,\n dataColumns,\n order,\n 'aria-label': ariaLabel,\n disabled = false,\n contentType,\n isBulkStyle = false,\n isOverflowHidden = false,\n onClick = noop,\n leftIcon,\n 'data-name': dataName\n },\n context\n) => {\n const {skin} = context;\n const primarySelectedColor = selectedColor || get('common.primary', skin);\n const mapUncapped = map.convert({cap: false});\n let isPublished = false;\n\n const selectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySelectedColor} a(0.07))`)\n }\n : {};\n\n const tagSelectedStyle = selected\n ? {\n backgroundColor: convert(`color(${primarySelectedColor} a(0.15))`),\n color: primarySelectedColor\n }\n : {};\n\n const tagsView = mapUncapped((tag, index) => {\n isPublished = tag.type === 'success';\n return (\n <div key={index} className={style.tag}>\n <Tag {...tag} customStyle={tagSelectedStyle} />\n </div>\n );\n })(tags);\n\n const dataColumnsView = mapUncapped((dataColumn, index) => {\n return (\n <div key={index} className={style[dataColumn.className]}>\n {dataColumn.type ? <Tag {...dataColumn} /> : dataColumn.label}\n </div>\n );\n })(dataColumns);\n\n const orderView =\n order !== null && order !== undefined ? (\n <div className={style.order} aria-label={ariaLabel}>\n {order + 1}\n </div>\n ) : null;\n\n const extractedIndex = pipe(split('-'), last)(dataName);\n\n return (\n <div\n className={classnames(\n style.wrapper,\n isBulkStyle && style.gridLayout,\n subtitle && style.withSubtitle,\n disabled && style.disabled,\n onClick !== noop && !disabled && style.cursorPointer\n )}\n onClick={!disabled ? onClick : undefined}\n style={selectedStyle}\n data-name={dataName}\n >\n <div\n className={classnames(style.dataColumnsWrapper, isOverflowHidden && style.hiddenOverflowX)}\n >\n {isPublished && contentType === 'certification' ? orderView : null}\n <div className={style.leftSection}>\n {leftIcon ? (\n <div>\n <FaIcon\n iconName={leftIcon.iconName}\n gradientBackground={leftIcon.gradientBackground || true}\n iconColor={leftIcon.iconColor || primarySelectedColor}\n preset={leftIcon.preset || 'xl'}\n borderRadius={leftIcon.borderRadius || '25%'}\n />\n </div>\n ) : null}\n </div>\n <div className={style.titleWrapper}>\n <div className={style.titleProviderWrapper}>\n <div className={style.title} title={title}>\n {title}\n </div>\n {!isEmpty(provider) ? (\n <Tag label={provider.label} type={provider.type} className={style.providerTag} />\n ) : null}\n </div>\n {subtitle ? <div className={style.subtitle}>{subtitle}</div> : null}\n </div>\n {dataColumnsView}\n </div>\n <div className={style.settings}>\n {tagsView}\n {selected ? (\n <FaIcon\n iconName=\"circle-check\"\n iconColor={primarySelectedColor}\n backgroundColor={COLORS.white}\n size={{faSize: 16, wrapperSize: 16}}\n />\n ) : null}\n {buttonLink ? <ButtonLink {...buttonLink} /> : null}\n {secondButtonLink ? <ButtonLink {...secondButtonLink} /> : null}\n {!isEmpty(bulletPointMenuButton) ? (\n <BulletPointMenuButton\n {...bulletPointMenuButton}\n data-name={`bullet-point-menu-button-${extractedIndex}`}\n />\n ) : null}\n </div>\n </div>\n );\n};\n\nListItem.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nListItem.propTypes = {\n title: PropTypes.string.isRequired,\n subtitle: PropTypes.string,\n 'data-name': PropTypes.string,\n provider: PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['info', 'default', 'success', 'failure', 'warning', 'progress'])\n }),\n selected: PropTypes.bool,\n selectedColor: PropTypes.string,\n dataColumns: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default']),\n className: PropTypes.oneOf(['cell', 'title'])\n })\n ),\n buttonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n secondButtonLink: PropTypes.shape({\n type: PropTypes.string,\n label: PropTypes.string,\n ariaLabel: PropTypes.string,\n dataName: PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.string,\n type: PropTypes.string\n }),\n onClick: PropTypes.func\n }),\n bulletPointMenuButton: PropTypes.shape({\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: PropTypes.arrayOf(\n PropTypes.shape({\n 'data-name': PropTypes.string,\n label: PropTypes.string,\n type: PropTypes.string,\n onClick: PropTypes.func\n })\n ),\n onClick: PropTypes.func\n }),\n tags: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.oneOf(['success', 'failure', 'warning', 'progress', 'default'])\n })\n ),\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n isBulkStyle: PropTypes.bool,\n isOverflowHidden: PropTypes.bool,\n order: PropTypes.number,\n 'aria-label': PropTypes.string,\n contentType: PropTypes.string,\n id: PropTypes.string,\n leftIcon: PropTypes.shape({\n iconName: PropTypes.string,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderRadius: PropTypes.string,\n preset: PropTypes.string,\n gradientBackground: PropTypes.bool,\n size: PropTypes.number,\n wrapperSize: PropTypes.number\n })\n};\n\nexport default ListItem;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,qBAAqB,MAAM,yCAAyC;AAC3E,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,QAAQ,GAAGA,CACf;EACEC,UAAU;EACVC,gBAAgB;EA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,MAAM;IACjCjB,YAAY,EAAExE,SAAS,CAACyF,MAAM;IAC9BlB,MAAM,EAAEvE,SAAS,CAACyF,MAAM;IACxBpB,kBAAkB,EAAErE,SAAS,CAAC6F,IAAI;IAClCd,IAAI,EAAE/E,SAAS,CAACqG,MAAM;IACtBpB,WAAW,EAAEjF,SAAS,CAACqG;EACzB,CAAC;AACH,CAAC;AAED,eAAe3F,QAAQ","ignoreList":[]}
|
|
@@ -70,6 +70,7 @@ declare namespace ListItems {
|
|
|
70
70
|
items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
71
71
|
title: PropTypes.Validator<string>;
|
|
72
72
|
subtitle: PropTypes.Requireable<string>;
|
|
73
|
+
'data-name': PropTypes.Requireable<string>;
|
|
73
74
|
provider: PropTypes.Requireable<PropTypes.InferProps<{
|
|
74
75
|
label: PropTypes.Requireable<string>;
|
|
75
76
|
type: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/list-items/index.js"],"names":[],"mappings":";AAiFA;;;;;;;;gBA0CC"}
|
|
@@ -33,7 +33,8 @@ const buildListItemsView = (content, ariaLabel, selectMultiple) => {
|
|
|
33
33
|
"data-name": `content-${index}`
|
|
34
34
|
}, /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
|
|
35
35
|
order: null,
|
|
36
|
-
contentType: itemType
|
|
36
|
+
contentType: itemType,
|
|
37
|
+
"data-name": `list-item-${index}`
|
|
37
38
|
}))));
|
|
38
39
|
const tableHeaderView = !isNil(tableHeader) && !isEmpty(tableHeader) ? /*#__PURE__*/React.createElement("div", {
|
|
39
40
|
className: style.tableHeaderWrapper
|