@coorpacademy/components 11.33.7 → 11.33.8

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 (226) hide show
  1. package/es/atom/button-link/index.d.ts +13 -2
  2. package/es/atom/button-link/index.d.ts.map +1 -1
  3. package/es/atom/button-link/index.js +2 -2
  4. package/es/atom/button-link/index.js.map +1 -1
  5. package/es/atom/button-link/style.css +2 -2
  6. package/es/atom/button-link/types.d.ts +28 -4
  7. package/es/atom/button-link/types.d.ts.map +1 -1
  8. package/es/atom/button-link/types.js +14 -5
  9. package/es/atom/button-link/types.js.map +1 -1
  10. package/es/atom/button-link-icon/style.css +2 -2
  11. package/es/atom/button-menu/index.d.ts +18 -0
  12. package/es/atom/button-menu/index.d.ts.map +1 -1
  13. package/es/atom/button-menu/index.js +19 -3
  14. package/es/atom/button-menu/index.js.map +1 -1
  15. package/es/atom/button-menu/style.css +19 -6
  16. package/es/atom/button-menu/types.d.ts +39 -0
  17. package/es/atom/button-menu/types.d.ts.map +1 -1
  18. package/es/atom/button-menu/types.js +7 -2
  19. package/es/atom/button-menu/types.js.map +1 -1
  20. package/es/atom/radio-with-title/index.d.ts +37 -0
  21. package/es/atom/radio-with-title/index.d.ts.map +1 -1
  22. package/es/atom/radio-with-title/types.d.ts +37 -0
  23. package/es/atom/radio-with-title/types.d.ts.map +1 -1
  24. package/es/atom/tag/style.css +10 -6
  25. package/es/atom/title/index.d.ts +37 -0
  26. package/es/atom/title/index.d.ts.map +1 -1
  27. package/es/atom/title/index.js +10 -4
  28. package/es/atom/title/index.js.map +1 -1
  29. package/es/atom/title/style.css +9 -1
  30. package/es/molecule/bullet-point-menu-button/index.d.ts +17 -0
  31. package/es/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
  32. package/es/molecule/bullet-point-menu-button/style.css +20 -16
  33. package/es/molecule/bullet-point-menu-button/types.d.ts +17 -0
  34. package/es/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
  35. package/es/molecule/cm-popin/types.d.ts +120 -8
  36. package/es/molecule/cm-popin/types.d.ts.map +1 -1
  37. package/es/molecule/draggable-list/index.d.ts +4 -1
  38. package/es/molecule/expandible-actionable-table/index.d.ts +47 -2
  39. package/es/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  40. package/es/molecule/expandible-actionable-table/types.d.ts +47 -2
  41. package/es/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  42. package/es/molecule/filters/index.js +2 -2
  43. package/es/molecule/filters/index.js.map +1 -1
  44. package/es/molecule/filters/style.css +7 -7
  45. package/es/molecule/title-and-checkbox-wrapper/index.d.ts +37 -0
  46. package/es/molecule/title-radio-wrapper/index.d.ts +37 -0
  47. package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  48. package/es/molecule/title-radio-wrapper/types.d.ts +37 -0
  49. package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  50. package/es/organism/brand-learning-priorities/index.d.ts +4 -1
  51. package/es/organism/header-with-actions/index.d.ts +95 -0
  52. package/es/organism/header-with-actions/index.d.ts.map +1 -0
  53. package/es/organism/header-with-actions/index.js +48 -0
  54. package/es/organism/header-with-actions/index.js.map +1 -0
  55. package/es/organism/header-with-actions/style.css +55 -0
  56. package/es/organism/header-with-actions/types.d.ts +120 -0
  57. package/es/organism/header-with-actions/types.d.ts.map +1 -0
  58. package/es/organism/header-with-actions/types.js +27 -0
  59. package/es/organism/header-with-actions/types.js.map +1 -0
  60. package/es/organism/list-item/index.d.ts +4 -1
  61. package/es/organism/list-item/index.js +7 -4
  62. package/es/organism/list-item/index.js.map +1 -1
  63. package/es/organism/list-item/style.css +4 -6
  64. package/es/organism/list-items/index.d.ts +76 -6
  65. package/es/organism/list-items/index.d.ts.map +1 -1
  66. package/es/organism/list-items/index.js +12 -6
  67. package/es/organism/list-items/index.js.map +1 -1
  68. package/es/organism/list-items/style.css +8 -2
  69. package/es/organism/rewards-form/index.d.ts +37 -0
  70. package/es/organism/select-opponents/index.d.ts +37 -0
  71. package/es/organism/select-opponents/index.d.ts.map +1 -1
  72. package/es/organism/select-opponents/types.d.ts +37 -0
  73. package/es/organism/select-opponents/types.d.ts.map +1 -1
  74. package/es/organism/setup-header/index.d.ts +52 -8
  75. package/es/organism/title-and-input/index.d.ts +74 -0
  76. package/es/organism/title-and-input/index.d.ts.map +1 -1
  77. package/es/organism/title-and-input/types.d.ts +74 -0
  78. package/es/organism/title-and-input/types.d.ts.map +1 -1
  79. package/es/organism/wizard-contents/index.d.ts +110 -6
  80. package/es/template/app-player/loading/index.d.ts +120 -8
  81. package/es/template/app-player/player/index.d.ts +240 -16
  82. package/es/template/app-player/player/slides/index.d.ts +120 -8
  83. package/es/template/app-player/player/slides/index.d.ts.map +1 -1
  84. package/es/template/app-player/popin-correction/index.d.ts +120 -8
  85. package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
  86. package/es/template/app-player/popin-end/index.d.ts +120 -8
  87. package/es/template/app-review/index.d.ts +120 -8
  88. package/es/template/app-review/index.d.ts.map +1 -1
  89. package/es/template/app-review/player/prop-types.d.ts +120 -8
  90. package/es/template/app-review/player/prop-types.d.ts.map +1 -1
  91. package/es/template/app-review/prop-types.d.ts +120 -8
  92. package/es/template/app-review/prop-types.d.ts.map +1 -1
  93. package/es/template/back-office/brand-create/index.d.ts +52 -8
  94. package/es/template/back-office/brand-create/index.d.ts.map +1 -1
  95. package/es/template/back-office/brand-list/index.d.ts +52 -8
  96. package/es/template/back-office/brand-list/index.d.ts.map +1 -1
  97. package/es/template/back-office/brand-update/index.d.ts +378 -28
  98. package/es/template/back-office/brand-update/index.d.ts.map +1 -1
  99. package/es/template/back-office/brand-update/index.js +13 -3
  100. package/es/template/back-office/brand-update/index.js.map +1 -1
  101. package/es/template/back-office/brand-update/style.css +4 -0
  102. package/es/template/back-office/dashboard-preview/index.d.ts +52 -8
  103. package/es/template/back-office/layout/index.d.ts +52 -8
  104. package/es/template/back-office/layout/index.d.ts.map +1 -1
  105. package/es/template/common/dashboard/index.d.ts +240 -16
  106. package/es/template/common/search-page/index.d.ts +120 -8
  107. package/es/template/external-course/index.d.ts +120 -8
  108. package/es/variables/colors.css +5 -1
  109. package/es/variables/colors.d.ts +1 -0
  110. package/es/variables/colors.d.ts.map +1 -1
  111. package/es/variables/colors.js +1 -0
  112. package/es/variables/colors.js.map +1 -1
  113. package/lib/atom/button-link/index.d.ts +13 -2
  114. package/lib/atom/button-link/index.d.ts.map +1 -1
  115. package/lib/atom/button-link/index.js +2 -2
  116. package/lib/atom/button-link/index.js.map +1 -1
  117. package/lib/atom/button-link/style.css +2 -2
  118. package/lib/atom/button-link/types.d.ts +28 -4
  119. package/lib/atom/button-link/types.d.ts.map +1 -1
  120. package/lib/atom/button-link/types.js +15 -6
  121. package/lib/atom/button-link/types.js.map +1 -1
  122. package/lib/atom/button-link-icon/style.css +2 -2
  123. package/lib/atom/button-menu/index.d.ts +18 -0
  124. package/lib/atom/button-menu/index.d.ts.map +1 -1
  125. package/lib/atom/button-menu/index.js +19 -3
  126. package/lib/atom/button-menu/index.js.map +1 -1
  127. package/lib/atom/button-menu/style.css +19 -6
  128. package/lib/atom/button-menu/types.d.ts +39 -0
  129. package/lib/atom/button-menu/types.d.ts.map +1 -1
  130. package/lib/atom/button-menu/types.js +7 -2
  131. package/lib/atom/button-menu/types.js.map +1 -1
  132. package/lib/atom/radio-with-title/index.d.ts +37 -0
  133. package/lib/atom/radio-with-title/index.d.ts.map +1 -1
  134. package/lib/atom/radio-with-title/types.d.ts +37 -0
  135. package/lib/atom/radio-with-title/types.d.ts.map +1 -1
  136. package/lib/atom/tag/style.css +10 -6
  137. package/lib/atom/title/index.d.ts +37 -0
  138. package/lib/atom/title/index.d.ts.map +1 -1
  139. package/lib/atom/title/index.js +10 -4
  140. package/lib/atom/title/index.js.map +1 -1
  141. package/lib/atom/title/style.css +9 -1
  142. package/lib/molecule/bullet-point-menu-button/index.d.ts +17 -0
  143. package/lib/molecule/bullet-point-menu-button/index.d.ts.map +1 -1
  144. package/lib/molecule/bullet-point-menu-button/style.css +20 -16
  145. package/lib/molecule/bullet-point-menu-button/types.d.ts +17 -0
  146. package/lib/molecule/bullet-point-menu-button/types.d.ts.map +1 -1
  147. package/lib/molecule/cm-popin/types.d.ts +120 -8
  148. package/lib/molecule/cm-popin/types.d.ts.map +1 -1
  149. package/lib/molecule/draggable-list/index.d.ts +4 -1
  150. package/lib/molecule/expandible-actionable-table/index.d.ts +47 -2
  151. package/lib/molecule/expandible-actionable-table/index.d.ts.map +1 -1
  152. package/lib/molecule/expandible-actionable-table/types.d.ts +47 -2
  153. package/lib/molecule/expandible-actionable-table/types.d.ts.map +1 -1
  154. package/lib/molecule/filters/index.js +2 -2
  155. package/lib/molecule/filters/index.js.map +1 -1
  156. package/lib/molecule/filters/style.css +7 -7
  157. package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +37 -0
  158. package/lib/molecule/title-radio-wrapper/index.d.ts +37 -0
  159. package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
  160. package/lib/molecule/title-radio-wrapper/types.d.ts +37 -0
  161. package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
  162. package/lib/organism/brand-learning-priorities/index.d.ts +4 -1
  163. package/lib/organism/header-with-actions/index.d.ts +95 -0
  164. package/lib/organism/header-with-actions/index.d.ts.map +1 -0
  165. package/lib/organism/header-with-actions/index.js +53 -0
  166. package/lib/organism/header-with-actions/index.js.map +1 -0
  167. package/lib/organism/header-with-actions/style.css +55 -0
  168. package/lib/organism/header-with-actions/types.d.ts +120 -0
  169. package/lib/organism/header-with-actions/types.d.ts.map +1 -0
  170. package/lib/organism/header-with-actions/types.js +32 -0
  171. package/lib/organism/header-with-actions/types.js.map +1 -0
  172. package/lib/organism/list-item/index.d.ts +4 -1
  173. package/lib/organism/list-item/index.js +7 -4
  174. package/lib/organism/list-item/index.js.map +1 -1
  175. package/lib/organism/list-item/style.css +4 -6
  176. package/lib/organism/list-items/index.d.ts +76 -6
  177. package/lib/organism/list-items/index.d.ts.map +1 -1
  178. package/lib/organism/list-items/index.js +12 -6
  179. package/lib/organism/list-items/index.js.map +1 -1
  180. package/lib/organism/list-items/style.css +8 -2
  181. package/lib/organism/rewards-form/index.d.ts +37 -0
  182. package/lib/organism/select-opponents/index.d.ts +37 -0
  183. package/lib/organism/select-opponents/index.d.ts.map +1 -1
  184. package/lib/organism/select-opponents/types.d.ts +37 -0
  185. package/lib/organism/select-opponents/types.d.ts.map +1 -1
  186. package/lib/organism/setup-header/index.d.ts +52 -8
  187. package/lib/organism/title-and-input/index.d.ts +74 -0
  188. package/lib/organism/title-and-input/index.d.ts.map +1 -1
  189. package/lib/organism/title-and-input/types.d.ts +74 -0
  190. package/lib/organism/title-and-input/types.d.ts.map +1 -1
  191. package/lib/organism/wizard-contents/index.d.ts +110 -6
  192. package/lib/template/app-player/loading/index.d.ts +120 -8
  193. package/lib/template/app-player/player/index.d.ts +240 -16
  194. package/lib/template/app-player/player/slides/index.d.ts +120 -8
  195. package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
  196. package/lib/template/app-player/popin-correction/index.d.ts +120 -8
  197. package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
  198. package/lib/template/app-player/popin-end/index.d.ts +120 -8
  199. package/lib/template/app-review/index.d.ts +120 -8
  200. package/lib/template/app-review/index.d.ts.map +1 -1
  201. package/lib/template/app-review/player/prop-types.d.ts +120 -8
  202. package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
  203. package/lib/template/app-review/prop-types.d.ts +120 -8
  204. package/lib/template/app-review/prop-types.d.ts.map +1 -1
  205. package/lib/template/back-office/brand-create/index.d.ts +52 -8
  206. package/lib/template/back-office/brand-create/index.d.ts.map +1 -1
  207. package/lib/template/back-office/brand-list/index.d.ts +52 -8
  208. package/lib/template/back-office/brand-list/index.d.ts.map +1 -1
  209. package/lib/template/back-office/brand-update/index.d.ts +378 -28
  210. package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
  211. package/lib/template/back-office/brand-update/index.js +13 -3
  212. package/lib/template/back-office/brand-update/index.js.map +1 -1
  213. package/lib/template/back-office/brand-update/style.css +4 -0
  214. package/lib/template/back-office/dashboard-preview/index.d.ts +52 -8
  215. package/lib/template/back-office/layout/index.d.ts +52 -8
  216. package/lib/template/back-office/layout/index.d.ts.map +1 -1
  217. package/lib/template/common/dashboard/index.d.ts +240 -16
  218. package/lib/template/common/search-page/index.d.ts +120 -8
  219. package/lib/template/external-course/index.d.ts +120 -8
  220. package/lib/variables/colors.css +5 -1
  221. package/lib/variables/colors.d.ts +1 -0
  222. package/lib/variables/colors.d.ts.map +1 -1
  223. package/lib/variables/colors.js +1 -0
  224. package/lib/variables/colors.js.map +1 -1
  225. package/package.json +2 -2
  226. package/LICENSE +0 -201
