@coorpacademy/components 11.33.13-alpha.2 → 11.33.13-alpha.20

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.
Files changed (157) hide show
  1. package/es/atom/button-link-icon/index.js +3 -3
  2. package/es/atom/button-link-icon/index.js.map +1 -1
  3. package/es/atom/button-menu/index.d.ts +1 -0
  4. package/es/atom/button-menu/index.d.ts.map +1 -1
  5. package/es/atom/button-menu/index.js +37 -21
  6. package/es/atom/button-menu/index.js.map +1 -1
  7. package/es/atom/button-menu/style.css +0 -10
  8. package/es/atom/button-menu/types.d.ts +7 -7
  9. package/es/atom/button-menu/types.d.ts.map +1 -1
  10. package/es/atom/button-menu/types.js +4 -1
  11. package/es/atom/button-menu/types.js.map +1 -1
  12. package/es/atom/button-menu/utils.d.ts +23 -0
  13. package/es/atom/button-menu/utils.d.ts.map +1 -0
  14. package/es/atom/button-menu/utils.js +24 -0
  15. package/es/atom/button-menu/utils.js.map +1 -0
  16. package/es/molecule/bullet-point-menu-button/index.d.ts +2 -0
  17. package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
  18. package/es/molecule/bullet-point-menu-button/index.js +8 -3
  19. package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
  20. package/es/molecule/bullet-point-menu-button/types.d.ts +3 -0
  21. package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
  22. package/es/molecule/bullet-point-menu-button/types.js +1 -0
  23. package/es/molecule/bullet-point-menu-button/types.js.map +1 -1
  24. package/es/molecule/cm-popin/index.d.ts.map +1 -1
  25. package/es/molecule/cm-popin/index.js +9 -22
  26. package/es/molecule/cm-popin/index.js.map +1 -1
  27. package/es/molecule/cm-popin/style.css +2 -1
  28. package/es/molecule/cm-popin/types.d.ts +5 -0
  29. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  30. package/es/molecule/draggable-list/index.d.ts +1 -0
  31. package/es/molecule/expandible-actionable-table/index.d.ts +4 -0
  32. package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  33. package/es/molecule/expandible-actionable-table/types.d.ts +4 -0
  34. package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  35. package/es/organism/brand-learning-priorities/index.d.ts +1 -0
  36. package/es/organism/header-with-actions/index.d.ts +2 -0
  37. package/es/organism/header-with-actions/index.d.ts.map +1 -1
  38. package/es/organism/header-with-actions/types.d.ts +2 -0
  39. package/es/organism/header-with-actions/types.d.ts.map +1 -1
  40. package/es/organism/list-item/index.d.ts +3 -1
  41. package/es/organism/list-item/index.d.ts.map +1 -1
  42. package/es/organism/list-item/index.js +11 -3
  43. package/es/organism/list-item/index.js.map +1 -1
  44. package/es/organism/list-items/index.d.ts +5 -0
  45. package/es/organism/list-items/index.d.ts.map +1 -1
  46. package/es/organism/list-items/index.js +2 -1
  47. package/es/organism/list-items/index.js.map +1 -1
  48. package/es/organism/wizard-contents/index.d.ts +4 -0
  49. package/es/template/app-player/loading/index.d.ts +5 -0
  50. package/es/template/app-player/player/index.d.ts +10 -0
  51. package/es/template/app-player/player/slides/index.d.ts +5 -0
  52. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  53. package/es/template/app-player/popin-correction/index.d.ts +5 -0
  54. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  55. package/es/template/app-player/popin-end/index.d.ts +5 -0
  56. package/es/template/app-review/index.d.ts +5 -0
  57. package/es/template/app-review/index.d.ts.map +1 -1
  58. package/es/template/app-review/player/prop-types.d.ts +5 -0
  59. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  60. package/es/template/app-review/prop-types.d.ts +5 -0
  61. package/es/template/app-review/prop-types.d.ts.map +1 -1
  62. package/es/template/back-office/brand-update/index.d.ts +16 -0
  63. package/es/template/back-office/brand-update/index.d.ts.map +1 -1
  64. package/es/template/back-office/brand-update/index.js +22 -3
  65. package/es/template/back-office/brand-update/index.js.map +1 -1
  66. package/es/template/back-office/brand-update/style.css +1 -0
  67. package/es/template/back-office/brand-update/utils.d.ts +79 -0
  68. package/es/template/back-office/brand-update/utils.d.ts.map +1 -0
  69. package/es/template/back-office/brand-update/utils.js +60 -0
  70. package/es/template/back-office/brand-update/utils.js.map +1 -0
  71. package/es/template/common/dashboard/index.d.ts +10 -0
  72. package/es/template/common/search-page/index.d.ts +5 -0
  73. package/es/template/external-course/index.d.ts +5 -0
  74. package/es/variables/colors.css +6 -1
  75. package/es/variables/colors.d.ts +4 -0
  76. package/es/variables/colors.d.ts.map +1 -1
  77. package/es/variables/colors.js +5 -1
  78. package/es/variables/colors.js.map +1 -1
  79. package/lib/atom/button-link-icon/index.js +3 -3
  80. package/lib/atom/button-link-icon/index.js.map +1 -1
  81. package/lib/atom/button-menu/index.d.ts +1 -0
  82. package/lib/atom/button-menu/index.d.ts.map +1 -1
  83. package/lib/atom/button-menu/index.js +38 -22
  84. package/lib/atom/button-menu/index.js.map +1 -1
  85. package/lib/atom/button-menu/style.css +0 -10
  86. package/lib/atom/button-menu/types.d.ts +7 -7
  87. package/lib/atom/button-menu/types.d.ts.map +1 -1
  88. package/lib/atom/button-menu/types.js +4 -1
  89. package/lib/atom/button-menu/types.js.map +1 -1
  90. package/lib/atom/button-menu/utils.d.ts +23 -0
  91. package/lib/atom/button-menu/utils.d.ts.map +1 -0
  92. package/lib/atom/button-menu/utils.js +28 -0
  93. package/lib/atom/button-menu/utils.js.map +1 -0
  94. package/lib/molecule/bullet-point-menu-button/index.d.ts +2 -0
  95. package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
  96. package/lib/molecule/bullet-point-menu-button/index.js +8 -3
  97. package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
  98. package/lib/molecule/bullet-point-menu-button/types.d.ts +3 -0
  99. package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
  100. package/lib/molecule/bullet-point-menu-button/types.js +1 -0
  101. package/lib/molecule/bullet-point-menu-button/types.js.map +1 -1
  102. package/lib/molecule/cm-popin/index.d.ts.map +1 -1
  103. package/lib/molecule/cm-popin/index.js +9 -22
  104. package/lib/molecule/cm-popin/index.js.map +1 -1
  105. package/lib/molecule/cm-popin/style.css +2 -1
  106. package/lib/molecule/cm-popin/types.d.ts +5 -0
  107. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  108. package/lib/molecule/draggable-list/index.d.ts +1 -0
  109. package/lib/molecule/expandible-actionable-table/index.d.ts +4 -0
  110. package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  111. package/lib/molecule/expandible-actionable-table/types.d.ts +4 -0
  112. package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  113. package/lib/organism/brand-learning-priorities/index.d.ts +1 -0
  114. package/lib/organism/header-with-actions/index.d.ts +2 -0
  115. package/lib/organism/header-with-actions/index.d.ts.map +1 -1
  116. package/lib/organism/header-with-actions/types.d.ts +2 -0
  117. package/lib/organism/header-with-actions/types.d.ts.map +1 -1
  118. package/lib/organism/list-item/index.d.ts +3 -1
  119. package/lib/organism/list-item/index.d.ts.map +1 -1
  120. package/lib/organism/list-item/index.js +11 -3
  121. package/lib/organism/list-item/index.js.map +1 -1
  122. package/lib/organism/list-items/index.d.ts +5 -0
  123. package/lib/organism/list-items/index.d.ts.map +1 -1
  124. package/lib/organism/list-items/index.js +2 -1
  125. package/lib/organism/list-items/index.js.map +1 -1
  126. package/lib/organism/wizard-contents/index.d.ts +4 -0
  127. package/lib/template/app-player/loading/index.d.ts +5 -0
  128. package/lib/template/app-player/player/index.d.ts +10 -0
  129. package/lib/template/app-player/player/slides/index.d.ts +5 -0
  130. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  131. package/lib/template/app-player/popin-correction/index.d.ts +5 -0
  132. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  133. package/lib/template/app-player/popin-end/index.d.ts +5 -0
  134. package/lib/template/app-review/index.d.ts +5 -0
  135. package/lib/template/app-review/index.d.ts.map +1 -1
  136. package/lib/template/app-review/player/prop-types.d.ts +5 -0
  137. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  138. package/lib/template/app-review/prop-types.d.ts +5 -0
  139. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  140. package/lib/template/back-office/brand-update/index.d.ts +16 -0
  141. package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
  142. package/lib/template/back-office/brand-update/index.js +22 -3
  143. package/lib/template/back-office/brand-update/index.js.map +1 -1
  144. package/lib/template/back-office/brand-update/style.css +1 -0
  145. package/lib/template/back-office/brand-update/utils.d.ts +79 -0
  146. package/lib/template/back-office/brand-update/utils.d.ts.map +1 -0
  147. package/lib/template/back-office/brand-update/utils.js +64 -0
  148. package/lib/template/back-office/brand-update/utils.js.map +1 -0
  149. package/lib/template/common/dashboard/index.d.ts +10 -0
  150. package/lib/template/common/search-page/index.d.ts +5 -0
  151. package/lib/template/external-course/index.d.ts +5 -0
  152. package/lib/variables/colors.css +6 -1
  153. package/lib/variables/colors.d.ts +4 -0
  154. package/lib/variables/colors.d.ts.map +1 -1
  155. package/lib/variables/colors.js +5 -1
  156. package/lib/variables/colors.js.map +1 -1
  157. 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': 'button-icon',
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': 'button-icon',
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: "button-icon",
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': '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,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,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IAAI;IACxBC,MAAM,EAAElE,SAAS,CAAC0D,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFnC,QAAQ,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
+ {"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,CAA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ACtBK,QAAQ,EAAEhE,SAAS,CAACiE,IAAI;IACxBC,MAAM,EAAElE,SAAS,CAAC0D,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFnC,QAAQ,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":[]}
@@ -11,6 +11,7 @@ declare const ButtonMenu: {
11
11
  type: import("prop-types").Requireable<string>;
12
12
  buttonLinkType: import("prop-types").Requireable<string>;
13
13
  icon: import("prop-types").Requireable<import("prop-types").InferProps<{
14
+ theme: import("prop-types").Requireable<string>;
14
15
  position: import("prop-types").Requireable<string>;
15
16
  type: import("prop-types").Requireable<string>;
16
17
  faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AAqDjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAMA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;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,43 +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';
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,
20
+ faIcon: {
21
+ ...DEFAULT_ICON_STYLE.faIcon,
22
+ ...custom
23
+ }
24
+ } : null;
25
+ return {
26
+ ...iconProps,
27
+ ...customProps
28
+ };
29
+ };
8
30
  const Button = props => {
9
31
  const {
10
32
  'data-name': dataName,
11
33
  disabled,
12
34
  label,
13
- onClick,
35
+ onClick = _noop,
14
36
  type = 'default',
15
37
  buttonLinkType,
16
38
  icon,
17
- customStyle = {}
39
+ customStyle = {},
40
+ ...rest
18
41
  } = props;
19
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);
20
43
  const handleOnClick = useCallback(() => onClick(), [onClick]);
