@laerdal/life-react-components 1.1.2-dev.8 → 1.2.1-dev.2

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 (241) hide show
  1. package/dist/esm/Breadcrumb/Breadcrumb.js +96 -49
  2. package/dist/esm/Breadcrumb/Breadcrumb.js.map +1 -1
  3. package/dist/esm/Button/DualFunctionButton.js +0 -3
  4. package/dist/esm/Button/DualFunctionButton.js.map +1 -1
  5. package/dist/esm/Button/Iconbutton.js +6 -2
  6. package/dist/esm/Button/Iconbutton.js.map +1 -1
  7. package/dist/esm/Button/index.js +0 -1
  8. package/dist/esm/Button/index.js.map +1 -1
  9. package/dist/esm/Chips/ChoiceChips.js +1 -2
  10. package/dist/esm/Chips/ChoiceChips.js.map +1 -1
  11. package/dist/esm/Dropdown/BasicDropdown.js +11 -3
  12. package/dist/esm/Dropdown/BasicDropdown.js.map +1 -1
  13. package/dist/esm/Dropdown/CommonStyling.js +15 -13
  14. package/dist/esm/Dropdown/CommonStyling.js.map +1 -1
  15. package/dist/esm/Dropdown/DropdownButton.js +20 -8
  16. package/dist/esm/Dropdown/DropdownButton.js.map +1 -1
  17. package/dist/esm/Dropdown/DropdownContent.js +117 -31
  18. package/dist/esm/Dropdown/DropdownContent.js.map +1 -1
  19. package/dist/esm/GlobalNavigationBar/RightSideNav.js +4 -0
  20. package/dist/esm/GlobalNavigationBar/RightSideNav.js.map +1 -1
  21. package/dist/esm/List/ListRow.js +204 -90
  22. package/dist/esm/List/ListRow.js.map +1 -1
  23. package/dist/esm/List/__tests__/ListRow.tests.js +7 -43
  24. package/dist/esm/List/__tests__/ListRow.tests.js.map +1 -1
  25. package/dist/esm/List/index.js +1 -2
  26. package/dist/esm/List/index.js.map +1 -1
  27. package/dist/esm/Modals/ModalContainer.js +1 -0
  28. package/dist/esm/Modals/ModalContainer.js.map +1 -1
  29. package/dist/esm/Modals/ModalDialog.js +12 -3
  30. package/dist/esm/Modals/ModalDialog.js.map +1 -1
  31. package/dist/esm/Modals/ModalNote.js +56 -0
  32. package/dist/esm/Modals/ModalNote.js.map +1 -0
  33. package/dist/esm/Modals/ModalStyles.js +48 -0
  34. package/dist/esm/Modals/ModalStyles.js.map +1 -1
  35. package/dist/esm/NotificationDot/NotificationDot.js +41 -0
  36. package/dist/esm/NotificationDot/NotificationDot.js.map +1 -0
  37. package/dist/esm/NotificationDot/index.js +2 -0
  38. package/dist/esm/NotificationDot/index.js.map +1 -0
  39. package/dist/esm/Tabs/TabLink.js +25 -20
  40. package/dist/esm/Tabs/TabLink.js.map +1 -1
  41. package/dist/esm/Tabs/VerticalTabs.js +4 -1
  42. package/dist/esm/Tabs/VerticalTabs.js.map +1 -1
  43. package/dist/esm/Toggles/ToggleSwitch.js +14 -9
  44. package/dist/esm/Toggles/ToggleSwitch.js.map +1 -1
  45. package/dist/esm/Toggles/TogglerStyles.js +101 -74
  46. package/dist/esm/Toggles/TogglerStyles.js.map +1 -1
  47. package/dist/esm/Toggles/TogglerTypes.js +0 -4
  48. package/dist/esm/Toggles/TogglerTypes.js.map +1 -1
  49. package/dist/esm/Tooltips/TooltipStyles.js +77 -0
  50. package/dist/esm/Tooltips/TooltipStyles.js.map +1 -0
  51. package/dist/esm/Tooltips/TooltipTypes.js +6 -0
  52. package/dist/esm/Tooltips/TooltipTypes.js.map +1 -0
  53. package/dist/esm/Tooltips/TooltipWrapper.js +24 -0
  54. package/dist/esm/Tooltips/TooltipWrapper.js.map +1 -0
  55. package/dist/esm/Tooltips/index.js +4 -0
  56. package/dist/esm/Tooltips/index.js.map +1 -0
  57. package/dist/esm/icons/contenticons/ContentIcons.js +454 -322
  58. package/dist/esm/icons/contenticons/ContentIcons.js.map +1 -1
  59. package/dist/esm/icons/index.js +55 -24
  60. package/dist/esm/icons/index.js.map +1 -1
  61. package/dist/esm/icons/systemicons/SystemIcons.js +652 -488
  62. package/dist/esm/icons/systemicons/SystemIcons.js.map +1 -1
  63. package/dist/esm/index.js +1 -0
  64. package/dist/esm/index.js.map +1 -1
  65. package/dist/esm/types.js +1 -0
  66. package/dist/esm/types.js.map +1 -1
  67. package/dist/js/Breadcrumb/Breadcrumb.d.ts +5 -2
  68. package/dist/js/Breadcrumb/Breadcrumb.js +94 -36
  69. package/dist/js/Breadcrumb/Breadcrumb.js.map +1 -1
  70. package/dist/js/Button/DualFunctionButton.d.ts +0 -1
  71. package/dist/js/Button/DualFunctionButton.js +0 -3
  72. package/dist/js/Button/DualFunctionButton.js.map +1 -1
  73. package/dist/js/Button/Iconbutton.js +2 -2
  74. package/dist/js/Button/Iconbutton.js.map +1 -1
  75. package/dist/js/Button/index.d.ts +0 -1
  76. package/dist/js/Button/index.js +0 -8
  77. package/dist/js/Button/index.js.map +1 -1
  78. package/dist/js/Chips/ChipTypes.d.ts +1 -0
  79. package/dist/js/Chips/ChoiceChips.js +1 -2
  80. package/dist/js/Chips/ChoiceChips.js.map +1 -1
  81. package/dist/js/Dropdown/BasicDropdown.d.ts +3 -2
  82. package/dist/js/Dropdown/BasicDropdown.js +18 -3
  83. package/dist/js/Dropdown/BasicDropdown.js.map +1 -1
  84. package/dist/js/Dropdown/CommonStyling.d.ts +1 -0
  85. package/dist/js/Dropdown/CommonStyling.js +12 -12
  86. package/dist/js/Dropdown/CommonStyling.js.map +1 -1
  87. package/dist/js/Dropdown/DropdownButton.d.ts +1 -1
  88. package/dist/js/Dropdown/DropdownButton.js +19 -9
  89. package/dist/js/Dropdown/DropdownButton.js.map +1 -1
  90. package/dist/js/Dropdown/DropdownButtonTypes.d.ts +1 -0
  91. package/dist/js/Dropdown/DropdownContent.d.ts +4 -1
  92. package/dist/js/Dropdown/DropdownContent.js +117 -38
  93. package/dist/js/Dropdown/DropdownContent.js.map +1 -1
  94. package/dist/js/GlobalNavigationBar/RightSideNav.js +1 -1
  95. package/dist/js/GlobalNavigationBar/RightSideNav.js.map +1 -1
  96. package/dist/js/List/ListRow.d.ts +12 -5
  97. package/dist/js/List/ListRow.js +77 -55
  98. package/dist/js/List/ListRow.js.map +1 -1
  99. package/dist/js/List/__tests__/ListRow.tests.js +8 -53
  100. package/dist/js/List/__tests__/ListRow.tests.js.map +1 -1
  101. package/dist/js/List/index.d.ts +1 -2
  102. package/dist/js/List/index.js +0 -8
  103. package/dist/js/List/index.js.map +1 -1
  104. package/dist/js/Modals/ModalContainer.js +1 -1
  105. package/dist/js/Modals/ModalContainer.js.map +1 -1
  106. package/dist/js/Modals/ModalDialog.d.ts +2 -0
  107. package/dist/js/Modals/ModalDialog.js +13 -3
  108. package/dist/js/Modals/ModalDialog.js.map +1 -1
  109. package/dist/js/Modals/ModalNote.d.ts +9 -0
  110. package/dist/js/Modals/ModalNote.js +79 -0
  111. package/dist/js/Modals/ModalNote.js.map +1 -0
  112. package/dist/js/Modals/ModalStyles.d.ts +6 -0
  113. package/dist/js/Modals/ModalStyles.js +58 -4
  114. package/dist/js/Modals/ModalStyles.js.map +1 -1
  115. package/dist/js/NotificationDot/NotificationDot.d.ts +8 -0
  116. package/dist/js/NotificationDot/NotificationDot.js +70 -0
  117. package/dist/js/NotificationDot/NotificationDot.js.map +1 -0
  118. package/dist/js/NotificationDot/index.d.ts +1 -0
  119. package/dist/js/NotificationDot/index.js +16 -0
  120. package/dist/js/NotificationDot/index.js.map +1 -0
  121. package/dist/js/Tabs/TabLink.d.ts +3 -1
  122. package/dist/js/Tabs/TabLink.js +26 -11
  123. package/dist/js/Tabs/TabLink.js.map +1 -1
  124. package/dist/js/Tabs/VerticalTabs.d.ts +1 -0
  125. package/dist/js/Tabs/VerticalTabs.js +4 -1
  126. package/dist/js/Tabs/VerticalTabs.js.map +1 -1
  127. package/dist/js/Toggles/ToggleSwitch.d.ts +1 -1
  128. package/dist/js/Toggles/ToggleSwitch.js +16 -8
  129. package/dist/js/Toggles/ToggleSwitch.js.map +1 -1
  130. package/dist/js/Toggles/TogglerStyles.d.ts +3 -0
  131. package/dist/js/Toggles/TogglerStyles.js +16 -6
  132. package/dist/js/Toggles/TogglerStyles.js.map +1 -1
  133. package/dist/js/Toggles/TogglerTypes.d.ts +2 -0
  134. package/dist/js/Toggles/TogglerTypes.js +0 -5
  135. package/dist/js/Toggles/TogglerTypes.js.map +1 -1
  136. package/dist/js/Tooltips/TooltipStyles.d.ts +10 -0
  137. package/dist/js/Tooltips/TooltipStyles.js +86 -0
  138. package/dist/js/Tooltips/TooltipStyles.js.map +1 -0
  139. package/dist/js/Tooltips/TooltipTypes.d.ts +14 -0
  140. package/dist/js/Tooltips/TooltipTypes.js +11 -0
  141. package/dist/js/Tooltips/TooltipTypes.js.map +1 -0
  142. package/dist/js/Tooltips/TooltipWrapper.d.ts +3 -0
  143. package/dist/js/Tooltips/TooltipWrapper.js +43 -0
  144. package/dist/js/Tooltips/TooltipWrapper.js.map +1 -0
  145. package/dist/js/Tooltips/index.d.ts +3 -0
  146. package/dist/js/Tooltips/index.js +30 -0
  147. package/dist/js/Tooltips/index.js.map +1 -0
  148. package/dist/js/icons/contenticons/ContentIcons.js +1513 -1381
  149. package/dist/js/icons/contenticons/ContentIcons.js.map +1 -1
  150. package/dist/js/icons/index.d.ts +2 -0
  151. package/dist/js/icons/index.js +68 -25
  152. package/dist/js/icons/index.js.map +1 -1
  153. package/dist/js/icons/systemicons/SystemIcons.js +652 -488
  154. package/dist/js/icons/systemicons/SystemIcons.js.map +1 -1
  155. package/dist/js/index.d.ts +1 -0
  156. package/dist/js/index.js +13 -0
  157. package/dist/js/index.js.map +1 -1
  158. package/dist/js/types.d.ts +1 -0
  159. package/dist/js/types.js +1 -0
  160. package/dist/js/types.js.map +1 -1
  161. package/dist/umd/Breadcrumb/Breadcrumb.js +97 -51
  162. package/dist/umd/Breadcrumb/Breadcrumb.js.map +1 -1
  163. package/dist/umd/Button/DualFunctionButton.js +10 -15
  164. package/dist/umd/Button/DualFunctionButton.js.map +1 -1
  165. package/dist/umd/Button/Iconbutton.js +6 -2
  166. package/dist/umd/Button/Iconbutton.js.map +1 -1
  167. package/dist/umd/Button/index.js +4 -10
  168. package/dist/umd/Button/index.js.map +1 -1
  169. package/dist/umd/Chips/ChoiceChips.js +1 -2
  170. package/dist/umd/Chips/ChoiceChips.js.map +1 -1
  171. package/dist/umd/Dropdown/BasicDropdown.js +11 -3
  172. package/dist/umd/Dropdown/BasicDropdown.js.map +1 -1
  173. package/dist/umd/Dropdown/CommonStyling.js +18 -14
  174. package/dist/umd/Dropdown/CommonStyling.js.map +1 -1
  175. package/dist/umd/Dropdown/DropdownButton.js +20 -8
  176. package/dist/umd/Dropdown/DropdownButton.js.map +1 -1
  177. package/dist/umd/Dropdown/DropdownContent.js +119 -34
  178. package/dist/umd/Dropdown/DropdownContent.js.map +1 -1
  179. package/dist/umd/GlobalNavigationBar/RightSideNav.js +4 -0
  180. package/dist/umd/GlobalNavigationBar/RightSideNav.js.map +1 -1
  181. package/dist/umd/List/ListRow.js +218 -92
  182. package/dist/umd/List/ListRow.js.map +1 -1
  183. package/dist/umd/List/__tests__/ListRow.tests.js +9 -46
  184. package/dist/umd/List/__tests__/ListRow.tests.js.map +1 -1
  185. package/dist/umd/List/index.js +5 -8
  186. package/dist/umd/List/index.js.map +1 -1
  187. package/dist/umd/Modals/ModalContainer.js +1 -0
  188. package/dist/umd/Modals/ModalContainer.js.map +1 -1
  189. package/dist/umd/Modals/ModalDialog.js +15 -7
  190. package/dist/umd/Modals/ModalDialog.js.map +1 -1
  191. package/dist/umd/Modals/ModalNote.js +133 -0
  192. package/dist/umd/Modals/ModalNote.js.map +1 -0
  193. package/dist/umd/Modals/ModalStyles.js +54 -5
  194. package/dist/umd/Modals/ModalStyles.js.map +1 -1
  195. package/dist/umd/NotificationDot/NotificationDot.js +119 -0
  196. package/dist/umd/NotificationDot/NotificationDot.js.map +1 -0
  197. package/dist/umd/NotificationDot/index.js +32 -0
  198. package/dist/umd/NotificationDot/index.js.map +1 -0
  199. package/dist/umd/Tabs/TabLink.js +28 -24
  200. package/dist/umd/Tabs/TabLink.js.map +1 -1
  201. package/dist/umd/Tabs/VerticalTabs.js +4 -1
  202. package/dist/umd/Tabs/VerticalTabs.js.map +1 -1
  203. package/dist/umd/Toggles/ToggleSwitch.js +16 -12
  204. package/dist/umd/Toggles/ToggleSwitch.js.map +1 -1
  205. package/dist/umd/Toggles/TogglerStyles.js +100 -73
  206. package/dist/umd/Toggles/TogglerStyles.js.map +1 -1
  207. package/dist/umd/Toggles/TogglerTypes.js +0 -5
  208. package/dist/umd/Toggles/TogglerTypes.js.map +1 -1
  209. package/dist/umd/Tooltips/TooltipStyles.js +101 -0
  210. package/dist/umd/Tooltips/TooltipStyles.js.map +1 -0
  211. package/dist/umd/Tooltips/TooltipTypes.js +25 -0
  212. package/dist/umd/Tooltips/TooltipTypes.js.map +1 -0
  213. package/dist/umd/Tooltips/TooltipWrapper.js +92 -0
  214. package/dist/umd/Tooltips/TooltipWrapper.js.map +1 -0
  215. package/dist/umd/Tooltips/index.js +33 -0
  216. package/dist/umd/Tooltips/index.js.map +1 -0
  217. package/dist/umd/icons/contenticons/ContentIcons.js +604 -471
  218. package/dist/umd/icons/contenticons/ContentIcons.js.map +1 -1
  219. package/dist/umd/icons/index.js +62 -29
  220. package/dist/umd/icons/index.js.map +1 -1
  221. package/dist/umd/icons/systemicons/SystemIcons.js +652 -488
  222. package/dist/umd/icons/systemicons/SystemIcons.js.map +1 -1
  223. package/dist/umd/index.js +13 -4
  224. package/dist/umd/index.js.map +1 -1
  225. package/dist/umd/types.js +1 -0
  226. package/dist/umd/types.js.map +1 -1
  227. package/package.json +1 -1
  228. package/dist/esm/Button/Anchor.js +0 -76
  229. package/dist/esm/Button/Anchor.js.map +0 -1
  230. package/dist/esm/List/ListRowDropdown.js +0 -105
  231. package/dist/esm/List/ListRowDropdown.js.map +0 -1
  232. package/dist/js/Button/Anchor.d.ts +0 -7
  233. package/dist/js/Button/Anchor.js +0 -66
  234. package/dist/js/Button/Anchor.js.map +0 -1
  235. package/dist/js/List/ListRowDropdown.d.ts +0 -8
  236. package/dist/js/List/ListRowDropdown.js +0 -110
  237. package/dist/js/List/ListRowDropdown.js.map +0 -1
  238. package/dist/umd/Button/Anchor.js +0 -201
  239. package/dist/umd/Button/Anchor.js.map +0 -1
  240. package/dist/umd/List/ListRowDropdown.js +0 -182
  241. package/dist/umd/List/ListRowDropdown.js.map +0 -1
