@laerdal/life-react-components 1.0.1-dev.22.full → 1.0.1-dev.29.full

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 (176) hide show
  1. package/dist/esm/Banners/Banner.js +11 -8
  2. package/dist/esm/Banners/Banner.js.map +1 -1
  3. package/dist/esm/Button/Anchor.js +76 -0
  4. package/dist/esm/Button/Anchor.js.map +1 -0
  5. package/dist/esm/Button/BackButton.js +1 -1
  6. package/dist/esm/Button/BackButton.js.map +1 -1
  7. package/dist/esm/Button/Button.js +46 -19
  8. package/dist/esm/Button/Button.js.map +1 -1
  9. package/dist/esm/Button/DualFunctionButton.js +111 -0
  10. package/dist/esm/Button/DualFunctionButton.js.map +1 -0
  11. package/dist/esm/Button/Iconbutton.js +21 -1
  12. package/dist/esm/Button/Iconbutton.js.map +1 -1
  13. package/dist/esm/Button/__tests__/Button.test.js +2 -1
  14. package/dist/esm/Button/__tests__/Button.test.js.map +1 -1
  15. package/dist/esm/Button/index.js +1 -0
  16. package/dist/esm/Button/index.js.map +1 -1
  17. package/dist/esm/Dropdown/BasicDropdown.js +60 -127
  18. package/dist/esm/Dropdown/BasicDropdown.js.map +1 -1
  19. package/dist/esm/Dropdown/ChipDropdownInput.js +41 -132
  20. package/dist/esm/Dropdown/ChipDropdownInput.js.map +1 -1
  21. package/dist/esm/Dropdown/CommonStyling.js +20 -15
  22. package/dist/esm/Dropdown/CommonStyling.js.map +1 -1
  23. package/dist/esm/Dropdown/DropdownButton.js +2 -2
  24. package/dist/esm/Dropdown/DropdownButton.js.map +1 -1
  25. package/dist/esm/Dropdown/DropdownContent.js +424 -0
  26. package/dist/esm/Dropdown/DropdownContent.js.map +1 -0
  27. package/dist/esm/Dropdown/DropdownFilter.js +42 -151
  28. package/dist/esm/Dropdown/DropdownFilter.js.map +1 -1
  29. package/dist/esm/GlobalNavigationBar/UserMenu/UserMenu.js +15 -17
  30. package/dist/esm/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
  31. package/dist/esm/InputFields/Checkbox.js +19 -10
  32. package/dist/esm/InputFields/Checkbox.js.map +1 -1
  33. package/dist/esm/InputFields/QuickSearch.js +22 -12
  34. package/dist/esm/InputFields/QuickSearch.js.map +1 -1
  35. package/dist/esm/InputFields/RadioButton.js +18 -11
  36. package/dist/esm/InputFields/RadioButton.js.map +1 -1
  37. package/dist/esm/InputFields/components/SearchBarInput.js +1 -1
  38. package/dist/esm/InputFields/components/SearchBarInput.js.map +1 -1
  39. package/dist/esm/Modals/ModalDialog.js +14 -14
  40. package/dist/esm/Modals/ModalDialog.js.map +1 -1
  41. package/dist/esm/Modals/ModalStyles.js +3 -2
  42. package/dist/esm/Modals/ModalStyles.js.map +1 -1
  43. package/dist/esm/Paginator/Paginator.js +18 -8
  44. package/dist/esm/Paginator/Paginator.js.map +1 -1
  45. package/dist/esm/Paginator/__tests__/Paginator.test.js +1 -1
  46. package/dist/esm/Paginator/__tests__/Paginator.test.js.map +1 -1
  47. package/dist/esm/Table/Table.js +2 -1
  48. package/dist/esm/Table/Table.js.map +1 -1
  49. package/dist/esm/Tabs/TabLink.js +1 -1
  50. package/dist/esm/Tabs/TabLink.js.map +1 -1
  51. package/dist/esm/Toasters/Toast.js +2 -1
  52. package/dist/esm/Toasters/Toast.js.map +1 -1
  53. package/dist/esm/types.js +8 -0
  54. package/dist/esm/types.js.map +1 -1
  55. package/dist/js/Banners/Banner.js +13 -11
  56. package/dist/js/Banners/Banner.js.map +1 -1
  57. package/dist/js/Button/Anchor.d.ts +7 -0
  58. package/dist/js/Button/Anchor.js +66 -0
  59. package/dist/js/Button/Anchor.js.map +1 -0
  60. package/dist/js/Button/BackButton.js +1 -1
  61. package/dist/js/Button/BackButton.js.map +1 -1
  62. package/dist/js/Button/Button.d.ts +4 -1
  63. package/dist/js/Button/Button.js +44 -18
  64. package/dist/js/Button/Button.js.map +1 -1
  65. package/dist/js/Button/DualFunctionButton.d.ts +12 -0
  66. package/dist/js/Button/DualFunctionButton.js +148 -0
  67. package/dist/js/Button/DualFunctionButton.js.map +1 -0
  68. package/dist/js/Button/Iconbutton.d.ts +1 -0
  69. package/dist/js/Button/Iconbutton.js +23 -3
  70. package/dist/js/Button/Iconbutton.js.map +1 -1
  71. package/dist/js/Button/__tests__/Button.test.js +3 -1
  72. package/dist/js/Button/__tests__/Button.test.js.map +1 -1
  73. package/dist/js/Button/index.d.ts +1 -0
  74. package/dist/js/Button/index.js +8 -0
  75. package/dist/js/Button/index.js.map +1 -1
  76. package/dist/js/Dropdown/BasicDropdown.d.ts +9 -2
  77. package/dist/js/Dropdown/BasicDropdown.js +67 -133
  78. package/dist/js/Dropdown/BasicDropdown.js.map +1 -1
  79. package/dist/js/Dropdown/ChipDropdownInput.js +45 -138
  80. package/dist/js/Dropdown/ChipDropdownInput.js.map +1 -1
  81. package/dist/js/Dropdown/CommonStyling.d.ts +6 -2
  82. package/dist/js/Dropdown/CommonStyling.js +17 -6
  83. package/dist/js/Dropdown/CommonStyling.js.map +1 -1
  84. package/dist/js/Dropdown/DropdownButton.js +1 -1
  85. package/dist/js/Dropdown/DropdownButton.js.map +1 -1
  86. package/dist/js/Dropdown/DropdownContent.d.ts +45 -0
  87. package/dist/js/Dropdown/DropdownContent.js +476 -0
  88. package/dist/js/Dropdown/DropdownContent.js.map +1 -0
  89. package/dist/js/Dropdown/DropdownFilter.js +59 -186
  90. package/dist/js/Dropdown/DropdownFilter.js.map +1 -1
  91. package/dist/js/GlobalNavigationBar/UserMenu/UserMenu.js +7 -17
  92. package/dist/js/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
  93. package/dist/js/InputFields/Checkbox.d.ts +5 -3
  94. package/dist/js/InputFields/Checkbox.js +16 -9
  95. package/dist/js/InputFields/Checkbox.js.map +1 -1
  96. package/dist/js/InputFields/QuickSearch.js +24 -6
  97. package/dist/js/InputFields/QuickSearch.js.map +1 -1
  98. package/dist/js/InputFields/RadioButton.d.ts +4 -2
  99. package/dist/js/InputFields/RadioButton.js +15 -10
  100. package/dist/js/InputFields/RadioButton.js.map +1 -1
  101. package/dist/js/InputFields/components/SearchBarInput.js +1 -1
  102. package/dist/js/InputFields/components/SearchBarInput.js.map +1 -1
  103. package/dist/js/Modals/ModalDialog.d.ts +2 -1
  104. package/dist/js/Modals/ModalDialog.js +15 -14
  105. package/dist/js/Modals/ModalDialog.js.map +1 -1
  106. package/dist/js/Modals/ModalStyles.d.ts +4 -3
  107. package/dist/js/Modals/ModalStyles.js +4 -2
  108. package/dist/js/Modals/ModalStyles.js.map +1 -1
  109. package/dist/js/Paginator/Paginator.js +7 -5
  110. package/dist/js/Paginator/Paginator.js.map +1 -1
  111. package/dist/js/Paginator/__tests__/Paginator.test.js +1 -1
  112. package/dist/js/Paginator/__tests__/Paginator.test.js.map +1 -1
  113. package/dist/js/Table/Table.js +3 -1
  114. package/dist/js/Table/Table.js.map +1 -1
  115. package/dist/js/Tabs/TabLink.js +1 -1
  116. package/dist/js/Tabs/TabLink.js.map +1 -1
  117. package/dist/js/Toasters/Toast.js +1 -1
  118. package/dist/js/Toasters/Toast.js.map +1 -1
  119. package/dist/js/types.d.ts +5 -0
  120. package/dist/js/types.js +10 -1
  121. package/dist/js/types.js.map +1 -1
  122. package/dist/umd/Banners/Banner.js +11 -8
  123. package/dist/umd/Banners/Banner.js.map +1 -1
  124. package/dist/umd/Button/Anchor.js +201 -0
  125. package/dist/umd/Button/Anchor.js.map +1 -0
  126. package/dist/umd/Button/BackButton.js +1 -1
  127. package/dist/umd/Button/BackButton.js.map +1 -1
  128. package/dist/umd/Button/Button.js +48 -22
  129. package/dist/umd/Button/Button.js.map +1 -1
  130. package/dist/umd/Button/DualFunctionButton.js +237 -0
  131. package/dist/umd/Button/DualFunctionButton.js.map +1 -0
  132. package/dist/umd/Button/Iconbutton.js +21 -1
  133. package/dist/umd/Button/Iconbutton.js.map +1 -1
  134. package/dist/umd/Button/__tests__/Button.test.js +5 -5
  135. package/dist/umd/Button/__tests__/Button.test.js.map +1 -1
  136. package/dist/umd/Button/index.js +10 -4
  137. package/dist/umd/Button/index.js.map +1 -1
  138. package/dist/umd/Dropdown/BasicDropdown.js +64 -131
  139. package/dist/umd/Dropdown/BasicDropdown.js.map +1 -1
  140. package/dist/umd/Dropdown/ChipDropdownInput.js +44 -134
  141. package/dist/umd/Dropdown/ChipDropdownInput.js.map +1 -1
  142. package/dist/umd/Dropdown/CommonStyling.js +23 -19
  143. package/dist/umd/Dropdown/CommonStyling.js.map +1 -1
  144. package/dist/umd/Dropdown/DropdownButton.js +1 -1
  145. package/dist/umd/Dropdown/DropdownButton.js.map +1 -1
  146. package/dist/umd/Dropdown/DropdownContent.js +458 -0
  147. package/dist/umd/Dropdown/DropdownContent.js.map +1 -0
  148. package/dist/umd/Dropdown/DropdownFilter.js +47 -155
  149. package/dist/umd/Dropdown/DropdownFilter.js.map +1 -1
  150. package/dist/umd/GlobalNavigationBar/UserMenu/UserMenu.js +18 -21
  151. package/dist/umd/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
  152. package/dist/umd/InputFields/Checkbox.js +22 -14
  153. package/dist/umd/InputFields/Checkbox.js.map +1 -1
  154. package/dist/umd/InputFields/QuickSearch.js +22 -12
  155. package/dist/umd/InputFields/QuickSearch.js.map +1 -1
  156. package/dist/umd/InputFields/RadioButton.js +21 -15
  157. package/dist/umd/InputFields/RadioButton.js.map +1 -1
  158. package/dist/umd/InputFields/components/SearchBarInput.js +1 -1
  159. package/dist/umd/InputFields/components/SearchBarInput.js.map +1 -1
  160. package/dist/umd/Modals/ModalDialog.js +17 -18
  161. package/dist/umd/Modals/ModalDialog.js.map +1 -1
  162. package/dist/umd/Modals/ModalStyles.js +6 -6
  163. package/dist/umd/Modals/ModalStyles.js.map +1 -1
  164. package/dist/umd/Paginator/Paginator.js +18 -8
  165. package/dist/umd/Paginator/Paginator.js.map +1 -1
  166. package/dist/umd/Paginator/__tests__/Paginator.test.js +1 -1
  167. package/dist/umd/Paginator/__tests__/Paginator.test.js.map +1 -1
  168. package/dist/umd/Table/Table.js +5 -5
  169. package/dist/umd/Table/Table.js.map +1 -1
  170. package/dist/umd/Tabs/TabLink.js +1 -1
  171. package/dist/umd/Tabs/TabLink.js.map +1 -1
  172. package/dist/umd/Toasters/Toast.js +1 -1
  173. package/dist/umd/Toasters/Toast.js.map +1 -1
  174. package/dist/umd/types.js +8 -0
  175. package/dist/umd/types.js.map +1 -1
  176. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Button/Button.tsx"],"names":["React","styled","css","LoadingIndicator","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","tabbedHereStyle","variant","colorTheme","focus_25","focus","accent1_700","primary_100","primary_700","primary_500","white","accent1","primary_800","primary","accent1_500","Primary","button","props","size","Bold","width","primary_600","accent1_800","primary_200","tabbedHere","neutral_100","neutral_300","Secondary","primary_300","Tertiary","accent1_20","primary_20","accent1_100","Correct","correct_500","correct_700","correct_800","Critical","critical_500","critical_700","critical_800","Text","neutral_500","Button","children","type","testId","disabled","icon","loading","renderProps","supressFocusRef","useRef","setTabbedHere","useState","renderContent","className","e","current","role","title"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,MAAT,QAAmC,WAAnC;AACA,SAASC,iBAAT,EAA4BC,iBAA5B,EAA+CC,iBAA/C,EAAkEC,kBAAlE,QAA4F,sBAA5F;;AAEA,MAAMC,eAAe,GAAG,CAACC,OAAD,EAAkBC,UAAlB,KAA0C;AAChE,UAAQD,OAAR;AACE,SAAK,SAAL;AACE,aAAOR,GAAI;AACjB;AACA;AACA;AACA,qCAAqCE,MAAM,CAACQ,QAAS,iBAAgBR,MAAM,CAACS,KAAM;AAClF,8BAA8BF,UAAU,KAAK,MAAf,GAAwBP,MAAM,CAACU,WAA/B,GA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,SAhBH;AAiBE,QAAA,MAAM,EAAE,MAAML,aAAa,CAAC,KAAD,CAjB7B;AAkBE,QAAA,UAAU,EAAE7B;AAlBd,uBAmBE;AAAK,QAAA,SAAS,EAAC;AAAf,SAAiC+B,aAAa,EAA9C,CAnBF,CADF;AAhIJ;AAwJD,CAjLD;;;AAZErD,EAAAA,O,aAAU,S,EAAY,W,EAAc,U,EAAa,M,EAAS,S,EAAY,U;AACtEyD,EAAAA,I,4BAAO,Q;AACPC,EAAAA,K;AACA1C,EAAAA,I,aAAO,O,EAAU,Q,EAAW,K;AAC5Bf,EAAAA,U,aAAa,M,EAAS,M;AACtBiB,EAAAA,K,4BAAQ,M;AACR6B,EAAAA,O;AACAH,EAAAA,M;AACAtB,EAAAA,U;AACAwB,EAAAA,I;;AAsLF,eAAeL,MAAf","sourcesContent":["import * as React from 'react';\nimport styled, { css } from 'styled-components';\nimport { LoadingIndicator } from '../LoadingIndicator';\nimport { COLORS, TYPOGRAPHY } from '../styles';\nimport { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle } from '../styles/typography';\n\nconst tabbedHereStyle = (variant: string, colorTheme?: string) => {\n switch (variant) {\n case 'primary':\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n color: ${colorTheme === 'dark' ? COLORS.primary_500 : COLORS.white};\n }\n `;\n case 'secondary':\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${colorTheme === 'dark' ? 'transparent' : COLORS.white};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1 : colorTheme === 'dark' ? COLORS.primary_800 : COLORS.primary};\n color: ${colorTheme === 'dark' ? COLORS.white : COLORS.primary_500};\n }\n `;\n case 'tertiary':\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${COLORS.white};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary};\n color: ${colorTheme === 'teal' ? COLORS.accent1_500 : COLORS.primary_500};\n }\n `;\n\n default:\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n color: ${colorTheme === 'dark' ? COLORS.primary_500 : COLORS.white};\n }\n `;\n }\n};\n\nconst Primary = styled.button<ButtonProps>`\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n min-height: ${(props) => (props.size === 'big' ? '56px' : '48px')};\n &.loading-state {\n cursor: wait;\n }\n &:focus:not(:focus-visible),\n &:focus:not(:focus-visible) > div.button-content {\n outline: 0 !important;\n }\n div.button-content {\n ${(props) =>\n props.size === 'big'\n ? ComponentLStyling(ComponentTextStyle.Bold, props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)\n : props.size === 'small'\n ? ComponentSStyling(ComponentTextStyle.Bold, props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)\n : ComponentMStyling(ComponentTextStyle.Bold, props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)};\n\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n border-radius: 8px;\n border-width: 2px;\n border-style: solid;\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n\n width: ${(props) => props.width};\n position: relative;\n\n min-height: ${(props) => (props.size === 'big' ? '56px' : props.size === 'small' ? '32px' : '40px')};\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n // paddings have -2px for border\n padding: ${(props) => (props.size === 'big' ? '14px 18px' : props.size === 'small' ? '4px 10px' : '6px 14px')};\n\n span.loading {\n opacity: 0;\n }\n .icon {\n margin-left: -4px;\n margin-top: -2px;\n margin-bottom: -2px;\n width: ${(props) => (props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px')};\n height: ${(props) => (props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px')};\n svg {\n width: ${(props) => (props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px')} !important;\n height: ${(props) => (props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px')} !important;\n }\n }\n\n div {\n position: absolute;\n width: 100%;\n svg {\n height: ${(props) => (props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px')};\n width: ${(props) => (props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px')};\n path {\n fill: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary : COLORS.white)};\n }\n }\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700)};\n color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_600 : COLORS.white)};\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_800)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_800)};\n box-shadow: none !important;\n color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)};\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('primary', props.colorTheme) : '')}\n &.focus-state {\n ${(props) => tabbedHereStyle('primary', props?.colorTheme)};\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.neutral_300)};\n border-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.neutral_300)};\n border-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n }\n }\n`;\n\nconst Secondary = styled(Primary)<ButtonProps>`\n div.button-content {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n background-color: transparent;\n div svg path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_700)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_700)};\n background-color: transparent;\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n }\n }\n }\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: white;\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_300 : COLORS.primary_800)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_300 : COLORS.primary_800)};\n background-color: transparent;\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary_800)};\n }\n }\n }\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: transparent;\n color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_300)};\n border-color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n cursor: not-allowed;\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('secondary', props.colorTheme) : '')}\n &.focus-state {\n ${(props) => tabbedHereStyle('secondary', props?.colorTheme)};\n }\n`;\n\nconst Tertiary = styled(Primary)<ButtonProps>`\n div.button-content {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary_500)};\n border-color: transparent;\n background-color: transparent;\n border-width: 1px;\n div svg path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_20 : COLORS.primary_20)};\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_20 : COLORS.primary_20)};\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n }\n }\n }\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_100 : COLORS.primary_100)};\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : COLORS.primary_800)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_100 : COLORS.primary_100)};\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : COLORS.primary_800)};\n }\n }\n }\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: white !important;\n color: ${COLORS.neutral_300};\n border-color: transparent;\n cursor: not-allowed;\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: white !important;\n color: ${COLORS.neutral_300};\n border-color: transparent !important;\n cursor: not-allowed;\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('tertiary', props.colorTheme) : '')}\n &.focus-state {\n ${(props) => tabbedHereStyle('tertiary', props?.colorTheme)};\n }\n`;\n\nconst Correct = styled(Primary)<ButtonProps>`\n div.button-content {\n color: white;\n border-color: ${COLORS.correct_500};\n background-color: ${COLORS.correct_500};\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n border-color: ${COLORS.correct_700};\n background-color: ${COLORS.correct_700};\n }\n &:focus > div.button-content,\n &.focus-state > div.button-content {\n border-color: ${COLORS.correct_700};\n background-color: ${COLORS.correct_700};\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n border-color: ${COLORS.correct_800};\n background-color: ${COLORS.correct_800};\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n }\n }\n`;\n\nconst Critical = styled(Primary)<ButtonProps>`\n div.button-content {\n color: white;\n border-color: ${COLORS.critical_500};\n background-color: ${COLORS.critical_500};\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n border-color: ${COLORS.critical_700};\n background-color: ${COLORS.critical_700};\n }\n &:focus > div.button-content,\n &.focus-state > div.button-content {\n border-color: ${COLORS.critical_700};\n background-color: ${COLORS.critical_700};\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n border-color: ${COLORS.critical_800};\n background-color: ${COLORS.critical_800};\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n }\n }\n`;\n\nconst Text = styled.button<ButtonProps>`\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n background-color: transparent;\n padding: 0;\n border: none;\n cursor: pointer;\n\n text-decoration: underline;\n ${(props) =>\n props.size === 'big'\n ? ComponentLStyling(ComponentTextStyle.Bold, props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)\n : props.size === 'small'\n ? ComponentSStyling(ComponentTextStyle.Bold, props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)\n : ComponentMStyling(ComponentTextStyle.Bold, props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n\n &:hover,\n &:focus,\n &.hover-state,\n &.focus-state {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n background: transparent;\n }\n &:active,\n &.active-state {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : COLORS.primary_800)};\n background: transparent;\n }\n &:disabled,\n &.disabled-state {\n color: ${COLORS.neutral_500};\n background: transparent;\n cursor: not-allowed;\n }\n`;\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'correct' | 'critical';\n role?: 'button' | string;\n title?: string;\n size?: 'small' | 'normal' | 'big';\n colorTheme?: 'teal' | 'dark';\n width?: 'auto' | string;\n loading?: boolean;\n testId?: string;\n tabbedHere?: boolean;\n icon?: React.ReactNode;\n}\n\nconst Button: React.FunctionComponent<ButtonProps> = ({\n children = 'Primary Button',\n variant = 'primary',\n type = 'button',\n size = 'normal',\n width = 'auto',\n testId,\n disabled,\n icon,\n ...props\n}) => {\n // Let's filter out properties that we don't need to render.\n const { loading, ...renderProps } = props;\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const renderContent = () => (\n <>\n {icon && <span className={loading ? 'icon loading' : 'icon'}>{icon}</span>}\n <span className={loading ? 'label loading' : 'label'}>{children}</span>\n {loading && <LoadingIndicator></LoadingIndicator>}\n </>\n );\n\n // Let's render button\n switch (variant) {\n case 'primary':\n return (\n <Primary\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Primary>\n );\n case 'secondary':\n return (\n <Secondary\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Secondary>\n );\n case 'tertiary':\n return (\n <Tertiary\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Tertiary>\n );\n case 'text':\n return (\n <Text {...renderProps} disabled={disabled} type={type} size={size} width={width} data-testid={testId}>\n {children}\n </Text>\n );\n case 'correct':\n return (\n <Correct\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Correct>\n );\n case 'critical':\n return (\n <Critical\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Critical>\n );\n default:\n return (\n <Primary\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Primary>\n );\n }\n};\n\nexport default Button;\n"],"file":"Button.js"}