21
- return icon ? /*#__PURE__*/React.createElement(ButtonLink, {
22
- label: label,
44
+ const buttonLinkProps = {
45
+ ...rest,
46
+ 'aria-label': label,
47
+ disabled,
48
+ label,
23
49
  type: buttonLinkType,
24
- disabled: disabled,
25
50
  onClick: handleOnClick,
26
- "data-name": dataName,
51
+ 'data-name': dataName,
27
52
  className: styleButton,
28
53
  customStyle: {
29
54
  ...customStyle
30
- },
31
- icon: icon
32
- }) : /*#__PURE__*/React.createElement("button", {
33
- type: "button",
34
- "aria-label": label,
35
- title: label,
36
- "data-name": dataName,
37
- className: styleButton,
38
- onClick: handleOnClick,
39
- disabled: disabled
40
- }, /*#__PURE__*/React.createElement("div", {
41
- className: style.buttonContent
42
- }, /*#__PURE__*/React.createElement("span", {
43
- className: style.label
44
- }, label)));
55
+ }
56
+ };
57
+ const iconProps = buildCustomIconByTheme(icon);
58
+ return /*#__PURE__*/React.createElement(ButtonLink, _extends({}, buttonLinkProps, {
59
+ icon: iconProps
60
+ }));
45
61
  };