@@ -1,55 +1,19 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import { ListRow } from '../index';
4
- import { Institute } from '../../icons/systemicons/SystemIcons';
4
+ import { Size } from '../../types';
5
+ import { SystemIcons } from '../../icons';
5
6
  describe('<ListRow />', () => {
6
7
  it('Renders', async () => {
7
8
  const {
8
9
  getByText
9
10
  } = render( /*#__PURE__*/React.createElement(ListRow, {
10
- Icon: Institute,
11
- mainInfo: /*#__PURE__*/React.createElement("div", null, "Laerdal Medical AS"),
12
- dropdownOptions: [{
13
- label: 'Option 1',
14
- action: () => {},
15
- key: 'Test1'
16
- }, {
17
- label: 'Option 2',
18
- action: () => {},
19
- key: 'Test2'
20
- }]
21
- }, "Menu 1"));
11
+ icon: /*#__PURE__*/React.createElement(SystemIcons.Institute, null),
12
+ mainText: 'Laerdal Medical AS',
13
+ size: Size.Small,
14
+ disabled: false
15
+ }));
22
16
  expect(getByText('Laerdal Medical AS')).toBeDefined();
23
17
  });
24
- it('When menu is clicked, it opens', async () => {
25
- const {
26
- getByRole,
27
- getByText
28
- } = render( /*#__PURE__*/React.createElement(ListRow, {
29
- Icon: Institute,
30
- mainInfo: /*#__PURE__*/React.createElement("div", null, "Laerdal Medical AS"),
31
- dropdownOptions: [{
32
- label: 'Option 1',
33
- action: () => {},
34
- key: 'Test1'
35
- }, {
36
- label: 'Option 2',
37
- action: () => {},
38
- key: 'Test2'
39
- }]
40
- }, "Menu 1")); //expect(getByText('Option 1')).not.toBeDefined();
41
-
42
- getByRole('button').click();
43
- expect(getByText('Option 1')).toBeDefined();
44
- });
45
- /*it('Renders with required input if specified', async () => {
46
- const { getByPlaceholderText } = render(<DropdownFilter id="Dropdown" list={list} placeholder="Placeholder" required />);
47
- expect(getByPlaceholderText('Placeholder').required).toBe(true);
48
- });
49
- it('Renders with inital value if specified', async () => {
50
- const initialValue = 'Contact';
51
- const { getByPlaceholderText } = render(<DropdownFilter id="Dropdown" list={list} placeholder="Placeholder" initalValue={initialValue} />);
52
- expect(getByPlaceholderText('Placeholder').value).toBe(initialValue);
53
- });*/
54
18
  });
55
19
  //# sourceMappingURL=ListRow.tests.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/List/__tests__/ListRow.tests.tsx"],"names":["React","render","ListRow","Institute","describe","it","getByText","label","action","key","expect","toBeDefined","getByRole","click"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,QAAuB,wBAAvB;AACA,SAASC,OAAT,QAAwB,UAAxB;AACA,SAASC,SAAT,QAA0B,qCAA1B;AAEAC,QAAQ,CAAC,aAAD,EAAgB,MAAM;AAC5BC,EAAAA,EAAE,CAAC,SAAD,EAAY,YAAY;AACxB,UAAM;AAAEC,MAAAA;AAAF,QAAgBL,MAAM,eAC1B,oBAAC,OAAD;AACE,MAAA,IAAI,EAAEE,SADR;AAEE,MAAA,QAAQ,eAAE,sDAFZ;AAGE,MAAA,eAAe,EAAE,CACf;AAAEI,QAAAA,KAAK,EAAE,UAAT;AAAqBC,QAAAA,MAAM,EAAE,MAAM,CAAE,CAArC;AAAuCC,QAAAA,GAAG,EAAE;AAA5C,OADe,EAEf;AAAEF,QAAAA,KAAK,EAAE,UAAT;AAAqBC,QAAAA,MAAM,EAAE,MAAM,CAAE,CAArC;AAAuCC,QAAAA,GAAG,EAAE;AAA5C,OAFe;AAHnB,gBAD0B,CAA5B;AAWAC,IAAAA,MAAM,CAACJ,SAAS,CAAC,oBAAD,CAAV,CAAN,CAAwCK,WAAxC;AACD,GAbC,CAAF;AAeAN,EAAAA,EAAE,CAAC,gCAAD,EAAmC,YAAY;AAC/C,UAAM;AAAEO,MAAAA,SAAF;AAAaN,MAAAA;AAAb,QAA2BL,MAAM,eACrC,oBAAC,OAAD;AACE,MAAA,IAAI,EAAEE,SADR;AAEE,MAAA,QAAQ,eAAE,sDAFZ;AAGE,MAAA,eAAe,EAAE,CACf;AAAEI,QAAAA,KAAK,EAAE,UAAT;AAAqBC,QAAAA,MAAM,EAAE,MAAM,CAAE,CAArC;AAAuCC,QAAAA,GAAG,EAAE;AAA5C,OADe,EAEf;AAAEF,QAAAA,KAAK,EAAE,UAAT;AAAqBC,QAAAA,MAAM,EAAE,MAAM,CAAE,CAArC;AAAuCC,QAAAA,GAAG,EAAE;AAA5C,OAFe;AAHnB,gBADqC,CAAvC,CAD+C,CAa/C;;AACAG,IAAAA,SAAS,CAAC,QAAD,CAAT,CAAoBC,KAApB;AACAH,IAAAA,MAAM,CAACJ,SAAS,CAAC,UAAD,CAAV,CAAN,CAA8BK,WAA9B;AACD,GAhBC,CAAF;AAkBA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEC,CA5CO,CAAR","sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\nimport { ListRow } from '../index';\nimport { Institute } from '../../icons/systemicons/SystemIcons';\n\ndescribe('<ListRow />', () => {\n it('Renders', async () => {\n const { getByText } = render(\n <ListRow\n Icon={Institute}\n mainInfo={<div>Laerdal Medical AS</div>}\n dropdownOptions={[\n { label: 'Option 1', action: () => {}, key: 'Test1' },\n { label: 'Option 2', action: () => {}, key: 'Test2' },\n ]}>\n Menu 1\n </ListRow>,\n );\n expect(getByText('Laerdal Medical AS')).toBeDefined();\n });\n\n it('When menu is clicked, it opens', async () => {\n const { getByRole, getByText } = render(\n <ListRow\n Icon={Institute}\n mainInfo={<div>Laerdal Medical AS</div>}\n dropdownOptions={[\n { label: 'Option 1', action: () => {}, key: 'Test1' },\n { label: 'Option 2', action: () => {}, key: 'Test2' },\n ]}>\n Menu 1\n </ListRow>,\n );\n\n //expect(getByText('Option 1')).not.toBeDefined();\n getByRole('button').click();\n expect(getByText('Option 1')).toBeDefined();\n });\n\n /*it('Renders with required input if specified', async () => {\n const { getByPlaceholderText } = render(<DropdownFilter id=\"Dropdown\" list={list} placeholder=\"Placeholder\" required />);\n expect(getByPlaceholderText('Placeholder').required).toBe(true);\n });\n\n it('Renders with inital value if specified', async () => {\n const initialValue = 'Contact';\n const { getByPlaceholderText } = render(<DropdownFilter id=\"Dropdown\" list={list} placeholder=\"Placeholder\" initalValue={initialValue} />);\n expect(getByPlaceholderText('Placeholder').value).toBe(initialValue);\n });*/\n});\n"],"file":"ListRow.tests.js"}
