@helsenorge/designsystem-react 15.7.2 → 16.0.0

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 (228) hide show
  1. package/lib/Button.js +2 -2
  2. package/lib/Button.js.map +1 -1
  3. package/lib/CHANGELOG.md +2652 -997
  4. package/lib/Close.js +1 -1
  5. package/lib/Close.js.map +1 -1
  6. package/lib/Drawer.js +2 -4
  7. package/lib/Drawer.js.map +1 -1
  8. package/lib/DrawerNavigation.js +1 -0
  9. package/lib/DrawerNavigation.js.map +1 -1
  10. package/lib/Duolist.js +5 -1
  11. package/lib/Duolist.js.map +1 -1
  12. package/lib/ElementHeader.js.map +1 -1
  13. package/lib/FilterLinkList.js +1 -1
  14. package/lib/FilterLinkList.js.map +1 -1
  15. package/lib/FormGroup.js +3 -3
  16. package/lib/FormGroup.js.map +1 -1
  17. package/lib/HelpDetails.js +1 -1
  18. package/lib/HelpTriggerIcon.js +2 -2
  19. package/lib/HelpTriggerIcon.js.map +1 -1
  20. package/lib/HelpTriggerStandalone.js +1 -1
  21. package/lib/HelpTriggerStandalone.js.map +1 -1
  22. package/lib/LazyIcon.js +1 -0
  23. package/lib/LazyIcon.js.map +1 -1
  24. package/lib/LazyIllustration.js +2 -0
  25. package/lib/LazyIllustration.js.map +1 -1
  26. package/lib/LinkList.js +10 -10
  27. package/lib/LinkList.js.map +1 -1
  28. package/lib/ListEditMode.js +1 -1
  29. package/lib/ListEditMode.js.map +1 -1
  30. package/lib/PopOver.js +2 -2
  31. package/lib/PopOver.js.map +1 -1
  32. package/lib/Radio.js +65 -55
  33. package/lib/Radio.js.map +1 -1
  34. package/lib/Radio2.js +74 -0
  35. package/lib/Radio2.js.map +1 -0
  36. package/lib/RadioMarker.js +2 -2
  37. package/lib/RadioMarker.js.map +1 -1
  38. package/lib/TabList.js +5 -5
  39. package/lib/TabList.js.map +1 -1
  40. package/lib/Toggle.js +2 -2
  41. package/lib/Toggle.js.map +1 -1
  42. package/lib/VisualRadio.js +1 -1
  43. package/lib/VisualRadio.js.map +1 -1
  44. package/lib/components/AnchorLink/styles.module.scss +3 -4
  45. package/lib/components/ArticleTeaser/styles.module.scss +12 -12
  46. package/lib/components/Button/Button.d.ts +1 -1
  47. package/lib/components/Button/styles.module.scss +111 -60
  48. package/lib/components/Button/styles.module.scss.d.ts +1 -1
  49. package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +6 -6
  50. package/lib/components/Chip/styles.module.scss +2 -3
  51. package/lib/components/Close/styles.module.scss +2 -3
  52. package/lib/components/DictionaryTrigger/index.js +26 -1
  53. package/lib/{DictionaryTrigger.js.map → components/DictionaryTrigger/index.js.map} +1 -1
  54. package/lib/components/DictionaryTrigger/styles.module.scss +6 -8
  55. package/lib/components/Drawer/Drawer.d.ts +0 -4
  56. package/lib/components/Drawer/DrawerBackButton.module.scss +1 -2
  57. package/lib/components/Drawer/styles.module.scss +6 -3
  58. package/lib/components/Dropdown/SingleSelect/styles.module.scss +0 -2
  59. package/lib/components/Dropdown/index.js +9 -17
  60. package/lib/components/Dropdown/index.js.map +1 -1
  61. package/lib/components/Dropdown/styles.module.scss +12 -14
  62. package/lib/components/Duolist/Duolist.d.ts +14 -2
  63. package/lib/components/Duolist/styles.module.scss +32 -8
  64. package/lib/components/Duolist/styles.module.scss.d.ts +3 -0
  65. package/lib/components/ElementHeader/ElementHeader.d.ts +1 -1
  66. package/lib/components/ElementHeader/styles.module.scss +1 -1
  67. package/lib/components/EmptyState/styles.module.scss +1 -2
  68. package/lib/components/ErrorWrapper/styles.module.scss +3 -3
  69. package/lib/components/Expander/styles.module.scss +0 -2
  70. package/lib/components/Expander/styles.module.scss.d.ts +1 -1
  71. package/lib/components/ExpanderList/index.js +20 -19
  72. package/lib/components/ExpanderList/index.js.map +1 -1
  73. package/lib/components/ExpanderList/styles.module.scss +10 -11
  74. package/lib/components/FavoriteButton/index.js +3 -3
  75. package/lib/components/FavoriteButton/index.js.map +1 -1
  76. package/lib/components/FavoriteButton/styles.module.scss +0 -1
  77. package/lib/components/Filter/FilterButton/styles.module.scss +5 -6
  78. package/lib/components/Filter/FilterButtonAndChipsWrapper/styles.module.scss +0 -1
  79. package/lib/components/Filter/FilterDrawer/styles.module.scss +0 -1
  80. package/lib/components/Filter/FilterLinkList/FilterLinkList.module.scss +5 -6
  81. package/lib/components/Filter/FilterOverviewSearch/styles.module.scss +1 -4
  82. package/lib/components/Filter/FilterSearch/styles.module.scss +14 -15
  83. package/lib/components/Filter/FilterSort/styles.module.scss +1 -2
  84. package/lib/components/Filter/FilterStateWrapper/styles.module.scss +0 -2
  85. package/lib/components/Filter/LoaderSpinner/styles.module.scss +2 -4
  86. package/lib/components/FormFieldTag/styles.module.scss +0 -1
  87. package/lib/components/FormGroup/styles.module.scss +0 -1
  88. package/lib/components/HelpBubble/styles.module.scss +0 -1
  89. package/lib/components/HelpDetails/styles.module.scss +2 -4
  90. package/lib/components/HelpDrawer/styles.module.scss +1 -2
  91. package/lib/components/HelpPanel/HelpPanel.d.ts +2 -2
  92. package/lib/components/HelpPanel/index.js +1 -17
  93. package/lib/components/HelpPanel/index.js.map +1 -1
  94. package/lib/components/HelpPanel/styles.module.scss +2 -22
  95. package/lib/components/HelpPanel/styles.module.scss.d.ts +0 -4
  96. package/lib/components/HelpTeaser/styles.module.scss +7 -9
  97. package/lib/components/HelpTriggerIcon/HelpTriggerIcon.d.ts +2 -2
  98. package/lib/components/HelpTriggerIcon/styles.module.scss +20 -22
  99. package/lib/components/HelpTriggerIcon/styles.module.scss.d.ts +1 -1
  100. package/lib/components/HelpTriggerInline/styles.module.scss +3 -5
  101. package/lib/components/HelpTriggerStandalone/styles.module.scss +3 -5
  102. package/lib/components/HighlightPanel/styles.module.scss +2 -3
  103. package/lib/components/Icons/AdditionalIconInformation.d.ts +4 -0
  104. package/lib/components/Icons/AdditionalIconInformation.js +14 -10
  105. package/lib/components/Icons/AdditionalIconInformation.js.map +1 -1
  106. package/lib/components/Icons/HistoryDocument.js +6 -7
  107. package/lib/components/Icons/HistoryDocument.js.map +1 -1
  108. package/lib/components/Icons/IconNames.d.ts +1 -1
  109. package/lib/components/Icons/IconNames.js +1 -0
  110. package/lib/components/Icons/IconNames.js.map +1 -1
  111. package/lib/components/Icons/YesNo.d.ts +3 -0
  112. package/lib/components/Icons/YesNo.js +53 -0
  113. package/lib/components/Icons/YesNo.js.map +1 -0
  114. package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
  115. package/lib/components/Illustrations/IllustrationNames.js +2 -0
  116. package/lib/components/Illustrations/IllustrationNames.js.map +1 -1
  117. package/lib/components/Illustrations/MoveAway.d.ts +11 -0
  118. package/lib/components/Illustrations/MoveAway.js +18 -0
  119. package/lib/components/Illustrations/MoveAway.js.map +1 -0
  120. package/lib/components/Illustrations/MoveAwayMedium.d.ts +3 -0
  121. package/lib/components/Illustrations/MoveAwayMedium.js +114 -0
  122. package/lib/components/Illustrations/MoveAwayMedium.js.map +1 -0
  123. package/lib/components/InfoTeaser/styles.module.scss +6 -8
  124. package/lib/components/Label/styles.module.scss +1 -1
  125. package/lib/components/LinkList/LinkList.d.ts +1 -1
  126. package/lib/components/LinkList/styles.module.scss +9 -11
  127. package/lib/components/LinkList/styles.module.scss.d.ts +1 -1
  128. package/lib/components/ListEditMode/styles.module.scss +5 -7
  129. package/lib/components/Loader/Loader.d.ts +1 -1
  130. package/lib/components/Loader/index.js +4 -4
  131. package/lib/components/Loader/index.js.map +1 -1
  132. package/lib/components/Loader/styles.module.scss +7 -7
  133. package/lib/components/Loader/styles.module.scss.d.ts +3 -3
  134. package/lib/components/Modal/constants.d.ts +1 -1
  135. package/lib/components/Modal/index.js +2 -2
  136. package/lib/components/Modal/index.js.map +1 -1
  137. package/lib/components/Modal/styles.module.scss +14 -19
  138. package/lib/components/Modal/styles.module.scss.d.ts +2 -3
  139. package/lib/components/Panel/index.js +1 -1
  140. package/lib/components/Panel/index.js.map +1 -1
  141. package/lib/components/Panel/styles.module.scss +15 -16
  142. package/lib/components/Panel/styles.module.scss.d.ts +1 -1
  143. package/lib/components/PopMenu/index.js +7 -4
  144. package/lib/components/PopMenu/index.js.map +1 -1
  145. package/lib/components/PopOver/styles.module.scss +1 -3
  146. package/lib/components/Progressbar/Progressbar.d.ts +1 -1
  147. package/lib/components/Progressbar/constants.d.ts +1 -1
  148. package/lib/components/Progressbar/index.js +4 -4
  149. package/lib/components/Progressbar/index.js.map +1 -1
  150. package/lib/components/Radio/Radio.d.ts +28 -0
  151. package/lib/components/Radio/index.d.ts +3 -0
  152. package/lib/components/Radio/index.js +7 -0
  153. package/lib/components/Radio/index.js.map +1 -0
  154. package/lib/components/{RadioButton → Radio}/styles.module.scss +8 -9
  155. package/lib/components/Radio/styles.module.scss.d.ts +26 -0
  156. package/lib/components/ServiceMessage/styles.module.scss +20 -22
  157. package/lib/components/Slider/styles.module.scss +1 -2
  158. package/lib/components/StatusDot/styles.module.scss +4 -5
  159. package/lib/components/StickyNote/index.js +2 -2
  160. package/lib/components/StickyNote/index.js.map +1 -1
  161. package/lib/components/StickyNote/styles.module.scss +9 -10
  162. package/lib/components/Tabs/TabList/styles.module.scss +20 -18
  163. package/lib/components/Tabs/TabPanel/styles.module.scss +2 -3
  164. package/lib/components/Tabs/styles.module.scss +0 -1
  165. package/lib/components/Tag/styles.module.scss +0 -1
  166. package/lib/components/Tile/styles.module.scss +5 -7
  167. package/lib/components/Toast/styles.module.scss +0 -1
  168. package/lib/components/Toggle/styles.module.scss +9 -10
  169. package/lib/components/Validation/index.js +2 -2
  170. package/lib/components/Validation/index.js.map +1 -1
  171. package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +0 -2
  172. package/lib/components/VisualCheckboxCloud/styles.module.scss +0 -1
  173. package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +0 -2
  174. package/lib/components/VisualCheckboxGroup/styles.module.scss +0 -1
  175. package/lib/components/VisualContentgroupWithImage/styles.module.scss +0 -1
  176. package/lib/components/VisualRadioCloud/Radio/index.js +1 -1
  177. package/lib/components/VisualRadioCloud/Radio/styles.module.scss +0 -2
  178. package/lib/components/VisualRadioCloud/index.js +1 -1
  179. package/lib/components/VisualRadioCloud/styles.module.scss +0 -1
  180. package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +0 -2
  181. package/lib/components/VisualRadioGroup/styles.module.scss +0 -1
  182. package/lib/constants.d.ts +2 -3
  183. package/lib/constants.js +2 -3
  184. package/lib/constants.js.map +1 -1
  185. package/lib/floating-ui.react.js +1 -458
  186. package/lib/floating-ui.react.js.map +1 -1
  187. package/lib/hooks/useDismissablePopover.d.ts +20 -0
  188. package/lib/hooks/useDismissablePopover.js +66 -0
  189. package/lib/hooks/useDismissablePopover.js.map +1 -0
  190. package/lib/hooks/useOutsideEvent.d.ts +3 -0
  191. package/lib/hooks/useOutsideEvent.js +24 -3
  192. package/lib/hooks/useOutsideEvent.js.map +1 -1
  193. package/lib/hooks/useReturnFocusOnClose.d.ts +7 -0
  194. package/lib/hooks/useReturnFocusOnClose.js +22 -0
  195. package/lib/hooks/useReturnFocusOnClose.js.map +1 -0
  196. package/lib/index.d.ts +2 -0
  197. package/lib/index.js +3 -1
  198. package/lib/scss/_visual-form.scss +47 -47
  199. package/lib/scss/helsenorge.scss +1 -0
  200. package/lib/scss/supernova/styles/colors.css +177 -122
  201. package/lib/scss/supernova/styles/typography.css +58 -51
  202. package/lib/scss/supernova-legacy/index.css +2 -0
  203. package/lib/scss/supernova-legacy/styles/legacy-colors.css +111 -0
  204. package/lib/utils/formSpacing.js +3 -3
  205. package/lib/utils/formSpacing.js.map +1 -1
  206. package/package.json +8 -14
  207. package/scss/_visual-form.scss +47 -47
  208. package/scss/helsenorge.scss +1 -0
  209. package/scss/supernova/styles/colors.css +177 -122
  210. package/scss/supernova/styles/typography.css +58 -51
  211. package/scss/supernova-legacy/index.css +2 -0
  212. package/scss/supernova-legacy/styles/legacy-colors.css +111 -0
  213. package/lib/DictionaryTrigger.js +0 -27
  214. package/lib/RadioButton.js +0 -84
  215. package/lib/RadioButton.js.map +0 -1
  216. package/lib/components/HelpTooltip/HelpTooltip.d.ts +0 -12
  217. package/lib/components/HelpTooltip/index.d.ts +0 -3
  218. package/lib/components/HelpTooltip/index.js +0 -48
  219. package/lib/components/HelpTooltip/index.js.map +0 -1
  220. package/lib/components/RadioButton/RadioButton.d.ts +0 -28
  221. package/lib/components/RadioButton/index.d.ts +0 -3
  222. package/lib/components/RadioButton/index.js +0 -7
  223. package/lib/components/RadioButton/index.js.map +0 -1
  224. package/lib/components/RadioButton/styles.module.scss.d.ts +0 -26
  225. package/lib/designsystem-react.css +0 -273
  226. /package/lib/components/{RadioButton → Radio}/RadioMarker/RadioMarker.d.ts +0 -0
  227. /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss +0 -0
  228. /package/lib/components/{RadioButton → Radio}/RadioMarker/styles.module.scss.d.ts +0 -0