1
+ {"version":3,"sources":["../../../src/Button/Button.tsx"],"names":["React","styled","css","LoadingIndicator","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","COLORS","Size","getBorderRadius","flatEdge","radius","tabbedHereStyle","variant","colorTheme","focus_25","focus","accent1_700","primary_100","primary_700","primary_600","white","accent1","primary_800","primary","primary_500","accent1_500","Primary","button","props","size","Large","Bold","Small","width","accent1_800","primary_200","tabbedHere","neutral_100","neutral_300","Secondary","primary_300","Tertiary","accent1_20","primary_20","accent1_100","Correct","correct_500","correct_700","correct_800","Critical","critical_500","critical_700","critical_800","Text","neutral_500","Button","children","type","Medium","imageExtraMargin","testId","disabled","icon","loading","renderProps","supressFocusRef","useRef","setTabbedHere","useState","renderContent","className","e","current","role","title"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,gBAAT,QAAiC,qBAAjC;AACA,SAASC,iBAAT,EAA4BC,iBAA5B,EAA+CC,iBAA/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QAAA,OAAO,EAAGD,CAAD,IAAY;AACnB,cAAI,CAACV,QAAL,EAAe;AACb,gBAAI,CAACI,eAAe,CAACO,OAArB,EAA8BL,aAAa,CAAC,IAAD,CAAb,CAA9B,KACKF,eAAe,CAACO,OAAhB,GAA0B,KAA1B;AACN;AACF,SAjBH;AAkBE,QAAA,MAAM,EAAE,MAAML,aAAa,CAAC,KAAD,CAlB7B;AAmBE,QAAA,UAAU,EAAE/B;AAnBd,uBAoBE;AAAK,QAAA,SAAS,EAAC;AAAf,SAAiCiC,aAAa,EAA9C,CApBF,CADF;AArIJ;AA8JD,CAzLD;;;AAdEzD,EAAAA,O,aAAU,S,EAAY,W,EAAc,U,EAAa,M,EAAS,S,EAAY,U;AAEtE6D,EAAAA,I,4BAAO,Q;AACPC,EAAAA,K;AAEAf,EAAAA,gB;AACA9C,EAAAA,U,aAAa,M,EAAS,M;AACtBoB,EAAAA,K,4BAAQ,M;AACR8B,EAAAA,O;AACAH,EAAAA,M;AACAxB,EAAAA,U;AACA0B,EAAAA,I;;AA8LF,eAAeP,MAAf","sourcesContent":["import * as React from 'react';\nimport styled, { css } from 'styled-components';\nimport { LoadingIndicator } from '../LoadingIndicator';\nimport { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle } from '../styles/typography';\nimport { COLORS, TYPOGRAPHY } from '../styles';\nimport { Size } from '../types';\n\nconst getBorderRadius = (flatEdge : string | undefined, radius: number) => {\n switch(flatEdge)\n {\n case 'left':\n return `0px ${radius}px ${radius}px 0px`;\n \n case 'right':\n return `${radius}px 0px 0px ${radius}px`;\n\n case 'none':\n default:\n return `${radius}px`;\n }\n}\n\n\nconst tabbedHereStyle = (variant: string, colorTheme?: string) => {\n switch (variant) {\n case 'primary':\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n color: ${colorTheme === 'dark' ? COLORS.primary_600 : COLORS.white};\n }\n `;\n case 'secondary':\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${colorTheme === 'dark' ? 'transparent' : COLORS.white};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1 : colorTheme === 'dark' ? COLORS.primary_800 : COLORS.primary};\n color: ${colorTheme === 'dark' ? COLORS.white : COLORS.primary_500};\n }\n `;\n case 'tertiary':\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${COLORS.white};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary};\n color: ${colorTheme === 'teal' ? COLORS.accent1_500 : COLORS.primary_500};\n }\n `;\n\n default:\n return css`\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n background-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n border-color: ${colorTheme === 'teal' ? COLORS.accent1_700 : colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700};\n color: ${colorTheme === 'dark' ? COLORS.primary_500 : COLORS.white};\n }\n `;\n }\n};\n\nconst Primary = styled.button<ButtonProps>`\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n min-height: ${(props) => (props.size === Size.Large ? '56px' : '48px')};\n &.loading-state {\n cursor: wait;\n }\n &:focus:not(:focus-visible),\n &:focus:not(:focus-visible) > div.button-content {\n outline: none !important;\n }\n div.button-content {\n ${(props) =>\n props.size === Size.Large\n ? ComponentLStyling(ComponentTextStyle.Bold, props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)\n : props.size === Size.Small\n ? ComponentSStyling(ComponentTextStyle.Bold, props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)\n : ComponentMStyling(ComponentTextStyle.Bold, props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)};\n\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n border-radius: ${props => getBorderRadius(props.flatEdge, 8)};\n border-width: 2px;\n border-style: solid;\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n\n width: ${(props) => props.width};\n position: relative;\n\n min-height: ${(props) => (props.size === Size.Large ? '56px' : props.size === Size.Small ? '32px' : '40px')};\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n // paddings have -2px for border\n padding: ${(props) => (props.size === Size.Large ? '14px 18px' : props.size === Size.Small ? '4px 10px' : '6px 14px')};\n\n span.loading {\n opacity: 0;\n }\n .icon {\n margin-left: -4px;\n margin-top: -2px;\n margin-bottom: -2px;\n width: ${(props) => (props.size === Size.Large ? '28px' : props.size === Size.Small ? '20px' : '24px')};\n height: ${(props) => (props.size === Size.Large ? '28px' : props.size === Size.Small ? '20px' : '24px')};\n svg {\n width: ${(props) => (props.size === Size.Large ? '28px' : props.size === Size.Small ? '20px' : '24px')} !important;\n height: ${(props) => (props.size === Size.Large ? '28px' : props.size === Size.Small ? '20px' : '24px')} !important;\n }\n }\n\n .extramargin {\n margin-right: 9px;\n }\n\n div {\n position: absolute;\n width: 100%;\n svg {\n height: ${(props) => (props.size === Size.Large ? '28px' : props.size === Size.Small ? '20px' : '24px')};\n width: ${(props) => (props.size === Size.Large ? '28px' : props.size === Size.Small ? '20px' : '24px')};\n path {\n fill: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary : COLORS.white)};\n }\n }\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_100 : COLORS.primary_700)};\n color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_600 : COLORS.white)};\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_800)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_800)};\n box-shadow: none !important;\n color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.white)};\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('primary', props.colorTheme) : '')}\n &.focus-state {\n ${(props) => tabbedHereStyle('primary', props?.colorTheme)};\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.neutral_300)};\n border-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_800 : COLORS.neutral_300)};\n border-color: ${(props) => (props.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n }\n }\n`;\n\nconst Secondary = styled(Primary)<ButtonProps>`\n div.button-content {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary)};\n background-color: transparent;\n div svg path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_700)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : props?.colorTheme === 'dark' ? COLORS.primary_200 : COLORS.primary_700)};\n background-color: transparent;\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n }\n }\n }\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: white;\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_300 : COLORS.primary_800)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.primary_300 : COLORS.primary_800)};\n background-color: transparent;\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : props?.colorTheme === 'dark' ? COLORS.white : COLORS.primary_800)};\n }\n }\n }\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: transparent;\n color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_300)};\n border-color: ${(props) => (props?.colorTheme === 'dark' ? COLORS.primary_700 : COLORS.neutral_100)};\n cursor: not-allowed;\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('secondary', props.colorTheme) : '')}\n &.focus-state {\n ${(props) => tabbedHereStyle('secondary', props?.colorTheme)};\n }\n`;\n\nconst Tertiary = styled(Primary)<ButtonProps>`\n div.button-content {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary_500)};\n border-color: transparent;\n background-color: transparent;\n border-width: 1px;\n div svg path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_20 : COLORS.primary_20)};\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_20 : COLORS.primary_20)};\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n }\n }\n }\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_100 : COLORS.primary_100)};\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : COLORS.primary_800)};\n border-color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_100 : COLORS.primary_100)};\n div {\n svg {\n path {\n fill: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : COLORS.primary_800)};\n }\n }\n }\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: white !important;\n color: ${COLORS.neutral_300};\n border-color: transparent;\n cursor: not-allowed;\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: white !important;\n color: ${COLORS.neutral_300};\n border-color: transparent !important;\n cursor: not-allowed;\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('tertiary', props.colorTheme) : '')}\n &.focus-state {\n ${(props) => tabbedHereStyle('tertiary', props?.colorTheme)};\n }\n`;\n\nconst Correct = styled(Primary)<ButtonProps>`\n div.button-content {\n color: white;\n border-color: ${COLORS.correct_500};\n background-color: ${COLORS.correct_500};\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n border-color: ${COLORS.correct_700};\n background-color: ${COLORS.correct_700};\n }\n &:focus > div.button-content,\n &.focus-state > div.button-content {\n border-color: ${COLORS.correct_700};\n background-color: ${COLORS.correct_700};\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n border-color: ${COLORS.correct_800};\n background-color: ${COLORS.correct_800};\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n }\n }\n`;\n\nconst Critical = styled(Primary)<ButtonProps>`\n div.button-content {\n color: white;\n border-color: ${COLORS.critical_500};\n background-color: ${COLORS.critical_500};\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n border-color: ${COLORS.critical_700};\n background-color: ${COLORS.critical_700};\n }\n &:focus > div.button-content,\n &.focus-state > div.button-content {\n border-color: ${COLORS.critical_700};\n background-color: ${COLORS.critical_700};\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n border-color: ${COLORS.critical_800};\n background-color: ${COLORS.critical_800};\n }\n &:disabled,\n &.disabled-state {\n cursor: not-allowed;\n }\n &:disabled > div.button-content,\n &.disabled-state > div.button-content {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ${COLORS.neutral_100};\n color: ${COLORS.neutral_300};\n border-color: ${COLORS.neutral_100};\n }\n }\n`;\n\nconst Text = styled.button<ButtonProps>`\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n background-color: transparent;\n padding: 0;\n border: none;\n cursor: pointer;\n\n text-decoration: underline;\n ${(props) =>\n props.size === Size.Large\n ? ComponentLStyling(ComponentTextStyle.Bold, props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)\n : props.size === Size.Small\n ? ComponentSStyling(ComponentTextStyle.Bold, props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)\n : ComponentMStyling(ComponentTextStyle.Bold, props.colorTheme === 'teal' ? COLORS.accent1 : COLORS.primary)};\n\n &:hover,\n &:focus,\n &.hover-state,\n &.focus-state {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_700 : COLORS.primary_700)};\n background: transparent;\n }\n &:active,\n &.active-state {\n color: ${(props) => (props.colorTheme === 'teal' ? COLORS.accent1_800 : COLORS.primary_800)};\n background: transparent;\n }\n &:disabled,\n &.disabled-state {\n color: ${COLORS.neutral_500};\n background: transparent;\n cursor: not-allowed;\n }\n`;\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'correct' | 'critical';\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n role?: 'button' | string;\n title?: string;\n size?: Size;\n imageExtraMargin?: boolean;\n colorTheme?: 'teal' | 'dark';\n width?: 'auto' | string;\n loading?: boolean;\n testId?: string;\n tabbedHere?: boolean;\n icon?: React.ReactNode;\n}\n\nconst Button: React.FunctionComponent<ButtonProps> = ({\n children = 'Primary Button',\n variant = 'primary',\n type = 'button',\n size = Size.Medium,\n width = 'auto',\n imageExtraMargin,\n testId,\n disabled,\n flatEdge,\n icon,\n ...props\n}) => {\n // Let's filter out properties that we don't need to render.\n const { loading, ...renderProps } = props;\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const renderContent = () => (\n <>\n {icon && <span className={(imageExtraMargin ? 'extramargin ' : '') + (loading ? 'icon loading' : 'icon')}>{icon}</span>}\n <span className={loading ? 'label loading' : 'label'}>{children}</span>\n {loading && <LoadingIndicator></LoadingIndicator>}\n </>\n );\n\n // Let's render button\n switch (variant) {\n case 'primary':\n return (\n <Primary\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n flatEdge={flatEdge}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Primary>\n );\n case 'secondary':\n return (\n <Secondary\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n flatEdge={flatEdge}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Secondary>\n );\n case 'tertiary':\n return (\n <Tertiary\n {...renderProps}\n disabled={disabled}\n type={type}\n flatEdge={flatEdge}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Tertiary>\n );\n case 'text':\n return (\n <Text {...renderProps} disabled={disabled} type={type} size={size} width={width} data-testid={testId}>\n {children}\n </Text>\n );\n case 'correct':\n return (\n <Correct\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n flatEdge={flatEdge}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Correct>\n );\n case 'critical':\n return (\n <Critical\n {...renderProps}\n disabled={disabled}\n flatEdge={flatEdge}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Critical>\n );\n default:\n return (\n <Primary\n {...renderProps}\n flatEdge={flatEdge}\n disabled={disabled}\n type={type}\n size={size}\n width={width}\n data-testid={testId}\n className={props.loading ? 'loading-state ' + props.className : ' ' + props.className}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}>\n <div className=\"button-content\">{renderContent()}</div>\n </Primary>\n );\n }\n};\n\nexport default Button;\n"],"file":"Button.js"}
@@ -0,0 +1,111 @@
1
+ import _pt from "prop-types";
2
+ const _excluded = ["children", "variant", "type", "size", "width", "testId", "disabled", "id", "dropdownCustomizationProps"],
3
+ _excluded2 = ["loading", "icon", "onClick"];
4
+
5
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
+
7
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
+
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+
11
+ import * as React from 'react';
12
+ import Button from './Button';
13
+ import { ArrowDropDown, ArrowDropUp } from '../icons/systemicons/SystemIcons';
14
+ import { Dropdown } from '../Dropdown/CommonStyling';
15
+ import { Size } from '../types';
16
+ import DropdownContent from '../Dropdown/DropdownContent';
17
+ import styled from 'styled-components';
18
+ const ButtonsContainer = styled.div`
19
+ display: flex;
20
+ align-items: center;
21
+
22
+ button:first-child {
23
+ margin-right: 2px;
24
+ }
25
+
26
+ .extramargin {
27
+ margin-right: 9px;
28
+ }
29
+
30
+ div.button-content {
31
+ gap: 0px;
32
+ padding: ${props => props.size == Size.Large ? '4px 10px' : props.size == Size.Medium ? '4px 8px' : '4px 6px'};
33
+ }
34
+ `;
35
+
36
+ const DualFunctionButton = _ref => {
37
+ let {
38
+ children = 'Primary Button',
39
+ variant = 'primary',
40
+ type = 'button',
41
+ size = Size.Medium,
42
+ width = 'auto',
43
+ testId,
44
+ disabled,
45
+ id,
46
+ dropdownCustomizationProps
47
+ } = _ref,
48
+ props = _objectWithoutProperties(_ref, _excluded);
49
+
50
+ // Let's filter out properties that we don't need to render.
51
+ const {
52
+ loading,
53
+ icon,
54
+ onClick
55
+ } = props,
56
+ renderProps = _objectWithoutProperties(props, _excluded2);
57
+
58
+ const [isOpen, setIsOpen] = React.useState(false);
59
+ const [selectedValues, setSelectedValues] = React.useState([]);
60
+ return /*#__PURE__*/React.createElement(ButtonsContainer, {
61
+ size: size
62
+ }, /*#__PURE__*/React.createElement(Dropdown, {
63
+ isButton: true,
64
+ locked: false,
65
+ disabled: false,
66
+ margin: ""
67
+ }, /*#__PURE__*/React.createElement(Button, _extends({}, renderProps, {
68
+ onClick: onClick,
69
+ disabled: disabled,
70
+ type: type,
71
+ imageExtraMargin: true,
72
+ loading: loading,
73
+ icon: icon,
74
+ size: size,
75
+ width: width,
76
+ variant: variant,
77
+ flatEdge: "right"
78
+ }), children), /*#__PURE__*/React.createElement(DropdownContent, {
79
+ customizationProps: dropdownCustomizationProps,
80
+ filter: "",
81
+ selectedValues: dropdownCustomizationProps.itemsType == 'normal' ? [] : selectedValues,
82
+ setSelectedValues: setSelectedValues,
83
+ isButton: true,
84
+ setIsOpen: setIsOpen,
85
+ hideOnClickOutside: true,
86
+ size: size,
87
+ isOpen: isOpen,
88
+ id: id ?? 'dropdownId',
89
+ messageOnNoResults: "",
90
+ alignLeft: true
91
+ })), /*#__PURE__*/React.createElement(Button, _extends({
92
+ variant: variant
93
+ }, renderProps, {
94
+ disabled: disabled,
95
+ type: type,
96
+ size: size,
97
+ onClick: () => setIsOpen(!isOpen),
98
+ icon: isOpen ? /*#__PURE__*/React.createElement(ArrowDropUp, {
99
+ size: "16px"
100
+ }) : /*#__PURE__*/React.createElement(ArrowDropDown, {
101
+ size: "16px"
102
+ }),
103
+ flatEdge: "left"
104
+ }), /*#__PURE__*/React.createElement("span", null)));
105
+ };
106
+
107
+ DualFunctionButton.propTypes = {
108
+ isButton: _pt.bool.isRequired
109
+ };
110
+ export default DualFunctionButton;
111
+ //# sourceMappingURL=DualFunctionButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Button/DualFunctionButton.tsx"],"names":["React","Button","ArrowDropDown","ArrowDropUp","Dropdown","Size","DropdownContent","styled","ButtonsContainer","div","props","size","Large","Medium","DualFunctionButton","children","variant","type","width","testId","disabled","id","dropdownCustomizationProps","loading","icon","onClick","renderProps","isOpen","setIsOpen","useState","selectedValues","setSelectedValues","itemsType","isButton"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,MAAP,MAAoC,UAApC;AACA,SAASC,aAAT,EAAwBC,WAAxB,QAA2C,kCAA3C;AACA,SAASC,QAAT,QAAyB,2BAAzB;AACA,SAASC,IAAT,QAAqB,UAArB;AACA,OAAOC,eAAP,MAA4D,6BAA5D;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AAEA,MAAMC,gBAAgB,GAAGD,MAAM,CAACE,GAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAgBC,KAAK,IAAIA,KAAK,CAACC,IAAN,IAAcN,IAAI,CAACO,KAAnB,GAA2B,UAA3B,GAAwCF,KAAK,CAACC,IAAN,IAAcN,IAAI,CAACQ,MAAnB,GAA4B,SAA5B,GAAwC,SAAW;AACpH;AACA,CAhBA;;AA2BA,MAAMC,kBAA4D,GAAG,QAW/D;AAAA,MAXgE;AACpEC,IAAAA,QAAQ,GAAG,gBADyD;AAEpEC,IAAAA,OAAO,GAAG,SAF0D;AAGpEC,IAAAA,IAAI,GAAG,QAH6D;AAIpEN,IAAAA,IAAI,GAAGN,IAAI,CAACQ,MAJwD;AAKpEK,IAAAA,KAAK,GAAG,MAL4D;AAMpEC,IAAAA,MANoE;AAOpEC,IAAAA,QAPoE;AAQpEC,IAAAA,EARoE;AASpEC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P1B;AAQM,IAAA,IAAI,EAAEjB,IARZ;AASM,IAAA,MAAM,EAAEgB,MATd;AAUM,IAAA,EAAE,EAAEN,EAAE,IAAI,YAVhB;AAWM,IAAA,kBAAkB,EAAC,EAXzB;AAYM,IAAA,SAAS,EAAE;AAZjB,IAfJ,CADC,eA8BD,oBAAC,MAAD;AAAQ,IAAA,OAAO,EAAEL;AAAjB,KACIU,WADJ;AAEA,IAAA,QAAQ,EAAEN,QAFV;AAGA,IAAA,IAAI,EAAEH,IAHN;AAIA,IAAA,IAAI,EAAEN,IAJN;AAKA,IAAA,OAAO,EAAE,MAAMiB,SAAS,CAAC,CAACD,MAAF,CALxB;AAMA,IAAA,IAAI,EAAEA,MAAM,gBAAG,oBAAC,WAAD;AAAa,MAAA,IAAI,EAAC;AAAlB,MAAH,gBAAiC,oBAAC,aAAD;AAAe,MAAA,IAAI,EAAC;AAApB,MAN7C;AAOA,IAAA,QAAQ,EAAC;AAPT,mBAOgB,iCAPhB,CA9BC,CAAP;AAuCD,CAxDH;;;AAJEM,EAAAA,Q;;AA+DF,eAAenB,kBAAf","sourcesContent":["import * as React from 'react';\nimport { LoadingIndicator } from '../LoadingIndicator';\nimport Button, { ButtonProps } from './Button'\nimport { ArrowDropDown, ArrowDropUp } from '../icons/systemicons/SystemIcons';\nimport { Dropdown } from '../Dropdown/CommonStyling';\nimport { Size } from '../types';\nimport DropdownContent, { DropdownCustomizationProps } from '../Dropdown/DropdownContent';\nimport styled from 'styled-components';\n\nconst ButtonsContainer = styled.div<{ size?: Size }>`\n display: flex;\n align-items: center;\n\n button:first-child {\n margin-right: 2px;\n }\n\n .extramargin {\n margin-right: 9px;\n }\n\n div.button-content {\n gap: 0px;\n padding: ${ props => props.size == Size.Large ? '4px 10px' : props.size == Size.Medium ? '4px 8px' : '4px 6px' };\n }\n`;\n\nexport interface ButtonOption {\n label: string;\n}\n\nexport interface DualButtonProps extends ButtonProps {\n isButton: boolean;\n dropdownCustomizationProps: DropdownCustomizationProps;\n}\n\nconst DualFunctionButton: React.FunctionComponent<DualButtonProps> = ({\n children = 'Primary Button',\n variant = 'primary',\n type = 'button',\n size = Size.Medium,\n width = 'auto',\n testId,\n disabled,\n id,\n dropdownCustomizationProps,\n ...props\n}) => {\n // Let's filter out properties that we don't need to render.\n const { loading, icon, onClick, ...renderProps } = props;\n const [isOpen, setIsOpen] = React.useState<boolean>(false);\n const [selectedValues, setSelectedValues] = React.useState<string[]>([]);\n\n return <ButtonsContainer size={size}>\n <Dropdown isButton={true} locked={false} disabled={false} margin=''>\n <Button\n {...renderProps}\n onClick={onClick}\n disabled={disabled}\n type={type}\n imageExtraMargin={true}\n loading={loading}\n icon={icon}\n size={size}\n width={width}\n variant={variant}\n flatEdge=\"right\">\n {children}\n </Button>\n <DropdownContent\n customizationProps={dropdownCustomizationProps}\n filter=''\n selectedValues={dropdownCustomizationProps.itemsType == 'normal' ? [] : selectedValues}\n setSelectedValues={setSelectedValues}\n isButton={true}\n setIsOpen={setIsOpen}\n hideOnClickOutside={true}\n size={size}\n isOpen={isOpen}\n id={id ?? 'dropdownId'}\n messageOnNoResults=''\n alignLeft={true} />\n </Dropdown>\n <Button variant={variant}\n {...renderProps}\n disabled={disabled}\n type={type}\n size={size}\n onClick={() => setIsOpen(!isOpen)}\n icon={isOpen ? <ArrowDropUp size=\"16px\" /> : <ArrowDropDown size=\"16px\"/>}\n flatEdge=\"left\"><span/></Button>\n </ButtonsContainer>;\n };\n\n\nexport default DualFunctionButton;\n"],"file":"DualFunctionButton.js"}
@@ -32,6 +32,24 @@ const tabbedHereStyle = (variant, tabbedHereBackgroundColor) => {
32
32
  }
33
33
  };