1
+ {"version":3,"sources":["../../../../src/List/__tests__/ListRow.tests.tsx"],"names":["React","render","ListRow","Size","SystemIcons","describe","it","getByText","Small","expect","toBeDefined"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,MAAR,QAAqB,wBAArB;AACA,SAAQC,OAAR,QAAsB,UAAtB;AACA,SAAQC,IAAR,QAAmB,aAAnB;AACA,SAAQC,WAAR,QAA0B,aAA1B;AAEAC,QAAQ,CAAC,aAAD,EAAgB,MAAM;AAC5BC,EAAAA,EAAE,CAAC,SAAD,EAAY,YAAY;AACxB,UAAM;AAACC,MAAAA;AAAD,QAAcN,MAAM,eACxB,oBAAC,OAAD;AACE,MAAA,IAAI,eAAE,oBAAC,WAAD,CAAa,SAAb,OADR;AAEE,MAAA,QAAQ,EAAE,oBAFZ;AAGE,MAAA,IAAI,EAAEE,IAAI,CAACK,KAHb;AAIE,MAAA,QAAQ,EAAE;AAJZ,MADwB,CAA1B;AAOAC,IAAAA,MAAM,CAACF,SAAS,CAAC,oBAAD,CAAV,CAAN,CAAwCG,WAAxC;AACD,GATC,CAAF;AAUD,CAXO,CAAR","sourcesContent":["import React from 'react';\nimport {render} from '@testing-library/react';\nimport {ListRow} from '../index';\nimport {Size} from '../../types';\nimport {SystemIcons} from '../../icons';\n\ndescribe('<ListRow />', () => {\n it('Renders', async () => {\n const {getByText} = render(\n <ListRow\n icon={<SystemIcons.Institute/>}\n mainText={'Laerdal Medical AS'}\n size={Size.Small}\n disabled={false}/>,\n );\n expect(getByText('Laerdal Medical AS')).toBeDefined();\n });\n});\n"],"file":"ListRow.tests.js"}
@@ -1,4 +1,3 @@
1
1
  import ListRow from './ListRow';
2
- import ListRowDropdown from './ListRowDropdown';
3
- export { ListRow, ListRowDropdown };
2
+ export { ListRow };
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/List/index.ts"],"names":["ListRow","ListRowDropdown"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,WAApB;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAEA,SAASD,OAAT,EAAkBC,eAAlB","sourcesContent":["import ListRow from './ListRow';\nimport ListRowDropdown from './ListRowDropdown';\n\nexport { ListRow, ListRowDropdown };\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/List/index.ts"],"names":["ListRow"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,WAApB;AAEA,SAAQA,OAAR","sourcesContent":["import ListRow from './ListRow';\n\nexport {ListRow};\n"],"file":"index.js"}
@@ -29,6 +29,7 @@ const ModalContainerStyles = {
29
29
  const modalTransitions = `
30
30
  .ReactModal__Overlay {
31
31
  opacity: 0;
32
+ z-index: 100;
32
33
  }
33
34
 
34
35
  .ReactModal__Overlay--after-open {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Modals/ModalContainer.tsx"],"names":["React","ReactModal","BOXSHADOWS","ModalContainerStyles","content","top","left","right","bottom","marginRight","width","height","borderRadius","boxSizing","margin","overflow","boxShadow","BOXSHADOW_L3","modalTransitions","ModalContainer","Component","modalHeight","modalWidth","modalOverflow","componentDidMount","defaultStyles","overlay","backgroundColor","document","querySelector","head","getElementsByTagName","style","createElement","setAttribute","appendChild","createTextNode","render","id","showModal","closeModal","children","padding","minWidth","maxWidth","props","sizes","GetSize","GetOverflow","stylesConfiguration","Object","assign","styles","getElementById"],"mappings":";;;;;;;;AAAA,OAAO,KAAKA,KAAZ,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D,MAAAA,OAAO,EAAE6C;AAAX,KAAf;AAEA,wBACE,oBAAC,UAAD;AAAY,MAAA,EAAE,EAAEX,EAAhB;AAAoB,MAAA,MAAM,EAAEC,SAA5B;AAAuC,MAAA,cAAc,EAAE,GAAvD;AAA4D,MAAA,cAAc,EAAE,MAAMC,UAAU,EAA5F;AAAgG,MAAA,KAAK,EAAEY,MAAvG;AAA+G,MAAA,UAAU,EAAExB,QAAQ,CAACyB,cAAT,CAAwB,MAAxB,KAAmC;AAA9J,OACGZ,QADH,CADF;AAKD;;AA/BoF;;gBAAjFtB,c;AAdJmB,EAAAA,E;AACAC,EAAAA,S;AACAC,EAAAA,U;AACAC,EAAAA,Q;AACApB,EAAAA,W;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAmB,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,Q;;;AAuCF,eAAezB,cAAf","sourcesContent":["import * as React from 'react';\nimport ReactModal from 'react-modal';\nimport { BOXSHADOWS } from '../styles';\n\nconst ModalContainerStyles = {\n content: {\n top: '50%',\n left: '50%',\n right: 'auto',\n bottom: 'auto',\n marginRight: '-50%',\n width: '640px',\n height: '320px',\n borderRadius: '8px',\n boxSizing: 'border-box' as any,\n margin: 0,\n overflow: 'auto',\n boxShadow: BOXSHADOWS.BOXSHADOW_L3,\n },\n};\n\n//override modal classes to define the animations\nconst modalTransitions = `\n.ReactModal__Overlay {\n opacity: 0;\n}\n\n.ReactModal__Overlay--after-open {\n opacity: 1;\n transition: opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Content{\n opacity:0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n}\n\n.ReactModal__Content--after-open{\n opacity: 1;\n transform: translate(-50%, -50%) scale(1.0, 1.0);\n transition: transform 150ms ease-in-out, opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Overlay--before-close {\n opacity: 0;\n transition: opacity 120ms linear;\n}\n\n.ReactModal__Content--before-close{\n opacity: 0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n transition: transform 120ms ease-in-out, opacity 120ms cubic-bezier(0.55, 0.05, 0.67, 0.19);\n}\n`;\n\ntype ModalContainerProps = {\n id?: string;\n showModal: boolean;\n closeModal: () => void;\n children: any;\n modalHeight?: any;\n modalWidth?: any;\n modalOverflow?: string;\n padding?: string;\n minWidth?: string;\n maxWidth?: string;\n};\n\ntype ModalContainerState = {};\n\nclass ModalContainer extends React.Component<ModalContainerProps, ModalContainerState> {\n componentDidMount() {\n if (ReactModal.defaultStyles.overlay) {\n ReactModal.defaultStyles.overlay.backgroundColor = 'rgba(0,0,0,0.5)';\n }\n\n //append style node to override modal transition classes\n if (!document.querySelector('[modal-custom-styling=\"active\"]')) {\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.setAttribute('modal-custom-styling', 'active');\n head.appendChild(style);\n style.appendChild(document.createTextNode(modalTransitions));\n }\n }\n\n GetSize = (modalHeight: string = 'auto', modalWidth: string = 'auto') => ({ height: modalHeight, width: modalWidth });\n GetOverflow = (modalOverflow: string = 'visible') => modalOverflow;\n render() {\n const { id, showModal, closeModal, children, modalHeight, modalWidth, modalOverflow, padding, minWidth = '', maxWidth = '' } = this.props;\n const sizes = this.GetSize(modalHeight, modalWidth);\n const { height, width } = sizes;\n const overflow = this.GetOverflow(modalOverflow);\n const stylesConfiguration = Object.assign({ ...ModalContainerStyles.content }, { height, width, padding, overflow, minWidth, maxWidth });\n const styles = { content: stylesConfiguration };\n\n return (\n <ReactModal id={id} isOpen={showModal} closeTimeoutMS={120} onRequestClose={() => closeModal()} style={styles} appElement={document.getElementById('root') || ''}>\n {children}\n </ReactModal>\n );\n }\n}\n\nexport default ModalContainer;\n"],"file":"ModalContainer.js"}
1
+ {"version":3,"sources":["../../../src/Modals/ModalContainer.tsx"],"names":["React","ReactModal","BOXSHADOWS","ModalContainerStyles","content","top","left","right","bottom","marginRight","width","height","borderRadius","boxSizing","margin","overflow","boxShadow","BOXSHADOW_L3","modalTransitions","ModalContainer","Component","modalHeight","modalWidth","modalOverflow","componentDidMount","defaultStyles","overlay","backgroundColor","document","querySelector","head","getElementsByTagName","style","createElement","setAttribute","appendChild","createTextNode","render","id","showModal","closeModal","children","padding","minWidth","maxWidth","props","sizes","GetSize","GetOverflow","stylesConfiguration","Object","assign","styles","getElementById"],"mappings":";;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,aAAvB;AACA,SAASC,UAAT,QAA2B,WAA3B;AAEA,MAAMC,oBAAoB,GAAG;AAC3BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE,KADE;AAEPC,IAAAA,IAAI,EAAE,KAFC;AAGPC,IAAAA,KAAK,EAAE,MAHA;AAIPC,IAAAA,MAAM,EAAE,MAJD;AAKPC,IAAAA,WAAW,EAAE,MALN;AAMPC,IAAAA,KAAK,EAAE,OANA;AAOPC,IAAAA,MAAM,EAAE,OAPD;AAQPC,IAAAA,YAAY,EAAE,KARP;AASPC,IAAAA,SAAS,EAAE,YATJ;AAUPC,IAAAA,MAAM,EAAE,CAVD;AAWPC,IAAAA,QAAQ,EAAE,MAXH;AAYPC,IAAAA,SAAS,EAAEd,UAAU,CAACe;AAZf;AADkB,CAA7B,C,CAiBA;;AACA,MAAMC,gBAAgB,GAAI;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAhCA;;AAiDA,MAAMC,cAAN,SAA6BnB,KAAK,CAACoB,SAAnC,CAAuF;AAAA;AAAA;;AAAA,qCAgB3E,CAACC,WAAmB,GAAG,MAAvB,EAA+BC,UAAkB,GAAG,MAApD,MAAgE;AAAEX,MAAAA,MAAM,EAAEU,WAAV;AAAuBX,MAAAA,KAAK,EAAEY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aAAjB,CAAjB;AACA,UAAM0B,mBAAmB,GAAGC,MAAM,CAACC,MAAP,mBAAmBhD,oBAAoB,CAACC,OAAxC,GAAmD;AAAEO,MAAAA,MAAF;AAAUD,MAAAA,KAAV;AAAiBgC,MAAAA,OAAjB;AAA0B3B,MAAAA,QAA1B;AAAoC4B,MAAAA,QAApC;AAA8CC,MAAAA;AAA9C,KAAnD,CAA5B;AACA,UAAMQ,MAAM,GAAG;AAAEhD,MAAAA,OAAO,EAAE6C;AAAX,KAAf;AAEA,wBACE,oBAAC,UAAD;AAAY,MAAA,EAAE,EAAEX,EAAhB;AAAoB,MAAA,MAAM,EAAEC,SAA5B;AAAuC,MAAA,cAAc,EAAE,GAAvD;AAA4D,MAAA,cAAc,EAAE,MAAMC,UAAU,EAA5F;AAAgG,MAAA,KAAK,EAAEY,MAAvG;AAA+G,MAAA,UAAU,EAAExB,QAAQ,CAACyB,cAAT,CAAwB,MAAxB,KAAmC;AAA9J,OACGZ,QADH,CADF;AAKD;;AA/BoF;;gBAAjFtB,c;AAdJmB,EAAAA,E;AACAC,EAAAA,S;AACAC,EAAAA,U;AACAC,EAAAA,Q;AACApB,EAAAA,W;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAmB,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,Q;;;AAuCF,eAAezB,cAAf","sourcesContent":["import * as React from 'react';\nimport ReactModal from 'react-modal';\nimport { BOXSHADOWS } from '../styles';\n\nconst ModalContainerStyles = {\n content: {\n top: '50%',\n left: '50%',\n right: 'auto',\n bottom: 'auto',\n marginRight: '-50%',\n width: '640px',\n height: '320px',\n borderRadius: '8px',\n boxSizing: 'border-box' as any,\n margin: 0,\n overflow: 'auto',\n boxShadow: BOXSHADOWS.BOXSHADOW_L3,\n },\n};\n\n//override modal classes to define the animations\nconst modalTransitions = `\n.ReactModal__Overlay {\n opacity: 0;\n z-index: 100;\n}\n\n.ReactModal__Overlay--after-open {\n opacity: 1;\n transition: opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Content{\n opacity:0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n}\n\n.ReactModal__Content--after-open{\n opacity: 1;\n transform: translate(-50%, -50%) scale(1.0, 1.0);\n transition: transform 150ms ease-in-out, opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Overlay--before-close {\n opacity: 0;\n transition: opacity 120ms linear;\n}\n\n.ReactModal__Content--before-close{\n opacity: 0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n transition: transform 120ms ease-in-out, opacity 120ms cubic-bezier(0.55, 0.05, 0.67, 0.19);\n}\n`;\n\ntype ModalContainerProps = {\n id?: string;\n showModal: boolean;\n closeModal: () => void;\n children: any;\n modalHeight?: any;\n modalWidth?: any;\n modalOverflow?: string;\n padding?: string;\n minWidth?: string;\n maxWidth?: string;\n};\n\ntype ModalContainerState = {};\n\nclass ModalContainer extends React.Component<ModalContainerProps, ModalContainerState> {\n componentDidMount() {\n if (ReactModal.defaultStyles.overlay) {\n ReactModal.defaultStyles.overlay.backgroundColor = 'rgba(0,0,0,0.5)';\n }\n\n //append style node to override modal transition classes\n if (!document.querySelector('[modal-custom-styling=\"active\"]')) {\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.setAttribute('modal-custom-styling', 'active');\n head.appendChild(style);\n style.appendChild(document.createTextNode(modalTransitions));\n }\n }\n\n GetSize = (modalHeight: string = 'auto', modalWidth: string = 'auto') => ({ height: modalHeight, width: modalWidth });\n GetOverflow = (modalOverflow: string = 'visible') => modalOverflow;\n render() {\n const { id, showModal, closeModal, children, modalHeight, modalWidth, modalOverflow, padding, minWidth = '', maxWidth = '' } = this.props;\n const sizes = this.GetSize(modalHeight, modalWidth);\n const { height, width } = sizes;\n const overflow = this.GetOverflow(modalOverflow);\n const stylesConfiguration = Object.assign({ ...ModalContainerStyles.content }, { height, width, padding, overflow, minWidth, maxWidth });\n const styles = { content: stylesConfiguration };\n\n return (\n <ReactModal id={id} isOpen={showModal} closeTimeoutMS={120} onRequestClose={() => closeModal()} style={styles} appElement={document.getElementById('root') || ''}>\n {children}\n </ReactModal>\n );\n }\n}\n\nexport default ModalContainer;\n"],"file":"ModalContainer.js"}
@@ -6,6 +6,7 @@ import { COLORS, ComponentL, ComponentM, ComponentTextStyle, ComponentXL } from
6
6
  import { Size } from '../types';
7
7
  import ModalContainer from './ModalContainer';
8
8
  import { BackButtonWrapper, CloseButtonWrapper, Column, ModalBody, ModalFooter, ModalTitleSection, StyledModalHeader } from './ModalStyles';
9
+ import { ModalNote } from './ModalNote';
9
10
  export const ModalDialog = ({
10
11
  size,
11
12
  isModalOpen,
@@ -17,7 +18,9 @@ export const ModalDialog = ({
17
18
  closeAction,
18
19
  submitAction,
19
20
  tooltip,
20
- children
21
+ children,
22
+ note,
23
+ state
21
24
  }) => {
22
25
  const [tooltipOpen, setTooltipOpen] = React.useState(false);
23
26
 
@@ -182,7 +185,11 @@ export const ModalDialog = ({
182
185
  color: COLORS.neutral_600
183
186
  })), tooltipOpen && /*#__PURE__*/React.createElement("span", null, tooltip)), !topImage && ModalCloseButton(closeAction)), /*#__PURE__*/React.createElement(ModalBody, {
184
187
  size: size
185
- }, children), /*#__PURE__*/React.createElement(ModalFooter, {
188
+ }, children), note && /*#__PURE__*/React.createElement(ModalNote, {
189
+ note: note,
190
+ state: state,
191
+ size: size
192
+ }), /*#__PURE__*/React.createElement(ModalFooter, {
186
193
  size: size
187
194
  }, buttons?.map((b, i) => /*#__PURE__*/React.createElement(Button, {
188
195
  key: b.id || i,
@@ -212,7 +219,9 @@ ModalDialog.propTypes = {
212
219
  tooltip: _pt.string,
213
220
  backButton: _pt.func,
214
221
  closeAction: _pt.func.isRequired,
215
- submitAction: _pt.func.isRequired
222
+ submitAction: _pt.func.isRequired,
223
+ note: _pt.string,
224
+ state: _pt.string
216
225
  };
217
226
  export default ModalDialog;
218
227
  //# sourceMappingURL=ModalDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Modals/ModalDialog.tsx"],"names":["React","Button","IconButton","ArrowLineLeft","Close","Help","COLORS","ComponentL","ComponentM","ComponentTextStyle","ComponentXL","Size","ModalContainer","BackButtonWrapper","CloseButtonWrapper","Column","ModalBody","ModalFooter","ModalTitleSection","StyledModalHeader","ModalDialog","size","isModalOpen","closeModalAndClearInput","title","topImage","buttons","backButton","closeAction","submitAction","tooltip","children","tooltipOpen","setTooltipOpen","useState","getMinWidth","Small","Large","Medium","getMaxWidth","getImageHeight","getMarginBottom","getPadding","ModalTitle","Bold","ModalCloseButton","onClick","black","ModalBackButton","reverse","lastLeftButton","find","a","position","neutral_600","map","b","i","id","disabled","loading","action","type","variant","order","marginRight","undefined","text"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAAQC,MAAR,EAAgBC,UAAhB,QAAiC,WAAjC;AAEA,SAAQC,aAAR,EAAuBC,KAAvB,EAA8BC,IAA9B,QAAyC,kCAAzC;AACA,SAAQC,MAAR,EAAgBC,UAAhB,EAA4BC,UAA5B,EAAwCC,kBAAxC,EAA4DC,WAA5D,QAA8E,WAA9E;AACA,SAAQC,IAAR,QAAmB,UAAnB;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,SACEC,iBADF,EAEEC,kBAFF,EAGEC,MAHF,EAIEC,SAJF,EAKEC,WALF,EAMEC,iBANF,EAOEC,iBAPF,QAQO,eARP;AA6BA,OAAO,MAAMC,WAAmD,GAAG,CAAC;AAClEC,EAAAA,IADkE;AAElEC,EAAAA,WAFkE;AAGlEC,EAAAA,uBAHkE;AAIlEC,EAAAA,KAJkE;AAKlEC,EAAAA,QALkE;AAMlEC,EAAAA,OANkE;AAOlEC,EAAAA,UAPkE;AAQlEC,EAAAA,WARkE;AASlEC,EAAAA,YATkE;AAUlEC,EAAAA,OAVkE;AAWlEC,EAAAA;AAXkE,CAAD,KAY7D;AACJ,QAAM,CAACC,WAAD,EAAcC,c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,O;AAXAmC,IAAAA,M;AACAM,IAAAA,I;AACAd,IAAAA,Q,aAAW,M,EAAS,O;;AAUpBvB,EAAAA,O;AACAH,EAAAA,U;AACAC,EAAAA,W;AACAC,EAAAA,Y;;AA+KF,eAAeT,WAAf","sourcesContent":["import * as React from 'react';\nimport {Button, IconButton} from '../Button';\nimport {ButtonProps} from '../Button/Button';\nimport {ArrowLineLeft, Close, Help} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentL, ComponentM, ComponentTextStyle, ComponentXL} from '../styles';\nimport {Size} from '../types'\nimport ModalContainer from './ModalContainer';\nimport {\n BackButtonWrapper,\n CloseButtonWrapper,\n Column,\n ModalBody,\n ModalFooter,\n ModalTitleSection,\n StyledModalHeader\n} from './ModalStyles';\n\ninterface ButtonAction extends Pick<ButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'> {\n action?: (() => void) | ((e: any) => void);\n text: string;\n position?: 'left' | 'right';\n}\n\ninterface NewModalProps {\n size?: Size;\n isModalOpen: boolean;\n closeModalAndClearInput: any;\n title?: string;\n topImage?: any;\n buttons?: ButtonAction[];\n tooltip?: string;\n backButton?: () => void;\n closeAction: () => void;\n submitAction: (event?: React.FormEvent<HTMLFormElement> | undefined) => void;\n}\n\nexport const ModalDialog: React.FunctionComponent<NewModalProps> = ({\n size,\n isModalOpen,\n closeModalAndClearInput,\n title,\n topImage,\n buttons,\n backButton,\n closeAction,\n submitAction,\n tooltip,\n children\n}) => {\n const [tooltipOpen, setTooltipOpen] = React.useState<boolean>(false);\n\n const getMinWidth = () => {\n switch (size) {\n case Size.Small:\n return '320px';\n case Size.Large:\n return '640px';\n case Size.Medium:\n default:\n return '480px';\n }\n };\n\n const getMaxWidth = () => {\n switch (size) {\n case Size.Small:\n return '480px';\n case Size.Large:\n return '720px';\n case Size.Medium:\n default:\n return '640px';\n }\n };\n\n const getImageHeight = () => {\n switch (size) {\n case Size.Small:\n return 160;\n case Size.Medium:\n return 200;\n case Size.Large:\n return 240;\n default:\n return 200;\n }\n };\n\n const getMarginBottom = () => {\n switch (size) {\n case Size.Small:\n return '16px';\n case Size.Medium:\n return '24px';\n case Size.Large:\n return '32px';\n default:\n return '24px';\n }\n };\n\n const getPadding = () => {\n switch (size) {\n case Size.Small:\n return '16px 16px 8px';\n case Size.Medium:\n return '24px 24px 20px';\n case Size.Large:\n return '32px';\n default:\n return '24px 24px 16px';\n }\n };\n\n const ModalTitle = (title: string, size?: Size) => {\n switch (size) {\n case Size.Small:\n return <ComponentM textStyle={ComponentTextStyle.Bold}>{title}</ComponentM>;\n case Size.Medium:\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\n case Size.Large:\n return <ComponentXL textStyle={ComponentTextStyle.Bold}>{title}</ComponentXL>;\n default:\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\n }\n };\n\n const ModalCloseButton = (onClick: any) => {\n return (\n <CloseButtonWrapper hasImage={!!topImage} size={size}>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => onClick()} borderRadius={48}>\n <Close size=\"24px\" color={COLORS.black} />\n </IconButton>\n </CloseButtonWrapper>\n );\n };\n\n const ModalBackButton = () => {\n if (backButton) {\n return (\n <BackButtonWrapper hasImage={!!topImage} size={size}>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => backButton()} borderRadius={48}>\n <ArrowLineLeft size=\"24px\" color={COLORS.black} />\n </IconButton>\n </BackButtonWrapper>\n );\n }\n };\n\n buttons?.reverse();\n const lastLeftButton = buttons?.find(a => a.position === 'left');\n buttons?.reverse();\n\n return (\n <ModalContainer showModal={isModalOpen} closeModal={closeModalAndClearInput} minWidth={getMinWidth()} maxWidth={getMaxWidth()} modalHeight=\"auto\" padding={getPadding()}>\n <Column>\n <form onSubmit={submitAction}>\n {topImage && (\n <StyledModalHeader size={size} height={getImageHeight()} marginBottom={getMarginBottom()}>\n <img src={topImage} alt=\"Modal top\" />\n {ModalBackButton()}\n {ModalCloseButton(closeAction)}\n </StyledModalHeader>\n )}\n <ModalTitleSection>\n {!topImage && ModalBackButton()}\n {title && ModalTitle(title, size)}\n {tooltip && (\n <div id=\"tooltip\">\n <div onMouseOver={() => setTooltipOpen(true)} onMouseOut={() => setTooltipOpen(false)}>\n <Help size=\"24px\" color={COLORS.neutral_600} />\n </div>\n {tooltipOpen && <span>{tooltip}</span>}\n </div>\n )}\n {!topImage && ModalCloseButton(closeAction)}\n </ModalTitleSection>\n\n <ModalBody size={size}>{children}</ModalBody>\n\n <ModalFooter size={size}>\n {buttons?.map((b, i) => (\n <Button key={b.id || i}\n id={b.id}\n disabled={b.disabled}\n loading={b.loading}\n size={size}\n onClick={b.action}\n type={b.type}\n variant={b.variant}\n style={\n b.position === 'left'\n ? {\n order: -1,\n marginRight: b === lastLeftButton ? 'auto' : undefined\n }\n : undefined\n }>\n {b.text}\n </Button>\n ))}\n </ModalFooter>\n </form>\n </Column>\n </ModalContainer>\n );\n};\n\nexport default ModalDialog;\n"],"file":"ModalDialog.js"}
1
+ {"version":3,"sources":["../../../src/Modals/ModalDialog.tsx"],"names":["React","Button","IconButton","ArrowLineLeft","Close","Help","COLORS","ComponentL","ComponentM","ComponentTextStyle","ComponentXL","Size","ModalContainer","BackButtonWrapper","CloseButtonWrapper","Column","ModalBody","ModalFooter","ModalTitleSection","StyledModalHeader","ModalNote","ModalDialog","size","isModalOpen","closeModalAndClearInput","title","topImage","buttons","backButton","closeAction","submitAction","tooltip","children","note","state","tooltipOpen","setTooltipOpen","useState","getMinWidth","Small","Large","Medium","getMaxWidth","getImageHeight","getMarginBottom","getPadding","ModalTitle","Bold","ModalCloseButton","onClick","black","ModalBackButton","reverse","lastLeftButton","find","a","position","neutral_600","map","b","i","id","disabled","loading","action","type","variant","order","marginRight","undefined","text"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,SAAQC,MAAR,EAAgBC,UAAhB,QAAiC,WAAjC;AAEA,SAAQC,aAAR,EAAuBC,KAAv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AA,IAAI,EAAEZ;AAA3C,IAxBZ,eA0BE,oBAAC,WAAD;AAAa,IAAA,IAAI,EAAEA;AAAnB,KACKK,OAAO,EAAE+B,GAAT,CAAa,CAACC,CAAD,EAAIC,CAAJ,kBACV,oBAAC,MAAD;AAAQ,IAAA,GAAG,EAAED,CAAC,CAACE,EAAF,IAAQD,CAArB;AACQ,IAAA,EAAE,EAAED,CAAC,CAACE,EADd;AAEQ,IAAA,QAAQ,EAAEF,CAAC,CAACG,QAFpB;AAGQ,IAAA,OAAO,EAAEH,CAAC,CAACI,OAHnB;AAIQ,IAAA,IAAI,EAAEzC,IAJd;AAKQ,IAAA,OAAO,EAAEqC,CAAC,CAACK,MALnB;AAMQ,IAAA,IAAI,EAAEL,CAAC,CAACM,IANhB;AAOQ,IAAA,OAAO,EAAEN,CAAC,CAACO,OAPnB;AAQQ,IAAA,KAAK,EACHP,CAAC,CAACH,QAAF,KAAe,MAAf,GACI;AACAW,MAAAA,KAAK,EAAE,CAAC,CADR;AAEAC,MAAAA,WAAW,EAAET,CAAC,KAAKN,cAAN,GAAuB,MAAvB,GAAgCgB;AAF7C,KADJ,GAKIA;AAdd,KAgBGV,CAAC,CAACW,IAhBL,CADH,CADL,CA1BF,CADF,CADF,CADF;AAuDD,CA9KM;;AAbL/C,EAAAA,W;AACAC,EAAAA,uB;AACAC,EAAAA,K;AACAC,EAAAA,Q;AACAC,EAAAA,O;AAXAqC,IAAAA,M;AACAM,IAAAA,I;AACAd,IAAAA,Q,aAAW,M,EAAS,O;;AAUpBzB,EAAAA,O;AACAH,EAAAA,U;AACAC,EAAAA,W;AACAC,EAAAA,Y;AACAG,EAAAA,I;AACAC,EAAAA,K;;AAmLF,eAAeb,WAAf","sourcesContent":["import * as React from 'react';\nimport { SystemIcon, SystemIcons } from '..';\nimport {Button, IconButton} from '../Button';\nimport {ButtonProps} from '../Button/Button';\nimport {ArrowLineLeft, Close, Help} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentL, ComponentM, ComponentTextStyle, ComponentXL} from '../styles';\nimport {Size} from '../types'\nimport ModalContainer from './ModalContainer';\nimport {\n BackButtonWrapper,\n CloseButtonWrapper,\n Column,\n ModalBody,\n ModalFooter,\n ModalTitleSection,\n StyledModalHeader\n} from './ModalStyles';\n\nimport {ModalNote} from './ModalNote';\n\ninterface ButtonAction extends Pick<ButtonProps, 'variant' | 'id' | 'loading' | 'disabled' | 'icon' | 'type'> {\n action?: (() => void) | ((e: any) => void);\n text: string;\n position?: 'left' | 'right';\n}\n\ninterface NewModalProps {\n size?: Size;\n isModalOpen: boolean;\n closeModalAndClearInput: any;\n title?: string;\n topImage?: any;\n buttons?: ButtonAction[];\n tooltip?: string;\n backButton?: () => void;\n closeAction: () => void;\n submitAction: (event?: React.FormEvent<HTMLFormElement> | undefined) => void;\n note?: string;\n state?: string;\n}\n\nexport const ModalDialog: React.FunctionComponent<NewModalProps> = ({\n size,\n isModalOpen,\n closeModalAndClearInput,\n title,\n topImage,\n buttons,\n backButton,\n closeAction,\n submitAction,\n tooltip,\n children,\n note,\n state\n}) => {\n const [tooltipOpen, setTooltipOpen] = React.useState<boolean>(false);\n\n const getMinWidth = () => {\n switch (size) {\n case Size.Small:\n return '320px';\n case Size.Large:\n return '640px';\n case Size.Medium:\n default:\n return '480px';\n }\n };\n\n const getMaxWidth = () => {\n switch (size) {\n case Size.Small:\n return '480px';\n case Size.Large:\n return '720px';\n case Size.Medium:\n default:\n return '640px';\n }\n };\n\n const getImageHeight = () => {\n switch (size) {\n case Size.Small:\n return 160;\n case Size.Medium:\n return 200;\n case Size.Large:\n return 240;\n default:\n return 200;\n }\n };\n\n const getMarginBottom = () => {\n switch (size) {\n case Size.Small:\n return '16px';\n case Size.Medium:\n return '24px';\n case Size.Large:\n return '32px';\n default:\n return '24px';\n }\n };\n\n const getPadding = () => {\n switch (size) {\n case Size.Small:\n return '16px 16px 8px';\n case Size.Medium:\n return '24px 24px 20px';\n case Size.Large:\n return '32px';\n default:\n return '24px 24px 16px';\n }\n };\n\n const ModalTitle = (title: string, size?: Size) => {\n switch (size) {\n case Size.Small:\n return <ComponentM textStyle={ComponentTextStyle.Bold}>{title}</ComponentM>;\n case Size.Medium:\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\n case Size.Large:\n return <ComponentXL textStyle={ComponentTextStyle.Bold}>{title}</ComponentXL>;\n default:\n return <ComponentL textStyle={ComponentTextStyle.Bold}>{title}</ComponentL>;\n }\n };\n\n const ModalCloseButton = (onClick: any) => {\n return (\n <CloseButtonWrapper hasImage={!!topImage} size={size}>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => onClick()} borderRadius={48}>\n <Close size=\"24px\" color={COLORS.black} />\n </IconButton>\n </CloseButtonWrapper>\n );\n };\n\n const ModalBackButton = () => {\n if (backButton) {\n return (\n <BackButtonWrapper hasImage={!!topImage} size={size}>\n <IconButton variant=\"secondary\" shape=\"circular\" action={() => backButton()} borderRadius={48}>\n <ArrowLineLeft size=\"24px\" color={COLORS.black} />\n </IconButton>\n </BackButtonWrapper>\n );\n }\n };\n\n buttons?.reverse();\n const lastLeftButton = buttons?.find(a => a.position === 'left');\n buttons?.reverse();\n\n return (\n <ModalContainer showModal={isModalOpen} closeModal={closeModalAndClearInput} minWidth={getMinWidth()} maxWidth={getMaxWidth()} modalHeight=\"auto\" padding={getPadding()}>\n <Column>\n <form onSubmit={submitAction}>\n {topImage && (\n <StyledModalHeader size={size} height={getImageHeight()} marginBottom={getMarginBottom()}>\n <img src={topImage} alt=\"Modal top\" />\n {ModalBackButton()}\n {ModalCloseButton(closeAction)}\n </StyledModalHeader>\n )}\n <ModalTitleSection>\n {!topImage && ModalBackButton()}\n {title && ModalTitle(title, size)}\n {tooltip && (\n <div id=\"tooltip\">\n <div onMouseOver={() => setTooltipOpen(true)} onMouseOut={() => setTooltipOpen(false)}>\n <Help size=\"24px\" color={COLORS.neutral_600} />\n </div>\n {tooltipOpen && <span>{tooltip}</span>}\n </div>\n )}\n {!topImage && ModalCloseButton(closeAction)}\n </ModalTitleSection>\n\n <ModalBody size={size}>{children}</ModalBody>\n\n { note && <ModalNote note={note} state={state} size={size}/> }\n\n <ModalFooter size={size}>\n {buttons?.map((b, i) => (\n <Button key={b.id || i}\n id={b.id}\n disabled={b.disabled}\n loading={b.loading}\n size={size}\n onClick={b.action}\n type={b.type}\n variant={b.variant}\n style={\n b.position === 'left'\n ? {\n order: -1,\n marginRight: b === lastLeftButton ? 'auto' : undefined\n }\n : undefined\n }>\n {b.text}\n </Button>\n ))}\n </ModalFooter>\n </form>\n </Column>\n </ModalContainer>\n );\n};\n\nexport default ModalDialog;\n"],"file":"ModalDialog.js"}
@@ -0,0 +1,56 @@
1
+ import _pt from "prop-types";
2
+ import * as React from 'react';
3
+ import { COLORS } from '..';
4
+ import { CheckComplete, Information, TechnicalWarning } from '../icons/systemicons/SystemIcons';
5
+ import { ModalNoteSection } from './ModalStyles';
6
+ export const ModalNote = ({
7
+ note,
8
+ icon,
9
+ size,
10
+ state = 'neutral'
11
+ }) => {
12
+ const stateVal = state.toLowerCase();
13
+
14
+ switch (stateVal) {
15
+ case 'positive':
16
+ return /*#__PURE__*/React.createElement(ModalNoteSection, {
17
+ state: stateVal,
18
+ size: size
19
+ }, icon ? icon : /*#__PURE__*/React.createElement(CheckComplete, {
20
+ color: COLORS.correct_500
21
+ }), /*#__PURE__*/React.createElement("span", null, note));
22
+
23
+ case 'warning':
24
+ return /*#__PURE__*/React.createElement(ModalNoteSection, {
25
+ state: stateVal,
26
+ size: size
27
+ }, icon ? icon : /*#__PURE__*/React.createElement(TechnicalWarning, {
28
+ color: COLORS.warning_500
29
+ }), /*#__PURE__*/React.createElement("span", null, note));
30
+
31
+ case 'critical':
32
+ return /*#__PURE__*/React.createElement(ModalNoteSection, {
33
+ state: stateVal,
34
+ size: size
35
+ }, icon ? icon : /*#__PURE__*/React.createElement(TechnicalWarning, {
36
+ color: COLORS.warning_500
37
+ }), /*#__PURE__*/React.createElement("span", null, note));
38
+
39
+ default:
40
+ return /*#__PURE__*/React.createElement(ModalNoteSection, {
41
+ state: stateVal,
42
+ size: size
43
+ }, icon ? icon : /*#__PURE__*/React.createElement(Information, {
44
+ color: COLORS.primary_500,
45
+ className: size
46
+ }), /*#__PURE__*/React.createElement("span", null, note));
47
+ }
48
+ };
49
+ ModalNote.propTypes = {
50
+ note: _pt.string.isRequired,
51
+ icon: _pt.node,
52
+ state: _pt.string,
53
+ size: _pt.string
54
+ };
55
+ export default ModalNote;
56
+ //# sourceMappingURL=ModalNote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Modals/ModalNote.tsx"],"names":["React","COLORS","CheckComplete","Information","TechnicalWarning","ModalNoteSection","ModalNote","note","icon","size","state","stateVal","toLowerCase","correct_500","warning_500","primary_500"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,MAAT,QAAuB,IAAvB;AACA,SAASC,aAAT,EAAwBC,WAAxB,EAAqCC,gBAArC,QAA6D,kCAA7D;AACA,SAAQC,gBAAR,QAA+B,eAA/B;AASA,OAAO,MAAMC,SAA8C,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOC,EAAAA,IAAP;AAAaC,EAAAA,IAAb;AAAmBC,EAAAA,KAAK,GAAC;AAAzB,CAAD,KAAyC;AACnG,QAAMC,QAAQ,GAAGD,KAAK,CAACE,WAAN,EAAjB;;AAEA,UAAOD,QAAP;AACI,SAAK,UAAL;AAAiB,0BACb,oBAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEA,QAAzB;AAAmC,QAAA,IAAI,EAAEF;AAAzC,SACKD,IAAI,GAAGA,IAAH,gBAAU,oBAAC,aAAD;AAAe,QAAA,KAAK,EAAEP,MAAM,CAACY;AAA7B,QADnB,eAEI,kCAAON,IAAP,CAFJ,CADa;;AAOjB,SAAK,SAAL;AAAgB,0BACZ,oBAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF;AAAzC,SACKD,IAAI,GAAGA,IAAH,gBAAU,oBAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEP,MAAM,CAACa;AAAhC,QADnB,eAEI,kCAAOP,IAAP,CAFJ,CADY;;AAOhB,SAAK,UAAL;AAAiB,0BACb,oBAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF;AAAzC,SACKD,IAAI,GAAGA,IAAH,gBAAU,oBAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEP,MAAM,CAACa;AAAhC,QADnB,eAEI,kCAAOP,IAAP,CAFJ,CADa;;AAOjB;AAAS,0BACL,oBAAC,gBAAD;AAAkB,QAAA,KAAK,EAAEI,QAAzB;AAAmC,QAAA,IAAI,EAAEF;AAAzC,SACKD,IAAI,GAAGA,IAAH,gBAAU,oBAAC,WAAD;AAAa,QAAA,KAAK,EAAEP,MAAM,CAACc,WAA3B;AAAwC,QAAA,SAAS,EAAEN;AAAnD,QADnB,eAEI,kCAAOF,IAAP,CAFJ,CADK;AAtBb;AA+BH,CAlCM;;AANHA,EAAAA,I;AACAC,EAAAA,I;AACAE,EAAAA,K;AACAD,EAAAA,I;;AAuCJ,eAAeH,SAAf","sourcesContent":["import * as React from 'react';\nimport { COLORS } from '..';\nimport { CheckComplete, Information, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport {ModalNoteSection} from './ModalStyles'\n\ninterface NoteProps {\n note: string;\n icon?: React.ReactNode;\n state?: string;\n size?: string;\n}\n\nexport const ModalNote : React.FunctionComponent<NoteProps> = ({note, icon, size, state='neutral'}) => { \n const stateVal = state.toLowerCase();\n\n switch(stateVal) {\n case 'positive': return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <CheckComplete color={COLORS.correct_500}/>}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n case 'warning': return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <TechnicalWarning color={COLORS.warning_500}/>}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n case 'critical': return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <TechnicalWarning color={COLORS.warning_500}/>}\n <span>{note}</span>\n </ModalNoteSection>\n );\n\n default: return (\n <ModalNoteSection state={stateVal} size={size}>\n {icon ? icon : <Information color={COLORS.primary_500} className={size}/>}\n <span>{note}</span>\n </ModalNoteSection>\n );\n }\n \n \n};\n\nexport default ModalNote;"],"file":"ModalNote.js"}
@@ -1,4 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
+ import { COLORS } from '..';
2
3
  import { Size } from '../types';
3
4
  /**
4
5
  * Modal styles
@@ -73,6 +74,23 @@ export const ModalTitle = styled.h5`
73
74
  font-size: ${props => props.fontSize || '1.25em'};
74
75
  font-weight: bold;
75
76
  `;
77
+ export const ModalNoteSection = styled.section`
78
+ background-color: ${props => getBackgroundColor(props.state)};
79
+ font-size: ${props => props?.size === 'small' ? `16px` : props?.size === 'large' ? '20px' : '18px'};
80
+ margin-top: ${props => props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px'};
81
+ margin-bottom: ${props => props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px'};
82
+ display: flex;
83
+ flex-direction: row;
84
+ padding: ${props => props?.size === 'small' ? `8px` : props?.size === 'large' ? '16px' : '12px'};
85
+ border-radius: 2px;
86
+
87
+ span {
88
+ display:block;
89
+ width: 80%;
90
+ margin-left: 8px;
91
+ color: ${props => getNoteMessageColor(props.state)};
92
+ }
93
+ `;
76
94
  export const ModalBody = styled.section`
77
95
  > :first-child {
78
96
  margin-top: 24px;
@@ -93,4 +111,34 @@ export const ModalFooter = styled.section`
93
111
 
94
112
  gap: ${props => props?.size === 'large' ? `16px` : '8px'};
95
113
  `;
114
+ export const getBackgroundColor = state => {
115
+ switch (state) {
116
+ case 'positive':
117
+ return COLORS.correct_100;
118
+
119
+ case 'warning':
120
+ return COLORS.warning_100;
121
+
122
+ case 'critical':
123
+ return COLORS.critical_100;
124
+
125
+ default:
126
+ return COLORS.primary_100;
127
+ }
128
+ };
129
+ export const getNoteMessageColor = state => {
130
+ switch (state) {
131
+ case 'positive':
132
+ return COLORS.correct_700;
133
+
134
+ case 'warning':
135
+ return COLORS.warning_700;
136
+
137
+ case 'critical':
138
+ return COLORS.critical_700;
139
+
140
+ default:
141
+ return COLORS.primary_700;
142
+ }
143
+ };
96
144
  //# sourceMappingURL=ModalStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Modals/ModalStyles.ts"],"names":["styled","css","Size","ModalHeader","section","props","marginBottom","StyledModalHeader","height","size","Column","div","ModalTitleSection","CloseButtonWrapper","hasImage","Small","Large","BackButtonWrapper","ModalTitle","h5","fontSize","ModalBody","ModalFooter"],"mappings":"AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,IAAT,QAAqB,UAArB;AAEA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GAAGH,MAAM,CAACI,OAAmC;AACrE;AACA;AACA;AACA,mBAAoBC,KAAD,IAAWA,KAAK,CAACC,YAAN,IAAsB,MAAO;AAC3D,CALO;AAOP,OAAO,MAAMC,iBAAiB,GAAGP,MAAM,CAACG,WAAD,CAAyE;AAChH;AACA;AACA;AACA;AACA,YAAaE,KAAD,IAAYA,KAAK,CAACG,MAAN,GAAgB,GAAEH,KAAK,CAACG,MAAN,IAAgBH,KAAK,CAACI,IAAN,KAAe,OAAf,GAAyB,EAAzB,GAA8BJ,KAAK,CAACI,IAAN,KAAe,OAAf,GAAyB,EAAzB,GAA8B,EAA5E,CAAgF,IAAlG,GAAwG,EAAI;AACpI;AACA;AACA,cAAeJ,KAAD,IAAY,GAAEA,KAAK,CAACG,MAAO,IAAI;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAhBO;AAkBP,OAAO,MAAME,MAAM,GAAGV,MAAM,CAACW,GAAI;AACjC;AACA;AACA;AACA;AACA,CALO;AAOP,OAAO,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3D,gBAAiBC,KAAD,IAAYA,KAAK,EAAEI,IAAP,KAAgBP,IAAI,CAACa,KAArB,GAA8B,MAA9B,GAAsCV,KAAK,EAAEI,IAAP,KAAgBP,IAAI,CAACc,KAArB,GAA6B,MAA7B,GAAsC,MAAQ;AAChH;AACA;AACA;AACA,SAAUX,KAAD,IAAYA,KAAK,EAAEI,IAAP,KAAgB,OAAhB,GAA2B,MAA3B,GAAmC,KAAO;AAC/D,CANO","sourcesContent":["import styled, { css } from 'styled-components';\nimport { Size } from '../types'\n\n/**\n * Modal styles\n */\nexport const ModalHeader = styled.section<{ marginBottom?: string }>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ${(props) => props.marginBottom || '24px'};\n`;\n\nexport const StyledModalHeader = styled(ModalHeader)<{ marginBottom?: string; size?: string; height?: number }>`\n flex: 0 calc(50% - 5px);\n flex-direction: column;\n position: relative;\n text-align: left;\n height: ${(props) => (props.height ? `${props.height - (props.size === 'small' ? 16 : props.size === 'large' ? 32 : 24)}px` : '')};\n img {\n width: 100%;\n height: ${(props) => `${props.height}px`};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n border-radius: 8px 8px 0 0;\n object-fit: cover;\n }\n`;\n\nexport const Column = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: stretch;\n height: 100%;\n`;\n\nexport const ModalTitleSection = styled.section`\n display: flex;\n div#tooltip {\n margin-left: 12px;\n }\n`;\n\nexport const CloseButtonWrapper = styled.div<{ size?: Size; hasImage?: boolean }>`\n button {\n ${(props) =>\n props.hasImage\n ? css`\n position: absolute;\n right: 0;\n top: 0;\n margin: -12px !important;\n `\n : css`\n position: absolute;\n top: 0;\n right: 0;\n left: unset;\n margin: ${props.size === Size.Small ? '4px 4px 0 0' : props.size === Size.Large ? '20px 20px 0 0' : '12px 12px 0 0'} !important;\n `}\n }\n`;\n\nexport const BackButtonWrapper = styled.div<{ size?: Size; hasImage?: boolean }>`\n button {\n ${(props) =>\n props.hasImage\n ? css`\n left: 0;\n top: 0;\n position: absolute;\n margin: -12px 0 0 -12px !important;\n `\n : css`\n position: unset;\n margin: -12px 0 0 -12px !important;\n `}\n }\n`;\n\nexport const ModalTitle = styled.h5<{ fontSize?: string }>`\n margin: 0;\n font-size: ${(props) => props.fontSize || '1.25em'};\n font-weight: bold;\n`;\n\nexport const ModalBody = styled.section<{ size?: string }>`\n > :first-child {\n margin-top: 24px;\n }\n\n > :last-child {\n margin-bottom: ${(props) => (props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px')};\n }\n\n p: first-of-type {\n padding-bottom: ${(props) => (props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px')};\n }\n`;\n\nexport const ModalFooter = styled.section<{ size?: Size }>`\n margin-top: ${(props) => (props?.size === Size.Small ? `20px` : props?.size === Size.Large ? '28px' : '24px')};\n display: flex;\n justify-content: flex-end;\n\n gap: ${(props) => (props?.size === 'large' ? `16px` : '8px')};\n`;\n"],"file":"ModalStyles.js"}
1
+ {"version":3,"sources":["../../../src/Modals/ModalStyles.ts"],"names":["styled","css","COLORS","Size","ModalHeader","section","props","marginBottom","StyledModalHeader","height","size","Column","div","ModalTitleSection","CloseButtonWrapper","hasImage","Small","Large","BackButtonWrapper","ModalTitle","h5","fontSize","ModalNoteSection","getBackgroundColor","state","getNoteMessageColor","ModalBody","ModalFooter","correct_100","warning_100","critical_100","primary_100","correct_700","warning_700","critical_700","primary_700"],"mappings":"AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,MAAT,QAAuB,IAAvB;AACA,SAASC,IAAT,QAAqB,UAArB;AAEA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GAAGJ,MAAM,CAACK,OAAmC;AACrE;AACA;AACA;AACA,mBAAoBC,KAAD,IAAWA,KAAK,CAACC,YAAN,IAAsB,MAAO;AAC3D,CALO;AAOP,OAAO,MAAMC,iBAAiB,GAAGR,MAAM,CAACI,WAAD,CAAyE;AAChH;AAC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CAZO;AAcP,OAAO,MAAMiB,WAAW,GAAG3B,MAAM,CAACK,OAAyB;AAC3D,gBAAiBC,KAAD,IAAYA,KAAK,EAAEI,IAAP,KAAgBP,IAAI,CAACa,KAArB,GAA8B,MAA9B,GAAsCV,KAAK,EAAEI,IAAP,KAAgBP,IAAI,CAACc,KAArB,GAA6B,MAA7B,GAAsC,MAAQ;AAChH;AACA;AACA;AACA,SAAUX,KAAD,IAAYA,KAAK,EAAEI,IAAP,KAAgB,OAAhB,GAA2B,MAA3B,GAAmC,KAAO;AAC/D,CANO;AAQP,OAAO,MAAMa,kBAAkB,GAAIC,KAAD,IAAkB;AAClD,UAAOA,KAAP;AACE,SAAK,UAAL;AAAiB,aAAOtB,MAAM,CAAC0B,WAAd;;AACjB,SAAK,SAAL;AAAgB,aAAO1B,MAAM,CAAC2B,WAAd;;AAChB,SAAK,UAAL;AAAiB,aAAO3B,MAAM,CAAC4B,YAAd;;AACjB;AAAS,aAAO5B,MAAM,CAAC6B,WAAd;AAJX;AAMD,CAPM;AASP,OAAO,MAAMN,mBAAmB,GAAID,KAAD,IAAkB;AACnD,UAAOA,KAAP;AACE,SAAK,UAAL;AAAiB,aAAOtB,MAAM,CAAC8B,WAAd;;AACjB,SAAK,SAAL;AAAgB,aAAO9B,MAAM,CAAC+B,WAAd;;AAChB,SAAK,UAAL;AAAiB,aAAO/B,MAAM,CAACgC,YAAd;;AACjB;AAAS,aAAOhC,MAAM,CAACiC,WAAd;AAJX;AAMD,CAPM","sourcesContent":["import styled, { css } from 'styled-components';\nimport { COLORS } from '..';\nimport { Size } from '../types'\n\n/**\n * Modal styles\n */\nexport const ModalHeader = styled.section<{ marginBottom?: string }>`\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: ${(props) => props.marginBottom || '24px'};\n`;\n\nexport const StyledModalHeader = styled(ModalHeader)<{ marginBottom?: string; size?: string; height?: number }>`\n flex: 0 calc(50% - 5px);\n flex-direction: column;\n position: relative;\n text-align: left;\n height: ${(props) => (props.height ? `${props.height - (props.size === 'small' ? 16 : props.size === 'large' ? 32 : 24)}px` : '')};\n img {\n width: 100%;\n height: ${(props) => `${props.height}px`};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n border-radius: 8px 8px 0 0;\n object-fit: cover;\n }\n`;\n\nexport const Column = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: stretch;\n height: 100%;\n`;\n\nexport const ModalTitleSection = styled.section`\n display: flex;\n div#tooltip {\n margin-left: 12px;\n }\n`;\n\nexport const CloseButtonWrapper = styled.div<{ size?: Size; hasImage?: boolean }>`\n button {\n ${(props) =>\n props.hasImage\n ? css`\n position: absolute;\n right: 0;\n top: 0;\n margin: -12px !important;\n `\n : css`\n position: absolute;\n top: 0;\n right: 0;\n left: unset;\n margin: ${props.size === Size.Small ? '4px 4px 0 0' : props.size === Size.Large ? '20px 20px 0 0' : '12px 12px 0 0'} !important;\n `}\n }\n`;\n\nexport const BackButtonWrapper = styled.div<{ size?: Size; hasImage?: boolean }>`\n button {\n ${(props) =>\n props.hasImage\n ? css`\n left: 0;\n top: 0;\n position: absolute;\n margin: -12px 0 0 -12px !important;\n `\n : css`\n position: unset;\n margin: -12px 0 0 -12px !important;\n `}\n }\n`;\n\nexport const ModalTitle = styled.h5<{ fontSize?: string }>`\n margin: 0;\n font-size: ${(props) => props.fontSize || '1.25em'};\n font-weight: bold;\n`;\n\nexport const ModalNoteSection = styled.section<{state:string, size?:string}>`\n background-color: ${(props)=> getBackgroundColor(props.state)};\n font-size: ${(props)=> (props?.size === 'small' ? `16px` : props?.size === 'large' ? '20px' : '18px')};\n margin-top: ${(props)=> (props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px')};\n margin-bottom: ${(props)=> (props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px')};\n display: flex;\n flex-direction: row;\n padding: ${(props)=> (props?.size === 'small' ? `8px` : props?.size === 'large' ? '16px' : '12px')};\n border-radius: 2px;\n\n span {\n display:block;\n width: 80%;\n margin-left: 8px;\n color: ${(props)=> getNoteMessageColor(props.state)};\n }\n`;\n\nexport const ModalBody = styled.section<{ size?: string }>`\n > :first-child {\n margin-top: 24px;\n }\n\n > :last-child {\n margin-bottom: ${(props) => (props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px')};\n }\n\n p: first-of-type {\n padding-bottom: ${(props) => (props?.size === 'small' ? `8px` : props?.size === 'large' ? '24px' : '16px')};\n }\n`;\n\nexport const ModalFooter = styled.section<{ size?: Size }>`\n margin-top: ${(props) => (props?.size === Size.Small ? `20px` : props?.size === Size.Large ? '28px' : '24px')};\n display: flex;\n justify-content: flex-end;\n\n gap: ${(props) => (props?.size === 'large' ? `16px` : '8px')};\n`;\n\nexport const getBackgroundColor = (state:string) => {\n switch(state){\n case 'positive': return COLORS.correct_100;\n case 'warning': return COLORS.warning_100;\n case 'critical': return COLORS.critical_100;\n default: return COLORS.primary_100;\n }\n}\n\nexport const getNoteMessageColor = (state:string) => {\n switch(state){\n case 'positive': return COLORS.correct_700;\n case 'warning': return COLORS.warning_700;\n case 'critical': return COLORS.critical_700;\n default: return COLORS.primary_700;\n }\n}"],"file":"ModalStyles.js"}
@@ -0,0 +1,41 @@
1
+ import _pt from "prop-types";
2
+ import * as React from 'react';
3
+ import styled from 'styled-components';
4
+ import { COLORS } from '..';
5
+ const ContentWrapper = styled.div`
6
+ width: ${props => props.size === 'small' ? '16px' : props.size === 'large' ? '24px' : '20px'};
7
+ height: ${props => props.size === 'small' ? '16px' : props.size === 'large' ? '24px' : '20px'};
8
+ padding: ${props => props.size === 'small' ? '3px' : props.size === 'large' ? '4px' : '4px'};
9
+ box-sizing: border-box;
10
+ `;
11
+ const Content = styled.div`
12
+ background-color: ${props => props.variant === 'positive' ? COLORS.correct_500 : COLORS.critical_500};
13
+ height: ${props => props.size === 'small' ? '10px' : props.size === 'large' ? '16px' : '12px'};
14
+ width: ${props => props.size === 'small' ? '10px' : props.size === 'large' ? '16px' : '12px'};
15
+ border-radius: ${props => props.size === 'small' ? '10px' : props.size === 'large' ? '16px' : '12px'};
16
+ border: ${props => props.size === 'small' ? '2px solid ' + COLORS.white : props.size === 'large' ? '3px solid ' + COLORS.white : '2px solid ' + COLORS.white};
17
+ box-sizing: border-box;
18
+ `;
19
+
20
+ const NotificationDot = ({
21
+ size = 'medium',
22
+ variant,
23
+ testId
24
+ }) => {
25
+ return /*#__PURE__*/React.createElement(ContentWrapper, {
26
+ size: size,
27
+ variant: variant
28
+ }, /*#__PURE__*/React.createElement(Content, {
29
+ size: size,
30
+ variant: variant,
31
+ "data-testId": testId
32
+ }));
33
+ };
34
+
35
+ NotificationDot.propTypes = {
36
+ size: _pt.string,
37
+ variant: _pt.oneOf(['critical', 'positive']).isRequired,
38
+ testId: _pt.string
39
+ };
40
+ export default NotificationDot;
41
+ //# sourceMappingURL=NotificationDot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/NotificationDot/NotificationDot.tsx"],"names":["React","styled","COLORS","ContentWrapper","div","props","size","Content","variant","correct_500","critical_500","white","NotificationDot","testId"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAAQC,MAAR,QAAqB,IAArB;AAQA,MAAMC,cAAc,GAAGF,MAAM,CAACG,GAAuB;AACrD,WAAYC,KAAD,IAAWA,KAAK,CAACC,IAAN,KAAe,OAAf,GAAyB,MAAzB,GAAmCD,KAAK,CAACC,IAAN,KAAe,OAAf,GAAyB,MAAzB,GAAkC,MAAQ;AACnG,YAAaD,KAAD,IAAWA,KAAK,CAACC,IAAN,KAAe,OAAf,GAAyB,MAAzB,GAAmCD,KAAK,CAACC,IAAN,KAAe,OAAf,GAAyB,MAAzB,GAAkC,MAAQ;AACpG,aAAcD,KAAD,IAAWA,KAAK,CAACC,IAAN,KAAe,OAAf,GAAyB,KAAzB,GAAkCD,KAAK,CAACC,IAAN,KAAe,OAAf,GAAyB,KAAzB,GAA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;AA2BF,eAAeD,eAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS} from '..';\n\nexport interface NotificationProps {\n size?: string;\n variant: 'critical' | 'positive';\n testId?: string;\n}\n\nconst ContentWrapper = styled.div<NotificationProps>`\n width: ${(props) => props.size === 'small' ? '16px' : (props.size === 'large' ? '24px' : '20px')};\n height: ${(props) => props.size === 'small' ? '16px' : (props.size === 'large' ? '24px' : '20px')};\n padding: ${(props) => props.size === 'small' ? '3px' : (props.size === 'large' ? '4px' : '4px')};\n box-sizing: border-box;\n`;\n\nconst Content = styled.div<NotificationProps>`\n background-color: ${(props) => props.variant === 'positive' ? COLORS.correct_500 : COLORS.critical_500};\n height: ${(props) => props.size === 'small' ? '10px' : (props.size === 'large' ? '16px' : '12px')};\n width: ${(props) => props.size === 'small' ? '10px' : (props.size === 'large' ? '16px' : '12px')};\n border-radius: ${(props) => props.size === 'small' ? '10px' : (props.size === 'large' ? '16px' : '12px')};\n border: ${(props) => props.size === 'small' ? '2px solid ' + COLORS.white : (props.size === 'large' ? '3px solid ' + COLORS.white : '2px solid ' + COLORS.white)};\n box-sizing: border-box;\n`;\n\nconst NotificationDot: React.FunctionComponent<NotificationProps> = ({size = 'medium', variant, testId}) => {\n return (\n <ContentWrapper size={size} variant={variant}>\n <Content size={size} variant={variant} data-testId={testId}/>\n </ContentWrapper>\n );\n};\n\nexport default NotificationDot;\n"],"file":"NotificationDot.js"}
@@ -0,0 +1,2 @@
1
+ export { default as NotificationDot } from './NotificationDot';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/NotificationDot/index.ts"],"names":["default","NotificationDot"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAApB,QAA2C,mBAA3C","sourcesContent":["export { default as NotificationDot } from './NotificationDot';"],"file":"index.js"}
@@ -2,10 +2,12 @@ import _pt from "prop-types";
2
2
  import * as React from 'react';
3
3
  import { NavLink, useLocation } from 'react-router-dom';
4
4
  import styled from 'styled-components';
5
+ import { NotificationDot } from '../NotificationDot';
5
6
  import { COLORS } from '../styles';
6
7
  const StyledTabLink = styled(NavLink)`
7
8
  display: flex;
8
- flex-direction: column;
9
+ flex-direction: row;
10
+ align-items: center;
9
11
 
10
12
  font-size: 16px;
11
13
  line-height: 120%;
@@ -90,27 +92,15 @@ const StyledTabLink = styled(NavLink)`
90
92
  }
91
93
  }
92
94
  `;
93
- const OptionalLineWrapper = styled.div`
95
+ const OptionalLineWrapperWithIcon = styled.div`
94
96
  display: flex;
95
97
  flex-direction: row;
96
- margin: 0 0 0 20px;
97
98
  span {
98
99
  margin: 0 0 0 4px !important;
99
100
  font-size: 12px;
100
101
  line-height: 16px;
101
102
  }
102
103
  `;
103
- const NotificationDot = styled.div`
104
- position: absolute;
105
- right: 12px;
106
- top: calc(50% - 12px);
107
- background-color: ${COLORS.critical_500};
108
- height: 8px;
109
- width: 8px;
110
- border-radius: 50%;
111
- border: 2px solid ${COLORS.white};
112
- margin: 6px;
113
- `;
114
104
  const TopWrapper = styled.div`
115
105
  display: flex;
116
106
  flex-direction: row;
@@ -118,6 +108,15 @@ const TopWrapper = styled.div`
118
108
  width: calc(100% - 32px);
119
109
  }
120
110
  `;
111
+ const TextContainer = styled.div`
112
+ width: 100%;
113
+ `;
114
+ const StyledNotification = styled.div`
115
+ margin: 0 15px 0 0 !important;
116
+ `;
117
+ const OptionalLineWrapper = styled.div`
118
+ font-size: 12px;
119
+ `;
121
120
 
122
121
  const TabLink = ({
123
122
  to,
@@ -128,7 +127,9 @@ const TabLink = ({
128
127
  OptionalLineIcon,
129
128
  onLinkClick,
130
129
  testId,
131
- showNotificationDot
130
+ showNotificationDot = false,
131
+ size = 'small',
132
+ variant = 'critical'
132
133
  }) => {
133
134
  const location = useLocation();
134
135
  const ref = React.useRef(null);
@@ -148,11 +149,13 @@ const TabLink = ({
148
149
  },
149
150
  ref: ref,
150
151
  "data-testid": testId
151
- }, /*#__PURE__*/React.createElement(TopWrapper, null, /*#__PURE__*/React.createElement("span", null, requiredLine), showNotificationDot && /*#__PURE__*/React.createElement(NotificationDot, {
152
- "data-testid": "NotificationDot"
153
- })), optionalLine && OptionalLineIcon ? /*#__PURE__*/React.createElement(OptionalLineWrapper, null, OptionalLineIcon && /*#__PURE__*/React.createElement(OptionalLineIcon, {
152
+ }, /*#__PURE__*/React.createElement(TextContainer, null, /*#__PURE__*/React.createElement(TopWrapper, null, /*#__PURE__*/React.createElement("span", null, requiredLine)), optionalLine && OptionalLineIcon ? /*#__PURE__*/React.createElement(OptionalLineWrapperWithIcon, null, OptionalLineIcon && /*#__PURE__*/React.createElement(OptionalLineIcon, {
154
153
  size: "16px"
155
- }), optionalLine !== undefined && /*#__PURE__*/React.createElement("span", null, optionalLine)) : optionalLine ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, optionalLine)) : /*#__PURE__*/React.createElement(React.Fragment, null));
154
+ }), optionalLine !== undefined && /*#__PURE__*/React.createElement("span", null, optionalLine)) : optionalLine ? /*#__PURE__*/React.createElement(OptionalLineWrapper, null, /*#__PURE__*/React.createElement("span", null, optionalLine)) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(StyledNotification, null, showNotificationDot && /*#__PURE__*/React.createElement(NotificationDot, {
155
+ testId: "NotificationDot",
156
+ size: size,
157
+ variant: variant
158
+ })));
156
159
  };
157
160
 
158
161
  TabLink.propTypes = {
@@ -161,7 +164,9 @@ TabLink.propTypes = {
161
164
  optionalLine: _pt.string,
162
165
  onLinkClick: _pt.func,
163
166
  testId: _pt.string,
164
- showNotificationDot: _pt.bool
167
+ showNotificationDot: _pt.bool,
168
+ size: _pt.string,
169
+ variant: _pt.oneOf(['positive', 'critical'])
165
170
  };
166
171
  export default TabLink;
167
172
  //# sourceMappingURL=TabLink.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Tabs/TabLink.tsx"],"names":["React","NavLink","useLocation","styled","COLORS","StyledTabLink","neutral_600","props","disabled","neutral_100","white","neutral_20","primary_20","primary_600","primary_100","primary_800","primary_500","neutral_300","OptionalLineWrapper","div","NotificationDot","critical_500","TopWrapper","TabLink","to","exact","requiredLine","optionalLine","OptionalLineIcon","onLinkClick","testId","showNotificationDot","location","ref","useRef","toString","pathname","current","blur","undefined"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,OAAT,EAAgCC,WAAhC,QAAmD,kBAAnD;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AAEA,SAASC,MAAT,QAAuB,WAAvB;AAiBA,MAAMC,aAAa,GAAGF,MAAM,CAACF,OAAD,CAA8B;AAC1D;AACA;AACA;AACA;AACA;AACA,WAAWG,MAAM,CAACE,WAAY;AAC9B;AACA,sBAAuBC,KAAD,IAAYA,KAAK,CAACC,QAAN,GAAiBJ,MAAM,CAACK,WAAxB,GAAsC,aAAe;AACvF,YAAaF,KAAD,IAAYA,KAAK,CAACC,QAAN,GAAiB,aAAjB,GAAiC,SAAW;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwBJ,MAAM,CAACM,KAAM;AACrC;AACA;AACA;AACA;AACA,0BAA0BN,MAAM,CAACM,KAAM;AACvC;AACA;AACA;AACA;AACA,wBAAwBN,MAAM,CAACO,UAAW;AAC1C;AACA;AACA,wBAAwBP,MAAM,CAACQ,UAAW;AAC1C;AACA;AACA,wBAAwBR,MAAM,CAACM,KAAM;AACrC;AACA;AACA;AACA,wBAAwBN,MAAM,CAACQ,UAAW;AAC1C,aAAaR,MAAM,CAACS,WAAY;AAChC;AACA;AACA;AACA,wBAAwBT,MAAM,CAACU,WAAY;AAC3C,aAAaV,MAAM,CAACW,WAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BX,MAAM,CAACY,WAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0BZ,MAAM,CAACS,WAA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;AAOE,IAAA,OAAO,EAAE,MAAM;AACbH,MAAAA,GAAG,EAAEI,OAAL,EAAcC,IAAd;;AACA,UAAIT,WAAJ,EAAiB;AACfA,QAAAA,WAAW;AACZ;AACF,KAZH;AAaE,IAAA,GAAG,EAAEI,GAbP;AAcE,mBAAaH;AAdf,kBAeE,oBAAC,UAAD,qBACE,kCAAOJ,YAAP,CADF,EAEGK,mBAAmB,iBAAI,oBAAC,eAAD;AAAiB,mBAAY;AAA7B,IAF1B,CAfF,EAmBGJ,YAAY,IAAIC,gBAAhB,gBACC,oBAAC,mBAAD,QACGA,gBAAgB,iBAAI,oBAAC,gBAAD;AAAkB,IAAA,IAAI,EAAC;AAAvB,IADvB,EAEGD,YAAY,KAAKY,SAAjB,iBAA8B,kCAAOZ,YAAP,CAFjC,CADD,GAKGA,YAAY,gBACd,8CACE,kCAAOA,YAAP,CADF,CADc,gBAKd,yCA7BJ,CADF;AAkCD,CAtCD;;;AArIEnB,EAAAA,Q;AACAkB,EAAAA,Y;AACAC,EAAAA,Y;AAEAE,EAAAA,W;AACAC,EAAAA,M;AACAC,EAAAA,mB;;AAuKF,eAAeR,OAAf","sourcesContent":["import * as React from 'react';\nimport { NavLink, NavLinkProps, useLocation } from 'react-router-dom';\nimport styled from 'styled-components';\nimport { BaseProps } from '../icons';\nimport { COLORS } from '../styles';\n\ntype TabLinkProps = {\n disabled?: boolean;\n requiredLine: string;\n optionalLine?: string;\n OptionalLineIcon?: React.FunctionComponent<BaseProps>;\n onLinkClick?: () => void;\n testId?: string;\n showNotificationDot?: boolean;\n} & NavLinkProps;\n\ntype StyledTabLinkProps = {\n disabled?: boolean;\n exact: boolean;\n};\n\nconst StyledTabLink = styled(NavLink)<StyledTabLinkProps>`\n display: flex;\n flex-direction: column;\n\n font-size: 16px;\n line-height: 120%;\n color: ${COLORS.neutral_600};\n\n background-color: ${(props) => (props.disabled ? COLORS.neutral_100 : 'transparent')};\n cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n border-left: 1px solid transparent;\n text-decoration: none;\n position: relative;\n border-radius: 2px;\n\n &:not(:last-child) {\n margin-bottom: 4px;\n }\n\n &:focus {\n background-color: ${COLORS.white};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n outline: none;\n\n &::after {\n background-color: ${COLORS.white};\n }\n }\n\n &.active {\n background-color: ${COLORS.neutral_20};\n }\n &.active:hover {\n background-color: ${COLORS.primary_20};\n }\n &.active:focus {\n background-color: ${COLORS.white};\n }\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_600};\n }\n &:active {\n box-shadow: none;\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n &.active {\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 0;\n bottom: 0;\n left: -1px;\n background-color: ${COLORS.primary_500};\n\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n }\n }\n &.active:hover {\n &::after {\n background-color: ${COLORS.primary_600};\n }\n }\n &.active:active {\n background-color: ${COLORS.primary_100};\n\n &::after {\n background-color: ${COLORS.primary_800};\n }\n }\n &:disabled {\n box-shadow: none;\n background-color: ${COLORS.white};\n span {\n color: ${COLORS.neutral_300};\n }\n &::after {\n background-color: ${COLORS.white};\n }\n }\n`;\n\nconst OptionalLineWrapper = styled.div`\n display: flex;\n flex-direction: row;\n margin: 0 0 0 20px;\n span {\n margin: 0 0 0 4px !important;\n font-size: 12px;\n line-height: 16px;\n }\n`;\n\nconst NotificationDot = styled.div`\n position: absolute;\n right: 12px;\n top: calc(50% - 12px);\n background-color: ${COLORS.critical_500};\n height: 8px;\n width: 8px;\n border-radius: 50%;\n border: 2px solid ${COLORS.white};\n margin: 6px;\n`;\n\nconst TopWrapper = styled.div`\n display: flex;\n flex-direction: row;\n span:not(:only-child) {\n width: calc(100% - 32px);\n }\n`;\n\nconst TabLink = ({ to, disabled = false, exact = false, requiredLine, optionalLine, OptionalLineIcon, onLinkClick, testId, showNotificationDot }: TabLinkProps) => {\n const location = useLocation();\n const ref = React.useRef<any>(null);\n\n return (\n <StyledTabLink\n to={to.toString()}\n activeClassName=\"active\"\n disabled={disabled}\n exact={exact}\n role=\"tab\"\n aria-selected={to === location.pathname}\n onClick={() => {\n ref?.current?.blur();\n if (onLinkClick) {\n onLinkClick();\n }\n }}\n ref={ref}\n data-testid={testId}>\n <TopWrapper>\n <span>{requiredLine}</span>\n {showNotificationDot && <NotificationDot data-testid=\"NotificationDot\" />}\n </TopWrapper>\n {optionalLine && OptionalLineIcon ? (\n <OptionalLineWrapper>\n {OptionalLineIcon && <OptionalLineIcon size=\"16px\" />}\n {optionalLine !== undefined && <span>{optionalLine}</span>}\n </OptionalLineWrapper>\n ) : optionalLine ? (\n <div>\n <span>{optionalLine}</span>\n </div>\n ) : (\n <></>\n )}\n </StyledTabLink>\n );\n};\n\nexport default TabLink;\n"],"file":"TabLink.js"}
1
+ {"version":3,"sources":["../../../src/Tabs/TabLink.tsx"],"names":["React","NavLink","useLocation","styled","NotificationDot","COLORS","StyledTabLink","neutral_600","props","disabled","neutral_100","white","neutral_20","primary_20","primary_600","primary_100","primary_800","primary_500","neutral_300","OptionalLineWrapperWithIcon","div","TopWrapper","TextContainer","StyledNotification","OptionalLineWrapper","TabLink","to","exact","requiredLine","optionalLine","OptionalLineIcon","onLinkClick","testId","showNotificationDot","size","variant","location","ref","useRef","toString","pathname","current","blur","undefined"],"mappings":";AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,OAAT,EAAgCC,WAAhC,QAAmD,kBAAnD;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAASC,eAAT,QAAgC,oBAAhC;AAEA,SAASC,MAAT,QAAuB,WAAvB;AAmBA,MAAMC,aAAa,GAAGH,MAAM,CAACF,OAAD,CAA8B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,WAAWI,MAAM,CAACE,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AkB,IAAA,IAAI,EAAC;AAAvB,IADvB,EAEGD,YAAY,KAAKc,SAAjB,iBAA8B,kCAAOd,YAAP,CAFjC,CADD,GAKGA,YAAY,gBACd,oBAAC,mBAAD,qBACE,kCAAOA,YAAP,CADF,CADc,gBAKd,yCAdF,CAfF,eAgCE,oBAAC,kBAAD,QACGI,mBAAmB,iBAAI,oBAAC,eAAD;AAAiB,IAAA,MAAM,EAAC,iBAAxB;AAA0C,IAAA,IAAI,EAAEC,IAAhD;AAAsD,IAAA,OAAO,EAAEC;AAA/D,IAD1B,CAhCF,CADF;AAsCD,CA1CD;;;AAvIE1B,EAAAA,Q;AACAmB,EAAAA,Y;AACAC,EAAAA,Y;AAEAE,EAAAA,W;AACAC,EAAAA,M;AACAC,EAAAA,mB;AACAC,EAAAA,I;AACAC,EAAAA,O,aAAU,U,EAAa,U;;AA2KzB,eAAeV,OAAf","sourcesContent":["import * as React from 'react';\nimport { NavLink, NavLinkProps, useLocation } from 'react-router-dom';\nimport styled from 'styled-components';\nimport { NotificationDot } from '../NotificationDot';\nimport { BaseProps } from '../icons';\nimport { COLORS } from '../styles';\n\ntype TabLinkProps = {\n disabled?: boolean;\n requiredLine: string;\n optionalLine?: string;\n OptionalLineIcon?: React.FunctionComponent<BaseProps>;\n onLinkClick?: () => void;\n testId?: string;\n showNotificationDot?: boolean;\n size?: string;\n variant?: 'positive' | 'critical';\n} & NavLinkProps;\n\ntype StyledTabLinkProps = {\n disabled?: boolean;\n exact: boolean;\n};\n\nconst StyledTabLink = styled(NavLink)<StyledTabLinkProps>`\n display: flex;\n flex-direction: row;\n align-items: center;\n\n font-size: 16px;\n line-height: 120%;\n color: ${COLORS.neutral_600};\n\n background-color: ${(props) => (props.disabled ? COLORS.neutral_100 : 'transparent')};\n cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n border-left: 1px solid transparent;\n text-decoration: none;\n position: relative;\n border-radius: 2px;\n\n &:not(:last-child) {\n margin-bottom: 4px;\n }\n\n &:focus {\n background-color: ${COLORS.white};\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n outline: none;\n\n &::after {\n background-color: ${COLORS.white};\n }\n }\n\n &.active {\n background-color: ${COLORS.neutral_20};\n }\n &.active:hover {\n background-color: ${COLORS.primary_20};\n }\n &.active:focus {\n background-color: ${COLORS.white};\n }\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_600};\n }\n &:active {\n box-shadow: none;\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n &.active {\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 0;\n bottom: 0;\n left: -1px;\n background-color: ${COLORS.primary_500};\n\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n }\n }\n &.active:hover {\n &::after {\n background-color: ${COLORS.primary_600};\n }\n }\n &.active:active {\n background-color: ${COLORS.primary_100};\n\n &::after {\n background-color: ${COLORS.primary_800};\n }\n }\n &:disabled {\n box-shadow: none;\n background-color: ${COLORS.white};\n span {\n color: ${COLORS.neutral_300};\n }\n &::after {\n background-color: ${COLORS.white};\n }\n }\n`;\n\nconst OptionalLineWrapperWithIcon = styled.div`\n display: flex;\n flex-direction: row;\n span {\n margin: 0 0 0 4px !important;\n font-size: 12px;\n line-height: 16px;\n }\n`;\n\nconst TopWrapper = styled.div`\n display: flex;\n flex-direction: row;\n span:not(:only-child) {\n width: calc(100% - 32px);\n }\n`;\n\nconst TextContainer = styled.div`\n width: 100%;\n`;\n\nconst StyledNotification = styled.div`\n margin: 0 15px 0 0 !important;\n`;\n\nconst OptionalLineWrapper = styled.div`\n font-size: 12px;\n`;\n\nconst TabLink = ({ to, disabled = false, exact = false, requiredLine, optionalLine, OptionalLineIcon, onLinkClick, testId, showNotificationDot = false, size = 'small', variant = 'critical' }: TabLinkProps) => {\n const location = useLocation();\n const ref = React.useRef<any>(null);\n\n return (\n <StyledTabLink\n to={to.toString()}\n activeClassName=\"active\"\n disabled={disabled}\n exact={exact}\n role=\"tab\"\n aria-selected={to === location.pathname}\n onClick={() => {\n ref?.current?.blur();\n if (onLinkClick) {\n onLinkClick();\n }\n }}\n ref={ref}\n data-testid={testId}>\n <TextContainer> \n <TopWrapper>\n <span>{requiredLine}</span> \n </TopWrapper>\n {optionalLine && OptionalLineIcon ? (\n <OptionalLineWrapperWithIcon>\n {OptionalLineIcon && <OptionalLineIcon size=\"16px\" />}\n {optionalLine !== undefined && <span>{optionalLine}</span>}\n </OptionalLineWrapperWithIcon>\n ) : optionalLine ? (\n <OptionalLineWrapper>\n <span>{optionalLine}</span>\n </OptionalLineWrapper>\n ) : (\n <></>\n )}\n </TextContainer>\n <StyledNotification>\n {showNotificationDot && <NotificationDot testId=\"NotificationDot\" size={size} variant={variant} />}\n </StyledNotification>\n </StyledTabLink>\n );\n};\n\nexport default TabLink;\n"],"file":"TabLink.js"}