@@ -0,0 +1,114 @@
1
+ import { t as ViewBoxSize } from "../../utils3.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/Illustrations/MoveAwayMedium.tsx
4
+ var MoveAwayMedium = ({ color, svgProperties, title }) => {
5
+ const palette = (() => {
6
+ switch (color) {
7
+ case "blueberry": return {
8
+ background: "var(--brandcolor-blueberry-verylight, #E4F7F9)",
9
+ door: "var(--brandcolor-blueberry-medium, #188097)",
10
+ sweater: "var(--brandcolor-blueberry-mediumlight, #AFDAE3)",
11
+ pants: "var(--brandcolor-blueberry-dark, #08667C)",
12
+ arrow: "var(--brandcolor-blueberry-medium, #188097)",
13
+ skin: "var(--brandcolor-blueberry-verylight, #E4F7F9)"
14
+ };
15
+ case "cherry": return {
16
+ background: "var(--brandcolor-cherry-verylight, #FFF2EA)",
17
+ door: "var(--brandcolor-cherry-medium, #C83521)",
18
+ sweater: "#B69079",
19
+ pants: "var(--brandcolor-cherry-dark, #A31F0E)",
20
+ arrow: "var(--brandcolor-cherry-medium, #C83521)",
21
+ skin: "var(--brandcolor-cherry-verylight, #FFF2EA)"
22
+ };
23
+ default: return {
24
+ background: "var(--brandcolor-neutral-verylight, #F5F3F3)",
25
+ door: "var(--brandcolor-neutral-medium, #989693)",
26
+ sweater: "var(--brandcolor-neutral-verylight, #F5F3F3)",
27
+ pants: "var(--brandcolor-neutral-dark, #62625F)",
28
+ arrow: "var(--brandcolor-neutral-verydark, #2B2C2B)",
29
+ skin: "var(--brandcolor-neutral-light, #EAE7E7)"
30
+ };
31
+ }
32
+ })();
33
+ return /* @__PURE__ */ jsxs("svg", {
34
+ ...svgProperties,
35
+ viewBox: ViewBoxSize.Medium,
36
+ children: [
37
+ title,
38
+ /* @__PURE__ */ jsx("path", {
39
+ fill: palette.background,
40
+ d: "M0 0h512v512H0z"
41
+ }),
42
+ /* @__PURE__ */ jsx("path", {
43
+ fill: "#fff",
44
+ d: "M184.571 78.379h139.787v344.188H184.571z"
45
+ }),
46
+ /* @__PURE__ */ jsx("path", {
47
+ d: "M324.358 460.404V51.757l106.461 26.69v343.998l-106.461 37.959Z",
48
+ fill: palette.door
49
+ }),
50
+ /* @__PURE__ */ jsx("path", {
51
+ d: "m106.104 306.548 3.249-13.158 10.375 2.358 1.953 5.463 2.942 5.337v3.495l-1.762 1.469-2.801-3.454-1.986-3.188-1.934 2.718 1.14 6.432-1.14 5.956-3.45 3.084-4.129-.313-2.457-3.892-1.359-4.835 1.359-7.472Zm147.847-37.089-4.44 1.573-2.357 10.397 15.572 4.29 5.682.58 5.325-1.623 2.214-4.244-.881-3.231-2.84-2.546-3.818-.587-7.203.587-2.384-1.646 2.384-1.977 2.796-1.573 1.312-2.181-3.246-1.522-3.957 1.522-4.159 2.181Z",
52
+ fill: palette.skin
53
+ }),
54
+ /* @__PURE__ */ jsx("path", {
55
+ d: "m132.583 362.267 7.472-63.191 7.635 1.137 12.671 2.274 14.457.975h12.833l8.935-.975 6.498-2.274 20.63 54.094-11.696 74.4h-26.154l2.762-68.877-11.534-15.432-9.746 24.692-37.037 53.444-23.392-12.021 25.666-48.246Z",
56
+ fill: palette.pants
57
+ }),
58
+ /* @__PURE__ */ jsx("path", {
59
+ d: "M164.422 200.796v-6.335l29.24 6.335-3.412 7.635 3.412 9.747 21.28 34.276 34.847 12.379-4.386 20.467-37.121-12.379 6.66 21.768-4.711 2.762-10.884 4.061-9.097 2.599h-12.183l-14.782-.975-10.884-1.624-8.61-1.95-7.797-2.111-4.711-2.762 18.519-51.495-13.808 10.559-11.209 42.398-21.118-3.249 13.808-53.769 46.947-38.337Z",
60
+ fill: palette.sweater
61
+ }),
62
+ /* @__PURE__ */ jsx("path", {
63
+ d: "m173.044 179.775.28-2.923-2.319-2.338-1.849-2.541-1.144-2.922.61-2.593 1.855-1.601 2.567-.286 2.033 1.176 1.245 2.268.89 1.62 2.007-1.804 1.83-2.77 3.202-3.177 3.405-1.474 4.283.174 3.2.317 3.056-.317 2.882-.907 2.128-1.428 1.551-2.084.504-2.394v-3.014l-.858-2.66-2.04-3.458-3.083-3.358-4.44-1.903-5.845-1.314h-6.402l-6.074 1.876-4.521 2.558-4.987 5.998-4.012.709s-4.676 2.561-4.821 2.743l-2.566 3.481-1.423 3.838-.502 4.548.502 5.236 1.965 5.658 3.769 4.217 3.364 1.929 2.592 2.249 2.363 3.227.737 1.957 1.779-2.694c.604-1.087 1.445-2.991 1.626-3.1l.661-2.719Z",
64
+ fill: "#000"
65
+ }),
66
+ /* @__PURE__ */ jsx("path", {
67
+ d: "M168.539 188.565v6.978l5.019.866 7.333 1.8 6.533 1.2-.484-2.525-.441-4.242v-3.195c.753.239 2.325.716 2.59.716.33 0 2.865.551 3.195.551.265 0 1.433-.367 1.984-.551l1.928-2.038 1.267-3.802.716-3.636v-2.92l6.171-1.873-5.675-14.71h-4.022l-3.911-.606-2.887.315-2.791 1.083-2.874 3.285-2.333 2.534-2.503 1.818-.937-1.818-1.432-1.928-2.479-1.377-2.424.771-1.543 1.763-.441 2.204.937 2.644 2.204 2.7 1.928 2.038v3.14l-1.212 3.581-1.873 3.031-1.543 2.203Z",
68
+ fill: palette.skin
69
+ }),
70
+ /* @__PURE__ */ jsx("path", {
71
+ d: "m198.486 160.996 5.9 14.904-6.163 1.811c0 4.104-1.087 12.421-5.438 12.855-1.835.184-4.145-.357-6.423-1.185m-7.896-3.885c1.711 1.082 4.775 2.752 7.896 3.885m0 0s.064 3.727.778 9.002m-18.478-3.109v-6.55c1.508-1.768 4.543-6.64 4.622-11.984-4.622-4.125-6.982-9.135-3.147-11.394 3.835-2.259 6.028 1.964 7.179 4.224 2.95-.197 3.798-8.738 11.864-9.225 3.085.71 12.997 1.699 15.206-4.407 2.217-6.129-1.528-13.289-9.566-16.132-8.458-2.991-20.584-2.462-28.228 8.901-6.473-.413-11.255 5.744-12.533 10.95-1.279 5.206.745 13.883 5.027 18.054 3.581 3.488 8.867 5.005 9.576 10.702m-18.446 54.5-18.677 51.968c5.558 5.009 26.89 9.149 45.776 9.149 21.55 0 31.207-5.741 37.148-9.149l-23.804-85.706 2.126-8.699-28.24-6.028.14 7.202",
72
+ fill: "none",
73
+ stroke: "#000",
74
+ "stroke-width": "4"
75
+ }),
76
+ /* @__PURE__ */ jsx("path", {
77
+ d: "m172.123 226.152-21.369 16.266-14.352 11.162-11.41 42.864-21.228-3.616 14.14-54.238 47.244-37.965m27.433 15.739 23.478 37.021 34.015 11.63-4.859 20.979-37.153-12.634",
78
+ fill: "none",
79
+ stroke: "#000",
80
+ "stroke-width": "4"
81
+ }),
82
+ /* @__PURE__ */ jsx("path", {
83
+ d: "M108.901 293.317a710.121 710.121 0 0 0-2.082 9.247c-.923 4.312-2.39 8.839-2.185 11.845.192 2.835 2.109 8.472 5.698 8.911 4.079.498 6.974-4.484 6.808-7.451-.254-4.543-1.19-9.14.134-10.746 1.736-.255 1.931.558 2.534 2.104 3.725 7.562 6.404 4.269 4.572-.917-1.202-2.565-5.268-9.28-5.057-11.319m127.035-13.79c1.419.427 6.75 1.969 8.993 2.589 4.196 1.161 8.573 2.869 11.548 2.842 2.805-.025 8.473-1.586 9.114-5.099.728-3.991-4.014-7.134-6.949-7.143-4.492-.013-9.078.642-10.584-.756-.149-1.726.662-1.871 2.221-2.375 7.671-3.233 4.58-6.064-.638-4.56-2.598 1.036-9.452 4.654-11.45 4.328m-104.792 29.13 44.815 59.556-3.058 69.052h26.508l11.503-74.171-20.631-54.437",
84
+ fill: "none",
85
+ stroke: "#000",
86
+ "stroke-width": "4"
87
+ }),
88
+ /* @__PURE__ */ jsx("path", {
89
+ d: "m140.378 299.409-7.86 62.836-25.526 48.212 23.62 12.11 36.211-52.596 10.411-24.957m11.839 84.453-1.397 19.17h33.023c6.133-.943 5.304-10.225-3.396-10.805-10.456-.697-14.29-5.228-14.29-8.365m-91.964-16.171-8.602 17.132 28.887 14.714c4.626 1.75 9.664-6.824 2.438-11.076-9.032-5.315-10.425-11.085-9.018-13.888m59.48-294.606v-47.55h139.447m0 344.7V51.291l106.928 26.732v344.699L323.681 460.71v-37.988Zm0 0h-88.844",
90
+ fill: "none",
91
+ stroke: "#000",
92
+ "stroke-width": "4"
93
+ }),
94
+ /* @__PURE__ */ jsx("path", {
95
+ d: "M343.583 248.592c2.129 0 4.668 2.312 4.668 6.272 0 3.961-2.539 6.274-4.668 6.274s-4.667-2.313-4.667-6.274c0-3.96 2.538-6.272 4.667-6.272Z",
96
+ fill: "none",
97
+ stroke: "#000",
98
+ "stroke-width": "5"
99
+ }),
100
+ /* @__PURE__ */ jsx("path", {
101
+ d: "m110.978 412.299 13.645 6.66v6.01l3.574 5.524 6.985 3.898c1.354 1.571 3.606 5.426 1.787 8.285-1.82 2.859-5.415 2.491-6.985 1.949l-27.616-14.132 8.61-18.194Zm77.323 35.9.975-19.006h13.808l2.924 4.386 4.873 3.086c2.599.325 7.797 1.008 7.797 1.138 0 .129 2.924 1.57 4.386 2.274l1.625 4.548-1.625 3.574h-34.763Z",
102
+ fill: "#000"
103
+ }),
104
+ /* @__PURE__ */ jsx("path", {
105
+ d: "M272.728 195.828h-42.607v17.866h42.607v10.069l28.167-19.327-28.167-19.327v10.719Z",
106
+ fill: palette.arrow
107
+ })
108
+ ]
109
+ });
110
+ };
111
+ //#endregion
112
+ export { MoveAwayMedium as default };
113
+
114
+ //# sourceMappingURL=MoveAwayMedium.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MoveAwayMedium.js","names":[],"sources":["../../../src/components/Illustrations/MoveAwayMedium.tsx"],"sourcesContent":["import type { Palette } from './MoveAway';\nimport type { BaseSvgIllustrationProps } from '../Illustration';\n\nimport { ViewBoxSize } from '../Illustration/utils';\n\nconst MoveAwayMedium: React.FC<BaseSvgIllustrationProps> = ({ color, svgProperties, title }) => {\n const palette = ((): Palette => {\n switch (color) {\n case 'blueberry':\n return {\n background: 'var(--brandcolor-blueberry-verylight, #E4F7F9)',\n door: 'var(--brandcolor-blueberry-medium, #188097)',\n sweater: 'var(--brandcolor-blueberry-mediumlight, #AFDAE3)',\n pants: 'var(--brandcolor-blueberry-dark, #08667C)',\n arrow: 'var(--brandcolor-blueberry-medium, #188097)',\n skin: 'var(--brandcolor-blueberry-verylight, #E4F7F9)',\n };\n case 'cherry':\n return {\n background: 'var(--brandcolor-cherry-verylight, #FFF2EA)',\n door: 'var(--brandcolor-cherry-medium, #C83521)',\n sweater: '#B69079',\n pants: 'var(--brandcolor-cherry-dark, #A31F0E)',\n arrow: 'var(--brandcolor-cherry-medium, #C83521)',\n skin: 'var(--brandcolor-cherry-verylight, #FFF2EA)',\n };\n default:\n return {\n background: 'var(--brandcolor-neutral-verylight, #F5F3F3)',\n door: 'var(--brandcolor-neutral-medium, #989693)',\n sweater: 'var(--brandcolor-neutral-verylight, #F5F3F3)',\n pants: 'var(--brandcolor-neutral-dark, #62625F)',\n arrow: 'var(--brandcolor-neutral-verydark, #2B2C2B)',\n skin: 'var(--brandcolor-neutral-light, #EAE7E7)',\n };\n }\n })();\n\n return (\n <svg {...svgProperties} viewBox={ViewBoxSize.Medium}>\n {title}\n <path fill={palette.background} d=\"M0 0h512v512H0z\" />\n <path fill=\"#fff\" d=\"M184.571 78.379h139.787v344.188H184.571z\" />\n <path d=\"M324.358 460.404V51.757l106.461 26.69v343.998l-106.461 37.959Z\" fill={palette.door} />\n <path\n d=\"m106.104 306.548 3.249-13.158 10.375 2.358 1.953 5.463 2.942 5.337v3.495l-1.762 1.469-2.801-3.454-1.986-3.188-1.934 2.718 1.14 6.432-1.14 5.956-3.45 3.084-4.129-.313-2.457-3.892-1.359-4.835 1.359-7.472Zm147.847-37.089-4.44 1.573-2.357 10.397 15.572 4.29 5.682.58 5.325-1.623 2.214-4.244-.881-3.231-2.84-2.546-3.818-.587-7.203.587-2.384-1.646 2.384-1.977 2.796-1.573 1.312-2.181-3.246-1.522-3.957 1.522-4.159 2.181Z\"\n fill={palette.skin}\n />\n <path\n d=\"m132.583 362.267 7.472-63.191 7.635 1.137 12.671 2.274 14.457.975h12.833l8.935-.975 6.498-2.274 20.63 54.094-11.696 74.4h-26.154l2.762-68.877-11.534-15.432-9.746 24.692-37.037 53.444-23.392-12.021 25.666-48.246Z\"\n fill={palette.pants}\n />\n <path\n d=\"M164.422 200.796v-6.335l29.24 6.335-3.412 7.635 3.412 9.747 21.28 34.276 34.847 12.379-4.386 20.467-37.121-12.379 6.66 21.768-4.711 2.762-10.884 4.061-9.097 2.599h-12.183l-14.782-.975-10.884-1.624-8.61-1.95-7.797-2.111-4.711-2.762 18.519-51.495-13.808 10.559-11.209 42.398-21.118-3.249 13.808-53.769 46.947-38.337Z\"\n fill={palette.sweater}\n />\n <path\n d=\"m173.044 179.775.28-2.923-2.319-2.338-1.849-2.541-1.144-2.922.61-2.593 1.855-1.601 2.567-.286 2.033 1.176 1.245 2.268.89 1.62 2.007-1.804 1.83-2.77 3.202-3.177 3.405-1.474 4.283.174 3.2.317 3.056-.317 2.882-.907 2.128-1.428 1.551-2.084.504-2.394v-3.014l-.858-2.66-2.04-3.458-3.083-3.358-4.44-1.903-5.845-1.314h-6.402l-6.074 1.876-4.521 2.558-4.987 5.998-4.012.709s-4.676 2.561-4.821 2.743l-2.566 3.481-1.423 3.838-.502 4.548.502 5.236 1.965 5.658 3.769 4.217 3.364 1.929 2.592 2.249 2.363 3.227.737 1.957 1.779-2.694c.604-1.087 1.445-2.991 1.626-3.1l.661-2.719Z\"\n fill=\"#000\"\n />\n <path\n d=\"M168.539 188.565v6.978l5.019.866 7.333 1.8 6.533 1.2-.484-2.525-.441-4.242v-3.195c.753.239 2.325.716 2.59.716.33 0 2.865.551 3.195.551.265 0 1.433-.367 1.984-.551l1.928-2.038 1.267-3.802.716-3.636v-2.92l6.171-1.873-5.675-14.71h-4.022l-3.911-.606-2.887.315-2.791 1.083-2.874 3.285-2.333 2.534-2.503 1.818-.937-1.818-1.432-1.928-2.479-1.377-2.424.771-1.543 1.763-.441 2.204.937 2.644 2.204 2.7 1.928 2.038v3.14l-1.212 3.581-1.873 3.031-1.543 2.203Z\"\n fill={palette.skin}\n />\n <path\n d=\"m198.486 160.996 5.9 14.904-6.163 1.811c0 4.104-1.087 12.421-5.438 12.855-1.835.184-4.145-.357-6.423-1.185m-7.896-3.885c1.711 1.082 4.775 2.752 7.896 3.885m0 0s.064 3.727.778 9.002m-18.478-3.109v-6.55c1.508-1.768 4.543-6.64 4.622-11.984-4.622-4.125-6.982-9.135-3.147-11.394 3.835-2.259 6.028 1.964 7.179 4.224 2.95-.197 3.798-8.738 11.864-9.225 3.085.71 12.997 1.699 15.206-4.407 2.217-6.129-1.528-13.289-9.566-16.132-8.458-2.991-20.584-2.462-28.228 8.901-6.473-.413-11.255 5.744-12.533 10.95-1.279 5.206.745 13.883 5.027 18.054 3.581 3.488 8.867 5.005 9.576 10.702m-18.446 54.5-18.677 51.968c5.558 5.009 26.89 9.149 45.776 9.149 21.55 0 31.207-5.741 37.148-9.149l-23.804-85.706 2.126-8.699-28.24-6.028.14 7.202\"\n fill=\"none\"\n stroke=\"#000\"\n stroke-width=\"4\"\n />\n <path\n d=\"m172.123 226.152-21.369 16.266-14.352 11.162-11.41 42.864-21.228-3.616 14.14-54.238 47.244-37.965m27.433 15.739 23.478 37.021 34.015 11.63-4.859 20.979-37.153-12.634\"\n fill=\"none\"\n stroke=\"#000\"\n stroke-width=\"4\"\n />\n <path\n d=\"M108.901 293.317a710.121 710.121 0 0 0-2.082 9.247c-.923 4.312-2.39 8.839-2.185 11.845.192 2.835 2.109 8.472 5.698 8.911 4.079.498 6.974-4.484 6.808-7.451-.254-4.543-1.19-9.14.134-10.746 1.736-.255 1.931.558 2.534 2.104 3.725 7.562 6.404 4.269 4.572-.917-1.202-2.565-5.268-9.28-5.057-11.319m127.035-13.79c1.419.427 6.75 1.969 8.993 2.589 4.196 1.161 8.573 2.869 11.548 2.842 2.805-.025 8.473-1.586 9.114-5.099.728-3.991-4.014-7.134-6.949-7.143-4.492-.013-9.078.642-10.584-.756-.149-1.726.662-1.871 2.221-2.375 7.671-3.233 4.58-6.064-.638-4.56-2.598 1.036-9.452 4.654-11.45 4.328m-104.792 29.13 44.815 59.556-3.058 69.052h26.508l11.503-74.171-20.631-54.437\"\n fill=\"none\"\n stroke=\"#000\"\n stroke-width=\"4\"\n />\n <path\n d=\"m140.378 299.409-7.86 62.836-25.526 48.212 23.62 12.11 36.211-52.596 10.411-24.957m11.839 84.453-1.397 19.17h33.023c6.133-.943 5.304-10.225-3.396-10.805-10.456-.697-14.29-5.228-14.29-8.365m-91.964-16.171-8.602 17.132 28.887 14.714c4.626 1.75 9.664-6.824 2.438-11.076-9.032-5.315-10.425-11.085-9.018-13.888m59.48-294.606v-47.55h139.447m0 344.7V51.291l106.928 26.732v344.699L323.681 460.71v-37.988Zm0 0h-88.844\"\n fill=\"none\"\n stroke=\"#000\"\n stroke-width=\"4\"\n />\n <path\n d=\"M343.583 248.592c2.129 0 4.668 2.312 4.668 6.272 0 3.961-2.539 6.274-4.668 6.274s-4.667-2.313-4.667-6.274c0-3.96 2.538-6.272 4.667-6.272Z\"\n fill=\"none\"\n stroke=\"#000\"\n stroke-width=\"5\"\n />\n <path\n d=\"m110.978 412.299 13.645 6.66v6.01l3.574 5.524 6.985 3.898c1.354 1.571 3.606 5.426 1.787 8.285-1.82 2.859-5.415 2.491-6.985 1.949l-27.616-14.132 8.61-18.194Zm77.323 35.9.975-19.006h13.808l2.924 4.386 4.873 3.086c2.599.325 7.797 1.008 7.797 1.138 0 .129 2.924 1.57 4.386 2.274l1.625 4.548-1.625 3.574h-34.763Z\"\n fill=\"#000\"\n />\n <path d=\"M272.728 195.828h-42.607v17.866h42.607v10.069l28.167-19.327-28.167-19.327v10.719Z\" fill={palette.arrow} />\n </svg>\n );\n};\n\nexport default MoveAwayMedium;\n"],"mappings":";;;AAKA,IAAM,kBAAsD,EAAE,OAAO,eAAe,YAAY;CAC9F,MAAM,iBAA0B;EAC9B,QAAQ,OAAR;GACE,KAAK,aACH,OAAO;IACL,YAAY;IACZ,MAAM;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;GACR;GACF,KAAK,UACH,OAAO;IACL,YAAY;IACZ,MAAM;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;GACR;GACF,SACE,OAAO;IACL,YAAY;IACZ,MAAM;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;GACR;EACJ;CACF,EAAA,CAAG;CAEH,OACE,qBAAC,OAAD;EAAK,GAAI;EAAe,SAAS,YAAY;EAA7C,UAAA;GACG;GACD,oBAAC,QAAD;IAAM,MAAM,QAAQ;IAAY,GAAE;GAAmB,CAAA;GACrD,oBAAC,QAAD;IAAM,MAAK;IAAO,GAAE;GAA4C,CAAA;GAChE,oBAAC,QAAD;IAAM,GAAE;IAAiE,MAAM,QAAQ;GAAO,CAAA;GAC9F,oBAAC,QAAD;IACE,GAAE;IACF,MAAM,QAAQ;GACf,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAM,QAAQ;GACf,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAM,QAAQ;GACf,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;GACN,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAM,QAAQ;GACf,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;GACd,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;GACd,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;GACd,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;GACd,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;IACL,QAAO;IACP,gBAAa;GACd,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;GACN,CAAA;GACD,oBAAC,QAAD;IAAM,GAAE;IAAoF,MAAM,QAAQ;GAAQ,CAAA;EAC/G;;AAET"}
@@ -1,7 +1,5 @@
1
1
  @use 'sass:map';