@@ -13,8 +13,17 @@ declare const ButtonLink: {
13
13
  'data-name': import("prop-types").Requireable<string>;
14
14
  'data-testid': import("prop-types").Requireable<string>;
15
15
  icon: import("prop-types").Requireable<import("prop-types").InferProps<{
16
- position: import("prop-types").Requireable<string>;
16
+ position: import("prop-types").Validator<string>;
17
17
  type: import("prop-types").Requireable<string>;
18
+ faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
19
+ name: import("prop-types").Validator<string>;
20
+ color: import("prop-types").Requireable<string>;
21
+ backgroundColor: import("prop-types").Requireable<string>;
22
+ size: import("prop-types").Requireable<number>;
23
+ customStyle: import("prop-types").Requireable<{
24
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
25
+ }>;
26
+ }>>;
18
27
  }>>;
19
28
  onClick: import("prop-types").Requireable<(...args: any[]) => any>;
20
29
  link: import("prop-types").Requireable<import("prop-types").InferProps<{
@@ -26,7 +35,9 @@ declare const ButtonLink: {
26
35
  hoverColor: import("prop-types").Requireable<string>;
27
36
  disabled: import("prop-types").Requireable<boolean>;
28
37
  className: import("prop-types").Requireable<string>;
29
- customStyle: import("prop-types").Requireable<import("prop-types").InferProps<{}>>;
38
+ customStyle: import("prop-types").Requireable<{
39
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
40
+ }>;
30
41
  };
31
42
  };