46
62
  Button.propTypes = process.env.NODE_ENV !== "production" ? buttonPropTypes : {};
47
63
  const ButtonMenu = props => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","ButtonLink","style","propTypes","buttonPropTypes","Button","props","dataName","disabled","label","onClick","type","buttonLinkType","icon","customStyle","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","createElement","className","title","buttonContent","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","_extends","key","buttonList","convert","cap","buttonMenuContainer"],"sources":["../../../src/atom/button-menu/index.tsx"],"sourcesContent":["import React, {useMemo, useCallback} from 'react';\nimport map from 'lodash/fp/map';\nimport classnames from 'classnames';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\n\nconst Button = (props: ButtonProps) => {\n const {\n 'data-name': dataName,\n disabled,\n label,\n onClick,\n type = 'default',\n buttonLinkType,\n icon,\n customStyle = {}\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 return icon ? (\n <ButtonLink\n label={label}\n type={buttonLinkType}\n disabled={disabled}\n onClick={handleOnClick}\n data-name={dataName}\n className={styleButton}\n customStyle={{...customStyle}}\n icon={icon}\n />\n ) : (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n disabled={disabled}\n >\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n </button>\n );\n};\n\nButton.propTypes = buttonPropTypes;\n\nconst ButtonMenu = (props: ButtonMenuProps) => {\n const {buttons, 'data-name': dataName} = 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;AACnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,IAAiCC,eAAe,QAAO,SAAS;AAEhF,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EACrC,MAAM;IACJ,WAAW,EAAEC,QAAQ;IACrBC,QAAQ;IACRC,KAAK;IACLC,OAAO;IACPC,IAAI,GAAG,SAAS;IAChBC,cAAc;IACdC,IAAI;IACJC,WAAW,GAAG,CAAC;EACjB,CAAC,GAAGR,KAAK;EACT,MAAMS,WAAW,GAAGf,UAAU,CAC5BE,KAAK,CAACc,MAAM,EACZL,IAAI,KAAK,SAAS,IAAIT,KAAK,CAACe,YAAY,EACxCN,IAAI,KAAK,aAAa,IAAIT,KAAK,CAACgB,WAAW,EAC3CP,IAAI,KAAK,WAAW,IAAIT,KAAK,CAACiB,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MAAEkB,GAAG,EAAElB,MAAM,CAACP,KAAK,GAAGuB;IAAM,EAAE,CAAC;EAC1D,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,UAAU,GAAGtC,OAAO;EACxB;EACA,MAAME,GAAG,CAACqC,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACN,WAAW,EAAED,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEC,WAAW,CACvB,CAAC;EAED,oBACEnC,KAAA,CAAA0B,aAAA;IAAK,aAAWf,QAAS;IAACgB,SAAS,EAAErB,KAAK,CAACoC;EAAoB,GAC5DH,UACE,CAAC;AAEV,CAAC;AAEDN,UAAU,CAAC1B,SAAS,GAAAuB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGzB,SAAS;AAEhC,eAAe0B,UAAU","ignoreList":[]}
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,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 @@
33
33
  pointer-events: none;
34
34
  }
35
35
 
36
- .buttonContent {
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
- }
41
-
42
- .label {
43
- margin: 0 8px 0 8px;
44
- display: block;
45
- }
46
36
 
47
37
  .defaultStyle {
48
38
  background-color: transparent;
@@ -8,6 +8,7 @@ export declare const buttonPropTypes: {
8
8
  type: PropTypes.Requireable<string>;
9
9
  buttonLinkType: PropTypes.Requireable<string>;
10
10
  icon: PropTypes.Requireable<PropTypes.InferProps<{
11
+ theme: PropTypes.Requireable<string>;
11
12
  position: PropTypes.Requireable<string>;
12
13
  type: PropTypes.Requireable<string>;
13
14
  faIcon: PropTypes.Requireable<PropTypes.InferProps<{
@@ -33,6 +34,7 @@ declare const propTypes: {
33
34
  type: PropTypes.Requireable<string>;
34
35
  buttonLinkType: PropTypes.Requireable<string>;
35
36
  icon: PropTypes.Requireable<PropTypes.InferProps<{
37
+ theme: PropTypes.Requireable<string>;
36
38
  position: PropTypes.Requireable<string>;
37
39
  type: PropTypes.Requireable<string>;
38
40
  faIcon: PropTypes.Requireable<PropTypes.InferProps<{
@@ -53,15 +55,13 @@ declare const propTypes: {
53
55
  'aria-label': PropTypes.Requireable<string>;
54
56
  };
55
57
  export default propTypes;
56
- export declare type ButtonProps = {
57
- 'data-name'?: string;
58
- disabled?: boolean;
59
- label: string;
60
- onClick: () => void;
58
+ export declare type Theme = 'archived' | 'published' | 'deleted';
59
+ export declare type ButtonProps = Omit<ButtonLinkProps, 'type' | 'icon'> & {
61
60
  type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
62
61
  buttonLinkType?: ButtonLinkProps['type'];
63
- icon?: IconType;
64
- customStyle?: Record<string, string | number>;
62
+ icon?: IconType & {
63
+ theme?: Theme;
64
+ };
65
65
  };
66
66
  export declare type ButtonMenuProps = {
67
67
  buttons: ButtonProps[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/types.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Ae,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"}
@@ -7,7 +7,10 @@ export const buttonPropTypes = {
7
7
  onClick: PropTypes.func.isRequired,
8
8
  type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),
9
9
  buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
10
- icon: PropTypes.shape(iconPropTypes),
10
+ icon: PropTypes.shape({
11
+ ...iconPropTypes,
12
+ theme: PropTypes.oneOf(['archived', 'published', 'deleted'])
13
+ }),
11
14
  customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
12
15
  };
13
16
  const propTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["PropTypes","iconPropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","buttonLinkType","icon","shape","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(iconPropTypes),\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 ButtonProps = {\n 'data-name'?: string;\n disabled?: boolean;\n label: string;\n onClick: () => void;\n type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';\n buttonLinkType?: ButtonLinkProps['type'];\n icon?: IconType;\n customStyle?: Record<string, string | number>;\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,CAACb,aAAa,CAAC;EACpCc,WAAW,EAAEf,SAAS,CAACgB,QAAQ,CAAChB,SAAS,CAACiB,SAAS,CAAC,CAACjB,SAAS,CAACG,MAAM,EAAEH,SAAS,CAACkB,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEpB,SAAS,CAACqB,OAAO,CAACrB,SAAS,CAACc,KAAK,CAACZ,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEP,SAAS,CAACG,MAAM;EAC7B,YAAY,EAAEH,SAAS,CAACG;AAC1B,CAAC;AAED,eAAegB,SAAS","ignoreList":[]}
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":[]}
@@ -3,6 +3,7 @@ import { BulletPointMenuButtonProps } from './types';
3
3
  declare const BulletPointMenuButton: {
4
4
  (props: BulletPointMenuButtonProps): JSX.Element;
5
5
  propTypes: {
6
+ 'data-name': import("prop-types").Requireable<string>;
6
7
  disabled: import("prop-types").Requireable<boolean>;
7
8
  buttonAriaLabel: import("prop-types").Requireable<string>;
8
9
  menuAriaLabel: import("prop-types").Requireable<string>;
@@ -14,6 +15,7 @@ declare const BulletPointMenuButton: {
14
15
  type: import("prop-types").Requireable<string>;
15
16
  buttonLinkType: import("prop-types").Requireable<string>;
16
17
  icon: import("prop-types").Requireable<import("prop-types").InferProps<{
18
+ theme: import("prop-types").Requireable<string>;
17
19
  position: import("prop-types").Requireable<string>;
18
20
  type: import("prop-types").Requireable<string>;
19
21
  faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,0BAA0B,EAAC,MAAM,SAAS,CAAC;AAG9D,QAAA,MAAM,qBAAqB;YAAW,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D/D,CAAC;AAIF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,0BAA0B,EAAC,MAAM,SAAS,CAAC;AAG9D,QAAA,MAAM,qBAAqB;YAAW,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D/D,CAAC;AAIF,eAAe,qBAAqB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import _noop from "lodash/fp/noop";
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, { useCallback, useState, useEffect } from 'react';
3
4
  import classnames from 'classnames';
4
5
  import ButtonLinkIcon from '../../atom/button-link-icon';
@@ -13,7 +14,8 @@ const BulletPointMenuButton = props => {
13
14
  onClick = _noop,
14
15
  buttons,
15
16
  menuButtonClassName,
16
- isBulkMenu
17
+ isBulkMenu,
18
+ 'data-name': dataName
17
19
  } = props;
18
20
  const [visible, setVisible] = useState(false);
19
21
  const handleOnClick = useCallback(() => {
@@ -31,8 +33,9 @@ const BulletPointMenuButton = props => {
31
33
  'data-name': 'button-menu',
32
34
  buttons
33
35
  };
36
+ const menuStyle = classnames(style.bulletPointMenu, isBulkMenu && style.bulkBulletPointMenu, visible && style.visible);
34
37
  const menu = /*#__PURE__*/React.createElement("div", {
35
- className: classnames(style.bulletPointMenu, isBulkMenu && style.bulkBulletPointMenu, visible && style.visible),
38
+ className: menuStyle,
36
39
  "data-name": "menu-wrapper",
37
40
  "aria-label": menuAriaLabel
38
41
  }, /*#__PURE__*/React.createElement(ButtonMenu, menuProps));
@@ -48,7 +51,9 @@ const BulletPointMenuButton = props => {
48
51
  return /*#__PURE__*/React.createElement("div", {
49
52
  className: style.bulletPointWrapper,
50
53
  "data-name": "bullet-point-wrapper"
51
- }, /*#__PURE__*/React.createElement(ButtonLinkIcon, bulletPointButtonProps), menu);
54
+ }, /*#__PURE__*/React.createElement(ButtonLinkIcon, _extends({}, bulletPointButtonProps, {
55
+ "data-name": dataName
56
+ })), menu);
52
57
  };
53
58
  BulletPointMenuButton.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
54
59
  export default BulletPointMenuButton;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","classnames","ButtonLinkIcon","ButtonMenu","propTypes","style","BulletPointMenuButton","props","disabled","buttonAriaLabel","menuAriaLabel","onClick","_noop","buttons","menuButtonClassName","isBulkMenu","visible","setVisible","handleOnClick","handleMouseDown","document","addEventListener","removeEventListener","menuProps","menu","createElement","className","bulletPointMenu","bulkBulletPointMenu","bulletPointButtonProps","size","icon","bulletPointWrapper","process","env","NODE_ENV"],"sources":["../../../src/molecule/bullet-point-menu-button/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useEffect} from 'react';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport ButtonMenu from '../../atom/button-menu';\nimport propTypes, {BulletPointMenuButtonProps} from './types';\nimport style from './style.css';\n\nconst BulletPointMenuButton = (props: BulletPointMenuButtonProps) => {\n const {\n disabled = false,\n buttonAriaLabel,\n menuAriaLabel,\n onClick = noop,\n buttons,\n menuButtonClassName,\n isBulkMenu\n } = props;\n const [visible, setVisible] = useState(false);\n\n const handleOnClick = useCallback(() => {\n onClick();\n setVisible(true);\n }, [onClick]);\n\n useEffect(() => {\n const handleMouseDown = () => setVisible(false);\n document.addEventListener('mousedown', handleMouseDown);\n return () => {\n document.removeEventListener('mousedown', handleMouseDown);\n };\n }, []);\n\n const menuProps = {\n 'data-name': 'button-menu',\n buttons\n };\n\n const menu = (\n <div\n className={classnames(\n style.bulletPointMenu,\n isBulkMenu && style.bulkBulletPointMenu,\n visible && style.visible\n )}\n data-name=\"menu-wrapper\"\n aria-label={menuAriaLabel}\n >\n <ButtonMenu {...menuProps} />\n </div>\n );\n const bulletPointButtonProps = {\n size: 'default',\n 'aria-label': buttonAriaLabel,\n 'data-name': 'bullet-point-button',\n icon: 'bullet-point',\n onClick: handleOnClick,\n disabled,\n className: menuButtonClassName\n };\n\n return (\n <div className={style.bulletPointWrapper} data-name=\"bullet-point-wrapper\">\n <ButtonLinkIcon {...bulletPointButtonProps} />\n {menu}\n </div>\n );\n};\n\nBulletPointMenuButton.propTypes = propTypes;\n\nexport default BulletPointMenuButton;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,SAAS,QAAO,OAAO;AAC7D,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,SAAS,MAAoC,SAAS;AAC7D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,qBAAqB,GAAIC,KAAiC,IAAK;EACnE,MAAM;IACJC,QAAQ,GAAG,KAAK;IAChBC,eAAe;IACfC,aAAa;IACbC,OAAO,GAAAC,KAAO;IACdC,OAAO;IACPC,mBAAmB;IACnBC;EACF,CAAC,GAAGR,KAAK;EACT,MAAM,CAACS,OAAO,EAAEC,UAAU,CAAC,GAAGlB,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAMmB,aAAa,GAAGpB,WAAW,CAAC,MAAM;IACtCa,OAAO,CAAC,CAAC;IACTM,UAAU,CAAC,IAAI,CAAC;EAClB,CAAC,EAAE,CAACN,OAAO,CAAC,CAAC;EAEbX,SAAS,CAAC,MAAM;IACd,MAAMmB,eAAe,GAAGA,CAAA,KAAMF,UAAU,CAAC,KAAK,CAAC;IAC/CG,QAAQ,CAACC,gBAAgB,CAAC,WAAW,EAAEF,eAAe,CAAC;IACvD,OAAO,MAAM;MACXC,QAAQ,CAACE,mBAAmB,CAAC,WAAW,EAAEH,eAAe,CAAC;IAC5D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMI,SAAS,GAAG;IAChB,WAAW,EAAE,aAAa;IAC1BV;EACF,CAAC;EAED,MAAMW,IAAI,gBACR3B,KAAA,CAAA4B,aAAA;IACEC,SAAS,EAAEzB,UAAU,CACnBI,KAAK,CAACsB,eAAe,EACrBZ,UAAU,IAAIV,KAAK,CAACuB,mBAAmB,EACvCZ,OAAO,IAAIX,KAAK,CAACW,OACnB,CAAE;IACF,aAAU,cAAc;IACxB,cAAYN;EAAc,gBAE1Bb,KAAA,CAAA4B,aAAA,CAACtB,UAAU,EAAKoB,SAAY,CACzB,CACN;EACD,MAAMM,sBAAsB,GAAG;IAC7BC,IAAI,EAAE,SAAS;IACf,YAAY,EAAErB,eAAe;IAC7B,WAAW,EAAE,qBAAqB;IAClCsB,IAAI,EAAE,cAAc;IACpBpB,OAAO,EAAEO,aAAa;IACtBV,QAAQ;IACRkB,SAAS,EAAEZ;EACb,CAAC;EAED,oBACEjB,KAAA,CAAA4B,aAAA;IAAKC,SAAS,EAAErB,KAAK,CAAC2B,kBAAmB;IAAC,aAAU;EAAsB,gBACxEnC,KAAA,CAAA4B,aAAA,CAACvB,cAAc,EAAK2B,sBAAyB,CAAC,EAC7CL,IACE,CAAC;AAEV,CAAC;AAEDlB,qBAAqB,CAACF,SAAS,GAAA6B,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG/B,SAAS;AAE3C,eAAeE,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useState","useEffect","classnames","ButtonLinkIcon","ButtonMenu","propTypes","style","BulletPointMenuButton","props","disabled","buttonAriaLabel","menuAriaLabel","onClick","_noop","buttons","menuButtonClassName","isBulkMenu","dataName","visible","setVisible","handleOnClick","handleMouseDown","document","addEventListener","removeEventListener","menuProps","menuStyle","bulletPointMenu","bulkBulletPointMenu","menu","createElement","className","bulletPointButtonProps","size","icon","bulletPointWrapper","_extends","process","env","NODE_ENV"],"sources":["../../../src/molecule/bullet-point-menu-button/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useEffect} from 'react';\nimport classnames from 'classnames';\nimport {noop} from 'lodash/fp';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport ButtonMenu from '../../atom/button-menu';\nimport propTypes, {BulletPointMenuButtonProps} from './types';\nimport style from './style.css';\n\nconst BulletPointMenuButton = (props: BulletPointMenuButtonProps) => {\n const {\n disabled = false,\n buttonAriaLabel,\n menuAriaLabel,\n onClick = noop,\n buttons,\n menuButtonClassName,\n isBulkMenu,\n 'data-name': dataName\n } = props;\n const [visible, setVisible] = useState(false);\n\n const handleOnClick = useCallback(() => {\n onClick();\n setVisible(true);\n }, [onClick]);\n\n useEffect(() => {\n const handleMouseDown = () => setVisible(false);\n document.addEventListener('mousedown', handleMouseDown);\n return () => {\n document.removeEventListener('mousedown', handleMouseDown);\n };\n }, []);\n\n const menuProps = {\n 'data-name': 'button-menu',\n buttons\n };\n\n const menuStyle = classnames(\n style.bulletPointMenu,\n isBulkMenu && style.bulkBulletPointMenu,\n visible && style.visible\n );\n\n const menu = (\n <div className={menuStyle} data-name=\"menu-wrapper\" aria-label={menuAriaLabel}>\n <ButtonMenu {...menuProps} />\n </div>\n );\n\n const bulletPointButtonProps = {\n size: 'default',\n 'aria-label': buttonAriaLabel,\n 'data-name': 'bullet-point-button',\n icon: 'bullet-point',\n onClick: handleOnClick,\n disabled,\n className: menuButtonClassName\n };\n\n return (\n <div className={style.bulletPointWrapper} data-name=\"bullet-point-wrapper\">\n <ButtonLinkIcon {...bulletPointButtonProps} data-name={dataName} />\n {menu}\n </div>\n );\n};\n\nBulletPointMenuButton.propTypes = propTypes;\n\nexport default BulletPointMenu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AAS,EAAEL,SAAU;IAAC,aAAU,cAAc;IAAC,cAAYf;EAAc,gBAC5Eb,KAAA,CAAAgC,aAAA,CAAC1B,UAAU,EAAKqB,SAAY,CACzB,CACN;EAED,MAAMO,sBAAsB,GAAG;IAC7BC,IAAI,EAAE,SAAS;IACf,YAAY,EAAEvB,eAAe;IAC7B,WAAW,EAAE,qBAAqB;IAClCwB,IAAI,EAAE,cAAc;IACpBtB,OAAO,EAAEQ,aAAa;IACtBX,QAAQ;IACRsB,SAAS,EAAEhB;EACb,CAAC;EAED,oBACEjB,KAAA,CAAAgC,aAAA;IAAKC,SAAS,EAAEzB,KAAK,CAAC6B,kBAAmB;IAAC,aAAU;EAAsB,gBACxErC,KAAA,CAAAgC,aAAA,CAAC3B,cAAc,EAAAiC,QAAA,KAAKJ,sBAAsB;IAAE,aAAWf;EAAS,EAAE,CAAC,EAClEY,IACE,CAAC;AAEV,CAAC;AAEDtB,qBAAqB,CAACF,SAAS,GAAAgC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGlC,SAAS;AAE3C,eAAeE,qBAAqB","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import { ButtonProps } from '../../atom/button-menu/types';
3
3
  declare const propTypes: {
4
+ 'data-name': PropTypes.Requireable<string>;
4
5
  disabled: PropTypes.Requireable<boolean>;
5
6
  buttonAriaLabel: PropTypes.Requireable<string>;
6
7
  menuAriaLabel: PropTypes.Requireable<string>;
@@ -12,6 +13,7 @@ declare const propTypes: {
12
13
  type: PropTypes.Requireable<string>;
13
14
  buttonLinkType: PropTypes.Requireable<string>;
14
15
  icon: PropTypes.Requireable<PropTypes.InferProps<{
16
+ theme: PropTypes.Requireable<string>;
15
17
  position: PropTypes.Requireable<string>;
16
18
  type: PropTypes.Requireable<string>;
17
19
  faIcon: PropTypes.Requireable<PropTypes.InferProps<{
@@ -34,6 +36,7 @@ declare const propTypes: {
34
36
  };
35
37
  export default propTypes;
36
38
  export declare type BulletPointMenuButtonProps = {
39
+ 'data-name': string;
37
40
  disabled?: boolean;
38
41
  buttonAriaLabel?: string;
39
42
  menuAriaLabel?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,0BAA0B,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,oBAAY,iCAAiC,GAAG;IAAC,KAAK,EAAE,0BAA0B,CAAA;CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/bullet-point-menu-button/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,0BAA0B,GAAG;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,oBAAY,iCAAiC,GAAG;IAAC,KAAK,EAAE,0BAA0B,CAAA;CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import ButtonMenu from '../../atom/button-menu';
3
3
  const propTypes = {
4
+ 'data-name': PropTypes.string,
4
5
  disabled: PropTypes.bool,
5
6
  buttonAriaLabel: PropTypes.string,
6
7
  menuAriaLabel: PropTypes.string,
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["PropTypes","ButtonMenu","propTypes","disabled","bool","buttonAriaLabel","string","menuAriaLabel","buttons","onClick","func","menuButtonClassName","isBulkMenu"],"sources":["../../../src/molecule/bullet-point-menu-button/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ButtonMenu from '../../atom/button-menu';\nimport {ButtonProps} from '../../atom/button-menu/types';\n\nconst propTypes = {\n disabled: PropTypes.bool,\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: ButtonMenu.propTypes.buttons,\n onClick: PropTypes.func,\n menuButtonClassName: PropTypes.string,\n isBulkMenu: PropTypes.bool\n};\n\nexport default propTypes;\n\nexport type BulletPointMenuButtonProps = {\n disabled?: boolean;\n buttonAriaLabel?: string;\n menuAriaLabel?: string;\n buttons: ButtonProps[];\n onClick: () => void;\n menuButtonClassName?: string;\n isBulkMenu?: boolean;\n};\n\nexport type BulletPointMenuButtonPropsFixture = {props: BulletPointMenuButtonProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAG/C,MAAMC,SAAS,GAAG;EAChBC,QAAQ,EAAEH,SAAS,CAACI,IAAI;EACxBC,eAAe,EAAEL,SAAS,CAACM,MAAM;EACjCC,aAAa,EAAEP,SAAS,CAACM,MAAM;EAC/BE,OAAO,EAAEP,UAAU,CAACC,SAAS,CAACM,OAAO;EACrCC,OAAO,EAAET,SAAS,CAACU,IAAI;EACvBC,mBAAmB,EAAEX,SAAS,CAACM,MAAM;EACrCM,UAAU,EAAEZ,SAAS,CAACI;AACxB,CAAC;AAED,eAAeF,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["PropTypes","ButtonMenu","propTypes","string","disabled","bool","buttonAriaLabel","menuAriaLabel","buttons","onClick","func","menuButtonClassName","isBulkMenu"],"sources":["../../../src/molecule/bullet-point-menu-button/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ButtonMenu from '../../atom/button-menu';\nimport {ButtonProps} from '../../atom/button-menu/types';\n\nconst propTypes = {\n 'data-name': PropTypes.string,\n disabled: PropTypes.bool,\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: ButtonMenu.propTypes.buttons,\n onClick: PropTypes.func,\n menuButtonClassName: PropTypes.string,\n isBulkMenu: PropTypes.bool\n};\n\nexport default propTypes;\n\nexport type BulletPointMenuButtonProps = {\n 'data-name': string;\n disabled?: boolean;\n buttonAriaLabel?: string;\n menuAriaLabel?: string;\n buttons: ButtonProps[];\n onClick: () => void;\n menuButtonClassName?: string;\n isBulkMenu?: boolean;\n};\n\nexport type BulletPointMenuButtonPropsFixture = {props: BulletPointMenuButtonProps};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAG/C,MAAMC,SAAS,GAAG;EAChB,WAAW,EAAEF,SAAS,CAACG,MAAM;EAC7BC,QAAQ,EAAEJ,SAAS,CAACK,IAAI;EACxBC,eAAe,EAAEN,SAAS,CAACG,MAAM;EACjCI,aAAa,EAAEP,SAAS,CAACG,MAAM;EAC/BK,OAAO,EAAEP,UAAU,CAACC,SAAS,CAACM,OAAO;EACrCC,OAAO,EAAET,SAAS,CAACU,IAAI;EACvBC,mBAAmB,EAAEX,SAAS,CAACG,MAAM;EACrCS,UAAU,EAAEZ,SAAS,CAACK;AACxB,CAAC;AAED,eAAeH,SAAS","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AA4CA,kDA+RC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AA4CA,kDAqRC"}
@@ -228,33 +228,20 @@ const CMPopin = props => {
228
228
  className: style.buttonContainer
229
229
  }, firstButton ? /*#__PURE__*/React.createElement("div", {
230
230
  className: firstButton.largeButton ? style.largeButton : style.button
231
- }, /*#__PURE__*/React.createElement(ButtonLink, {
232
- label: firstButton.label,
231
+ }, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, firstButton, {
233
232
  onClick: firstButton.handleOnclick,
234
- "data-name": 'cm-popin-cta',
235
- "aria-label": firstButton['aria-label'],
236
- type: firstButton.type,
237
- customStyle: firstButton.customStyle
238
- })) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
233
+ "data-name": 'cm-popin-cta'
234
+ }))) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
239
235
  className: secondButton.largeButton ? style.largeButton : style.button
240
- }, /*#__PURE__*/React.createElement(ButtonLink, {
241
- label: secondButton.label,
236
+ }, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, secondButton, {
242
237
  onClick: secondButton.handleOnclick,
243
- "data-name": `cm-popin-cta-${secondButton.type}`,
244
- "aria-label": secondButton['aria-label'],
245
- type: secondButton.type,
246
- customStyle: secondButton.customStyle,
247
- icon: secondButton.icon
248
- })) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
238
+ "data-name": `cm-popin-cta-${secondButton.type}`
239
+ }))) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
249
240
  className: thirdButton.largeButton ? style.largeButton : style.button
250
- }, /*#__PURE__*/React.createElement(ButtonLink, {
251
- label: thirdButton.label,
241
+ }, /*#__PURE__*/React.createElement(ButtonLink, _extends({}, thirdButton, {
252
242
  onClick: thirdButton.handleOnclick,
253
- "data-name": `cm-popin-cta-${thirdButton.type}`,
254
- "aria-label": thirdButton['aria-label'],
255
- type: thirdButton.type,
256
- customStyle: thirdButton.customStyle
257
- })) : null);
243
+ "data-name": `cm-popin-cta-${thirdButton.type}`
244
+ }))) : null);
258
245
  };
259
246
  return /*#__PURE__*/React.createElement("div", {
260
247
  className: mode !== 'cookie' ? style.background : null,