@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
@@ -25,7 +25,7 @@ var _typography = require("../styles/typography");
25
25
 
26
26
  var _HyperLink = require("../HyperLink");
27
27
 
28
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
28
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
 
@@ -62,11 +62,13 @@ var BannerCenter = _styledComponents.default.div(_templateObject2 || (_templateO
62
62
  return (0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, props.color);
63
63
  }, _styles.BREAKPOINTS.MEDIUM, _styles.BREAKPOINTS.LARGE);
64
64
 
65
- var ButtonWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 0 0 0 auto;\n ", ";\n"])), function (props) {
65
+ var ButtonWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 0 0 0 auto;\n"])));
66
+
67
+ var ButtonContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: contents;\n ", ";\n"])), function (props) {
66
68
  return props.type ? (0, _styles2.getButtonStyle)(props.type) : null;
67
69
  });
68
70
 
69
- var BannerContentWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n"])));
71
+ var BannerContentWrapper = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n"])));
70
72
 
71
73
  var Banner = function Banner(_ref) {
72
74
  var size = _ref.size,
@@ -116,7 +118,7 @@ var Banner = function Banner(_ref) {
116
118
  id: "".concat(Math.floor(Math.random() * 999999999999), "_BannerLink"),
117
119
  href: link,
118
120
  variant: "default"
119
- }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
121
+ }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
120
122
  type: formatTypeToLowerCase
121
123
  }, /*#__PURE__*/React.createElement(_Button.IconButton, {
122
124
  variant: "secondary",
@@ -129,7 +131,7 @@ var Banner = function Banner(_ref) {
129
131
  }, /*#__PURE__*/React.createElement(_SystemIcons.Close, {
130
132
  color: _styles.COLORS.warning_500,
131
133
  size: "24px"
132
- })))));
134
+ }))))));
133
135
 
134
136
  case 'critical':
135
137
  return /*#__PURE__*/React.createElement(BannerContainer, {
@@ -153,7 +155,7 @@ var Banner = function Banner(_ref) {
153
155
  id: "".concat(Math.floor(Math.random() * 999999999999), "_BannerLink"),
154
156
  href: link,
155
157
  variant: "default"
156
- }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
158
+ }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
157
159
  type: formatTypeToLowerCase
158
160
  }, /*#__PURE__*/React.createElement(_Button.IconButton, {
159
161
  variant: "secondary",
@@ -166,7 +168,7 @@ var Banner = function Banner(_ref) {
166
168
  }, /*#__PURE__*/React.createElement(_SystemIcons.Close, {
167
169
  color: _styles.COLORS.critical_500,
168
170
  size: "24px"
169
- })))));
171
+ }))))));
170
172
 
171
173
  case 'positive':
172
174
  return /*#__PURE__*/React.createElement(BannerContainer, {
@@ -190,7 +192,7 @@ var Banner = function Banner(_ref) {
190
192
  id: "".concat(Math.floor(Math.random() * 999999999999), "_BannerLink"),
191
193
  href: link,
192
194
  variant: "default"
193
- }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
195
+ }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
194
196
  type: formatTypeToLowerCase
195
197
  }, /*#__PURE__*/React.createElement(_Button.IconButton, {
196
198
  variant: "secondary",
@@ -203,7 +205,7 @@ var Banner = function Banner(_ref) {
203
205
  }, /*#__PURE__*/React.createElement(_SystemIcons.Close, {
204
206
  color: _styles.COLORS.correct_500,
205
207
  size: "24px"
206
- })))));
208
+ }))))));
207
209
 
208
210
  default:
209
211
  return /*#__PURE__*/React.createElement(BannerContainer, {
@@ -227,7 +229,7 @@ var Banner = function Banner(_ref) {
227
229
  id: "".concat(Math.floor(Math.random() * 999999999999), "_BannerLink"),
228
230
  href: link,
229
231
  variant: "default"
230
- }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, {
232
+ }, linkText))), onClose && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonContainer, {
231
233
  type: "neutral"
232
234
  }, /*#__PURE__*/React.createElement(_Button.IconButton, {
233
235
  variant: "secondary",
@@ -240,7 +242,7 @@ var Banner = function Banner(_ref) {
240
242
  }, /*#__PURE__*/React.createElement(_SystemIcons.Close, {
241
243
  color: _styles.COLORS.primary_500,
242
244
  size: "24px"
243
- })))));
245
+ }))))));
244
246
  }
245
247
  };