32
43
  export default ButtonLink;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAOA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAoD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/index.tsx"],"names":[],"mappings":";AAOA,OAAkB,EAAC,eAAe,EAAW,MAAM,SAAS,CAAC;AAoD7D,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmIzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
@@ -3,7 +3,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  import React, { useCallback, useState, useMemo } from 'react';
4
4
  import classnames from 'classnames';
5
5
  import Link from '../link';
6
- import FaIcon from '../icon';
6
+ import FaIcon, { DEFAULT_ICON_COLOR } from '../icon';
7
7
  import { ICONS } from '../../util/button-icons';
8
8
  import ToolTip from '../tooltip';
9
9
  import propTypes from './types';
@@ -27,7 +27,7 @@ const getButtonContent = (icon, content, hovered, hoverBackgroundColor, hoverCol
27
27
  }
28
28
  const iconComponent = faIcon ? /*#__PURE__*/React.createElement(FaIcon, {
29
29
  iconName: faIcon.name,
30
- iconColor: hovered && hoverColor ? hoverColor : faIcon.color,
30
+ iconColor: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,
31
31
  // eslint-disable-next-line no-nested-ternary
32
32
  backgroundColor: !faIcon?.backgroundColor ? 'transparent' : hovered && hoverBackgroundColor ? hoverBackgroundColor : faIcon.backgroundColor,
33
33
  size: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","createElement","className","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","_extends","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","process","env","NODE_ENV"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\n : {})}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,OAAO,QAAO,OAAO;AAE3D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,SAAS,MAAmC,SAAS;AAC5D,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,gBAAgB,GAAGA,CACvBC,IAAe,EACfC,OAAkC,EAClCC,OAAiB,EACjBC,oBAA6B,EAC7BC,UAAmB,KAChB;EACH,MAAM;I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UAAU,CAAC3B,SAAS,GAAAsE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useState","useMemo","classnames","Link","FaIcon","DEFAULT_ICON_COLOR","ICONS","ToolTip","propTypes","style","getButtonContent","icon","content","hovered","hoverBackgroundColor","hoverColor","type","faIcon","position","Icon","createElement","className","buttonContent","label","iconComponent","iconName","name","iconColor","color","backgroundColor","size","faSize","wrapperSize","customStyle","theme","ButtonLink","props","usage","disabled","dataName","dataTestId","ariaLabel","tooltipText","tooltipPlacement","link","onClick","_noop","onKeyDown","useTitle","styleButton","button","iconButton","primary","secondary","tertiary","text","dangerous","setHovered","handleOnClick","event","handleOnKeyDown","handleMouseOver","handleMouseLeave","TooltipContent","tooltipContentWrapper","renderToolTip","closeToolTipInformationTextAriaLabel","fontSize","anchorId","toolTipIsVisible","placement","_customStyle","_extends","title","onMouseEnter","onMouseLeave","onMouseOver","tabIndex","process","env","NODE_ENV"],"sources":["../../../src/atom/button-link/index.tsx"],"sourcesContent":["import React, {useCallback, useState, useMemo} from 'react';\nimport {noop} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport FaIcon, {DEFAULT_ICON_COLOR} from '../icon';\nimport {ICONS} from '../../util/button-icons';\nimport ToolTip from '../tooltip';\nimport propTypes, {ButtonLinkProps, IconType} from './types';\nimport style from './style.css';\n\nconst getButtonContent = (\n icon?: IconType,\n content?: string | React.ReactNode,\n hovered?: boolean,\n hoverBackgroundColor?: string,\n hoverColor?: string\n) => {\n const {type, faIcon, position} = icon || {type: '', position: ''};\n const Icon = type && ICONS[type];\n\n if (!Icon && !faIcon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{content}</span>\n </div>\n );\n }\n\n const iconComponent = faIcon ? (\n <FaIcon\n {...{\n iconName: faIcon.name,\n iconColor: hovered && hoverColor ? hoverColor : faIcon.color ?? DEFAULT_ICON_COLOR,\n // eslint-disable-next-line no-nested-ternary\n backgroundColor: !faIcon?.backgroundColor\n ? 'transparent'\n : hovered && hoverBackgroundColor\n ? hoverBackgroundColor\n : faIcon.backgroundColor,\n size: {\n faSize: faIcon.size,\n wrapperSize: faIcon.size\n },\n customStyle: faIcon.customStyle\n }}\n />\n ) : (\n <Icon className={style.icon} theme=\"coorpmanager\" />\n );\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? iconComponent : null}\n {content ? <span className={style.label}>{content}</span> : null}\n {position === 'right' ? iconComponent : null}\n </div>\n );\n};\n\nconst ButtonLink = (props: ButtonLinkProps) => {\n const {\n type,\n usage = 'button',\n label,\n content,\n hoverBackgroundColor,\n hoverColor,\n disabled = false,\n icon,\n 'data-name': dataName,\n 'data-testid': dataTestId = 'button-link',\n 'aria-label': ariaLabel,\n tooltipText,\n tooltipPlacement = 'left',\n link,\n onClick = noop,\n onKeyDown = noop,\n className,\n customStyle,\n useTitle = true\n } = props;\n const styleButton = classnames(\n className,\n style.button,\n !label && style.iconButton,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n const [hovered, setHovered] = useState(false);\n\n const handleOnClick = useCallback(event => onClick(event), [onClick]);\n\n const handleOnKeyDown = useCallback(event => onKeyDown(event), [onKeyDown]);\n\n const handleMouseOver = useCallback(() => {\n setHovered(true);\n }, [setHovered]);\n\n const handleMouseLeave = useCallback(() => setHovered(false), [setHovered]);\n\n const TooltipContent = useCallback(\n () => <span className={style.tooltipContentWrapper}>{tooltipText || ariaLabel}</span>,\n [tooltipText, ariaLabel]\n );\n\n const renderToolTip = () => {\n const closeToolTipInformationTextAriaLabel = tooltipText || ariaLabel;\n if (!closeToolTipInformationTextAriaLabel) return null;\n return (\n <ToolTip\n fontSize={12}\n anchorId=\"button-icon\"\n toolTipIsVisible={hovered}\n placement={tooltipPlacement}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n />\n );\n };\n\n const _customStyle = useMemo(() => {\n return {\n ...customStyle,\n ...((hoverBackgroundColor || hoverColor) && hovered\n ? {\n backgroundColor: hoverBackgroundColor,\n color: hoverColor\n }\n : null)\n };\n }, [hoverBackgroundColor, hoverColor, hovered, customStyle]);\n\n if (link) {\n return (\n <Link\n {...link}\n {...(useTitle && {\n title: ariaLabel || label\n })}\n style={customStyle}\n className={styleButton}\n data-name={dataName}\n data-testid={dataTestId}\n aria-label={ariaLabel || label}\n hoverColor={hoverColor}\n hoverBackgroundColor={hoverBackgroundColor}\n onMouseEnter={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </Link>\n );\n }\n\n return (\n <button\n {...(useTitle && {\n title: ariaLabel || label\n })}\n {...(ariaLabel && !label\n ? {\n 'data-for': 'button-icon',\n 'data-tip': hovered\n }\n : {})}\n // eslint-disable-next-line react/button-has-type\n type={usage}\n aria-label={ariaLabel || label}\n data-name={dataName}\n data-testid={dataTestId}\n style={_customStyle}\n className={styleButton}\n onClick={handleOnClick}\n onKeyDown={handleOnKeyDown}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n tabIndex={0}\n disabled={disabled}\n >\n {getButtonContent(icon, content ?? label, hovered, hoverBackgroundColor, hoverColor)}\n {renderToolTip()}\n </button>\n );\n};\n\nButtonLink.propTypes = propTypes;\n\nexport default ButtonLink;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,QAAQ,EAAEC,OAAO,QAAO,OAAO;AAE3D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,IAAGC,kBAAkB,QAAO,SAAS;AAClD,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,OAAOC,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AAEb,gBAAiB;IAC/Be,QAAQ,EAAE,CAAE;IACZvC,QAAQ,EAAEA;EAAS,IAElB5B,gBAAgB,CAACC,IAAI,EAAEC,OAAO,IAAIW,KAAK,EAAEV,OAAO,EAAEC,oBAAoB,EAAEC,UAAU,CAAC,EACnFkD,aAAa,CAAC,CACT,CAAC;AAEb,CAAC;AAED9B,UAAU,CAAC3B,SAAS,GAAAsE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxE,SAAS;AAEhC,eAAe2B,UAAU","ignoreList":[]}
@@ -12,7 +12,7 @@
12
12
  .button {
13
13
  width: 100%;
14
14
  height: 44px;
15
- border-radius: 7px;
15
+ border-radius: 8px;
16
16
  font-family: Gilroy;
17
17
  font-size: 14px;
18
18
  font-weight: bold;
@@ -109,4 +109,4 @@
109
109
  font-size: 12px;
110
110
  font-weight: 500;
111
111
  line-height: 16px;
112
- }
112
+ }
@@ -1,6 +1,19 @@
1
1
  /// <reference types="react" />