2
2
  @use '../../scss/breakpoints' as breakpoints;
3
- @import '../../scss/supernova/styles/colors.css';
4
- @import '../../scss/supernova/styles/spacers.css';
5
3
 
6
4
  .wrapper {
7
5
  position: relative;
@@ -12,8 +10,8 @@
12
10
  grid-template-columns: [icon] auto [content] 1fr;
13
11
  width: 100%;
14
12
  overflow: hidden;
15
- background-color: var(--color-base-background-blueberry);
16
- border: 1px solid var(--color-base-border-blueberry);
13
+ background-color: var(--color-base-blueberry-background-light);
14
+ border: 1px solid var(--color-base-blueberry-border-light);
17
15
  padding: var(--core-space-m) var(--core-space-s) var(--core-space-l) var(--core-space-s);
18
16
  row-gap: var(--core-space-2xs);
19
17
 
@@ -61,7 +59,7 @@
61
59
  width: fit-content;
62
60
  white-space: nowrap;
63
61
  border-radius: 1.25rem;
64
- background: var(--color-action-graphics-onlight, #188097);
62
+ background: var(--color-action-graphics-dark-normal, #188097);
65
63
  color: var(--core-color-white, #fff);
66
64
  padding: 0.375rem 1rem;
67
65
  bottom: 0;
@@ -76,13 +74,13 @@
76
74
  line-height: 120%; // 1.2rem
77
75
 
78
76
  &:hover {
79
- background-color: var(--color-action-graphics-onlight-hover);
77
+ background-color: var(--color-action-graphics-dark-hover);
80
78
  }
81
79
 
82
80
  &:focus-visible {
83
- border: 1px solid var(--color-base-graphics-ondark);
81
+ border: 1px solid var(--color-base-graphics-light);
84
82
  outline: none;
85
- box-shadow: 0 0 0 3px var(--color-base-graphics-onlight);
83
+ box-shadow: 0 0 0 3px var(--color-base-graphics-dark);
86
84
  }
87
85
 
88
86
  &:active {
@@ -51,7 +51,7 @@
51
51
  .sublabel {
52
52
  @include fonts.sublabel;
53
53
 
54
- color: var(--color-base-text-onlight-subdued);
54
+ color: var(--color-base-subdued-text-dark);
55
55
 
56
56
  &--subdued {
57
57
  @include fonts.sublabel-subdued;
@@ -3,7 +3,7 @@ import { HNDesignsystemLinkList } from '../../resources/Resources';
3
3
  import { PaletteNames } from '../../theme/palette';
4
4
  import { ElementHeaderType } from '../ElementHeader/ElementHeader';
5
5
  import { ListEditModeItemProps } from '../ListEditMode';
6
- export type LinkListSize = 'small' | 'medium' | 'large';
6
+ export type LinkListSize = 'small' | 'normal' | 'large';
7
7
  export type LinkListStatus = 'none' | 'new';
8
8
  export type LinkAnchorTargets = '_self' | '_blank' | '_parent';
9
9
  export type LinkListColors = Extract<PaletteNames, 'white' | 'blueberry' | 'cherry' | 'neutral'>;
@@ -3,8 +3,6 @@
3
3
  @use '../../scss/font-settings' as font-settings;
4
4
  @use '../../scss/palette' as palette;
5
5
  @use '../../scss/breakpoints' as breakpoints;
6
- @import '../../scss/supernova/styles/colors.css';
7
- @import '../../scss/supernova/styles/spacers.css';
8
6
 
9
7
  .link-list {
10
8
  list-style: none;
@@ -73,7 +71,7 @@
73
71
  display: flex;
74
72
  min-height: 4rem;
75
73
  text-decoration: none;
76
- color: var(--color-base-text-onlight);
74
+ color: var(--color-base-text-dark);
77
75
 
78
76
  // listeelement settes til div om man er i edit mode, og skal da ikke ha interactive effekter
79
77
  &:not(div) {
@@ -92,7 +90,7 @@
92
90
  &--fill,
93
91
  &--line {
94
92
  &--white {
95
- background-color: var(--color-base-background-white);
93
+ background-color: var(--color-base-background-light);
96
94
  }
97
95
 
98
96
  &--blueberry {
@@ -109,7 +107,7 @@
109
107
  }
110
108
 
111
109
  &--fill-negative {
112
- background-color: var(--color-base-background-white);
110
+ background-color: var(--color-base-background-light);
113
111
  }
114
112
 
115
113
  &--fill,
@@ -146,7 +144,7 @@
146
144
  line-height: font-settings.$lineheight-size-xs;
147
145
  }
148
146
 
149
- &--medium {
147
+ &--normal {
150
148
  font-size: font-settings.$font-size-sm;
151
149
  line-height: font-settings.$lineheight-size-sm;
152
150
  }
@@ -162,7 +160,7 @@
162
160
  line-height: font-settings.$lineheight-size-sm;
163
161
  }
164
162
 
165
- &--medium {
163
+ &--normal {
166
164
  font-size: font-settings.$font-size-md;
167
165
  line-height: font-settings.$lineheight-size-md;
168
166
  }
@@ -215,17 +213,17 @@
215
213
  }
216
214
 
217
215
  &:focus-visible {
218
- outline: 4px solid var(--color-action-border-onlight-focus);
216
+ outline: 4px solid var(--color-action-border-dark-focus);
219
217
  outline-offset: 0; // Override user agent default
220
218
  position: relative;
221
219
  z-index: 1;
222
220
  }
223
221
 
224
222
  &--outline {
225
- background-color: var(--color-base-background-white);
223
+ background-color: var(--color-base-background-light);
226
224
 
227
225
  &--white {
228
- background-color: var(--color-base-background-white);
226
+ background-color: var(--color-base-background-light);
229
227
  }
230
228
 
231
229
  &--blueberry {
@@ -304,7 +302,7 @@
304
302
  background-color: transparent;
305
303
 
306
304
  &--new {
307
- background-color: var(--color-notification-status-info);
305
+ background-color: var(--color-notification-info);
308
306
  }
309
307
  }
310
308
  }
@@ -19,9 +19,9 @@ export type Styles = {
19
19
  'link-list__anchor--line--cherry': string;
20
20
  'link-list__anchor--line--neutral': string;
21
21
  'link-list__anchor--line--white': string;
22
- 'link-list__anchor--medium': string;
23
22
  'link-list__anchor--neutral': string;
24
23
  'link-list__anchor--new': string;
24
+ 'link-list__anchor--normal': string;
25
25
  'link-list__anchor--outline': string;
26
26
  'link-list__anchor--outline--blueberry': string;
27
27
  'link-list__anchor--outline--cherry': string;
@@ -3,8 +3,6 @@
3
3
  @use '../../scss/font-settings' as font-settings;
4
4
  @use '../../scss/palette' as palette;
5
5
  @use '../../scss/breakpoints' as breakpoints;
6
- @import '../../scss/supernova/styles/colors.css';
7
- @import '../../scss/supernova/styles/spacers.css';
8
6
 
9
7
  .list-edit-mode {
10
8
  border: none !important;
@@ -21,15 +19,15 @@
21
19
  cursor: pointer;
22
20
 
23
21
  &:hover {
24
- background-color: var(--color-action-background-transparent-onmulticolor-hover);
22
+ background-color: var(--color-action-background-transparent-multi-onlight-hover);
25
23
  }
26
24
 
27
25
  &:active {
28
- background-color: var(--color-action-background-transparent-onmulticolor-active);
26
+ background-color: var(--color-action-background-transparent-multi-ondark-hover);
29
27
  }
30
28
 
31
29
  &:focus-visible {
32
- outline: 4px solid var(--color-action-border-onlight-focus);
30
+ outline: 4px solid var(--color-action-border-dark-focus);
33
31
  }
34
32
  }
35
33
 
@@ -41,10 +39,10 @@
41
39
 
42
40
  &--neutral,
43
41
  &--white {
44
- border-bottom: 1px solid var(--color-base-border-onlight);
42
+ border-bottom: 1px solid var(--color-base-border-dark);
45
43
 
46
44
  &:first-of-type {
47
- border-top: 1px solid var(--color-base-border-onlight);
45
+ border-top: 1px solid var(--color-base-border-dark);
48
46
  }
49
47
  }
50
48
 
@@ -1,7 +1,7 @@
1
1
  import { PaletteNames } from '../../theme/palette';
2
2
  import { Overlay } from './constants';
3
3
  export type LoaderColors = PaletteNames;
4
- export type LoaderSizes = 'tiny' | 'small' | 'medium' | 'large';
4
+ export type LoaderSizes = 'tiny' | 'normal' | 'medium' | 'large';
5
5
  export interface LoaderProps {
6
6
  /** Sets the color of the loader. If overlay is used, the color will always be white. */
7
7
  color?: LoaderColors;
@@ -13,7 +13,7 @@ var Overlay = /* @__PURE__ */ function(Overlay) {
13
13
  //#endregion
14
14
  //#region src/components/Loader/Loader.tsx
15
15
  var Loader = (props) => {
16
- const { overlay, size = "small", className = "", labelId = uuid(), testId, center, inline, ariaLabelledById, ariaLabel = "Laster inn" } = props;
16
+ const { overlay, size = "normal", className = "", labelId = uuid(), testId, center, inline, ariaLabelledById, ariaLabel = "Laster inn" } = props;
17
17
  const color = props.overlay ? "white" : props.color || "neutral";
18
18
  const showLoader = () => {
19
19
  if (overlay === Overlay.parent || inline) return false;
@@ -21,7 +21,7 @@ var Loader = (props) => {
21
21
  };
22
22
  const [display, setDisplay] = useState(showLoader());
23
23
  const hasInitializedRef = useRef(false);
24
- const isSmall = size === "small";
24
+ const isNormal = size === "normal";
25
25
  const isMedium = size === "medium";
26
26
  const isLarge = size === "large";
27
27
  const loaderWrapperClasses = classNames({
@@ -32,12 +32,12 @@ var Loader = (props) => {
32
32
  [loaderStyles["loader-wrapper--inline"]]: inline && display
33
33
  });
34
34
  const loaderClasses = classNames(loaderStyles.loader, {
35
- [loaderStyles["loader--small"]]: isSmall,
35
+ [loaderStyles["loader--normal"]]: isNormal,
36
36
  [loaderStyles["loader--medium"]]: isMedium,
37
37
  [loaderStyles["loader--large"]]: isLarge
38
38
  }, className);
39
39
  const loaderDotClasses = classNames(loaderStyles.loader__dot, {
40
- [loaderStyles["loader__dot--small"]]: isSmall,
40
+ [loaderStyles["loader__dot--normal"]]: isNormal,
41
41
  [loaderStyles["loader__dot--medium"]]: isMedium,
42
42
  [loaderStyles["loader__dot--large"]]: isLarge,
43
43
  [loaderStyles["loader__dot--banana"]]: color === "banana",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Loader/constants.ts","../../../src/components/Loader/Loader.tsx","../../../src/components/Loader/index.ts"],"sourcesContent":["export enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\n","import { useCallback, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { PaletteNames } from '../../theme/palette';\n\nimport { Overlay } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { uuid } from '../../utils/uuid';\n\nimport loaderStyles from './styles.module.scss';\n\nexport type LoaderColors = PaletteNames;\nexport type LoaderSizes = 'tiny' | 'small' | 'medium' | 'large';\n\nexport interface LoaderProps {\n /** Sets the color of the loader. If overlay is used, the color will always be white. */\n color?: LoaderColors;\n /**\tAdds custom classes to the element. */\n className?: string;\n /** Changes the size of the loader. */\n size?: LoaderSizes;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** id of the label */\n labelId?: string;\n /** Centers the loader in a container */\n center?: boolean;\n /** Inline the loader so it can be used in a span or paragraph */\n inline?: boolean;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Individual id for loading icon (aria-labelledby). */\n ariaLabelledById?: string;\n /** String that labels the current loading element */\n ariaLabel?: string;\n}\n\nconst Loader: React.FC<LoaderProps> = props => {\n const {\n overlay,\n size = 'small',\n className = '',\n labelId = uuid(),\n testId,\n center,\n inline,\n ariaLabelledById,\n ariaLabel = 'Laster inn',\n } = props;\n const color = props.overlay ? 'white' : props.color || 'neutral';\n\n const showLoader = (): boolean => {\n if (overlay === Overlay.parent || inline) {\n return false;\n }\n\n return true;\n };\n\n const [display, setDisplay] = useState(showLoader());\n const hasInitializedRef = useRef(false);\n\n const isSmall = size === 'small';\n const isMedium = size === 'medium';\n const isLarge = size === 'large';\n\n const loaderWrapperClasses = classNames({\n [loaderStyles['loader-wrapper--center']]: center,\n [loaderStyles['loader-wrapper--overlay']]: overlay,\n [loaderStyles['loader-wrapper--overlay-screen']]: overlay === Overlay.screen,\n [loaderStyles['loader-wrapper--overlay-parent']]: overlay === Overlay.parent && display,\n [loaderStyles['loader-wrapper--inline']]: inline && display,\n });\n const loaderClasses = classNames(\n loaderStyles.loader,\n {\n [loaderStyles['loader--small']]: isSmall,\n [loaderStyles['loader--medium']]: isMedium,\n [loaderStyles['loader--large']]: isLarge,\n },\n className\n );\n const loaderDotClasses = classNames(loaderStyles.loader__dot, {\n [loaderStyles['loader__dot--small']]: isSmall,\n [loaderStyles['loader__dot--medium']]: isMedium,\n [loaderStyles['loader__dot--large']]: isLarge,\n [loaderStyles['loader__dot--banana']]: color === 'banana',\n [loaderStyles['loader__dot--cherry']]: color === 'cherry',\n [loaderStyles['loader__dot--kiwi']]: color === 'kiwi',\n [loaderStyles['loader__dot--neutral']]: color === 'neutral',\n [loaderStyles['loader__dot--plum']]: color === 'plum',\n [loaderStyles['loader__dot--black']]: color === 'black',\n [loaderStyles['loader__dot--white']]: color === 'white',\n });\n\n const wrapperRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node && !hasInitializedRef.current) {\n hasInitializedRef.current = true;\n if (overlay === Overlay.parent && node.parentElement?.style) {\n node.parentElement.style.position = 'relative';\n setDisplay(true);\n }\n if (inline && node.parentElement?.style) {\n node.parentElement.style.display = 'flex';\n setDisplay(true);\n }\n }\n },\n [overlay, inline]\n );\n\n return (\n <div className={loaderWrapperClasses} ref={wrapperRef} style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}>\n {display && (\n <div\n data-testid={testId}\n data-analyticsid={AnalyticsId.Loader}\n role=\"progressbar\"\n aria-labelledby={ariaLabelledById || labelId}\n className={loaderClasses}\n >\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n {!ariaLabelledById && (\n <span id={labelId} className={loaderStyles['loader__hidden-text']}>\n {ariaLabel}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Loader;\n","import Loader from './Loader';\nexport { Overlay } from './constants';\nexport * from './Loader';\nexport default Loader;\n"],"mappings":";;;;;;;AAAA,IAAY,UAAL,yBAAA,SAAA;CACL,QAAA,YAAA;CACA,QAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;;ACmCA,IAAM,UAAgC,UAAS;CAC7C,MAAM,EACJ,SACA,OAAO,SACP,YAAY,IACZ,UAAU,KAAK,GACf,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,CAClB;CAEA,OACE,oBAAC,OAAD;EAAK,WAAW;EAAsB,KAAK;EAAY,OAAO,YAAY,QAAQ,SAAS,EAAE,QAAQ,OAAO,cAAc,IAAI,CAAC;EAC5H,UAAA,WACC,qBAAC,OAAD;GACE,eAAa;GACb,oBAAkB,YAAY;GAC9B,MAAK;GACL,mBAAiB,oBAAoB;GACrC,WAAW;GALb,UAAA;IAOE,oBAAC,OAAD,EAAK,WAAW,iBAAmB,CAAA;IACnC,oBAAC,OAAD,EAAK,WAAW,iBAAmB,CAAA;IACnC,oBAAC,OAAD,EAAK,WAAW,iBAAmB,CAAA;IACnC,oBAAC,OAAD,EAAK,WAAW,iBAAmB,CAAA;IAClC,CAAC,oBACA,oBAAC,QAAD;KAAM,IAAI;KAAS,WAAW,aAAa;KACxC,UAAA;IACG,CAAA;GAEL;;CAEJ,CAAA;AAET;;;ACrIA,IAAA,iBAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Loader/constants.ts","../../../src/components/Loader/Loader.tsx","../../../src/components/Loader/index.ts"],"sourcesContent":["export enum Overlay {\n screen = 'screen',\n parent = 'parent',\n}\n","import { useCallback, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport type { PaletteNames } from '../../theme/palette';\n\nimport { Overlay } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { uuid } from '../../utils/uuid';\n\nimport loaderStyles from './styles.module.scss';\n\nexport type LoaderColors = PaletteNames;\nexport type LoaderSizes = 'tiny' | 'normal' | 'medium' | 'large';\n\nexport interface LoaderProps {\n /** Sets the color of the loader. If overlay is used, the color will always be white. */\n color?: LoaderColors;\n /**\tAdds custom classes to the element. */\n className?: string;\n /** Changes the size of the loader. */\n size?: LoaderSizes;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** id of the label */\n labelId?: string;\n /** Centers the loader in a container */\n center?: boolean;\n /** Inline the loader so it can be used in a span or paragraph */\n inline?: boolean;\n /** Loader is displayed with grey background covering the entire screen */\n overlay?: keyof typeof Overlay;\n /** Individual id for loading icon (aria-labelledby). */\n ariaLabelledById?: string;\n /** String that labels the current loading element */\n ariaLabel?: string;\n}\n\nconst Loader: React.FC<LoaderProps> = props => {\n const {\n overlay,\n size = 'normal',\n className = '',\n labelId = uuid(),\n testId,\n center,\n inline,\n ariaLabelledById,\n ariaLabel = 'Laster inn',\n } = props;\n const color = props.overlay ? 'white' : props.color || 'neutral';\n\n const showLoader = (): boolean => {\n if (overlay === Overlay.parent || inline) {\n return false;\n }\n\n return true;\n };\n\n const [display, setDisplay] = useState(showLoader());\n const hasInitializedRef = useRef(false);\n\n const isNormal = size === 'normal';\n const isMedium = size === 'medium';\n const isLarge = size === 'large';\n\n const loaderWrapperClasses = classNames({\n [loaderStyles['loader-wrapper--center']]: center,\n [loaderStyles['loader-wrapper--overlay']]: overlay,\n [loaderStyles['loader-wrapper--overlay-screen']]: overlay === Overlay.screen,\n [loaderStyles['loader-wrapper--overlay-parent']]: overlay === Overlay.parent && display,\n [loaderStyles['loader-wrapper--inline']]: inline && display,\n });\n const loaderClasses = classNames(\n loaderStyles.loader,\n {\n [loaderStyles['loader--normal']]: isNormal,\n [loaderStyles['loader--medium']]: isMedium,\n [loaderStyles['loader--large']]: isLarge,\n },\n className\n );\n const loaderDotClasses = classNames(loaderStyles.loader__dot, {\n [loaderStyles['loader__dot--normal']]: isNormal,\n [loaderStyles['loader__dot--medium']]: isMedium,\n [loaderStyles['loader__dot--large']]: isLarge,\n [loaderStyles['loader__dot--banana']]: color === 'banana',\n [loaderStyles['loader__dot--cherry']]: color === 'cherry',\n [loaderStyles['loader__dot--kiwi']]: color === 'kiwi',\n [loaderStyles['loader__dot--neutral']]: color === 'neutral',\n [loaderStyles['loader__dot--plum']]: color === 'plum',\n [loaderStyles['loader__dot--black']]: color === 'black',\n [loaderStyles['loader__dot--white']]: color === 'white',\n });\n\n const wrapperRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node && !hasInitializedRef.current) {\n hasInitializedRef.current = true;\n if (overlay === Overlay.parent && node.parentElement?.style) {\n node.parentElement.style.position = 'relative';\n setDisplay(true);\n }\n if (inline && node.parentElement?.style) {\n node.parentElement.style.display = 'flex';\n setDisplay(true);\n }\n }\n },\n [overlay, inline]\n );\n\n return (\n <div className={loaderWrapperClasses} ref={wrapperRef} style={overlay === Overlay.screen ? { zIndex: ZIndex.OverlayScreen } : {}}>\n {display && (\n <div\n data-testid={testId}\n data-analyticsid={AnalyticsId.Loader}\n role=\"progressbar\"\n aria-labelledby={ariaLabelledById || labelId}\n className={loaderClasses}\n >\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n <div className={loaderDotClasses} />\n {!ariaLabelledById && (\n <span id={labelId} className={loaderStyles['loader__hidden-text']}>\n {ariaLabel}\n </span>\n )}\n </div>\n )}\n </div>\n );\n};\n\nexport default Loader;\n","import Loader from './Loader';\nexport { Overlay } from './constants';\nexport * from './Loader';\nexport default Loader;\n"],"mappings":";;;;;;;AAAA,IAAY,UAAL,yBAAA,SAAA;CACL,QAAA,YAAA;CACA,QAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;;ACmCA,IAAM,UAAgC,UAAS;CAC7C,MAAM,EACJ,SACA,OAAO,UACP,YAAY,IACZ,UAAU,KAAK,GACf,QACA,QACA,QACA,kBACA,YAAY,iBACV;CACJ,MAAM,QAAQ,MAAM,UAAU,UAAU,MAAM,SAAS;CAEvD,MAAM,mBAA4B;EAChC,IAAI,YAAY,QAAQ,UAAU,QAChC,OAAO;EAGT,OAAO;CACT;CAEA,MAAM,CAAC,SAAS,cAAc,SAAS,WAAW,CAAC;CACnD,MAAM,oBAAoB,OAAO,KAAK;CAEtC,MAAM,WAAW,SAAS;CAC1B,MAAM,WAAW,SAAS;CAC1B,MAAM,UAAU,SAAS;CAEzB,MAAM,uBAAuB,WAAW;GACrC,aAAa,4BAA4B;GACzC,aAAa,6BAA6B;GAC1C,aAAa,oCAAoC,YAAY,QAAQ;GAC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A;IAClC,CAAC,oBACA,oBAAC,QAAD;KAAM,IAAI;KAAS,WAAW,aAAa;KACxC,UAAA;IACG,CAAA;GAEL;;CAEJ,CAAA;AAET;;;ACrIA,IAAA,iBAAe"}
@@ -79,7 +79,7 @@
79
79
  width: 8 * 5px;
80
80
  height: 8px;
81
81
 
82
- &--small {
82
+ &--normal {
83
83
  width: 12 * 5px;
84
84
  height: 12px;
85
85
  }
@@ -108,7 +108,7 @@
108
108
  // Sets a form of easing animation curve
109
109
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
110
110
 
111
- &--small {
111
+ &--normal {
112
112
  width: 12px;
113
113
  height: 12px;
114
114
  }
@@ -166,9 +166,9 @@
166
166
  left: 16px;
167
167
  }
168
168
 
169
- &--small:nth-child(2),
170
- &--small:nth-child(3) {
171
- @include loader-dot-translate(translate-small, 24px);
169
+ &--normal:nth-child(2),
170
+ &--normal:nth-child(3) {
171
+ @include loader-dot-translate(translate-normal, 24px);
172
172
  }
173
173
 
174
174
  &--medium:nth-child(2),
@@ -181,7 +181,7 @@
181
181
  @include loader-dot-translate(translate-large, 48px);
182
182
  }
183
183
 
184
- &--small:nth-child(3) {
184
+ &--normal:nth-child(3) {
185
185
  left: 24px;
186
186
  }
187
187
 
@@ -200,7 +200,7 @@
200
200
  @include loader-dot-scale(scale-reverse, 1, 0);
201
201
  }
202
202
 
203
- &--small:nth-child(4) {
203
+ &--normal:nth-child(4) {
204
204
  left: 48px;
205
205
  }
206
206
 
@@ -8,13 +8,13 @@ export type Styles = {
8
8
  'loader__dot--large': string;
9
9
  'loader__dot--medium': string;
10
10
  'loader__dot--neutral': string;
11
+ 'loader__dot--normal': string;
11
12
  'loader__dot--plum': string;
12
- 'loader__dot--small': string;
13
13
  'loader__dot--white': string;
14
14
  'loader__hidden-text': string;
15
15
  'loader--large': string;
16
16
  'loader--medium': string;
17
- 'loader--small': string;
17
+ 'loader--normal': string;
18
18
  'loader-wrapper--center': string;
19
19
  'loader-wrapper--inline': string;
20
20
  'loader-wrapper--overlay': string;
@@ -26,7 +26,7 @@ export type Styles = {
26
26
  translate: string;
27
27
  'translate-large': string;
28
28
  'translate-medium': string;
29
- 'translate-small': string;
29
+ 'translate-normal': string;
30
30
  'translate-tiny': string;
31
31
  };
32
32
 
@@ -5,6 +5,6 @@ export declare enum ModalVariants {
5
5
  success = "success"
6
6
  }
7
7
  export declare enum ModalSize {
8
- large = "large",
8
+ normal = "normal",
9
9
  medium = "medium"
10
10
  }
@@ -28,7 +28,7 @@ var ModalVariants = /* @__PURE__ */ function(ModalVariants) {
28
28
  return ModalVariants;
29
29
  }({});
30
30
  var ModalSize = /* @__PURE__ */ function(ModalSize) {
31
- ModalSize["large"] = "large";
31
+ ModalSize["normal"] = "normal";
32
32
  ModalSize["medium"] = "medium";
33
33
  return ModalSize;
34
34
  }({});
@@ -65,7 +65,7 @@ var getIcon = (variant, icon) => {
65
65
  return null;
66
66
  };
67
67
  var Modal = (props) => {
68
- const { footerContent, variant = ModalVariants.normal, primaryButtonText = "OK", titleId = uuid(), className = "", size = ModalSize.large, zIndex = ZIndex.OverlayScreen, role = "dialog" } = props;
68
+ const { footerContent, variant = ModalVariants.normal, primaryButtonText = "OK", titleId = uuid(), className = "", size = ModalSize.normal, zIndex = ZIndex.OverlayScreen, role = "dialog" } = props;
69
69
  const topContent = React.useRef(null);
70
70
  const modalContentRef = React.useRef(null);
71
71
  const dialogRef = React.useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Modal/constants.ts","../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/index.ts"],"sourcesContent":["export enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n}\n\nexport enum ModalSize {\n large = 'large',\n medium = 'medium',\n}\n","import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport type { IconProps } from '../Icon';\n\nimport { ModalSize, ModalVariants } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { isComponent } from '../../utils/component';\nimport { disableBodyScroll, enableBodyScroll } from '../../utils/scroll';\nimport { uuid } from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon, { IconSize } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport AlertSignStroke from '../Icons/AlertSignStroke';\nimport CheckOutline from '../Icons/CheckOutline';\nimport Portal from '../Portal';\nimport Title from '../Title/Title';\n\nimport styles from './styles.module.scss';\n\nexport interface ModalProps {\n /** Title of the modal */\n title: string;\n /** id of the modal title */\n titleId?: string;\n /** Description of the modal. Will not render if the modal has children. */\n description?: string;\n /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\n /** Changes the visual representation of the modal */\n variant?: keyof typeof ModalVariants;\n /** Change width of the modal (default: large) */\n size?: keyof typeof ModalSize;\n /** Icon displayed in title */\n icon?: React.ReactElement;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Primary button text */\n primaryButtonText?: string;\n /** Secondary button text */\n secondaryButtonText?: string;\n /** Sets the aria-label of the modal */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the modal */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Alternative component to modal */\n children?: React.ReactNode;\n /** Component shown after title */\n afterTitleChildren?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Customize the z-index of the modal */\n zIndex?: number;\n /** Function is called when user clicks primary button */\n onSuccess?: () => void;\n /** Function is called when user clicks secondary button, clicks escape or outside the modal */\n onClose?: () => void;\n /** When enabled the component will be rendered in the bottom of document.body */\n printable?: boolean;\n /** If disabled, clicking escape or outside the modal will not close it */\n disableCloseEvents?: boolean;\n /** Aria role used for the Modal. Default is dialog */\n role?: 'dialog' | 'alertdialog';\n}\n\nconst getVariantIcon = (variant?: ModalProps['variant']): React.JSX.Element | null => {\n if (variant === ModalVariants.error) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignFill} color={palette.cherry500} />;\n } else if (variant === ModalVariants.warning) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignStroke} color={palette.black} />;\n } else if (variant === ModalVariants.success) {\n return <Icon size={IconSize.Small} svgIcon={CheckOutline} color={palette.kiwi900} />;\n }\n return null;\n};\n\nconst getIcon = (variant?: ModalProps['variant'], icon?: ModalProps['icon']): React.JSX.Element | null => {\n const variantIcon = getVariantIcon(variant);\n if (variantIcon) {\n return <div className={styles.modal__iconWrapper}>{variantIcon}</div>;\n }\n if (icon) {\n return (\n <div className={styles.modal__iconWrapper}>\n {isComponent<IconProps>(icon, Icon) &&\n React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal: React.FC<ModalProps> = props => {\n const {\n footerContent,\n variant = ModalVariants.normal,\n primaryButtonText = 'OK',\n titleId = uuid(),\n className = '',\n size = ModalSize.large,\n zIndex = ZIndex.OverlayScreen,\n role = 'dialog',\n } = props;\n\n const topContent = React.useRef<HTMLDivElement>(null);\n const modalContentRef = React.useRef<HTMLDivElement>(null);\n const dialogRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(dialogRef, true);\n const topContentVisible = useIsVisible(topContent);\n const bottomContent = React.useRef<HTMLDivElement>(null);\n const bottomContentVisible = useIsVisible(bottomContent);\n const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;\n useReturnFocusOnUnmount(dialogRef);\n\n function handleKeyboardEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape' && props.onClose) {\n e.stopPropagation();\n props.onClose();\n }\n }\n\n function handleClickEvent(event: MouseEvent): void {\n if (event.target && overlayRef.current === event.target && props.onClose) {\n event.stopPropagation();\n props.onClose();\n }\n }\n\n const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess || footerContent;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: props.ariaLabel, id: props.ariaLabelledBy, fallbackId: titleId });\n\n useEffect(() => {\n const overlayElement = overlayRef.current;\n disableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.addEventListener('keydown', handleKeyboardEvent);\n overlayElement.addEventListener('click', handleClickEvent);\n }\n return (): void => {\n enableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.removeEventListener('keydown', handleKeyboardEvent);\n overlayElement.removeEventListener('click', handleClickEvent);\n }\n };\n }, [props.disableCloseEvents]);\n\n useEffect(() => {\n dialogRef.current?.focus();\n }, []);\n\n const dialogClasses = cn(\n className,\n styles.modal,\n variant && styles[`modal--${variant}`],\n size && styles[`modal--${size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: variant === ModalVariants.error,\n [styles['modal__title--success']]: variant === ModalVariants.success,\n });\n\n const Component = (\n <div data-testid=\"dialog-container\">\n <div\n ref={overlayRef}\n className={styles['modal-overlay']}\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.Modal}\n style={{ zIndex }}\n >\n <div className={styles.align}>\n <div className={dialogClasses} role={role} aria-modal=\"true\" tabIndex={-1} {...ariaLabelAttributes} ref={dialogRef}>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--top'], {\n [styles['modal__shadow--show']]: !topContentVisible && contentIsScrollable,\n })}\n />\n <div\n className={cn(styles.modal__contentWrapper)}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\n ref={modalContentRef}\n >\n {!props.noCloseButton && (\n <div className={styles.modal__closeWrapper}>\n <div className={cn(styles.modal__closeWrapper__close)}>\n <Close onClick={props.onClose} ariaLabel={props.ariaLabelCloseBtn} />\n </div>\n </div>\n )}\n <div className={cn(size && styles[`modal__contentWrapper__scroll--${size}`])}>\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(variant, props.icon)}\n <Title id={ariaLabelAttributes?.['aria-labelledby']} htmlMarkup=\"h3\" appearance=\"title3\" className={titleClasses}>\n {props.title}\n </Title>\n {props.afterTitleChildren && <div className={styles['modal__afterTitleChildren']}>{props.afterTitleChildren}</div>}\n </div>\n {props.children && <div>{props.children}</div>}\n {!props.children && <p className={styles.modal__description}>{props.description}</p>}\n <div ref={bottomContent} />\n </div>\n </div>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--bottom'], {\n [styles['modal__shadow--show']]: !bottomContentVisible && contentIsScrollable,\n })}\n />\n {showActions && (\n <div className={cn(styles['modal__call-to-action'], size && styles[`modal__call-to-action--${size}`])}>\n {props.onSuccess && primaryButtonText && <Button onClick={props.onSuccess}>{primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n {footerContent}\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n\n if (props.printable) {\n const printModal = 'print-modal';\n return (\n <Portal className={printModal} testId=\"print-modal\">\n <style media=\"print\">{`body > *:not(.${printModal}) {display: none;}`}</style>\n {Component}\n </Portal>\n );\n }\n\n return Component;\n};\n\nexport default Modal;\n","import Modal from './Modal';\nexport { ModalVariants, ModalSize } from './constants';\nexport * from './Modal';\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAY,gBAAL,yBAAA,eAAA;CACL,cAAA,YAAA;CACA,cAAA,aAAA;CACA,cAAA,WAAA;CACA,cAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,WA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,UAAA,MAAM;SAAe,CAAA;SACnF,oBAAC,OAAD,EAAK,KAAK,cAAgB,CAAA;QACvB;OACF,CAAA,CAAA;;MACL,oBAAC,OAAD,EACE,WAAW,WAAG,OAAO,kBAAkB,OAAO,0BAA0B,GACrE,OAAO,yBAAyB,CAAC,wBAAwB,oBAC5D,CAAC,EACF,CAAA;MACA,eACC,qBAAC,OAAD;OAAK,WAAW,WAAG,OAAO,0BAA0B,QAAQ,OAAO,0BAA0B,OAAO;OAApG,UAAA;QACG,MAAM,aAAa,qBAAqB,oBAAC,gBAAD;SAAQ,SAAS,MAAM;SAAY,UAAA;QAA0B,CAAA;QACrG,MAAM,uBAAuB,MAAM,qBAAqB,SAAS,KAChE,oBAAC,gBAAD;SAAQ,SAAQ;SAAa,SAAS,MAAM;SACzC,UAAA,MAAM;QACD,CAAA;QAET;OACE;;KAEJ;;GACF,CAAA;EACF,CAAA;CACF,CAAA;CAGP,IAAI,MAAM,WAAW;EACnB,MAAM,aAAa;EACnB,OACE,qBAAC,QAAD;GAAQ,WAAW;GAAY,QAAO;GAAtC,UAAA,CACE,oBAAC,SAAD;IAAO,OAAM;IAAS,UAAA,iBAAiB,WAAW;GAA2B,CAAA,GAC5E,SACK;;CAEZ;CAEA,OAAO;AACT;;;AC9PA,IAAA,gBAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Modal/constants.ts","../../../src/components/Modal/Modal.tsx","../../../src/components/Modal/index.ts"],"sourcesContent":["export enum ModalVariants {\n normal = 'normal',\n warning = 'warning',\n error = 'error',\n success = 'success',\n}\n\nexport enum ModalSize {\n normal = 'normal',\n medium = 'medium',\n}\n","import React, { useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport type { IconProps } from '../Icon';\n\nimport { ModalSize, ModalVariants } from './constants';\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { palette } from '../../theme/palette';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { isComponent } from '../../utils/component';\nimport { disableBodyScroll, enableBodyScroll } from '../../utils/scroll';\nimport { uuid } from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Icon, { IconSize } from '../Icon';\nimport AlertSignFill from '../Icons/AlertSignFill';\nimport AlertSignStroke from '../Icons/AlertSignStroke';\nimport CheckOutline from '../Icons/CheckOutline';\nimport Portal from '../Portal';\nimport Title from '../Title/Title';\n\nimport styles from './styles.module.scss';\n\nexport interface ModalProps {\n /** Title of the modal */\n title: string;\n /** id of the modal title */\n titleId?: string;\n /** Description of the modal. Will not render if the modal has children. */\n description?: string;\n /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\n /** Changes the visual representation of the modal */\n variant?: keyof typeof ModalVariants;\n /** Change width of the modal (default: large) */\n size?: keyof typeof ModalSize;\n /** Icon displayed in title */\n icon?: React.ReactElement;\n /** Hides the close button */\n noCloseButton?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Primary button text */\n primaryButtonText?: string;\n /** Secondary button text */\n secondaryButtonText?: string;\n /** Sets the aria-label of the modal */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the modal */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Alternative component to modal */\n children?: React.ReactNode;\n /** Component shown after title */\n afterTitleChildren?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Customize the z-index of the modal */\n zIndex?: number;\n /** Function is called when user clicks primary button */\n onSuccess?: () => void;\n /** Function is called when user clicks secondary button, clicks escape or outside the modal */\n onClose?: () => void;\n /** When enabled the component will be rendered in the bottom of document.body */\n printable?: boolean;\n /** If disabled, clicking escape or outside the modal will not close it */\n disableCloseEvents?: boolean;\n /** Aria role used for the Modal. Default is dialog */\n role?: 'dialog' | 'alertdialog';\n}\n\nconst getVariantIcon = (variant?: ModalProps['variant']): React.JSX.Element | null => {\n if (variant === ModalVariants.error) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignFill} color={palette.cherry500} />;\n } else if (variant === ModalVariants.warning) {\n return <Icon size={IconSize.Small} svgIcon={AlertSignStroke} color={palette.black} />;\n } else if (variant === ModalVariants.success) {\n return <Icon size={IconSize.Small} svgIcon={CheckOutline} color={palette.kiwi900} />;\n }\n return null;\n};\n\nconst getIcon = (variant?: ModalProps['variant'], icon?: ModalProps['icon']): React.JSX.Element | null => {\n const variantIcon = getVariantIcon(variant);\n if (variantIcon) {\n return <div className={styles.modal__iconWrapper}>{variantIcon}</div>;\n }\n if (icon) {\n return (\n <div className={styles.modal__iconWrapper}>\n {isComponent<IconProps>(icon, Icon) &&\n React.cloneElement(icon, {\n size: IconSize.Small,\n })}\n </div>\n );\n }\n return null;\n};\n\nconst Modal: React.FC<ModalProps> = props => {\n const {\n footerContent,\n variant = ModalVariants.normal,\n primaryButtonText = 'OK',\n titleId = uuid(),\n className = '',\n size = ModalSize.normal,\n zIndex = ZIndex.OverlayScreen,\n role = 'dialog',\n } = props;\n\n const topContent = React.useRef<HTMLDivElement>(null);\n const modalContentRef = React.useRef<HTMLDivElement>(null);\n const dialogRef = React.useRef<HTMLDivElement>(null);\n useFocusTrap(dialogRef, true);\n const topContentVisible = useIsVisible(topContent);\n const bottomContent = React.useRef<HTMLDivElement>(null);\n const bottomContentVisible = useIsVisible(bottomContent);\n const contentIsScrollable = modalContentRef.current && modalContentRef.current.scrollHeight > modalContentRef.current.clientHeight;\n useReturnFocusOnUnmount(dialogRef);\n\n function handleKeyboardEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape' && props.onClose) {\n e.stopPropagation();\n props.onClose();\n }\n }\n\n function handleClickEvent(event: MouseEvent): void {\n if (event.target && overlayRef.current === event.target && props.onClose) {\n event.stopPropagation();\n props.onClose();\n }\n }\n\n const overlayRef = React.useRef<HTMLDivElement>(null);\n\n const showActions = (props.secondaryButtonText && props.secondaryButtonText?.length > 0) || props.onSuccess || footerContent;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: props.ariaLabel, id: props.ariaLabelledBy, fallbackId: titleId });\n\n useEffect(() => {\n const overlayElement = overlayRef.current;\n disableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.addEventListener('keydown', handleKeyboardEvent);\n overlayElement.addEventListener('click', handleClickEvent);\n }\n return (): void => {\n enableBodyScroll();\n if (!props.disableCloseEvents && overlayElement) {\n overlayElement.removeEventListener('keydown', handleKeyboardEvent);\n overlayElement.removeEventListener('click', handleClickEvent);\n }\n };\n }, [props.disableCloseEvents]);\n\n useEffect(() => {\n dialogRef.current?.focus();\n }, []);\n\n const dialogClasses = cn(\n className,\n styles.modal,\n variant && styles[`modal--${variant}`],\n size && styles[`modal--${size}`],\n contentIsScrollable && !showActions && styles['modal--no-actions']\n );\n\n const titleClasses = cn({\n [styles['modal__title--error']]: variant === ModalVariants.error,\n [styles['modal__title--success']]: variant === ModalVariants.success,\n });\n\n const Component = (\n <div data-testid=\"dialog-container\">\n <div\n ref={overlayRef}\n className={styles['modal-overlay']}\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.Modal}\n style={{ zIndex }}\n >\n <div className={styles.align}>\n <div className={dialogClasses} role={role} aria-modal=\"true\" tabIndex={-1} {...ariaLabelAttributes} ref={dialogRef}>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--top'], {\n [styles['modal__shadow--show']]: !topContentVisible && contentIsScrollable,\n })}\n />\n <div\n className={cn(styles.modal__contentWrapper)}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\n ref={modalContentRef}\n >\n {!props.noCloseButton && (\n <div className={styles.modal__closeWrapper}>\n <div className={cn(styles.modal__closeWrapper__close)}>\n <Close onClick={props.onClose} ariaLabel={props.ariaLabelCloseBtn} />\n </div>\n </div>\n )}\n <div className={cn(size && styles[`modal__contentWrapper__scroll--${size}`])}>\n <div ref={topContent} />\n <div className={styles.modal__contentWrapper__title}>\n {getIcon(variant, props.icon)}\n <Title id={ariaLabelAttributes?.['aria-labelledby']} htmlMarkup=\"h3\" appearance=\"title3\" className={titleClasses}>\n {props.title}\n </Title>\n {props.afterTitleChildren && <div className={styles['modal__afterTitleChildren']}>{props.afterTitleChildren}</div>}\n </div>\n {props.children && <div>{props.children}</div>}\n {!props.children && <p className={styles.modal__description}>{props.description}</p>}\n <div ref={bottomContent} />\n </div>\n </div>\n <div\n className={cn(styles['modal__shadow'], styles['modal__shadow--bottom'], {\n [styles['modal__shadow--show']]: !bottomContentVisible && contentIsScrollable,\n })}\n />\n {showActions && (\n <div className={cn(styles['modal__call-to-action'], size && styles[`modal__call-to-action--${size}`])}>\n {props.onSuccess && primaryButtonText && <Button onClick={props.onSuccess}>{primaryButtonText}</Button>}\n {props.secondaryButtonText && props.secondaryButtonText?.length > 0 && (\n <Button variant=\"borderless\" onClick={props.onClose}>\n {props.secondaryButtonText}\n </Button>\n )}\n {footerContent}\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n\n if (props.printable) {\n const printModal = 'print-modal';\n return (\n <Portal className={printModal} testId=\"print-modal\">\n <style media=\"print\">{`body > *:not(.${printModal}) {display: none;}`}</style>\n {Component}\n </Portal>\n );\n }\n\n return Component;\n};\n\nexport default Modal;\n","import Modal from './Modal';\nexport { ModalVariants, ModalSize } from './constants';\nexport * from './Modal';\nexport default Modal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAY,gBAAL,yBAAA,eAAA;CACL,cAAA,YAAA;CACA,cAAA,aAAA;CACA,cAAA,WAAA;CACA,cAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAEA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,YAAA;CACA,UAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;;ACkEA,IAAM,kBAAkB,YAA8D;CACpF,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