246
248
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["BannerContainer","styled","div","props","type","COLORS","correct_100","black","bottom","BREAKPOINTS","MEDIUM","LARGE","link","BannerCenter","ComponentTextStyle","Regular","color","ButtonWrapper","BannerContentWrapper","Banner","size","children","testId","linkText","onClose","icon","noIcon","React","useState","window","innerWidth","width","setWidth","useEffect","handleResize","addEventListener","formatTypeToLowerCase","toLowerCase","warning_100","warning_700","warning_20","Math","floor","random","white","warning_500","critical_100","critical_700","critical_20","critical_500","correct_700","correct_20","correct_500","primary_100","primary_700","primary_20","primary_500","hover"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,8gBACL,UAACC,KAAD;AAAA,SAAyBA,KAAK,CAACC,IAAN,GAAaD,KAAK,CAACC,IAAnB,GAA0BC,eAAOC,WAA1D;AAAA,CADK,EAIVD,eAAOE,KAJG,EAKL,UAACJ,KAAD;AAAA,SAAyBA,KAAK,CAACK,MAAN,GAAe,MAAf,GAAwB,GAAjD;AAAA,CALK,EAUfC,oBAAYC,MAVG,EAafD,oBAAYE,KAbG,EA4BR,UAACR,KAAD;AAAA,SAAwBA,KAAK,CAACS,IAA9B;AAAA,CA5BQ,CAArB;;AAgCA,IAAMC,YAAY,GAAGZ,0BAAOC,GAAV,yaACd,UAACC,KAAD;AAAA,SAAW,mCAAkBW,2BAAmBC,OAArC,EAA8CZ,KAAK,CAACa,KAApD,CAAX;AAAA,CADc,EAMdP,oBAAYC,MANE,EASdD,oBAAYE,KATE,CAAlB;;AA4BA,IAAMM,aAAa,GAAGhB,0BAAOC,GAAV,0GAEf,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,GAAa,6BAAeD,KAAK,CAACC,IAArB,CAAb,GAA0C,IAAtD;AAAA,CAFe,CAAnB;;AAKA,IAAMc,oBAAoB,GAAGjB,0BAAOC,GAAV,2LAA1B;;AAsBA,IAAMiB,MAA4C,GAAG,SAA/CA,MAA+C,OAAqF;AAAA,MAAlFC,IAAkF,QAAlFA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Ac,EAAAA,M;AACAG,EAAAA,I;AACAD,EAAAA,O;AACAE,EAAAA,M;;eAqHaP,M","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../styles';\nimport {Close, Help, TechnicalWarning, ThumbsUp, Tip} from '../icons/systemicons/SystemIcons';\nimport {IconButton} from '../Button';\nimport {getButtonStyle} from './styles';\nimport {ComponentMStyling, ComponentResponsive} from '../styles/typography';\nimport {HyperLink} from '../HyperLink';\n\n/**\n * Styles for <Banner />\n */\nconst BannerContainer = styled.div<BannerProps>`\n background: ${(props: BannerProps) => (props.type ? props.type : COLORS.correct_100)};\n min-height: 48px;\n display: flex;\n color: ${COLORS.black};\n margin-top: ${(props: BannerProps) => (props.bottom ? 'auto' : '0')};\n\n button:last-child {\n line-height: 0;\n margin: 0 0 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 0 0 16px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 0 0 32px;\n }\n &.small {\n margin: 0 0 0 8px;\n }\n &.medium {\n margin: 0 0 0 16px;\n }\n &.large {\n margin: 0 0 0 32px;\n }\n }\n\n a {\n color: ${(props: BannerProps) => props.link} !important;\n }\n`;\n\nconst BannerCenter = styled.div`\n ${(props) => ComponentMStyling(ComponentTextStyle.Regular, props.color)}\n \n display: flex;\n width: 100%;\n margin: 0 0 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 16px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 40px 0 56px;\n }\n &.small {\n margin: 0 0 0 16px;\n }\n &.medium {\n margin: 0 16px 0 32px;\n }\n &.large {\n margin: 0 40px 0 56px;\n }\n\n > svg {\n flex-shrink: 0;\n margin: 12px 0;\n }\n`;\n\nconst ButtonWrapper = styled.div<{ type?: string }>`\n margin: 0 0 0 auto;\n ${(props) => (props.type ? getButtonStyle(props.type) : null)};\n`;\n\nconst BannerContentWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n`;\n\ntype BannerProps = {\n size?: 'small' | 'medium' | 'large';\n type?: string;\n link?: string;\n linkText?: string;\n hover?: string;\n bottom?: boolean;\n testId?: string;\n icon?: React.ReactNode;\n onClose?: () => void;\n noIcon?: boolean;\n};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ size, type, children, bottom, testId, linkText, link, onClose, icon, noIcon }) => {\n const [width, setWidth] = React.useState<number>(window.innerWidth);\n React.useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n window.addEventListener('resize', handleResize);\n });\n\n const formatTypeToLowerCase = type?.toLowerCase();\n switch (formatTypeToLowerCase) {\n case 'warning':\n return (\n <BannerContainer data-testid={testId} type={COLORS.warning_100} link={COLORS.warning_700} hover={COLORS.warning_20} bottom={bottom}>\n <BannerCenter color={COLORS.warning_700} className={size}>\n {icon ? icon : noIcon ? null : <Help color={COLORS.warning_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.warning_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'critical':\n return (\n <BannerContainer data-testid={testId} type={COLORS.critical_100} link={COLORS.critical_700} hover={COLORS.critical_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.critical_700} className={size}>\n {icon ? icon : noIcon ? null : <TechnicalWarning color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.critical_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'positive':\n return (\n <BannerContainer data-testid={testId} type={COLORS.correct_100} link={COLORS.correct_700} hover={COLORS.correct_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.correct_700} className={size}>\n {icon ? icon : noIcon ? null : <ThumbsUp color={COLORS.correct_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.correct_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n default:\n return (\n <BannerContainer data-testid={testId} type={COLORS.primary_100} link={COLORS.primary_700} hover={COLORS.primary_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.primary_700} className={size}>\n {icon ? icon : noIcon ? null : <Tip color={COLORS.primary_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.primary_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </IconButton>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n }\n};\n\nexport default Banner;\n"],"file":"Banner.js"}
1
+ {"version":3,"sources":["../../../src/Banners/Banner.tsx"],"names":["BannerContainer","styled","div","props","type","COLORS","correct_100","black","bottom","BREAKPOINTS","MEDIUM","LARGE","link","BannerCenter","ComponentTextStyle","Regular","color","ButtonWrapper","ButtonContainer","BannerContentWrapper","Banner","size","children","testId","linkText","onClose","icon","noIcon","React","useState","window","innerWidth","width","setWidth","useEffect","handleResize","addEventListener","formatTypeToLowerCase","toLowerCase","warning_100","warning_700","warning_20","Math","floor","random","white","warning_500","critical_100","critical_700","critical_20","critical_500","correct_700","correct_20","correct_500","primary_100","primary_700","primary_20","primary_500","hover"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA,IAAMA,eAAe,GAAGC,0BAAOC,GAAV,8gBACL,UAACC,KAAD;AAAA,SAAyBA,KAAK,CAACC,IAAN,GAAaD,KAAK,CAACC,IAAnB,GAA0BC,eAAOC,WAA1D;AAAA,CADK,EAIVD,eAAOE,KAJG,EAKL,UAACJ,KAAD;AAAA,SAAyBA,KAAK,CAACK,MAAN,GAAe,MAAf,GAAwB,GAAjD;AAAA,CALK,EAUfC,oBAAYC,MAVG,EAafD,oBAAYE,KAbG,EA4BR,UAACR,KAAD;AAAA,SAAwBA,KAAK,CAACS,IAA9B;AAAA,CA5BQ,CAArB;;A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A/E;AAAqF,QAAA,OAAO,EAAC;AAA7F,SACGY,QADH,CAHJ,CADF,CAFF,EAYGC,OAAO,iBACN,oBAAC,aAAD,qBACE,oBAAC,eAAD;AAAiB,QAAA,IAAI,EAAC;AAAtB,sBACE,oBAAC,kBAAD;AAAY,QAAA,OAAO,EAAC,WAApB;AAAgC,QAAA,KAAK,EAAC,UAAtC;AAAiD,QAAA,wBAAwB,MAAzE;AAA0E,QAAA,yBAAyB,EAAEpB,eAAOwC,KAA5G;AAAmH,QAAA,MAAM,EAAE;AAAA,iBAAMpB,OAAO,EAAb;AAAA;AAA3H,sBACE,oBAAC,kBAAD;AAAO,QAAA,KAAK,EAAEpB,eAAOoD,WAArB;AAAkC,QAAA,IAAI,EAAC;AAAvC,QADF,CADF,CADF,CAbJ,CADF,CADF;AAnFJ;AA8GD,CAxHD;;;AAZEpC,EAAAA,I,4BAAO,O,EAAU,Q,EAAW,O;AAC5BjB,EAAAA,I;AACAQ,EAAAA,I;AACAY,EAAAA,Q;AACAkC,EAAAA,K;AACAlD,EAAAA,M;AACAe,EAAAA,M;AACAG,EAAAA,I;AACAD,EAAAA,O;AACAE,EAAAA,M;;eA6HaP,M","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\n\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../styles';\nimport {Close, Help, TechnicalWarning, ThumbsUp, Tip} from '../icons/systemicons/SystemIcons';\nimport {IconButton} from '../Button';\nimport {getButtonStyle} from './styles';\nimport {ComponentMStyling, ComponentResponsive} from '../styles/typography';\nimport {HyperLink} from '../HyperLink';\n\n/**\n * Styles for <Banner />\n */\nconst BannerContainer = styled.div<BannerProps>`\n background: ${(props: BannerProps) => (props.type ? props.type : COLORS.correct_100)};\n min-height: 48px;\n display: flex;\n color: ${COLORS.black};\n margin-top: ${(props: BannerProps) => (props.bottom ? 'auto' : '0')};\n\n button:last-child {\n line-height: 0;\n margin: 0 0 0 8px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 0 0 16px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 0 0 32px;\n }\n &.small {\n margin: 0 0 0 8px;\n }\n &.medium {\n margin: 0 0 0 16px;\n }\n &.large {\n margin: 0 0 0 32px;\n }\n }\n\n a {\n color: ${(props: BannerProps) => props.link} !important;\n }\n`;\n\nconst BannerCenter = styled.div`\n ${(props) => ComponentMStyling(ComponentTextStyle.Regular, props.color)}\n \n display: flex;\n width: 100%;\n margin: 0 0 0 16px;\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 16px 0 32px;\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 40px 0 56px;\n }\n &.small {\n margin: 0 0 0 16px;\n }\n &.medium {\n margin: 0 16px 0 32px;\n }\n &.large {\n margin: 0 40px 0 56px;\n }\n\n > svg {\n flex-shrink: 0;\n margin: 12px 0;\n }\n`;\n\nconst ButtonWrapper = styled.div`\n margin: 0 0 0 auto;\n`;\n\nconst ButtonContainer = styled.div<{ type?: string }>`\n display: contents;\n ${(props) => (props.type ? getButtonStyle(props.type) : null)};\n`;\n\nconst BannerContentWrapper = styled.div`\n display: flex;\n align-items: center;\n margin: 12px 0;\n &:not(:first-child) {\n margin-left: 8px;\n }\n`;\n\ntype BannerProps = {\n size?: 'small' | 'medium' | 'large';\n type?: string;\n link?: string;\n linkText?: string;\n hover?: string;\n bottom?: boolean;\n testId?: string;\n icon?: React.ReactNode;\n onClose?: () => void;\n noIcon?: boolean;\n};\n\nconst Banner: React.FunctionComponent<BannerProps> = ({ size, type, children, bottom, testId, linkText, link, onClose, icon, noIcon }) => {\n const [width, setWidth] = React.useState<number>(window.innerWidth);\n React.useEffect(() => {\n function handleResize() {\n setWidth(window.innerWidth);\n }\n window.addEventListener('resize', handleResize);\n });\n\n const formatTypeToLowerCase = type?.toLowerCase();\n switch (formatTypeToLowerCase) {\n case 'warning':\n return (\n <BannerContainer data-testid={testId} type={COLORS.warning_100} link={COLORS.warning_700} hover={COLORS.warning_20} bottom={bottom}>\n <BannerCenter color={COLORS.warning_700} className={size}>\n {icon ? icon : noIcon ? null : <Help color={COLORS.warning_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.warning_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.warning_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'critical':\n return (\n <BannerContainer data-testid={testId} type={COLORS.critical_100} link={COLORS.critical_700} hover={COLORS.critical_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.critical_700} className={size}>\n {icon ? icon : noIcon ? null : <TechnicalWarning color={COLORS.critical_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.critical_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.critical_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n case 'positive':\n return (\n <BannerContainer data-testid={testId} type={COLORS.correct_100} link={COLORS.correct_700} hover={COLORS.correct_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.correct_700} className={size}>\n {icon ? icon : noIcon ? null : <ThumbsUp color={COLORS.correct_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.correct_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type={formatTypeToLowerCase}>\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.correct_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n default:\n return (\n <BannerContainer data-testid={testId} type={COLORS.primary_100} link={COLORS.primary_700} hover={COLORS.primary_20} bottom={bottom} className={size}>\n <BannerCenter color={COLORS.primary_700} className={size}>\n {icon ? icon : noIcon ? null : <Tip color={COLORS.primary_700} size=\"24px\" />}\n <BannerContentWrapper>\n <ComponentResponsive size={size} width={width} color={COLORS.primary_700}>\n {children}&nbsp;&nbsp;\n {link && linkText && (\n <HyperLink id={`${Math.floor(Math.random() * 999999999999)}_BannerLink`} href={link} variant=\"default\">\n {linkText}\n </HyperLink>\n )}\n </ComponentResponsive>\n </BannerContentWrapper>\n {onClose && (\n <ButtonWrapper>\n <ButtonContainer type=\"neutral\">\n <IconButton variant=\"secondary\" shape=\"circular\" useTransparentBackground tabbedHereBackgroundColor={COLORS.white} action={() => onClose()}>\n <Close color={COLORS.primary_500} size=\"24px\" />\n </IconButton>\n </ButtonContainer>\n </ButtonWrapper>\n )}\n </BannerCenter>\n </BannerContainer>\n );\n }\n};\n\nexport default Banner;\n"],"file":"Banner.js"}
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ interface AnchorProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ size: 'small' | 'medium' | 'large' | 'xsmall' | 'xlarge';
4
+ href?: string;
5
+ }
6
+ declare const Anchor: React.FunctionComponent<AnchorProps>;
7
+ export default Anchor;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var React = _interopRequireWildcard(require("react"));
13
+
14
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
+
16
+ var _styles = require("../styles");
17
+
18
+ var _templateObject;
19
+
20
+ var _excluded = ["children", "size", "href", "target"];
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+
28
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
29
+
30
+ 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); }
31
+
32
+ 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; }
33
+
34
+ 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; }
35
+
36
+ var Anchor = function Anchor(_ref) {
37
+ var children = _ref.children,
38
+ _ref$size = _ref.size,
39
+ size = _ref$size === void 0 ? 'small' : _ref$size,
40
+ _ref$href = _ref.href,
41
+ href = _ref$href === void 0 ? '#' : _ref$href,
42
+ _ref$target = _ref.target,
43
+ target = _ref$target === void 0 ? '_blank' : _ref$target,
44
+ props = _objectWithoutProperties(_ref, _excluded);
45
+
46
+ return /*#__PURE__*/React.createElement(AnchorTag, _extends({
47
+ size: size,
48
+ href: href,
49
+ target: target
50
+ }, props), children);
51
+ };
52
+
53
+ Anchor.propTypes = {
54
+ size: _propTypes.default.oneOf(['small', 'medium', 'large', 'xsmall', 'xlarge']).isRequired,
55
+ href: _propTypes.default.string
56
+ };
57
+
58
+ var AnchorTag = _styledComponents.default.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n background-color: transparent;\n padding: 0;\n border: none;\n max-width:max-content; \n text-decoration: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: bold;\n font-family: inherit;\n cursor: pointer;\n outline:none;\n &:visited,\n &.vistied-state {\n color: ", ";\n background: transparent;\n text-decoration: none;\n }\n &:hover, \n &.hover-state {\n color: ", ";\n text-decoration: underline;\n }\n &:focus,\n &.focus-state {\n background-color: ", ";\n text-decoration: underline;\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n outline:none;\n color: ", ";\n }\n &:active,\n &.active-state {\n color: ", ";\n background: transparent;\n text-decoration: underline;\n background-color:unset !important;\n box-shadow: unset !important;\n } \n"])), _styles.COLORS.primary_500, function (props) {
59
+ return props.size === 'large' ? '20px' : props.size === 'small' ? '16px' : props.size === 'xsmall' ? '14px' : props.size === 'xlarge' ? '24px' : '18px';
60
+ }, function (props) {
61
+ return props.size === 'large' ? '32px' : props.size === 'small' ? '24px' : props.size === 'xsmall' ? '20px' : props.size === 'xlarge' ? '36px' : '28px';
62
+ }, _styles.COLORS.accent1_500, _styles.COLORS.primary_600, _styles.COLORS.white, _styles.COLORS.focus_25, _styles.COLORS.focus, _styles.COLORS.primary_500, _styles.COLORS.primary_700);
63
+
64
+ var _default = Anchor;
65
+ exports.default = _default;
66
+ //# sourceMappingURL=Anchor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Button/Anchor.tsx"],"names":["Anchor","children","size","href","target","props","AnchorTag","styled","a","COLORS","primary_500","accent1_500","primary_600","white","focus_25","focus","primary_700"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;AAOA,IAAMA,MAA4C,GAAG,SAA/CA,MAA+C,OAAuE;AAAA,MAApEC,QAAoE,QAApEA,QAAoE;AAAA,uBAA1DC,I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styled from 'styled-components';\nimport {COLORS} from '../styles';\n\ninterface AnchorProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>{\n size : 'small' | 'medium' | 'large' | 'xsmall' | 'xlarge';\n href?: string;\n}\n\nconst Anchor: React.FunctionComponent<AnchorProps> = ({ children, size = 'small', href='#', target='_blank' , ...props}) => {\n return (\n <AnchorTag size={size} href={href} target={target} {...props}>\n {children}\n </AnchorTag>\n )\n}\n\nconst AnchorTag = styled.a<AnchorProps>`\n color: ${COLORS.primary_500};\n background-color: transparent;\n padding: 0;\n border: none;\n max-width:max-content; \n text-decoration: none;\n font-size: ${props => (props.size === 'large' ? '20px' : props.size === 'small' ? '16px' : props.size === 'xsmall' ? '14px' : props.size === 'xlarge' ? '24px' : '18px')};\n line-height: ${props => (props.size === 'large' ? '32px' : props.size === 'small' ? '24px' : props.size === 'xsmall' ? '20px' : props.size === 'xlarge' ? '36px' : '28px')};\n font-weight: bold;\n font-family: inherit;\n cursor: pointer;\n outline:none;\n &:visited,\n &.vistied-state {\n color: ${ COLORS.accent1_500 };\n background: transparent;\n text-decoration: none;\n }\n &:hover, \n &.hover-state {\n color: ${COLORS.primary_600};\n text-decoration: underline;\n }\n &:focus,\n &.focus-state {\n background-color: ${COLORS.white};\n text-decoration: underline;\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline:none;\n color: ${COLORS.primary_500};\n }\n &:active,\n &.active-state {\n color: ${ COLORS.primary_700 };\n background: transparent;\n text-decoration: underline;\n background-color:unset !important;\n box-shadow: unset !important;\n } \n`;\n\nexport default Anchor;"],"file":"Anchor.js"}
@@ -37,7 +37,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
37
37
 