2
2
  import PropTypes from 'prop-types';
3
3
  import { ICONS } from '../../util/button-icons';
4
+ export declare const iconPropTypes: {
5
+ position: PropTypes.Validator<string>;
6
+ type: PropTypes.Requireable<string>;
7
+ faIcon: PropTypes.Requireable<PropTypes.InferProps<{
8
+ name: PropTypes.Validator<string>;
9
+ color: PropTypes.Requireable<string>;
10
+ backgroundColor: PropTypes.Requireable<string>;
11
+ size: PropTypes.Requireable<number>;
12
+ customStyle: PropTypes.Requireable<{
13
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
14
+ }>;
15
+ }>>;
16
+ };
4
17
  declare const propTypes: {
5
18
  type: PropTypes.Requireable<string>;
6
19
  usage: PropTypes.Requireable<string>;
@@ -12,8 +25,17 @@ declare const propTypes: {
12
25
  'data-name': PropTypes.Requireable<string>;
13
26
  'data-testid': PropTypes.Requireable<string>;
14
27
  icon: PropTypes.Requireable<PropTypes.InferProps<{
15
- position: PropTypes.Requireable<string>;
28
+ position: PropTypes.Validator<string>;
16
29
  type: PropTypes.Requireable<string>;
30
+ faIcon: PropTypes.Requireable<PropTypes.InferProps<{
31
+ name: PropTypes.Validator<string>;
32
+ color: PropTypes.Requireable<string>;
33
+ backgroundColor: PropTypes.Requireable<string>;
34
+ size: PropTypes.Requireable<number>;
35
+ customStyle: PropTypes.Requireable<{
36
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
37
+ }>;
38
+ }>>;
17
39
  }>>;
18
40
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
19
41
  link: PropTypes.Requireable<PropTypes.InferProps<{
@@ -25,9 +47,11 @@ declare const propTypes: {
25
47
  hoverColor: PropTypes.Requireable<string>;
26
48
  disabled: PropTypes.Requireable<boolean>;
27
49
  className: PropTypes.Requireable<string>;
28
- customStyle: PropTypes.Requireable<PropTypes.InferProps<{}>>;
50
+ customStyle: PropTypes.Requireable<{
51
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
52
+ }>;
29
53
  };
30
- export declare type FaIcontype = {
54
+ export declare type FaIconType = {
31
55
  name: string;
32
56
  color?: string;
33
57
  backgroundColor?: string;
@@ -37,7 +61,7 @@ export declare type FaIcontype = {
37
61
  export declare type IconType = {
38
62
  position: 'right' | 'left';
39
63
  type?: keyof typeof ICONS;
40
- faIcon?: FaIcontype;
64
+ faIcon?: FaIconType;
41
65
  };
42
66
  export declare type ButtonLinkProps = {
43
67
  type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CAyBd,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe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AAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;KAClD,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,eAAe,CAAA;CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
@@ -1,6 +1,18 @@
1
1
  import _keys from "lodash/fp/keys";
2
2
  import PropTypes from 'prop-types';
3
3
  import { ICONS } from '../../util/button-icons';
4
+ const faIconPropTypes = {
5
+ name: PropTypes.string.isRequired,
6
+ color: PropTypes.string,
7
+ backgroundColor: PropTypes.string,
8
+ size: PropTypes.number,
9
+ customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
10
+ };
11
+ export const iconPropTypes = {
12
+ position: PropTypes.oneOf(['right', 'left']).isRequired,
13
+ type: PropTypes.oneOf(_keys(ICONS)),
14
+ faIcon: PropTypes.shape(faIconPropTypes)
15
+ };
4
16
  const propTypes = {
5
17
  type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
6
18
  usage: PropTypes.oneOf(['button', 'submit', 'reset']),
@@ -11,10 +23,7 @@ const propTypes = {
11
23
  tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),
12
24
  'data-name': PropTypes.string,
13
25
  'data-testid': PropTypes.string,
14
- icon: PropTypes.shape({
15
- position: PropTypes.oneOf(['right', 'left']),
16
- type: PropTypes.oneOf(_keys(ICONS))
17
- }),
26
+ icon: PropTypes.shape(iconPropTypes),
18
27
  onClick: PropTypes.func,
19
28
  link: PropTypes.shape({
20
29
  href: PropTypes.string,
@@ -25,7 +34,7 @@ const propTypes = {
25
34
  hoverColor: PropTypes.string,
26
35
  disabled: PropTypes.bool,
27
36
  className: PropTypes.string,
28
- customStyle: PropTypes.shape({})
37
+ customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
29
38
  };
30
39
  export default propTypes;
31
40
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["PropTypes","ICONS","propTypes","type","oneOf","usage","label","string","content","node","tooltipText","tooltipPlacement","icon","shape","position","_keys","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className","customStyle"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.shape({})\n};\n\nexport type FaIcontype = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, unknown>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIcontype;\n};\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,SAAQC,KAAK,QAAO,yBAAyB;AAE7C,MAAMC,SAAS,GAAG;EAChBC,IAAI,EAAEH,SAAS,CAACI,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAChFC,KAAK,EAAEL,SAAS,CAACI,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;EACrDE,KAAK,EAAEN,SAAS,CAACO,MAAM;EACvBC,OAAO,EAAER,SAAS,CAACS,IAAI;EACvB,YAAY,EAAET,SAAS,CAACO,MAAM;EAC9BG,WAAW,EAAEV,SAAS,CAACO,MAAM;EAC7BI,gBAAgB,EAAEX,SAAS,CAACI,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EACrE,WAAW,EAAEJ,SAAS,CAACO,MAAM;EAC7B,aAAa,EAAEP,SAAS,CAACO,MAAM;EAC/BK,IAAI,EAAEZ,SAAS,CAACa,KAAK,CAAC;IACpBC,QAAQ,EAAEd,SAAS,CAACI,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5CD,IAAI,EAAEH,SAAS,CAACI,KAAK,CAACW,KAAA,CAAKd,KAAK,CAAC;EACnC,CAAC,CAAC;EACFe,OAAO,EAAEhB,SAAS,CAACiB,IAAI;EACvBC,IAAI,EAAElB,SAAS,CAACa,KAAK,CAAC;IACpBM,IAAI,EAAEnB,SAAS,CAACO,MAAM;IACtBa,QAAQ,EAAEpB,SAAS,CAACqB,IAAI;IACxBC,MAAM,EAAEtB,SAAS,CAACI,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFmB,oBAAoB,EAAEvB,SAAS,CAACO,MAAM;EACtCiB,UAAU,EAAExB,SAAS,CAACO,MAAM;EAC5BkB,QAAQ,EAAEzB,SAAS,CAACqB,IAAI;EACxBK,SAAS,EAAE1B,SAAS,CAACO,MAAM;EAC3BoB,WAAW,EAAE3B,SAAS,CAACa,KAAK,CAAC,CAAC,CAAC;AACjC,CAAC;AA2CD,eAAeX,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":["PropTypes","ICONS","faIconPropTypes","name","string","isRequired","color","backgroundColor","size","number","customStyle","objectOf","oneOfType","iconPropTypes","position","oneOf","type","_keys","faIcon","shape","propTypes","usage","label","content","node","tooltipText","tooltipPlacement","icon","onClick","func","link","href","download","bool","target","hoverBackgroundColor","hoverColor","disabled","className"],"sources":["../../../src/atom/button-link/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport {ICONS} from '../../util/button-icons';\n\nconst faIconPropTypes = {\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n backgroundColor: PropTypes.string,\n size: PropTypes.number,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport const iconPropTypes = {\n position: PropTypes.oneOf(['right', 'left']).isRequired,\n type: PropTypes.oneOf(keys(ICONS)),\n faIcon: PropTypes.shape(faIconPropTypes)\n};\n\nconst propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n usage: PropTypes.oneOf(['button', 'submit', 'reset']),\n label: PropTypes.string,\n content: PropTypes.node,\n 'aria-label': PropTypes.string,\n tooltipText: PropTypes.string,\n tooltipPlacement: PropTypes.oneOf(['left', 'right', 'top', 'bottom']),\n 'data-name': PropTypes.string,\n 'data-testid': PropTypes.string,\n icon: PropTypes.shape(iconPropTypes),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n hoverBackgroundColor: PropTypes.string,\n hoverColor: PropTypes.string,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport type FaIconType = {\n name: string;\n color?: string;\n backgroundColor?: string;\n size?: number;\n customStyle?: Record<string, unknown>;\n};\n\nexport type IconType = {\n position: 'right' | 'left';\n type?: keyof typeof ICONS;\n faIcon?: FaIconType;\n};\n\nexport type ButtonLinkProps = {\n type?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'dangerous';\n usage?: 'button' | 'submit' | 'reset';\n label?: string;\n content?: React.ReactNode;\n 'aria-label'?: string;\n tooltipText?: string;\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom';\n 'data-name'?: string;\n 'data-testid'?: string;\n icon?: IconType;\n onClick?: () => void;\n onKeyDown?: () => void;\n link?: {\n href?: string;\n download?: boolean;\n target?: '_self' | '_blank' | '_parent' | '_top';\n };\n hoverBackgroundColor?: string;\n hoverColor?: string;\n disabled?: boolean;\n className?: string;\n customStyle?: Record<string, unknown>;\n useTitle?: boolean;\n};\n\nexport type Fixture = {props: ButtonLinkProps};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,SAAQC,KAAK,QAAO,yBAAyB;AAE7C,MAAMC,eAAe,GAAG;EACtBC,IAAI,EAAEH,SAAS,CAACI,MAAM,CAACC,UAAU;EACjCC,KAAK,EAAEN,SAAS,CAACI,MAAM;EACvBG,eAAe,EAAEP,SAAS,CAACI,MAAM;EACjCI,IAAI,EAAER,SAAS,CAACS,MAAM;EACtBC,WAAW,EAAEV,SAAS,CAACW,QAAQ,CAACX,SAAS,CAACY,SAAS,CAAC,CAACZ,SAAS,CAACI,MAAM,EAAEJ,SAAS,CAACS,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,OAAO,MAAMI,aAAa,GAAG;EAC3BC,QAAQ,EAAEd,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAACV,UAAU;EACvDW,IAAI,EAAEhB,SAAS,CAACe,KAAK,CAACE,KAAA,CAAKhB,KAAK,CAAC,CAAC;EAClCiB,MAAM,EAAElB,SAAS,CAACmB,KAAK,CAACjB,eAAe;AACzC,CAAC;AAED,MAAMkB,SAAS,GAAG;EAChBJ,IAAI,EAAEhB,SAAS,CAACe,KAAK,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;EAChFM,KAAK,EAAErB,SAAS,CAACe,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;EACrDO,KAAK,EAAEtB,SAAS,CAACI,MAAM;EACvBmB,OAAO,EAAEvB,SAAS,CAACwB,IAAI;EACvB,YAAY,EAAExB,SAAS,CAACI,MAAM;EAC9BqB,WAAW,EAAEzB,SAAS,CAACI,MAAM;EAC7BsB,gBAAgB,EAAE1B,SAAS,CAACe,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EACrE,WAAW,EAAEf,SAAS,CAACI,MAAM;EAC7B,aAAa,EAAEJ,SAAS,CAACI,MAAM;EAC/BuB,IAAI,EAAE3B,SAAS,CAACmB,KAAK,CAACN,aAAa,CAAC;EACpCe,OAAO,EAAE5B,SAAS,CAAC6B,IAAI;EACvBC,IAAI,EAAE9B,SAAS,CAACmB,KAAK,CAAC;IACpBY,IAAI,EAAE/B,SAAS,CAACI,MAAM;IACtB4B,QAAQ,EAAEhC,SAAS,CAACiC,IAAI;IACxBC,MAAM,EAAElC,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;EAChE,CAAC,CAAC;EACFoB,oBAAoB,EAAEnC,SAAS,CAACI,MAAM;EACtCgC,UAAU,EAAEpC,SAAS,CAACI,MAAM;EAC5BiC,QAAQ,EAAErC,SAAS,CAACiC,IAAI;EACxBK,SAAS,EAAEtC,SAAS,CAACI,MAAM;EAC3BM,WAAW,EAAEV,SAAS,CAACW,QAAQ,CAACX,SAAS,CAACY,SAAS,CAAC,CAACZ,SAAS,CAACI,MAAM,EAAEJ,SAAS,CAACS,MAAM,CAAC,CAAC;AAC3F,CAAC;AA4CD,eAAeW,SAAS","ignoreList":[]}
@@ -46,14 +46,14 @@
46
46
  composes: button;
47
47
  width: 44px;
48
48
  height: 44px;
49
- border-radius: 7px;
49
+ border-radius: 12px;
50
50
  }
51
51
 
52
52
  .responsive {
53
53
  composes: button;
54
54
  width: 44px;
55
55
  height: 44px;
56
- border-radius: 7px;
56
+ border-radius: 12px;
57
57
  }
58
58
 
59
59
  .responsive .icon {
@@ -9,8 +9,26 @@ declare const ButtonMenu: {
9
9
  label: import("prop-types").Validator<string>;
10
10
  onClick: import("prop-types").Validator<(...args: any[]) => any>;
11
11
  type: import("prop-types").Requireable<string>;
12
+ buttonLinkType: import("prop-types").Requireable<string>;
13
+ icon: import("prop-types").Requireable<import("prop-types").InferProps<{
14
+ position: import("prop-types").Validator<string>;
15
+ type: import("prop-types").Requireable<string>;
16
+ faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
17
+ name: import("prop-types").Validator<string>;
18
+ color: import("prop-types").Requireable<string>;
19
+ backgroundColor: import("prop-types").Requireable<string>;
20
+ size: import("prop-types").Requireable<number>;
21
+ customStyle: import("prop-types").Requireable<{
22
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
23
+ }>;
24
+ }>>;
25
+ }>>;
26
+ customStyle: import("prop-types").Requireable<{
27
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
28
+ }>;
12
29
  }> | null | undefined)[]>;
13
30
  'data-name': import("prop-types").Requireable<string>;
31
+ 'aria-label': import("prop-types").Requireable<string>;
14
32
  };
15
33
  };
16
34
  export default ButtonMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-menu/index.tsx"],"names":[],"mappings":";AAIA,OAAkB,EAAC,eAAe,EAA+B,MAAM,SAAS,CAAC;AAiCjF,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;;;;;;CAazC,CAAC;AAIF,eAAe,UAAU,CAAC"}
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"}
@@ -2,6 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
2
2
  import React, { useMemo, useCallback } from 'react';
3
3
  import map from 'lodash/fp/map';
4
4
  import classnames from 'classnames';
5
+ import ButtonLink from '../button-link';
5
6
  import style from './style.css';
6
7
  import propTypes, { buttonPropTypes } from './types';
7
8
  const Button = props => {
@@ -10,11 +11,25 @@ const Button = props => {
10
11
  disabled,
11
12
  label,
12
13
  onClick,
13
- type = 'default'
14
+ type = 'default',
15
+ buttonLinkType,
16
+ icon,
17
+ customStyle = {}
14
18
  } = props;
15
19
  const styleButton = classnames(style.button, type === 'default' && style.defaultStyle, type === 'defaultLeft' && style.defaultLeft, type === 'dangerous' && style.dangerous, type === 'dangerousLeft' && style.dangerousLeft, disabled && style.disabled);
16
20
  const handleOnClick = useCallback(() => onClick(), [onClick]);
17
- return /*#__PURE__*/React.createElement("button", {
21
+ return icon ? /*#__PURE__*/React.createElement(ButtonLink, {
22
+ label: label,
23
+ type: buttonLinkType,
24
+ disabled: disabled,
25
+ onClick: handleOnClick,
26
+ "data-name": dataName,
27
+ className: styleButton,
28
+ customStyle: {
29
+ ...customStyle
30
+ },
31
+ icon: icon
32
+ }) : /*#__PURE__*/React.createElement("button", {
18
33
  type: "button",
19
34
  "aria-label": label,
20
35
  title: label,
@@ -45,7 +60,8 @@ const ButtonMenu = props => {
45
60
  cap: false
46
61
  })(buildButton, buttons), [buttons, buildButton]);
47
62
  return /*#__PURE__*/React.createElement("div", {
48
- "data-name": dataName
63
+ "data-name": dataName,
64
+ className: style.buttonMenuContainer
49
65
  }, buttonList);
50
66
  };
51
67
  ButtonMenu.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","useCallback","map","classnames","style","propTypes","buttonPropTypes","Button","props","dataName","disabled","label","onClick","type","styleButton","button","defaultStyle","defaultLeft","dangerous","dangerousLeft","handleOnClick","createElement","title","className","buttonContent","process","env","NODE_ENV","ButtonMenu","buttons","buildButton","index","_extends","key","buttonList","convert","cap"],"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 style from './style.css';\nimport propTypes, {ButtonMenuProps, ButtonProps, buttonPropTypes} from './types';\n\nconst Button = (props: ButtonProps) => {\n const {'data-name': dataName, disabled, label, onClick, type = 'default'} = 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\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n return (\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 <div data-name={dataName}>{buttonList}</div>;\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,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,IAAiCC,eAAe,QAAO,SAAS;AAEhF,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EACrC,MAAM;IAAC,WAAW,EAAEC,QAAQ;IAAEC,QAAQ;IAAEC,KAAK;IAAEC,OAAO;IAAEC,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EAAE,CAAC;EAC1D,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,UAAU,GAAGlC,OAAO;EACxB;EACA,MAAME,GAAG,CAACiC,OAAO,CAAC;IAACC,GAAG,EAAE;EAAK,CAAC,CAAC,CAACN,WAAW,EAAED,OAAO,CAAC,EACrD,CAACA,OAAO,EAAEC,WAAW,CACvB,CAAC;EAED,oBAAO/B,KAAA,CAAAsB,aAAA;IAAK,aAAWZ;EAAS,GAAEyB,UAAgB,CAAC;AACrD,CAAC;AAEDN,UAAU,CAACvB,SAAS,GAAAoB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGtB,SAAS;AAEhC,eAAeuB,UAAU","ignoreList":[]}
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,SAAS,EACvCR,IA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AAElB,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,20 +1,28 @@
1
1
  @value colors: "../../variables/colors.css";
2
2
  @value cm_grey_100 from colors;
3
- @value cm_grey_200 from colors;
4
- @value cm_grey_900 from colors;
5
3
  @value cm_negative_100 from colors;
4
+ @value cm_negative_300 from colors;
5
+ @value negative_100 from colors;
6
+
7
+ .buttonMenuContainer {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 8px;
11
+ }
6
12
 
7
13
  .button {
8
14
  width: 100%;
9
15
  height: 40px;
10
16
  font-family: Gilroy;
11
17
  font-size: 14px;
18
+ font-weight: 600;
12
19
  display: flex;
13
20
  justify-content: center;
14
21
  align-items: center;
15
22
  cursor: pointer;
16
23
  border: none;
17
24
  pointer-events: auto;
25
+ border-radius: 8px;
18
26
  /* prevents text selection when dragging
19
27
  the mouse over the button */
20
28
  user-select: none;
@@ -37,8 +45,8 @@
37
45
  }
38
46
 
39
47
  .defaultStyle {
40
- background-color: cm_grey_100;
41
- color: cm_grey_900;
48
+ background-color: transparent;
49
+ color: cm_grey_700;
42
50
  }
43
51
 
44
52
  .defaultLeft {
@@ -47,15 +55,20 @@
47
55
  }
48
56
 
49
57
  .defaultStyle:hover {
50
- background-color: cm_grey_200;
58
+ background-color: cm_grey_100;
51
59
  }
52
60
 
53
61
  .dangerous {
54
62
  composes: defaultStyle;
55
- color: cm_negative_100;
63
+ color: cm_negative_300;
64
+ }
65
+
66
+ .dangerous:hover {
67
+ background-color: negative_100;
56
68
  }
57
69
 
58
70
  .dangerousLeft {
59
71
  composes: dangerous;
60
72
  justify-content: flex-start;
61
73
  }
74
+
@@ -1,10 +1,28 @@
1
1
  import PropTypes from 'prop-types';
2
+ import { ButtonLinkProps, IconType } from '../button-link/types';
2
3
  export declare const buttonPropTypes: {
3
4
  'data-name': PropTypes.Requireable<string>;
4
5
  disabled: PropTypes.Requireable<boolean>;
5
6
  label: PropTypes.Validator<string>;
6
7
  onClick: PropTypes.Validator<(...args: any[]) => any>;
7
8
  type: PropTypes.Requireable<string>;
9
+ buttonLinkType: PropTypes.Requireable<string>;
10
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
11
+ position: PropTypes.Validator<string>;
12
+ type: PropTypes.Requireable<string>;
13
+ faIcon: PropTypes.Requireable<PropTypes.InferProps<{
14
+ name: PropTypes.Validator<string>;
15
+ color: PropTypes.Requireable<string>;
16
+ backgroundColor: PropTypes.Requireable<string>;
17
+ size: PropTypes.Requireable<number>;
18
+ customStyle: PropTypes.Requireable<{
19
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
20
+ }>;
21
+ }>>;
22
+ }>>;
23
+ customStyle: PropTypes.Requireable<{
24
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
25
+ }>;
8
26
  };
9
27
  declare const propTypes: {
10
28
  buttons: PropTypes.Validator<(PropTypes.InferProps<{
@@ -13,8 +31,26 @@ declare const propTypes: {
13
31
  label: PropTypes.Validator<string>;
14
32
  onClick: PropTypes.Validator<(...args: any[]) => any>;
15
33
  type: PropTypes.Requireable<string>;
34
+ buttonLinkType: PropTypes.Requireable<string>;
35
+ icon: PropTypes.Requireable<PropTypes.InferProps<{
36
+ position: PropTypes.Validator<string>;
37
+ type: PropTypes.Requireable<string>;
38
+ faIcon: PropTypes.Requireable<PropTypes.InferProps<{
39
+ name: PropTypes.Validator<string>;
40
+ color: PropTypes.Requireable<string>;
41
+ backgroundColor: PropTypes.Requireable<string>;
42
+ size: PropTypes.Requireable<number>;
43
+ customStyle: PropTypes.Requireable<{
44
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
45
+ }>;
46
+ }>>;
47
+ }>>;
48
+ customStyle: PropTypes.Requireable<{
49
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
50
+ }>;
16
51
  }> | null | undefined)[]>;
17
52
  'data-name': PropTypes.Requireable<string>;
53
+ 'aria-label': PropTypes.Requireable<string>;
18
54
  };
19
55
  export default propTypes;
20
56
  export declare type ButtonProps = {
@@ -23,6 +59,9 @@ export declare type ButtonProps = {
23
59
  label: string;
24
60
  onClick: () => void;
25
61
  type?: 'default' | 'defaultLeft' | 'dangerous' | 'dangerousLeft';
62
+ buttonLinkType?: ButtonLinkProps['type'];
63
+ icon?: IconType;
64
+ customStyle?: Record<string, string | number>;
26
65
  };
27
66
  export declare type ButtonMenuProps = {
28
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;AAEnC,eAAO,MAAM,eAAe;;;;;;CAM3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;CAGd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC;CAClE,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"}
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;;;;;;;;;;;;;;;;;;;;;;;CAS3B,CAAC;AAEF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;CAId,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,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,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC/C,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"}
@@ -1,14 +1,19 @@
1
1
  import PropTypes from 'prop-types';
2
+ import { iconPropTypes } from '../button-link/types';
2
3
  export const buttonPropTypes = {
3
4
  'data-name': PropTypes.string,
4
5
  disabled: PropTypes.bool,
5
6
  label: PropTypes.string.isRequired,
6
7
  onClick: PropTypes.func.isRequired,
7
- type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft'])
8
+ type: PropTypes.oneOf(['default', 'defaultLeft', 'dangerous', 'dangerousLeft']),
9
+ buttonLinkType: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),
10
+ icon: PropTypes.shape(iconPropTypes),
11
+ customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
8
12
  };
9
13
  const propTypes = {
10
14
  buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,
11
- 'data-name': PropTypes.string
15
+ 'data-name': PropTypes.string,
16
+ 'aria-label': PropTypes.string
12
17
  };
13
18
  export default propTypes;
14
19
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["PropTypes","buttonPropTypes","string","disabled","bool","label","isRequired","onClick","func","type","oneOf","propTypes","buttons","arrayOf","shape"],"sources":["../../../src/atom/button-menu/types.ts"],"sourcesContent":["import PropTypes from 'prop-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};\n\nconst propTypes = {\n buttons: PropTypes.arrayOf(PropTypes.shape(buttonPropTypes)).isRequired,\n 'data-name': 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};\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;AAElC,OAAO,MAAMC,eAAe,GAAG;EAC7B,WAAW,EAAED,SAAS,CAACE,MAAM;EAC7BC,QAAQ,EAAEH,SAAS,CAACI,IAAI;EACxBC,KAAK,EAAEL,SAAS,CAACE,MAAM,CAACI,UAAU;EAClCC,OAAO,EAAEP,SAAS,CAACQ,IAAI,CAACF,UAAU;EAClCG,IAAI,EAAET,SAAS,CAACU,KAAK,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,CAAC;AAChF,CAAC;AAED,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEZ,SAAS,CAACa,OAAO,CAACb,SAAS,CAACc,KAAK,CAACb,eAAe,CAAC,CAAC,CAACK,UAAU;EACvE,WAAW,EAAEN,SAAS,CAACE;AACzB,CAAC;AAED,eAAeS,SAAS","ignoreList":[]}
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":[]}
@@ -20,6 +20,43 @@ declare const RadioWithTitle: {
20
20
  }>;
21
21
  icon: import("prop-types").Requireable<import("prop-types").InferProps<any>>;
22
22
  }>>;
23
+ button: import("prop-types").Requireable<import("prop-types").InferProps<{
24
+ type: import("prop-types").Requireable<string>;
25
+ usage: import("prop-types").Requireable<string>;
26
+ label: import("prop-types").Requireable<string>;
27
+ content: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
28
+ 'aria-label': import("prop-types").Requireable<string>;
29
+ tooltipText: import("prop-types").Requireable<string>;
30
+ tooltipPlacement: import("prop-types").Requireable<string>;
31
+ 'data-name': import("prop-types").Requireable<string>;
32
+ 'data-testid': import("prop-types").Requireable<string>;
33
+ icon: import("prop-types").Requireable<import("prop-types").InferProps<{
34
+ position: import("prop-types").Validator<string>;
35
+ type: import("prop-types").Requireable<string>;
36
+ faIcon: import("prop-types").Requireable<import("prop-types").InferProps<{
37
+ name: import("prop-types").Validator<string>;
38
+ color: import("prop-types").Requireable<string>;
39
+ backgroundColor: import("prop-types").Requireable<string>;
40
+ size: import("prop-types").Requireable<number>;
41
+ customStyle: import("prop-types").Requireable<{
42
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
43
+ }>;
44
+ }>>;
45
+ }>>;
46
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
47
+ link: import("prop-types").Requireable<import("prop-types").InferProps<{
48
+ href: import("prop-types").Requireable<string>;
49
+ download: import("prop-types").Requireable<boolean>;
50
+ target: import("prop-types").Requireable<string>;
51
+ }>>;
52
+ hoverBackgroundColor: import("prop-types").Requireable<string>;
53
+ hoverColor: import("prop-types").Requireable<string>;
54
+ disabled: import("prop-types").Requireable<boolean>;
55
+ className: import("prop-types").Requireable<string>;
56
+ customStyle: import("prop-types").Requireable<{
57
+ [x: string]: NonNullable<string | number | null | undefined> | null | undefined;
58
+ }>;
59
+ }>>;
23
60
  }>>>;
24
61
  name: import("prop-types").Requireable<string>;
25
62
  checked: import("prop-types").Requireable<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}