34
34
 
35
+ const getBorderRadius = props => props.borderRadius ? `${props.borderRadius}px` : '4px';
36
+
37
+ const getBorderRadiusStyle = props => {
38
+ const radius = getBorderRadius(props);
39
+
40
+ switch (props.flatEdge) {
41
+ case 'left':
42
+ return `0px ${radius} ${radius} 0px`;
43
+
44
+ case 'right':
45
+ return `${radius} 0px 0px ${radius}`;
46
+
47
+ case 'none':
48
+ default:
49
+ return `${radius}`;
50
+ }
51
+ };
52
+
35
53
  const StyledIconButton = styled.button`
36
54
  border-width: 0;
37
55
  cursor: pointer;
@@ -48,7 +66,7 @@ const StyledIconButton = styled.button`
48
66
  div {
49
67
  height: 36px;
50
68
  width: 36px;
51
- border-radius: ${props => props.borderRadius ? `${props.borderRadius}px` : '4px'};
69
+ border-radius: ${getBorderRadiusStyle};
52
70
  display: flex;
53
71
  justify-content: center;
54
72
  align-items: center;
@@ -176,6 +194,7 @@ const IconButton = ({
176
194
  iconColor,
177
195
  unsetIconSize,
178
196
  tabIndex,
197
+ flatEdge,
179
198
  borderRadius,
180
199
  onKeyPress,
181
200
  tabbedHereBackgroundColor,
@@ -231,6 +250,7 @@ const IconButton = ({
231
250
  id: id,
232
251
  type: type ?? 'button',
233
252
  "data-testid": id,
253
+ flatEdge: flatEdge,
234
254
  onClick: event => action(event),
235
255
  onKeyDown: e => isPressingEnter(e) ? action() : null,
236
256
  disabled: disabled,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Button/Iconbutton.tsx"],"names":["React","styled","css","BREAKPOINTS","COLORS","tabbedHereStyle","variant","tabbedHereBackgroundColor","primary_500","neutral_600","primary_700","white","StyledIconButton","button","props","hideOnLowWidth","MEDIUM","borderRadius","unsetIconSize","StyledPrimaryIconButton","useTransparentBackground","iconColor","primary_800","neutral_200","tabbedHere","StyledSecondaryIconButton","primary_20","primary_100","neutral_300","IconButton","id","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","type","supressFocusRef","useRef","setTabbedHere","useState","isPressingEnter","e","key","preventDefault","stopPropagation","event","current"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AAEA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,WAApC;;AAcA,MAAMC,eAAe,GAAG,CAACC,OAAD,EAAkBC,yBAAlB,KA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Af,EAAAA,wB;AACAC,EAAAA,S;AACAH,EAAAA,a;AACAkB,EAAAA,Q;AACAnB,EAAAA,Y;AACAoB,EAAAA,U;AACA9B,EAAAA,yB;;AAwGF,eAAesB,UAAf","sourcesContent":["import * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n tabbedHere?: boolean;\n tabbedHereBackgroundColor?: string;\n}\n\nconst tabbedHereStyle = (variant: string, tabbedHereBackgroundColor?: string) => {\n switch (variant) {\n case 'secondary':\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || 'transparent'} !important;\n box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ${COLORS.neutral_600};\n }\n `;\n case 'primary':\n default:\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || COLORS.primary_700} !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n `;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none;\n }\n }\n`;\n\nconst StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('primary', props.tabbedHereBackgroundColor) : '')};\n`;\n\nconst StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n ${(props) => (props.tabbedHere ? tabbedHereStyle('secondary', props.tabbedHereBackgroundColor) : '')};\n`;\n\ntype Props = {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n tabbedHereBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n};\n\nconst IconButton: React.FunctionComponent<Props> = ({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n borderRadius,\n onKeyPress,\n tabbedHereBackgroundColor,\n type,\n}): React.ReactElement<Props> => {\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n};\n\nexport default IconButton;\n"],"file":"Iconbutton.js"}
1
+ {"version":3,"sources":["../../../src/Button/Iconbutton.tsx"],"names":["React","styled","css","BREAKPOINTS","COLORS","tabbedHereStyle","variant","tabbedHereBackgroundColor","primary_500","neutral_600","primary_700","white","getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","StyledIconButton","button","hideOnLowWidth","MEDIUM","unsetIconSize","StyledPrimaryIconButton","useTransparentBackground","iconColor","primary_800","neutral_200","tabbedHere","StyledSecondaryIconButton","primary_20","primary_100","neutral_300","IconButton","id","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","type","supressFocusRef","useRef","setTabbedHere","useState","isPressingEnter","e","key","preventDefault","stopPropagation","event","current"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,IAAiBC,GAAjB,Q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EAAGL,CAAD,IAAY;AACnB,cAAI,CAACT,QAAL,EAAe;AACb,gBAAI,CAACI,eAAe,CAACU,OAArB,EAA8BR,aAAa,CAAC,IAAD,CAAb,CAA9B,KACKF,eAAe,CAACU,OAAhB,GAA0B,KAA1B;AACN;AACF,SAvBH;AAwBE,QAAA,MAAM,EAAE,MAAMR,aAAa,CAAC,KAAD,CAxB7B;AAyBE,QAAA,UAAU,EAAEjB,UAzBd;AA0BE,QAAA,UAAU,EAAEa,UA1Bd;AA2BE,QAAA,yBAAyB,EAAElC;AA3B7B,sBA4BE,iCAAM+B,QAAN,CA5BF,CADF;AAnCJ;AAoED,CApGD;;;AAlBEJ,EAAAA,E;AACA5B,EAAAA,O,aAAU,S,EAAY,W;AACtB6B,EAAAA,K,aAAQ,Q,EAAW,U;AACnBC,EAAAA,M;AACAhB,EAAAA,c;AAEAiB,EAAAA,c;AACAE,EAAAA,Q;AACAf,EAAAA,wB;AACAC,EAAAA,S;AACAH,EAAAA,a;AACAkB,EAAAA,Q;AACA1B,EAAAA,Y;AACA2B,EAAAA,U;AACAlC,EAAAA,yB;;AA0GF,eAAe0B,UAAf","sourcesContent":["import * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n tabbedHere?: boolean;\n tabbedHereBackgroundColor?: string;\n}\n\nconst tabbedHereStyle = (variant: string, tabbedHereBackgroundColor?: string) => {\n switch (variant) {\n case 'secondary':\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || 'transparent'} !important;\n box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ${COLORS.neutral_600};\n }\n `;\n case 'primary':\n default:\n return css`\n div {\n background-color: ${tabbedHereBackgroundColor || COLORS.primary_700} !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n `;\n }\n};\n\nconst getBorderRadius = (props:HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px'); \n\nconst getBorderRadiusStyle = (props:HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch(props.flatEdge)\n {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n \n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none;\n }\n }\n`;\n\nconst StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n ${(props) => (props.tabbedHere ? tabbedHereStyle('primary', props.tabbedHereBackgroundColor) : '')};\n`;\n\nconst StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n ${(props) => (props.tabbedHere ? tabbedHereStyle('secondary', props.tabbedHereBackgroundColor) : '')};\n`;\n\ntype Props = {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n tabbedHereBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n};\n\nconst IconButton: React.FunctionComponent<Props> = ({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n onKeyPress,\n tabbedHereBackgroundColor,\n type,\n}): React.ReactElement<Props> => {\n const supressFocusRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n flatEdge={flatEdge}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => action(event)}\n onKeyDown={(e: any) => (isPressingEnter(e) ? action() : null)}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={(e: any) => {\n if (!disabled && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!disabled) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n onBlur={() => setTabbedHere(false)}\n tabbedHere={tabbedHere}\n onKeyPress={onKeyPress}\n tabbedHereBackgroundColor={tabbedHereBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n};\n\nexport default IconButton;\n"],"file":"Iconbutton.js"}
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import { Button } from '../index';
4
4
  import 'jest-styled-components';
5
+ import { Size } from '../..';
5
6
  describe('<Button />', () => {
6
7
  it('Renders primary button', async () => {
7
8
  const {
@@ -10,7 +11,7 @@ describe('<Button />', () => {
10
11
  } = render( /*#__PURE__*/React.createElement(Button, {
11
12
  variant: "primary",
12
13
  testId: "TestButton",
13
- size: "big"
14
+ size: Size.Large
14
15
  }, "TestButton"));
15
16
  expect(queryByText('TestButton')).toBeDefined();
16
17
  /*expect(getByTestId('TestButton')).toHaveStyleRule('background-color', COLORS.primary);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/Button/__tests__/Button.test.tsx"],"names":["React","render","Button","describe","it","queryByText","getByTestId","expect","toBeDefined"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,QAAuB,wBAAvB;AACA,SAASC,MAAT,QAAuB,UAAvB;AACA,OAAO,wBAAP;AAGAC,QAAQ,CAAC,YAAD,EAAe,MAAM;AAC3BC,EAAAA,EAAE,CAAC,wBAAD,EAA2B,YAAY;AACvC,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,QAA+BL,MAAM,eACzC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC,SAAhB;AAA0B,MAAA,MAAM,EAAC,YAAjC;AAA8C,MAAA,IAAI,EAAC;AAAnD,oBADyC,CAA3C;AAKAM,IAAAA,MAAM,CAACF,WAAW,CAAC,YAAD,CAAZ,CAAN,CAAkCG,WAAlC;AACA;AACJ;AACA;AACG,GAVC,CAAF;AAWAJ,EAAAA,EAAE,CAAC,0BAAD,EAA6B,YAAY;AACzC,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,QAA+BL,MAAM,eACzC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC,WAAhB;AAA4B,MAAA,MAAM,EAAC;AAAnC,oBADyC,CAA3C;AAKAM,IAAAA,MAAM,CAACF,WAAW,CAAC,YAAD,CAAZ,CAAN,CAAkCG,WAAlC;AACA;AACJ;AACA;AACG,GAVC,CAAF;AAWAJ,EAAAA,EAAE,CAAC,yBAAD,EAA4B,YAAY;AACxC,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,QAA+BL,MAAM,eACzC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC,UAAhB;AAA2B,MAAA,MAAM,EAAC;AAAlC,oBADyC,CAA3C;AAKAM,IAAAA,MAAM,CAACF,WAAW,CAAC,YAAD,CAAZ,CAAN,CAAkCG,WAAlC;AACA;AACJ;AACA;AACG,GAVC,CAAF;AAWD,CAlCO,CAAR","sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Button } from '../index';\nimport 'jest-styled-components';\nimport { COLORS } from '../../styles';\n\ndescribe('<Button />', () => {\n it('Renders primary button', async () => {\n const { queryByText, getByTestId } = render(\n <Button variant=\"primary\" testId=\"TestButton\" size=\"big\">\n TestButton\n </Button>,\n );\n expect(queryByText('TestButton')).toBeDefined();\n /*expect(getByTestId('TestButton')).toHaveStyleRule('background-color', COLORS.primary);\n expect(getByTestId('TestButton')).toHaveStyleRule('cursor', 'pointer');\n expect(getByTestId('TestButton')).toHaveStyleRule('color', 'white');*/\n });\n it('Renders secondary button', async () => {\n const { queryByText, getByTestId } = render(\n <Button variant=\"secondary\" testId=\"TestButton\">\n TestButton\n </Button>,\n );\n expect(queryByText('TestButton')).toBeDefined();\n /*expect(getByTestId('TestButton')).toHaveStyleRule('color', COLORS.primary);\n expect(getByTestId('TestButton')).toHaveStyleRule('border-color', COLORS.primary);\n expect(getByTestId('TestButton')).toHaveStyleRule('background-color', 'white');*/\n });\n it('Renders tertiary button', async () => {\n const { queryByText, getByTestId } = render(\n <Button variant=\"tertiary\" testId=\"TestButton\">\n TestButton\n </Button>,\n );\n expect(queryByText('TestButton')).toBeDefined();\n /*expect(getByTestId('TestButton')).toHaveStyleRule('background-color', 'white');\n expect(getByTestId('TestButton')).toHaveStyleRule('border-color', COLORS.neutral_100);\n expect(getByTestId('TestButton')).toHaveStyleRule('color', COLORS.primary);*/\n });\n});\n"],"file":"Button.test.js"}
1
+ {"version":3,"sources":["../../../../src/Button/__tests__/Button.test.tsx"],"names":["React","render","Button","Size","describe","it","queryByText","getByTestId","Large","expect","toBeDefined"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,QAAuB,wBAAvB;AACA,SAASC,MAAT,QAAuB,UAAvB;AACA,OAAO,wBAAP;AAEA,SAASC,IAAT,QAAqB,OAArB;AAEAC,QAAQ,CAAC,YAAD,EAAe,MAAM;AAC3BC,EAAAA,EAAE,CAAC,wBAAD,EAA2B,YAAY;AACvC,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,QAA+BN,MAAM,eACzC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC,SAAhB;AAA0B,MAAA,MAAM,EAAC,YAAjC;AAA8C,MAAA,IAAI,EAAEE,IAAI,CAACK;AAAzD,oBADyC,CAA3C;AAKAC,IAAAA,MAAM,CAACH,WAAW,CAAC,YAAD,CAAZ,CAAN,CAAkCI,WAAlC;AACA;AACJ;AACA;AACG,GAVC,CAAF;AAWAL,EAAAA,EAAE,CAAC,0BAAD,EAA6B,YAAY;AACzC,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,QAA+BN,MAAM,eACzC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC,WAAhB;AAA4B,MAAA,MAAM,EAAC;AAAnC,oBADyC,CAA3C;AAKAQ,IAAAA,MAAM,CAACH,WAAW,CAAC,YAAD,CAAZ,CAAN,CAAkCI,WAAlC;AACA;AACJ;AACA;AACG,GAVC,CAAF;AAWAL,EAAAA,EAAE,CAAC,yBAAD,EAA4B,YAAY;AACxC,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,QAA+BN,MAAM,eACzC,oBAAC,MAAD;AAAQ,MAAA,OAAO,EAAC,UAAhB;AAA2B,MAAA,MAAM,EAAC;AAAlC,oBADyC,CAA3C;AAKAQ,IAAAA,MAAM,CAACH,WAAW,CAAC,YAAD,CAAZ,CAAN,CAAkCI,WAAlC;AACA;AACJ;AACA;AACG,GAVC,CAAF;AAWD,CAlCO,CAAR","sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\nimport { Button } from '../index';\nimport 'jest-styled-components';\nimport { COLORS } from '../../styles';\nimport { Size } from '../..';\n\ndescribe('<Button />', () => {\n it('Renders primary button', async () => {\n const { queryByText, getByTestId } = render(\n <Button variant=\"primary\" testId=\"TestButton\" size={Size.Large}>\n TestButton\n </Button>,\n );\n expect(queryByText('TestButton')).toBeDefined();\n /*expect(getByTestId('TestButton')).toHaveStyleRule('background-color', COLORS.primary);\n expect(getByTestId('TestButton')).toHaveStyleRule('cursor', 'pointer');\n expect(getByTestId('TestButton')).toHaveStyleRule('color', 'white');*/\n });\n it('Renders secondary button', async () => {\n const { queryByText, getByTestId } = render(\n <Button variant=\"secondary\" testId=\"TestButton\">\n TestButton\n </Button>,\n );\n expect(queryByText('TestButton')).toBeDefined();\n /*expect(getByTestId('TestButton')).toHaveStyleRule('color', COLORS.primary);\n expect(getByTestId('TestButton')).toHaveStyleRule('border-color', COLORS.primary);\n expect(getByTestId('TestButton')).toHaveStyleRule('background-color', 'white');*/\n });\n it('Renders tertiary button', async () => {\n const { queryByText, getByTestId } = render(\n <Button variant=\"tertiary\" testId=\"TestButton\">\n TestButton\n </Button>,\n );\n expect(queryByText('TestButton')).toBeDefined();\n /*expect(getByTestId('TestButton')).toHaveStyleRule('background-color', 'white');\n expect(getByTestId('TestButton')).toHaveStyleRule('border-color', COLORS.neutral_100);\n expect(getByTestId('TestButton')).toHaveStyleRule('color', COLORS.primary);*/\n });\n});\n"],"file":"Button.test.js"}
@@ -1,4 +1,5 @@
1
1
  export { default as IconButton } from './Iconbutton';
2
2
  export { default as Button } from './Button';
3
3
  export { default as BackButton } from './BackButton';
4
+ export { default as Anchor } from './Anchor';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Button/index.ts"],"names":["default","IconButton","Button","BackButton"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAApB,QAAsC,cAAtC;AACA,SAASD,OAAO,IAAIE,MAApB,QAAkC,UAAlC;AACA,SAASF,OAAO,IAAIG,UAApB,QAAsC,cAAtC","sourcesContent":["export { default as IconButton } from './Iconbutton';\nexport { default as Button } from './Button';\nexport { default as BackButton } from './BackButton';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/Button/index.ts"],"names":["default","IconButton","Button","BackButton","Anchor"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAApB,QAAsC,cAAtC;AACA,SAASD,OAAO,IAAIE,MAApB,QAAkC,UAAlC;AACA,SAASF,OAAO,IAAIG,UAApB,QAAsC,cAAtC;AACA,SAASH,OAAO,IAAII,MAApB,QAAkC,UAAlC","sourcesContent":["export { default as IconButton } from './Iconbutton';\nexport { default as Button } from './Button';\nexport { default as BackButton } from './BackButton';\nexport { default as Anchor } from './Anchor';\n"],"file":"index.js"}