38
38
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
39
39
 
40
- var Button = _styledComponents.default.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n min-height: 48px;\n padding: 0;\n margin: 0;\n\n max-width: max-content;\n display: flex;\n align-items: center;\n border: none;\n background-color: transparent;\n cursor: pointer;\n\n ", ";\n font-feature-settings: 'liga' off;\n\n & > .button-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n max-width: max-content;\n padding: 4px 4px 4px 0;\n border-radius: 4px;\n cursor: inherit;\n }\n\n & > .button-content > span {\n display: flex;\n cursor: inherit;\n }\n & > .button-content > label {\n display: flex;\n cursor: inherit;\n }\n\n &:hover > .button-content,\n &.hover-state > .button-content {\n background-color: ", ";\n color: ", ";\n }\n &:focus > .button-content,\n &.focus-state > .button-content {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2e7fa1;\n }\n &:active > .button-content,\n &.active-state > .button-content {\n background-color: ", ";\n color: ", ";\n box-shadow: unset;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:disabled > .button-content {\n color: ", " !important;\n background-color: transparent !important;\n }\n"])), function (props) {
40
+ var Button = _styledComponents.default.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n min-height: 48px;\n padding: 0;\n margin: 0;\n outline:none;\n max-width: max-content;\n display: flex;\n align-items: center;\n border: none;\n background-color: transparent;\n cursor: pointer;\n\n ", ";\n font-feature-settings: 'liga' off;\n\n & > .button-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n max-width: max-content;\n padding: 4px 4px 4px 0;\n border-radius: 4px;\n cursor: inherit;\n }\n\n & > .button-content > span {\n display: flex;\n cursor: inherit;\n }\n & > .button-content > label {\n display: flex;\n cursor: inherit;\n }\n\n &:hover > .button-content,\n &.hover-state > .button-content {\n background-color: ", ";\n color: ", ";\n }\n &:focus > .button-content,\n &.focus-state > .button-content {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2e7fa1;\n }\n &:active > .button-content,\n &.active-state > .button-content {\n background-color: ", ";\n color: ", ";\n box-shadow: unset;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:disabled > .button-content {\n color: ", " !important;\n background-color: transparent !important;\n }\n"])), function (props) {
41
41
  return props.size === 'XSmall' ? (0, _typography.ComponentXSStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600) : (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, _styles.COLORS.neutral_600);
42
42
  }, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.neutral_300);
43
43
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Button/BackButton.tsx"],"names":["Button","styled","button","props","size","ComponentTextStyle","Bold","COLORS","neutral_600","primary_20","primary_700","primary_100","primary_800","neutral_300","BackButton","children","disabled"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAGC,0BAAOC,MAAV,myCAaR,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAe,QAAf,GAA0B,oCAAmBC,+BAAmBC,IAAtC,EAA4CC,eAAOC,WAAnD,CAA1B,GAA4F,mCAAkBH,+BAAmBC,IAArC,EAA2CC,eAAOC,WAAlD,CAAxG;AAAA,CAbQ,EAsCYD,eAAOE,UAtCnB,EAuCCF,eAAOG,WAvCR,EA+CYH,eAAOI,WA/CnB,EAgDCJ,eAAOK,WAhDR,EAuDCL,eAAOM,WAvDR,CAAZ;;AAgEA,IAAMC,UAAoD,GAAG,SAAvDA,UAAuD,OAA4C;AAAA,MAAzCC,QAAyC,QAAzCA,QAAyC;AAAA,uBAA/BX,IAA+B;AAAA,MAA/BA,IAA+B,0BAAxB,OAAwB;AAAA,MAAZD,KAAY;;AACvG,sBACE,oBAAC,MAAD,eAAYA,KAAZ;AAAmB,IAAA,IAAI,EAAEC;AAAzB,mBACE;AAAK,IAAA,SAAS,EAAE;AAAhB,kBACE,+CACE,oBAAC,0BAAD;AAAe,IAAA,IAAI,EAAEA,IAAI,KAAK,QAAT,GAAoB,IAApB,GAA2B;AAAhD,IADF,CADF,eAIE,mCAAQW,QAAR,CAJF,CADF,CADF;AAUD,CAXD;;;AAHEX,EAAAA,I,4BAAM,O,EAAU,Q;AAChBY,EAAAA,Q;;eAeaF,U","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS } from '../styles';\nimport { ArrowLineLeft } from '../icons/systemicons/SystemIcons';\nimport { ComponentTextStyle, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\n\nconst Button = styled.button<BackButtonProps>`\n box-sizing: border-box;\n min-height: 48px;\n padding: 0;\n margin: 0;\n\n max-width: max-content;\n display: flex;\n align-items: center;\n border: none;\n background-color: transparent;\n cursor: pointer;\n\n ${(props) => (props.size === 'XSmall' ? ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600) : ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600))};\n font-feature-settings: 'liga' off;\n\n & > .button-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n max-width: max-content;\n padding: 4px 4px 4px 0;\n border-radius: 4px;\n cursor: inherit;\n }\n\n & > .button-content > span {\n display: flex;\n cursor: inherit;\n }\n & > .button-content > label {\n display: flex;\n cursor: inherit;\n }\n\n &:hover > .button-content,\n &.hover-state > .button-content {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n &:focus > .button-content,\n &.focus-state > .button-content {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2e7fa1;\n }\n &:active > .button-content,\n &.active-state > .button-content {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: unset;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:disabled > .button-content {\n color: ${COLORS.neutral_300} !important;\n background-color: transparent !important;\n }\n`;\n\ninterface BackButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n size: 'Small' | 'XSmall';\n disabled?: boolean;\n}\nconst BackButton: React.FunctionComponent<BackButtonProps> = ({ children, size = 'Small', ...props }) => {\n return (\n <Button {...props} size={size}>\n <div className={'button-content'}>\n <span>\n <ArrowLineLeft size={size === 'XSmall' ? '20' : '24'} />\n </span>\n <label>{children}</label>\n </div>\n </Button>\n );\n};\n\nexport default BackButton;\n"],"file":"BackButton.js"}
1
+ {"version":3,"sources":["../../../src/Button/BackButton.tsx"],"names":["Button","styled","button","props","size","ComponentTextStyle","Bold","COLORS","neutral_600","primary_20","primary_700","primary_100","primary_800","neutral_300","BackButton","children","disabled"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAGC,0BAAOC,MAAV,kzCAaR,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAe,QAAf,GAA0B,oCAAmBC,+BAAmBC,IAAtC,EAA4CC,eAAOC,WAAnD,CAA1B,GAA4F,mCAAkBH,+BAAmBC,IAArC,EAA2CC,eAAOC,WAAlD,CAAxG;AAAA,CAbQ,EAsCYD,eAAOE,UAtCnB,EAuCCF,eAAOG,WAvCR,EA+CYH,eAAOI,WA/CnB,EAgDCJ,eAAOK,WAhDR,EAuDCL,eAAOM,WAvDR,CAAZ;;AAgEA,IAAMC,UAAoD,GAAG,SAAvDA,UAAuD,OAA4C;AAAA,MAAzCC,QAAyC,QAAzCA,QAAyC;AAAA,uBAA/BX,IAA+B;AAAA,MAA/BA,IAA+B,0BAAxB,OAAwB;AAAA,MAAZD,KAAY;;AACvG,sBACE,oBAAC,MAAD,eAAYA,KAAZ;AAAmB,IAAA,IAAI,EAAEC;AAAzB,mBACE;AAAK,IAAA,SAAS,EAAE;AAAhB,kBACE,+CACE,oBAAC,0BAAD;AAAe,IAAA,IAAI,EAAEA,IAAI,KAAK,QAAT,GAAoB,IAApB,GAA2B;AAAhD,IADF,CADF,eAIE,mCAAQW,QAAR,CAJF,CADF,CADF;AAUD,CAXD;;;AAHEX,EAAAA,I,4BAAM,O,EAAU,Q;AAChBY,EAAAA,Q;;eAeaF,U","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport { COLORS } from '../styles';\nimport { ArrowLineLeft } from '../icons/systemicons/SystemIcons';\nimport { ComponentTextStyle, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\n\nconst Button = styled.button<BackButtonProps>`\n box-sizing: border-box;\n min-height: 48px;\n padding: 0;\n margin: 0;\n outline:none;\n max-width: max-content;\n display: flex;\n align-items: center;\n border: none;\n background-color: transparent;\n cursor: pointer;\n\n ${(props) => (props.size === 'XSmall' ? ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600) : ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600))};\n font-feature-settings: 'liga' off;\n\n & > .button-content {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n max-width: max-content;\n padding: 4px 4px 4px 0;\n border-radius: 4px;\n cursor: inherit;\n }\n\n & > .button-content > span {\n display: flex;\n cursor: inherit;\n }\n & > .button-content > label {\n display: flex;\n cursor: inherit;\n }\n\n &:hover > .button-content,\n &.hover-state > .button-content {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n &:focus > .button-content,\n &.focus-state > .button-content {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2e7fa1;\n }\n &:active > .button-content,\n &.active-state > .button-content {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: unset;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:disabled > .button-content {\n color: ${COLORS.neutral_300} !important;\n background-color: transparent !important;\n }\n`;\n\ninterface BackButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n size: 'Small' | 'XSmall';\n disabled?: boolean;\n}\nconst BackButton: React.FunctionComponent<BackButtonProps> = ({ children, size = 'Small', ...props }) => {\n return (\n <Button {...props} size={size}>\n <div className={'button-content'}>\n <span>\n <ArrowLineLeft size={size === 'XSmall' ? '20' : '24'} />\n </span>\n <label>{children}</label>\n </div>\n </Button>\n );\n};\n\nexport default BackButton;\n"],"file":"BackButton.js"}
@@ -1,9 +1,12 @@
1
1
  import * as React from 'react';
2
+ import { Size } from '../types';
2
3
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
4
  variant?: 'primary' | 'secondary' | 'tertiary' | 'text' | 'correct' | 'critical';
5
+ flatEdge?: 'right' | 'left' | 'none' | undefined;
4
6
  role?: 'button' | string;
5
7
  title?: string;
6
- size?: 'small' | 'normal' | 'big';
8
+ size?: Size;
9
+ imageExtraMargin?: boolean;
7
10
  colorTheme?: 'teal' | 'dark';
8
11
  width?: 'auto' | string;
9
12
  loading?: boolean;
@@ -15,11 +15,13 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
15
15
 
16
16
  var _LoadingIndicator = require("../LoadingIndicator");
17
17
 
18
+ var _typography = require("../styles/typography");
19
+
18
20
  var _styles = require("../styles");
19
21
 
20
- var _typography = require("../styles/typography");
22
+ var _types = require("../types");
21
23
 
22
- var _excluded = ["children", "variant", "type", "size", "width", "testId", "disabled", "icon"],
24
+ var _excluded = ["children", "variant", "type", "size", "width", "imageExtraMargin", "testId", "disabled", "flatEdge", "icon"],
23
25
  _excluded2 = ["loading"];
24
26
 
25
27
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
@@ -50,10 +52,24 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
50
52
 
51
53
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
52
54
 
55
+ var getBorderRadius = function getBorderRadius(flatEdge, radius) {
56
+ switch (flatEdge) {
57
+ case 'left':
58
+ return "0px ".concat(radius, "px ").concat(radius, "px 0px");
59
+
60
+ case 'right':
61
+ return "".concat(radius, "px 0px 0px ").concat(radius, "px");
62
+
63
+ case 'none':
64
+ default:
65
+ return "".concat(radius, "px");
66
+ }
67
+ };
68
+
53
69
  var tabbedHereStyle = function tabbedHereStyle(variant, colorTheme) {
54
70
  switch (variant) {
55
71
  case 'primary':
56
- return (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n "])), _styles.COLORS.focus_25, _styles.COLORS.focus, colorTheme === 'teal' ? _styles.COLORS.accent1_700 : colorTheme === 'dark' ? _styles.COLORS.primary_100 : _styles.COLORS.primary_700, colorTheme === 'teal' ? _styles.COLORS.accent1_700 : colorTheme === 'dark' ? _styles.COLORS.primary_100 : _styles.COLORS.primary_700, colorTheme === 'dark' ? _styles.COLORS.primary_500 : _styles.COLORS.white);
72
+ return (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n "])), _styles.COLORS.focus_25, _styles.COLORS.focus, colorTheme === 'teal' ? _styles.COLORS.accent1_700 : colorTheme === 'dark' ? _styles.COLORS.primary_100 : _styles.COLORS.primary_700, colorTheme === 'teal' ? _styles.COLORS.accent1_700 : colorTheme === 'dark' ? _styles.COLORS.primary_100 : _styles.COLORS.primary_700, colorTheme === 'dark' ? _styles.COLORS.primary_600 : _styles.COLORS.white);
57
73
 
58
74
  case 'secondary':
59
75
  return (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n outline: none;\n div {\n outline: none;\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n "])), _styles.COLORS.focus_25, _styles.COLORS.focus, colorTheme === 'dark' ? 'transparent' : _styles.COLORS.white, colorTheme === 'teal' ? _styles.COLORS.accent1 : colorTheme === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.primary, colorTheme === 'dark' ? _styles.COLORS.white : _styles.COLORS.primary_500);
@@ -66,32 +82,34 @@ var tabbedHereStyle = function tabbedHereStyle(variant, colorTheme) {
66
82
  }
67
83
  };
68
84
 
69
- var Primary = _styledComponents.default.button(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n min-height: ", ";\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 ", ";\n\n background-color: ", ";\n border-radius: 8px;\n border-width: 2px;\n border-style: solid;\n border-color: ", ";\n\n width: ", ";\n position: relative;\n\n min-height: ", ";\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: ", ";\n\n span.loading {\n opacity: 0;\n }\n .icon {\n margin-left: -4px;\n margin-top: -2px;\n margin-bottom: -2px;\n width: ", ";\n height: ", ";\n svg {\n width: ", " !important;\n height: ", " !important;\n }\n }\n\n div {\n position: absolute;\n width: 100%;\n svg {\n height: ", ";\n width: ", ";\n path {\n fill: ", ";\n }\n }\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: ", ";\n border-color: ", ";\n box-shadow: none !important;\n color: ", ";\n }\n ", "\n &.focus-state {\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: ", ";\n color: ", ";\n border-color: ", ";\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n }\n }\n"])), function (props) {
70
- return props.size === 'big' ? '56px' : '48px';
85
+ var Primary = _styledComponents.default.button(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n min-height: ", ";\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 ", ";\n\n background-color: ", ";\n border-radius: ", ";\n border-width: 2px;\n border-style: solid;\n border-color: ", ";\n\n width: ", ";\n position: relative;\n\n min-height: ", ";\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: ", ";\n\n span.loading {\n opacity: 0;\n }\n .icon {\n margin-left: -4px;\n margin-top: -2px;\n margin-bottom: -2px;\n width: ", ";\n height: ", ";\n svg {\n width: ", " !important;\n height: ", " !important;\n }\n }\n\n .extramargin {\n margin-right: 9px;\n }\n\n div {\n position: absolute;\n width: 100%;\n svg {\n height: ", ";\n width: ", ";\n path {\n fill: ", ";\n }\n }\n }\n }\n &:hover > div.button-content,\n &.hover-state > div.button-content {\n background-color: ", ";\n border-color: ", ";\n color: ", ";\n }\n &:active > div.button-content,\n &.active-state > div.button-content {\n background-color: ", ";\n border-color: ", ";\n box-shadow: none !important;\n color: ", ";\n }\n ", "\n &.focus-state {\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: ", ";\n color: ", ";\n border-color: ", ";\n cursor: not-allowed;\n &:hover,\n &:active {\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n }\n }\n"])), function (props) {
86
+ return props.size === _types.Size.Large ? '56px' : '48px';
71
87
  }, function (props) {
72
- return props.size === 'big' ? (0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.white) : props.size === 'small' ? (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.white) : (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.white);
88
+ return props.size === _types.Size.Large ? (0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.white) : props.size === _types.Size.Small ? (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.white) : (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.primary_800 : _styles.COLORS.white);
73
89
  }, function (props) {
74
90
  return props.colorTheme === 'teal' ? _styles.COLORS.accent1 : (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.white : _styles.COLORS.primary;
91
+ }, function (props) {
92
+ return getBorderRadius(props.flatEdge, 8);
75
93
  }, function (props) {
76
94
  return props.colorTheme === 'teal' ? _styles.COLORS.accent1 : (props === null || props === void 0 ? void 0 : props.colorTheme) === 'dark' ? _styles.COLORS.white : _styles.COLORS.primary;
77
95
  }, function (props) {
78
96
  return props.width;
79
97
  }, function (props) {
80
- return props.size === 'big' ? '56px' : props.size === 'small' ? '32px' : '40px';
98
+ return props.size === _types.Size.Large ? '56px' : props.size === _types.Size.Small ? '32px' : '40px';
81
99
  }, function (props) {
82
- return props.size === 'big' ? '14px 18px' : props.size === 'small' ? '4px 10px' : '6px 14px';
100
+ return props.size === _types.Size.Large ? '14px 18px' : props.size === _types.Size.Small ? '4px 10px' : '6px 14px';
83
101
  }, function (props) {
84
- return props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px';
102
+ return props.size === _types.Size.Large ? '28px' : props.size === _types.Size.Small ? '20px' : '24px';
85
103
  }, function (props) {
86
- return props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px';
104
+ return props.size === _types.Size.Large ? '28px' : props.size === _types.Size.Small ? '20px' : '24px';
87
105
  }, function (props) {
88
- return props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px';
106
+ return props.size === _types.Size.Large ? '28px' : props.size === _types.Size.Small ? '20px' : '24px';
89
107
  }, function (props) {
90
- return props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px';
108
+ return props.size === _types.Size.Large ? '28px' : props.size === _types.Size.Small ? '20px' : '24px';
91
109
  }, function (props) {
92
- return props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px';
110
+ return props.size === _types.Size.Large ? '28px' : props.size === _types.Size.Small ? '20px' : '24px';
93
111
  }, function (props) {
94
- return props.size === 'big' ? '28px' : props.size === 'small' ? '20px' : '24px';
112
+ return props.size === _types.Size.Large ? '28px' : props.size === _types.Size.Small ? '20px' : '24px';
95
113
  }, function (props) {
96
114
  return props.colorTheme === 'dark' ? _styles.COLORS.primary : _styles.COLORS.white;
97
115
  }, function (props) {
@@ -182,7 +200,7 @@ var Critical = (0, _styledComponents.default)(Primary)(_templateObject9 || (_tem
182
200
  var Text = _styledComponents.default.button(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: transparent;\n padding: 0;\n border: none;\n cursor: pointer;\n\n text-decoration: underline;\n ", ";\n\n &:hover,\n &:focus,\n &.hover-state,\n &.focus-state {\n color: ", ";\n background: transparent;\n }\n &:active,\n &.active-state {\n color: ", ";\n background: transparent;\n }\n &:disabled,\n &.disabled-state {\n color: ", ";\n background: transparent;\n cursor: not-allowed;\n }\n"])), function (props) {
183
201
  return props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary;
184
202
  }, function (props) {
185
- return props.size === 'big' ? (0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary) : props.size === 'small' ? (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary) : (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary);
203
+ return props.size === _types.Size.Large ? (0, _typography.ComponentLStyling)(_typography.ComponentTextStyle.Bold, props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary) : props.size === _types.Size.Small ? (0, _typography.ComponentSStyling)(_typography.ComponentTextStyle.Bold, props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary) : (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Bold, props.colorTheme === 'teal' ? _styles.COLORS.accent1 : _styles.COLORS.primary);
186
204
  }, function (props) {
187
205
  return props.colorTheme === 'teal' ? _styles.COLORS.accent1_700 : _styles.COLORS.primary_700;
188
206
  }, function (props) {
@@ -197,11 +215,13 @@ var Button = function Button(_ref) {
197
215
  _ref$type = _ref.type,
198
216
  type = _ref$type === void 0 ? 'button' : _ref$type,
199
217
  _ref$size = _ref.size,
200
- size = _ref$size === void 0 ? 'normal' : _ref$size,
218
+ size = _ref$size === void 0 ? _types.Size.Medium : _ref$size,
201
219
  _ref$width = _ref.width,
202
220
  width = _ref$width === void 0 ? 'auto' : _ref$width,
221
+ imageExtraMargin = _ref.imageExtraMargin,
203
222
  testId = _ref.testId,
204
223
  disabled = _ref.disabled,
224
+ flatEdge = _ref.flatEdge,
205
225
  icon = _ref.icon,
206
226
  props = _objectWithoutProperties(_ref, _excluded);
207
227
 
@@ -218,7 +238,7 @@ var Button = function Button(_ref) {
218
238
 
219
239
  var renderContent = function renderContent() {
220
240
  return /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement("span", {
221
- className: loading ? 'icon loading' : 'icon'
241
+ className: (imageExtraMargin ? 'extramargin ' : '') + (loading ? 'icon loading' : 'icon')
222
242
  }, icon), /*#__PURE__*/React.createElement("span", {
223
243
  className: loading ? 'label loading' : 'label'
224
244
  }, children), loading && /*#__PURE__*/React.createElement(_LoadingIndicator.LoadingIndicator, null));
@@ -231,6 +251,7 @@ var Button = function Button(_ref) {
231
251
  disabled: disabled,
232
252
  type: type,
233
253
  size: size,
254
+ flatEdge: flatEdge,
234
255
  width: width,
235
256
  "data-testid": testId,
236
257
  className: props.loading ? 'loading-state ' + props.className : ' ' + props.className,
@@ -255,6 +276,7 @@ var Button = function Button(_ref) {
255
276
  disabled: disabled,
256
277
  type: type,
257
278
  size: size,
279
+ flatEdge: flatEdge,
258
280
  width: width,
259
281
  "data-testid": testId,
260
282
  className: props.loading ? 'loading-state ' + props.className : ' ' + props.className,
@@ -278,6 +300,7 @@ var Button = function Button(_ref) {
278
300
  return /*#__PURE__*/React.createElement(Tertiary, _extends({}, renderProps, {
279
301
  disabled: disabled,
280
302
  type: type,
303
+ flatEdge: flatEdge,
281
304
  size: size,
282
305
  width: width,
283
306
  "data-testid": testId,
@@ -312,6 +335,7 @@ var Button = function Button(_ref) {
312
335
  disabled: disabled,
313
336
  type: type,
314
337
  size: size,
338
+ flatEdge: flatEdge,
315
339
  width: width,
316
340
  "data-testid": testId,
317
341
  className: props.loading ? 'loading-state ' + props.className : ' ' + props.className,
@@ -334,6 +358,7 @@ var Button = function Button(_ref) {
334
358
  case 'critical':
335
359
  return /*#__PURE__*/React.createElement(Critical, _extends({}, renderProps, {
336
360
  disabled: disabled,
361
+ flatEdge: flatEdge,
337
362
  type: type,
338
363
  size: size,
339
364
  width: width,
@@ -357,6 +382,7 @@ var Button = function Button(_ref) {
357
382
 
358
383
  default:
359
384
  return /*#__PURE__*/React.createElement(Primary, _extends({}, renderProps, {
385
+ flatEdge: flatEdge,
360
386
  disabled: disabled,
361
387
  type: type,
362
388
  size: size,
@@ -385,7 +411,7 @@ Button.propTypes = {
385
411
  variant: _propTypes.default.oneOf(['primary', 'secondary', 'tertiary', 'text', 'correct', 'critical']),
386
412
  role: _propTypes.default.oneOfType([_propTypes.default.oneOf(['button']), _propTypes.default.string]),
387
413
  title: _propTypes.default.string,
388
- size: _propTypes.default.oneOf(['small', 'normal', 'big']),
414
+ imageExtraMargin: _propTypes.default.bool,
389
415
  colorTheme: _propTypes.default.oneOf(['teal', 'dark']),
390
416
  width: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.string]),
391
417
  loading: _propTypes.default.bool,