@dnb/eufemia 9.17.2 → 9.18.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 (382) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/cjs/components/Tag.d.ts +14 -0
  3. package/cjs/components/Tag.js +52 -0
  4. package/cjs/components/accordion/Accordion.d.ts +7 -7
  5. package/cjs/components/autocomplete/Autocomplete.d.ts +13 -13
  6. package/cjs/components/button/Button.d.ts +7 -7
  7. package/cjs/components/button/Button.js +6 -4
  8. package/cjs/components/checkbox/Checkbox.d.ts +3 -3
  9. package/cjs/components/date-picker/DatePicker.d.ts +14 -14
  10. package/cjs/components/date-picker/DatePickerAddon.d.ts +1 -1
  11. package/cjs/components/date-picker/DatePickerCalendar.d.ts +1 -1
  12. package/cjs/components/date-picker/DatePickerInput.d.ts +1 -1
  13. package/cjs/components/dropdown/Dropdown.d.ts +9 -9
  14. package/cjs/components/form-row/FormRow.d.ts +4 -4
  15. package/cjs/components/form-set/FormSet.d.ts +5 -5
  16. package/cjs/components/global-error/GlobalError.d.ts +1 -1
  17. package/cjs/components/global-status/GlobalStatus.d.ts +5 -5
  18. package/cjs/components/heading/Heading.d.ts +2 -2
  19. package/cjs/components/heading/HeadingProvider.d.ts +2 -2
  20. package/cjs/components/icon/Icon.d.ts +1 -1
  21. package/cjs/components/icon-primary/IconPrimary.d.ts +1 -1
  22. package/cjs/components/index.d.ts +2 -0
  23. package/cjs/components/index.js +8 -0
  24. package/cjs/components/input/Input.d.ts +9 -9
  25. package/cjs/components/input-masked/InputMasked.d.ts +11 -11
  26. package/cjs/components/input-masked/InputMasked.js +6 -3
  27. package/cjs/components/input-masked/InputMaskedHooks.js +26 -34
  28. package/cjs/components/input-masked/InputMaskedUtils.js +9 -20
  29. package/cjs/components/lib.js +9 -0
  30. package/cjs/components/modal/Modal.js +123 -271
  31. package/cjs/components/modal/ModalContent.js +145 -243
  32. package/cjs/components/modal/ModalRoot.js +194 -0
  33. package/cjs/components/modal/components/CloseButton.js +125 -0
  34. package/cjs/components/modal/components/ModalHeader.js +124 -0
  35. package/cjs/components/modal/{ModalHeader.js → components/ModalHeaderBar.js} +50 -162
  36. package/cjs/components/modal/{ModalInner.js → components/ModalInner.js} +11 -19
  37. package/cjs/components/modal/helpers.js +80 -0
  38. package/cjs/components/modal/types.js +1 -0
  39. package/cjs/components/number-format/NumberFormat.d.ts +8 -8
  40. package/cjs/components/pagination/Pagination.d.ts +30 -30
  41. package/cjs/components/pagination/PaginationProvider.d.ts +2 -2
  42. package/cjs/components/radio/Radio.d.ts +4 -4
  43. package/cjs/components/radio/RadioGroup.d.ts +3 -3
  44. package/cjs/components/section/Section.d.ts +3 -2
  45. package/cjs/components/skeleton/Skeleton.d.ts +2 -2
  46. package/cjs/components/slider/Slider.d.ts +4 -4
  47. package/cjs/components/step-indicator/StepIndicator.d.ts +5 -5
  48. package/cjs/components/step-indicator/StepIndicatorContext.d.ts +1 -1
  49. package/cjs/components/step-indicator/StepIndicatorItem.d.ts +2 -2
  50. package/cjs/components/step-indicator/StepIndicatorItem.js +1 -0
  51. package/cjs/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
  52. package/cjs/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
  53. package/cjs/components/switch/Switch.d.ts +5 -5
  54. package/cjs/components/tabs/Tabs.d.ts +4 -4
  55. package/cjs/components/tabs/TabsContentWrapper.d.ts +1 -1
  56. package/cjs/components/tag/Tag.js +97 -0
  57. package/cjs/components/tag/index.d.ts +8 -0
  58. package/cjs/components/tag/index.js +52 -0
  59. package/cjs/components/tag/style/_tag.scss +26 -0
  60. package/cjs/components/tag/style/dnb-tag.css +109 -0
  61. package/cjs/components/tag/style/dnb-tag.min.css +1 -0
  62. package/cjs/components/tag/style/dnb-tag.scss +12 -0
  63. package/cjs/components/tag/style/index.d.ts +6 -0
  64. package/cjs/components/tag/style/index.js +3 -0
  65. package/cjs/components/tag/style.js +3 -0
  66. package/cjs/components/textarea/Textarea.d.ts +4 -4
  67. package/cjs/components/toggle-button/ToggleButton.d.ts +6 -6
  68. package/cjs/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
  69. package/cjs/components/tooltip/Tooltip.d.ts +5 -5
  70. package/cjs/components/tooltip/TooltipContainer.d.ts +3 -3
  71. package/cjs/components/tooltip/TooltipPortal.d.ts +1 -1
  72. package/cjs/components/tooltip/TooltipWithEvents.d.ts +1 -1
  73. package/cjs/fragments/scroll-view/ScrollView.js +7 -16
  74. package/cjs/index.d.ts +2 -0
  75. package/cjs/index.js +8 -0
  76. package/cjs/shared/Context.js +2 -1
  77. package/cjs/style/core/helper-classes/skip-link.scss +1 -1
  78. package/cjs/style/dnb-ui-components.css +40 -0
  79. package/cjs/style/dnb-ui-components.min.css +1 -1
  80. package/cjs/style/dnb-ui-components.scss +1 -0
  81. package/components/Tag.d.ts +14 -0
  82. package/components/Tag.js +3 -0
  83. package/components/accordion/Accordion.d.ts +7 -7
  84. package/components/autocomplete/Autocomplete.d.ts +13 -13
  85. package/components/button/Button.d.ts +7 -7
  86. package/components/button/Button.js +6 -4
  87. package/components/checkbox/Checkbox.d.ts +3 -3
  88. package/components/date-picker/DatePicker.d.ts +14 -14
  89. package/components/date-picker/DatePickerAddon.d.ts +1 -1
  90. package/components/date-picker/DatePickerCalendar.d.ts +1 -1
  91. package/components/date-picker/DatePickerInput.d.ts +1 -1
  92. package/components/dropdown/Dropdown.d.ts +9 -9
  93. package/components/form-row/FormRow.d.ts +4 -4
  94. package/components/form-set/FormSet.d.ts +5 -5
  95. package/components/global-error/GlobalError.d.ts +1 -1
  96. package/components/global-status/GlobalStatus.d.ts +5 -5
  97. package/components/heading/Heading.d.ts +2 -2
  98. package/components/heading/HeadingProvider.d.ts +2 -2
  99. package/components/icon/Icon.d.ts +1 -1
  100. package/components/index.d.ts +2 -0
  101. package/components/index.js +2 -1
  102. package/components/input/Input.d.ts +9 -9
  103. package/components/input-masked/InputMasked.d.ts +11 -11
  104. package/components/input-masked/InputMasked.js +6 -4
  105. package/components/input-masked/InputMaskedHooks.js +24 -28
  106. package/components/input-masked/InputMaskedUtils.js +9 -20
  107. package/components/lib.js +3 -1
  108. package/components/modal/Modal.js +112 -250
  109. package/components/modal/Modal.tsx +524 -0
  110. package/components/modal/ModalContent.js +137 -224
  111. package/components/modal/ModalContent.tsx +515 -0
  112. package/components/modal/ModalContext.tsx +10 -0
  113. package/components/modal/ModalRoot.js +145 -0
  114. package/components/modal/ModalRoot.tsx +131 -0
  115. package/components/modal/components/CloseButton.js +72 -0
  116. package/components/modal/components/CloseButton.tsx +56 -0
  117. package/components/modal/components/ModalHeader.js +70 -0
  118. package/components/modal/components/ModalHeader.tsx +79 -0
  119. package/components/modal/components/ModalHeaderBar.js +122 -0
  120. package/components/modal/components/ModalHeaderBar.tsx +118 -0
  121. package/components/modal/{ModalInner.js → components/ModalInner.js} +11 -17
  122. package/components/modal/components/ModalInner.tsx +45 -0
  123. package/components/modal/helpers.js +64 -0
  124. package/components/modal/helpers.ts +63 -0
  125. package/components/modal/types.js +1 -0
  126. package/{cjs/components/modal/Modal.d.ts → components/modal/types.ts} +124 -182
  127. package/components/number-format/NumberFormat.d.ts +8 -8
  128. package/components/pagination/Pagination.d.ts +30 -30
  129. package/components/pagination/PaginationProvider.d.ts +2 -2
  130. package/components/radio/Radio.d.ts +4 -4
  131. package/components/radio/RadioGroup.d.ts +3 -3
  132. package/components/section/Section.d.ts +3 -1
  133. package/components/skeleton/Skeleton.d.ts +2 -2
  134. package/components/slider/Slider.d.ts +4 -4
  135. package/components/step-indicator/StepIndicator.d.ts +5 -5
  136. package/components/step-indicator/StepIndicatorContext.d.ts +1 -1
  137. package/components/step-indicator/StepIndicatorItem.d.ts +2 -2
  138. package/components/step-indicator/StepIndicatorItem.js +1 -0
  139. package/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
  140. package/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
  141. package/components/switch/Switch.d.ts +5 -5
  142. package/components/tabs/Tabs.d.ts +4 -4
  143. package/components/tabs/TabsContentWrapper.d.ts +1 -1
  144. package/components/tag/Tag.js +63 -0
  145. package/components/tag/Tag.tsx +95 -0
  146. package/components/tag/index.d.ts +8 -0
  147. package/components/tag/index.js +3 -0
  148. package/components/tag/style/_tag.scss +26 -0
  149. package/components/tag/style/dnb-tag.css +109 -0
  150. package/components/tag/style/dnb-tag.min.css +1 -0
  151. package/components/tag/style/dnb-tag.scss +12 -0
  152. package/components/tag/style/index.d.ts +6 -0
  153. package/components/tag/style/index.js +1 -0
  154. package/components/tag/style.js +1 -0
  155. package/components/textarea/Textarea.d.ts +4 -4
  156. package/components/toggle-button/ToggleButton.d.ts +6 -6
  157. package/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
  158. package/components/tooltip/Tooltip.d.ts +5 -5
  159. package/components/tooltip/TooltipContainer.d.ts +3 -3
  160. package/components/tooltip/TooltipPortal.d.ts +1 -1
  161. package/components/tooltip/TooltipWithEvents.d.ts +1 -1
  162. package/es/components/Tag.d.ts +14 -0
  163. package/es/components/Tag.js +3 -0
  164. package/es/components/accordion/Accordion.d.ts +7 -7
  165. package/es/components/autocomplete/Autocomplete.d.ts +13 -13
  166. package/es/components/button/Button.d.ts +7 -7
  167. package/es/components/button/Button.js +6 -4
  168. package/es/components/checkbox/Checkbox.d.ts +3 -3
  169. package/es/components/date-picker/DatePicker.d.ts +14 -14
  170. package/es/components/date-picker/DatePickerAddon.d.ts +1 -1
  171. package/es/components/date-picker/DatePickerCalendar.d.ts +1 -1
  172. package/es/components/date-picker/DatePickerInput.d.ts +1 -1
  173. package/es/components/dropdown/Dropdown.d.ts +9 -9
  174. package/es/components/form-row/FormRow.d.ts +4 -4
  175. package/es/components/form-set/FormSet.d.ts +5 -5
  176. package/es/components/global-error/GlobalError.d.ts +1 -1
  177. package/es/components/global-status/GlobalStatus.d.ts +5 -5
  178. package/es/components/heading/Heading.d.ts +2 -2
  179. package/es/components/heading/HeadingProvider.d.ts +2 -2
  180. package/es/components/icon/Icon.d.ts +1 -1
  181. package/es/components/icon-primary/IconPrimary.d.ts +1 -1
  182. package/es/components/index.d.ts +2 -0
  183. package/es/components/index.js +2 -1
  184. package/es/components/input/Input.d.ts +9 -9
  185. package/es/components/input-masked/InputMasked.d.ts +11 -11
  186. package/es/components/input-masked/InputMasked.js +6 -4
  187. package/es/components/input-masked/InputMaskedHooks.js +14 -18
  188. package/es/components/input-masked/InputMaskedUtils.js +7 -18
  189. package/es/components/lib.js +3 -1
  190. package/es/components/modal/Modal.js +97 -227
  191. package/es/components/modal/Modal.tsx +524 -0
  192. package/es/components/modal/ModalContent.js +95 -186
  193. package/es/components/modal/ModalContent.tsx +515 -0
  194. package/es/components/modal/ModalContext.tsx +10 -0
  195. package/es/components/modal/ModalRoot.js +108 -0
  196. package/es/components/modal/ModalRoot.tsx +131 -0
  197. package/es/components/modal/components/CloseButton.js +41 -0
  198. package/es/components/modal/components/CloseButton.tsx +56 -0
  199. package/es/components/modal/components/ModalHeader.js +40 -0
  200. package/es/components/modal/components/ModalHeader.tsx +79 -0
  201. package/es/components/modal/components/ModalHeaderBar.js +88 -0
  202. package/es/components/modal/components/ModalHeaderBar.tsx +118 -0
  203. package/es/components/modal/{ModalInner.js → components/ModalInner.js} +8 -18
  204. package/es/components/modal/components/ModalInner.tsx +45 -0
  205. package/es/components/modal/helpers.js +60 -0
  206. package/es/components/modal/helpers.ts +63 -0
  207. package/es/components/modal/types.js +1 -0
  208. package/es/components/modal/{Modal.d.ts → types.ts} +124 -182
  209. package/es/components/number-format/NumberFormat.d.ts +8 -8
  210. package/es/components/pagination/Pagination.d.ts +30 -30
  211. package/es/components/pagination/PaginationProvider.d.ts +2 -2
  212. package/es/components/radio/Radio.d.ts +4 -4
  213. package/es/components/radio/RadioGroup.d.ts +3 -3
  214. package/es/components/section/Section.d.ts +3 -2
  215. package/es/components/skeleton/Skeleton.d.ts +2 -2
  216. package/es/components/slider/Slider.d.ts +4 -4
  217. package/es/components/step-indicator/StepIndicator.d.ts +5 -5
  218. package/es/components/step-indicator/StepIndicatorContext.d.ts +1 -1
  219. package/es/components/step-indicator/StepIndicatorItem.d.ts +2 -2
  220. package/es/components/step-indicator/StepIndicatorItem.js +1 -0
  221. package/es/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
  222. package/es/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
  223. package/es/components/switch/Switch.d.ts +5 -5
  224. package/es/components/tabs/Tabs.d.ts +4 -4
  225. package/es/components/tabs/TabsContentWrapper.d.ts +1 -1
  226. package/es/components/tag/Tag.js +58 -0
  227. package/es/components/tag/Tag.tsx +95 -0
  228. package/es/components/tag/index.d.ts +8 -0
  229. package/es/components/tag/index.js +3 -0
  230. package/es/components/tag/style/_tag.scss +26 -0
  231. package/es/components/tag/style/dnb-tag.css +109 -0
  232. package/es/components/tag/style/dnb-tag.min.css +1 -0
  233. package/es/components/tag/style/dnb-tag.scss +12 -0
  234. package/es/components/tag/style/index.d.ts +6 -0
  235. package/es/components/tag/style/index.js +1 -0
  236. package/es/components/tag/style.js +1 -0
  237. package/es/components/textarea/Textarea.d.ts +4 -4
  238. package/es/components/toggle-button/ToggleButton.d.ts +6 -6
  239. package/es/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
  240. package/es/components/tooltip/Tooltip.d.ts +5 -5
  241. package/es/components/tooltip/TooltipContainer.d.ts +3 -3
  242. package/es/components/tooltip/TooltipPortal.d.ts +1 -1
  243. package/es/components/tooltip/TooltipWithEvents.d.ts +1 -1
  244. package/es/fragments/scroll-view/ScrollView.js +7 -15
  245. package/es/fragments/scroll-view/ScrollView.tsx +92 -0
  246. package/es/index.d.ts +2 -0
  247. package/es/index.js +2 -1
  248. package/es/shared/Context.js +2 -1
  249. package/es/style/core/helper-classes/skip-link.scss +1 -1
  250. package/es/style/dnb-ui-components.css +40 -0
  251. package/es/style/dnb-ui-components.min.css +1 -1
  252. package/es/style/dnb-ui-components.scss +1 -0
  253. package/esm/components/Tag.d.ts +14 -0
  254. package/esm/components/Tag.js +3 -0
  255. package/esm/components/accordion/Accordion.d.ts +7 -7
  256. package/esm/components/autocomplete/Autocomplete.d.ts +13 -13
  257. package/esm/components/button/Button.d.ts +7 -7
  258. package/esm/components/button/Button.js +6 -4
  259. package/esm/components/checkbox/Checkbox.d.ts +3 -3
  260. package/esm/components/date-picker/DatePicker.d.ts +14 -14
  261. package/esm/components/date-picker/DatePickerAddon.d.ts +1 -1
  262. package/esm/components/date-picker/DatePickerCalendar.d.ts +1 -1
  263. package/esm/components/date-picker/DatePickerInput.d.ts +1 -1
  264. package/esm/components/dropdown/Dropdown.d.ts +9 -9
  265. package/esm/components/form-row/FormRow.d.ts +4 -4
  266. package/esm/components/form-set/FormSet.d.ts +5 -5
  267. package/esm/components/global-error/GlobalError.d.ts +1 -1
  268. package/esm/components/global-status/GlobalStatus.d.ts +5 -5
  269. package/esm/components/heading/Heading.d.ts +2 -2
  270. package/esm/components/heading/HeadingProvider.d.ts +2 -2
  271. package/esm/components/icon/Icon.d.ts +1 -1
  272. package/esm/components/index.d.ts +2 -0
  273. package/esm/components/index.js +2 -1
  274. package/esm/components/input/Input.d.ts +9 -9
  275. package/esm/components/input-masked/InputMasked.d.ts +11 -11
  276. package/esm/components/input-masked/InputMasked.js +6 -4
  277. package/esm/components/input-masked/InputMaskedHooks.js +24 -28
  278. package/esm/components/input-masked/InputMaskedUtils.js +9 -20
  279. package/esm/components/lib.js +3 -1
  280. package/esm/components/modal/Modal.js +112 -250
  281. package/esm/components/modal/Modal.tsx +524 -0
  282. package/esm/components/modal/ModalContent.js +137 -224
  283. package/esm/components/modal/ModalContent.tsx +515 -0
  284. package/esm/components/modal/ModalContext.tsx +10 -0
  285. package/esm/components/modal/ModalRoot.js +145 -0
  286. package/esm/components/modal/ModalRoot.tsx +131 -0
  287. package/esm/components/modal/components/CloseButton.js +72 -0
  288. package/esm/components/modal/components/CloseButton.tsx +56 -0
  289. package/esm/components/modal/components/ModalHeader.js +70 -0
  290. package/esm/components/modal/components/ModalHeader.tsx +79 -0
  291. package/esm/components/modal/components/ModalHeaderBar.js +122 -0
  292. package/esm/components/modal/components/ModalHeaderBar.tsx +118 -0
  293. package/esm/components/modal/{ModalInner.js → components/ModalInner.js} +11 -17
  294. package/esm/components/modal/components/ModalInner.tsx +45 -0
  295. package/esm/components/modal/helpers.js +64 -0
  296. package/esm/components/modal/helpers.ts +63 -0
  297. package/esm/components/modal/types.js +1 -0
  298. package/esm/components/modal/{Modal.d.ts → types.ts} +124 -182
  299. package/esm/components/number-format/NumberFormat.d.ts +8 -8
  300. package/esm/components/pagination/Pagination.d.ts +30 -30
  301. package/esm/components/pagination/PaginationProvider.d.ts +2 -2
  302. package/esm/components/radio/Radio.d.ts +4 -4
  303. package/esm/components/radio/RadioGroup.d.ts +3 -3
  304. package/esm/components/section/Section.d.ts +3 -1
  305. package/esm/components/skeleton/Skeleton.d.ts +2 -2
  306. package/esm/components/slider/Slider.d.ts +4 -4
  307. package/esm/components/step-indicator/StepIndicator.d.ts +5 -5
  308. package/esm/components/step-indicator/StepIndicatorContext.d.ts +1 -1
  309. package/esm/components/step-indicator/StepIndicatorItem.d.ts +2 -2
  310. package/esm/components/step-indicator/StepIndicatorItem.js +1 -0
  311. package/esm/components/step-indicator/StepIndicatorSidebar.d.ts +3 -3
  312. package/esm/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
  313. package/esm/components/switch/Switch.d.ts +5 -5
  314. package/esm/components/tabs/Tabs.d.ts +4 -4
  315. package/esm/components/tabs/TabsContentWrapper.d.ts +1 -1
  316. package/esm/components/tag/Tag.js +63 -0
  317. package/esm/components/tag/Tag.tsx +95 -0
  318. package/esm/components/tag/index.d.ts +8 -0
  319. package/esm/components/tag/index.js +3 -0
  320. package/esm/components/tag/style/_tag.scss +26 -0
  321. package/esm/components/tag/style/dnb-tag.css +109 -0
  322. package/esm/components/tag/style/dnb-tag.min.css +1 -0
  323. package/esm/components/tag/style/dnb-tag.scss +12 -0
  324. package/esm/components/tag/style/index.d.ts +6 -0
  325. package/esm/components/tag/style/index.js +1 -0
  326. package/esm/components/tag/style.js +1 -0
  327. package/esm/components/textarea/Textarea.d.ts +4 -4
  328. package/esm/components/toggle-button/ToggleButton.d.ts +6 -6
  329. package/esm/components/toggle-button/ToggleButtonGroup.d.ts +3 -3
  330. package/esm/components/tooltip/Tooltip.d.ts +5 -5
  331. package/esm/components/tooltip/TooltipContainer.d.ts +3 -3
  332. package/esm/components/tooltip/TooltipPortal.d.ts +1 -1
  333. package/esm/components/tooltip/TooltipWithEvents.d.ts +1 -1
  334. package/esm/dnb-ui-components.min.mjs +1 -1
  335. package/esm/dnb-ui-elements.min.mjs +1 -1
  336. package/esm/dnb-ui-extensions.min.mjs +1 -1
  337. package/esm/dnb-ui-lib.min.mjs +2 -2
  338. package/esm/dnb-ui-web-components.min.mjs +2 -2
  339. package/esm/fragments/scroll-view/ScrollView.js +10 -16
  340. package/esm/fragments/scroll-view/ScrollView.tsx +92 -0
  341. package/esm/index.d.ts +2 -0
  342. package/esm/index.js +2 -1
  343. package/esm/shared/Context.js +2 -1
  344. package/esm/style/core/helper-classes/skip-link.scss +1 -1
  345. package/esm/style/dnb-ui-components.css +40 -0
  346. package/esm/style/dnb-ui-components.min.css +1 -1
  347. package/esm/style/dnb-ui-components.scss +1 -0
  348. package/fragments/scroll-view/ScrollView.js +10 -16
  349. package/fragments/scroll-view/ScrollView.tsx +92 -0
  350. package/index.d.ts +2 -0
  351. package/index.js +2 -1
  352. package/package.json +1 -1
  353. package/shared/Context.js +2 -1
  354. package/style/core/helper-classes/skip-link.scss +1 -1
  355. package/style/dnb-ui-components.css +40 -0
  356. package/style/dnb-ui-components.min.css +1 -1
  357. package/style/dnb-ui-components.scss +1 -0
  358. package/umd/dnb-ui-components.min.js +5 -5
  359. package/umd/dnb-ui-elements.min.js +1 -1
  360. package/umd/dnb-ui-extensions.min.js +1 -1
  361. package/umd/dnb-ui-lib.min.js +4 -4
  362. package/umd/dnb-ui-web-components.min.js +2 -2
  363. package/cjs/components/modal/ModalContent.d.ts +0 -168
  364. package/cjs/components/modal/ModalHeader.d.ts +0 -73
  365. package/cjs/components/modal/ModalInner.d.ts +0 -20
  366. package/cjs/fragments/scroll-view/ScrollView.d.ts +0 -1
  367. package/components/modal/Modal.d.ts +0 -329
  368. package/components/modal/ModalContent.d.ts +0 -168
  369. package/components/modal/ModalHeader.d.ts +0 -73
  370. package/components/modal/ModalHeader.js +0 -224
  371. package/components/modal/ModalInner.d.ts +0 -20
  372. package/es/components/modal/ModalContent.d.ts +0 -168
  373. package/es/components/modal/ModalHeader.d.ts +0 -73
  374. package/es/components/modal/ModalHeader.js +0 -166
  375. package/es/components/modal/ModalInner.d.ts +0 -20
  376. package/es/fragments/scroll-view/ScrollView.d.ts +0 -1
  377. package/esm/components/modal/ModalContent.d.ts +0 -168
  378. package/esm/components/modal/ModalHeader.d.ts +0 -73
  379. package/esm/components/modal/ModalHeader.js +0 -224
  380. package/esm/components/modal/ModalInner.d.ts +0 -20
  381. package/esm/fragments/scroll-view/ScrollView.d.ts +0 -1
  382. package/fragments/scroll-view/ScrollView.d.ts +0 -1
@@ -13,7 +13,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
13
13
  import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
14
14
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
15
15
  var _excluded = ["triggeredBy"],
16
- _excluded2 = ["mode", "hide", "title", "labelled_by", "header_content", "modal_content", "bar_content", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "spacing", "prevent_close", "open_delay", "prevent_core_style", "animation_duration", "no_animation", "no_animation_on_mobile", "min_width", "max_width", "fullscreen", "align_content", "container_placement", "closeModal", "className", "class", "content_class", "overlay_class", "content_id", "toggleOpenClose", "children"];
16
+ _excluded2 = ["mode", "hide", "title", "labelled_by", "header_content", "modal_content", "bar_content", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "spacing", "prevent_core_style", "animation_duration", "no_animation", "no_animation_on_mobile", "min_width", "max_width", "fullscreen", "align_content", "container_placement", "closeModal", "className", "class", "content_class", "overlay_class", "content_id", "children"];
17
17
 
18
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
19
19
 
@@ -23,22 +23,22 @@ import "core-js/modules/es.array.filter.js";
23
23
  import "core-js/modules/es.object.to-string.js";
24
24
  import "core-js/modules/web.dom-collections.for-each.js";
25
25
  import "core-js/modules/es.parse-float.js";
26
- import "core-js/modules/es.regexp.exec.js";
27
26
 
28
27
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
29
28
 
30
29
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
30
 
32
31
  import React from 'react';
33
- import PropTypes from 'prop-types';
34
32
  import classnames from 'classnames';
35
33
  import keycode from 'keycode';
36
34
  import { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from './bodyScrollLock';
37
35
  import { warn, isTrue, makeUniqueId, InteractionInvalidation, findElementInChildren, combineLabelledBy, combineDescribedBy, validateDOMAttributes, dispatchCustomElementEvent } from '../../shared/component-helper';
38
36
  import ScrollView from '../../fragments/scroll-view/ScrollView';
39
37
  import ModalContext from './ModalContext';
40
- import ModalHeader, { ModalHeaderBar } from './ModalHeader';
41
- import { IS_IOS, IS_SAFARI, IS_MAC } from '../../shared/helpers';
38
+ import ModalHeader from './components/ModalHeader';
39
+ import ModalHeaderBar from './components/ModalHeaderBar';
40
+ import { IS_IOS, IS_SAFARI, IS_MAC, isAndroid } from '../../shared/helpers';
41
+ import { getListOfModalRoots, getModalRoot, addToIndex, removeFromIndex } from './helpers';
42
42
 
43
43
  var ModalContent = function (_React$PureComponent) {
44
44
  _inherits(ModalContent, _React$PureComponent);
@@ -54,9 +54,24 @@ var ModalContent = function (_React$PureComponent) {
54
54
 
55
55
  _defineProperty(_assertThisInitialized(_this), "state", {
56
56
  triggeredBy: null,
57
- triggeredByEvent: null
57
+ triggeredByEvent: null,
58
+ color: null
58
59
  });
59
60
 
61
+ _defineProperty(_assertThisInitialized(_this), "_contentRef", void 0);
62
+
63
+ _defineProperty(_assertThisInitialized(_this), "_id", void 0);
64
+
65
+ _defineProperty(_assertThisInitialized(_this), "_lockTimeout", void 0);
66
+
67
+ _defineProperty(_assertThisInitialized(_this), "_focusTimeout", void 0);
68
+
69
+ _defineProperty(_assertThisInitialized(_this), "_androidFocusTimeout", void 0);
70
+
71
+ _defineProperty(_assertThisInitialized(_this), "_ii", void 0);
72
+
73
+ _defineProperty(_assertThisInitialized(_this), "_iiLocal", void 0);
74
+
60
75
  _defineProperty(_assertThisInitialized(_this), "lockBody", function () {
61
76
  var modalRoots = getListOfModalRoots();
62
77
  var firstLevel = modalRoots[0];
@@ -83,6 +98,9 @@ var ModalContent = function (_React$PureComponent) {
83
98
  });
84
99
 
85
100
  _defineProperty(_assertThisInitialized(_this), "_androidFocusHelper", function () {
101
+ var _this$props$animation = _this.props.animation_duration,
102
+ animation_duration = _this$props$animation === void 0 ? null : _this$props$animation;
103
+ var timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
86
104
  clearTimeout(_this._androidFocusTimeout);
87
105
  _this._androidFocusTimeout = setTimeout(function () {
88
106
  try {
@@ -92,38 +110,38 @@ var ModalContent = function (_React$PureComponent) {
92
110
  document.activeElement.scrollIntoView();
93
111
  }
94
112
  } catch (e) {}
95
- }, parseFloat(_this.props.animation_duration) / 2);
113
+ }, timeoutDuration / 2);
96
114
  });
97
115
 
98
- _defineProperty(_assertThisInitialized(_this), "preventClick", function (e) {
99
- if (e) {
100
- e.stopPropagation();
116
+ _defineProperty(_assertThisInitialized(_this), "preventClick", function (event) {
117
+ if (event) {
118
+ event.stopPropagation();
101
119
  }
102
120
  });
103
121
 
104
- _defineProperty(_assertThisInitialized(_this), "onCloseClickHandler", function (e) {
105
- _this.closeModal(e, {
122
+ _defineProperty(_assertThisInitialized(_this), "onCloseClickHandler", function (event) {
123
+ _this.closeModalContent(event, {
106
124
  triggeredBy: 'button'
107
125
  });
108
126
  });
109
127
 
110
- _defineProperty(_assertThisInitialized(_this), "onContentClickHandler", function (e) {
111
- _this.closeModal(e, {
128
+ _defineProperty(_assertThisInitialized(_this), "onContentClickHandler", function (event) {
129
+ _this.closeModalContent(event, {
112
130
  triggeredBy: 'overlay',
113
131
  ifIsLatest: false
114
132
  });
115
133
  });
116
134
 
117
- _defineProperty(_assertThisInitialized(_this), "onKeyDownHandler", function (e) {
118
- switch (keycode(e)) {
135
+ _defineProperty(_assertThisInitialized(_this), "onKeyDownHandler", function (event) {
136
+ switch (keycode(event)) {
119
137
  case 'esc':
120
138
  {
121
- var mostCurrent = getListOfModalRoots(-1);
139
+ var mostCurrent = getModalRoot(-1);
122
140
 
123
141
  if (mostCurrent === _assertThisInitialized(_this)) {
124
- e.preventDefault();
142
+ event.preventDefault();
125
143
 
126
- _this.closeModal(e, {
144
+ _this.closeModalContent(event, {
127
145
  triggeredBy: 'keyboard'
128
146
  });
129
147
  }
@@ -134,6 +152,8 @@ var ModalContent = function (_React$PureComponent) {
134
152
  });
135
153
 
136
154
  _defineProperty(_assertThisInitialized(_this), "setBackgroundColor", function (color) {
155
+ document.documentElement.style.setProperty('--modal-background-color', color);
156
+
137
157
  _this.setState({
138
158
  color: color
139
159
  });
@@ -147,19 +167,26 @@ var ModalContent = function (_React$PureComponent) {
147
167
  _createClass(ModalContent, [{
148
168
  key: "componentDidMount",
149
169
  value: function componentDidMount() {
150
- this.addToIndex();
170
+ var _this$props = this.props,
171
+ _this$props$id = _this$props.id,
172
+ id = _this$props$id === void 0 ? null : _this$props$id,
173
+ _this$props$no_animat = _this$props.no_animation,
174
+ no_animation = _this$props$no_animat === void 0 ? false : _this$props$no_animat,
175
+ _this$props$animation2 = _this$props.animation_duration,
176
+ animation_duration = _this$props$animation2 === void 0 ? null : _this$props$animation2;
177
+ var timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
178
+ addToIndex(this);
151
179
  this.removeScrollPossibility();
152
180
  this.setFocus();
153
181
  this.setAndroidFocusHelper();
154
- var id = this.props.id;
155
182
  dispatchCustomElementEvent(this, 'on_open', {
156
183
  id: id
157
184
  });
158
185
 
159
- if (isTrue(this.props.no_animation) || process.env.NODE_ENV === 'test') {
186
+ if (isTrue(no_animation) || process.env.NODE_ENV === 'test') {
160
187
  this.lockBody();
161
188
  } else {
162
- this._lockTimeout = setTimeout(this.lockBody, parseFloat(this.props.animation_duration) * 1.2);
189
+ this._lockTimeout = setTimeout(this.lockBody, timeoutDuration * 1.2);
163
190
  }
164
191
  }
165
192
  }, {
@@ -174,7 +201,7 @@ var ModalContent = function (_React$PureComponent) {
174
201
  value: function removeLocks() {
175
202
  var modalRoots = getListOfModalRoots();
176
203
  var firstLevel = modalRoots[0];
177
- this.removeFromIndex();
204
+ removeFromIndex(this);
178
205
 
179
206
  if (firstLevel === this) {
180
207
  var _this$_ii;
@@ -213,7 +240,7 @@ var ModalContent = function (_React$PureComponent) {
213
240
  }, {
214
241
  key: "setAndroidFocusHelper",
215
242
  value: function setAndroidFocusHelper() {
216
- if (typeof window !== 'undefined' && typeof navigator !== 'undefined' && /Android/.test(navigator.appVersion)) {
243
+ if (typeof window !== 'undefined' && isAndroid()) {
217
244
  window.addEventListener('resize', this._androidFocusHelper);
218
245
  }
219
246
  }
@@ -223,48 +250,18 @@ var ModalContent = function (_React$PureComponent) {
223
250
  window.removeEventListener('resize', this._androidFocusHelper);
224
251
  clearTimeout(this._androidFocusTimeout);
225
252
  }
226
- }, {
227
- key: "addToIndex",
228
- value: function addToIndex() {
229
- if (typeof window !== 'undefined') {
230
- try {
231
- if (!Array.isArray(window.__modalStack)) {
232
- window.__modalStack = [];
233
- }
234
-
235
- window.__modalStack.push(this);
236
- } catch (e) {
237
- warn(e);
238
- }
239
- }
240
- }
241
- }, {
242
- key: "removeFromIndex",
243
- value: function removeFromIndex() {
244
- var _this2 = this;
245
-
246
- if (typeof window !== 'undefined') {
247
- try {
248
- if (!Array.isArray(window.__modalStack)) {
249
- window.__modalStack = [];
250
- }
251
-
252
- window.__modalStack = window.__modalStack.filter(function (cur) {
253
- return cur !== _this2;
254
- });
255
- } catch (e) {
256
- warn(e);
257
- }
258
- }
259
- }
260
253
  }, {
261
254
  key: "setFocus",
262
255
  value: function setFocus() {
263
- var _this$props = this.props,
264
- focus_selector = _this$props.focus_selector,
265
- no_animation = _this$props.no_animation,
266
- animation_duration = _this$props.animation_duration;
256
+ var _this$props2 = this.props,
257
+ _this$props2$focus_se = _this$props2.focus_selector,
258
+ focus_selector = _this$props2$focus_se === void 0 ? null : _this$props2$focus_se,
259
+ _this$props2$no_anima = _this$props2.no_animation,
260
+ no_animation = _this$props2$no_anima === void 0 ? null : _this$props2$no_anima,
261
+ _this$props2$animatio = _this$props2.animation_duration,
262
+ animation_duration = _this$props2$animatio === void 0 ? null : _this$props2$animatio;
267
263
  var elem = this._contentRef.current;
264
+ var timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
268
265
 
269
266
  if (elem) {
270
267
  clearTimeout(this._focusTimeout);
@@ -285,7 +282,7 @@ var ModalContent = function (_React$PureComponent) {
285
282
  } catch (e) {
286
283
  warn(e);
287
284
  }
288
- }, isTrue(no_animation) ? 0 : parseFloat(animation_duration) || 0);
285
+ }, isTrue(no_animation) ? 0 : timeoutDuration || 0);
289
286
  }
290
287
  }
291
288
  }, {
@@ -302,10 +299,10 @@ var ModalContent = function (_React$PureComponent) {
302
299
  clearAllBodyScrollLocks();
303
300
  }
304
301
  }, {
305
- key: "closeModal",
306
- value: function closeModal(event, _ref) {
302
+ key: "closeModalContent",
303
+ value: function closeModalContent(event, _ref) {
307
304
  var _event$persist,
308
- _this3 = this;
305
+ _this2 = this;
309
306
 
310
307
  var triggeredBy = _ref.triggeredBy,
311
308
  params = _objectWithoutProperties(_ref, _excluded);
@@ -315,7 +312,7 @@ var ModalContent = function (_React$PureComponent) {
315
312
  triggeredBy: triggeredBy,
316
313
  triggeredByEvent: event
317
314
  }, function () {
318
- _this3.props.closeModal(event, _objectSpread({
315
+ _this2.props.closeModal(event, _objectSpread({
319
316
  triggeredBy: triggeredBy
320
317
  }, params));
321
318
  });
@@ -323,61 +320,65 @@ var ModalContent = function (_React$PureComponent) {
323
320
  }, {
324
321
  key: "render",
325
322
  value: function render() {
326
- var _this$props2 = this.props,
327
- mode = _this$props2.mode,
328
- hide = _this$props2.hide,
329
- title = _this$props2.title,
330
- labelled_by = _this$props2.labelled_by,
331
- header_content = _this$props2.header_content,
332
- modal_content = _this$props2.modal_content,
333
- bar_content = _this$props2.bar_content,
334
- _id = _this$props2.id,
335
- close_title = _this$props2.close_title,
336
- dialog_title = _this$props2.dialog_title,
337
- hide_close_button = _this$props2.hide_close_button,
338
- close_button_attributes = _this$props2.close_button_attributes,
339
- spacing = _this$props2.spacing,
340
- prevent_close = _this$props2.prevent_close,
341
- open_delay = _this$props2.open_delay,
342
- prevent_core_style = _this$props2.prevent_core_style,
343
- animation_duration = _this$props2.animation_duration,
344
- no_animation = _this$props2.no_animation,
345
- no_animation_on_mobile = _this$props2.no_animation_on_mobile,
346
- min_width = _this$props2.min_width,
347
- max_width = _this$props2.max_width,
348
- fullscreen = _this$props2.fullscreen,
349
- align_content = _this$props2.align_content,
350
- container_placement = _this$props2.container_placement,
351
- closeModal = _this$props2.closeModal,
352
- className = _this$props2.className,
353
- _className = _this$props2.class,
354
- content_class = _this$props2.content_class,
355
- overlay_class = _this$props2.overlay_class,
356
- content_id = _this$props2.content_id,
357
- toggleOpenClose = _this$props2.toggleOpenClose,
358
- children = _this$props2.children,
359
- rest = _objectWithoutProperties(_this$props2, _excluded2);
360
-
323
+ var _this$props3 = this.props,
324
+ _this$props3$mode = _this$props3.mode,
325
+ mode = _this$props3$mode === void 0 ? 'modal' : _this$props3$mode,
326
+ hide = _this$props3.hide,
327
+ title = _this$props3.title,
328
+ labelled_by = _this$props3.labelled_by,
329
+ header_content = _this$props3.header_content,
330
+ modal_content = _this$props3.modal_content,
331
+ bar_content = _this$props3.bar_content,
332
+ _id = _this$props3.id,
333
+ _this$props3$close_ti = _this$props3.close_title,
334
+ close_title = _this$props3$close_ti === void 0 ? 'Lukk' : _this$props3$close_ti,
335
+ _this$props3$dialog_t = _this$props3.dialog_title,
336
+ dialog_title = _this$props3$dialog_t === void 0 ? 'Vindu' : _this$props3$dialog_t,
337
+ _this$props3$hide_clo = _this$props3.hide_close_button,
338
+ hide_close_button = _this$props3$hide_clo === void 0 ? false : _this$props3$hide_clo,
339
+ close_button_attributes = _this$props3.close_button_attributes,
340
+ _this$props3$spacing = _this$props3.spacing,
341
+ spacing = _this$props3$spacing === void 0 ? true : _this$props3$spacing,
342
+ _this$props3$prevent_ = _this$props3.prevent_core_style,
343
+ prevent_core_style = _this$props3$prevent_ === void 0 ? false : _this$props3$prevent_,
344
+ animation_duration = _this$props3.animation_duration,
345
+ _this$props3$no_anima = _this$props3.no_animation,
346
+ no_animation = _this$props3$no_anima === void 0 ? false : _this$props3$no_anima,
347
+ _this$props3$no_anima2 = _this$props3.no_animation_on_mobile,
348
+ no_animation_on_mobile = _this$props3$no_anima2 === void 0 ? false : _this$props3$no_anima2,
349
+ min_width = _this$props3.min_width,
350
+ max_width = _this$props3.max_width,
351
+ _this$props3$fullscre = _this$props3.fullscreen,
352
+ fullscreen = _this$props3$fullscre === void 0 ? 'auto' : _this$props3$fullscre,
353
+ align_content = _this$props3.align_content,
354
+ container_placement = _this$props3.container_placement,
355
+ closeModal = _this$props3.closeModal,
356
+ className = _this$props3.className,
357
+ _className = _this$props3.class,
358
+ content_class = _this$props3.content_class,
359
+ overlay_class = _this$props3.overlay_class,
360
+ content_id = _this$props3.content_id,
361
+ children = _this$props3.children,
362
+ rest = _objectWithoutProperties(_this$props3, _excluded2);
363
+
364
+ var color = this.state.color;
361
365
  var contentId = content_id || makeUniqueId('modal-');
362
- var style = this.state.color ? {
363
- '--modal-background-color': "var(--color-".concat(this.state.color, ")")
364
- } : null;
365
366
  var minWidth = min_width;
366
367
  var maxWidth = max_width;
367
368
 
368
- if (minWidth && !maxWidth && parseFloat(minWidth) > 0) {
369
+ if (minWidth && !maxWidth && parseFloat(String(minWidth)) > 0) {
369
370
  maxWidth = 0;
370
- } else if (maxWidth && !minWidth && parseFloat(maxWidth) > 0) {
371
+ } else if (maxWidth && !minWidth && parseFloat(String(maxWidth)) > 0) {
371
372
  minWidth = 0;
372
373
  }
373
374
 
374
375
  var useDialogRole = !(IS_MAC || IS_SAFARI || IS_IOS);
375
376
  var contentParams = {
376
377
  role: useDialogRole ? 'dialog' : 'region',
377
- 'aria-modal': useDialogRole ? 'true' : undefined,
378
+ 'aria-modal': useDialogRole ? true : undefined,
378
379
  'aria-labelledby': combineLabelledBy(this.props, title ? contentId + '-title' : null, labelled_by),
379
380
  'aria-describedby': combineDescribedBy(this.props, contentId + '-content'),
380
- 'aria-label': !title && !labelled_by ? this.props.dialog_title : undefined,
381
+ 'aria-label': !title && !labelled_by ? dialog_title : undefined,
381
382
  className: classnames('dnb-modal__content', (container_placement || mode === 'drawer') && "dnb-modal__content--".concat(container_placement || 'right'), isTrue(fullscreen) ? 'dnb-modal__content--fullscreen' : fullscreen === 'auto' && 'dnb-modal__content--auto-fullscreen', content_class, mode && "dnb-modal__content--".concat(mode), hide && 'dnb-modal__content--hide', isTrue(spacing) && 'dnb-modal__content--spacing', align_content && "dnb-modal__content__align--".concat(align_content), isTrue(no_animation) && 'dnb-modal__content--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__content--no-animation-on-mobile'),
382
383
  onClick: this.onContentClickHandler
383
384
  };
@@ -393,134 +394,46 @@ var ModalContent = function (_React$PureComponent) {
393
394
  onKeyDown: this.onKeyDownHandler
394
395
  }, rest);
395
396
 
396
- var overlayParams = {
397
- className: classnames('dnb-modal__overlay', overlay_class, hide && 'dnb-modal__overlay--hide', mode && "dnb-modal__overlay--".concat(mode), isTrue(no_animation) && 'dnb-modal__overlay--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__overlay--no-animation-on-mobile')
398
- };
399
397
  validateDOMAttributes(this.props, innerParams);
400
- var bar = findElementInChildren(modal_content, function (cur) {
398
+ var barExists = findElementInChildren(modal_content, function (cur) {
401
399
  return cur.type === ModalHeaderBar;
402
- }) ? null : React.createElement(ModalHeaderBar, null, bar_content);
403
- var header = findElementInChildren(modal_content, function (cur) {
400
+ });
401
+ var headerExists = findElementInChildren(modal_content, function (cur) {
404
402
  return cur.type === ModalHeader;
405
- }) ? null : React.createElement(ModalHeader, {
406
- title: title
407
- }, header_content);
408
- var content = React.createElement("div", {
409
- id: contentId + '-content',
410
- className: "dnb-modal__content__wrapper"
411
- }, modal_content);
403
+ });
412
404
  return React.createElement(ModalContext.Provider, {
413
- value: _objectSpread(_objectSpread({
414
- id: contentId,
415
- setBackgroundColor: this.setBackgroundColor
416
- }, this.props), {}, {
405
+ value: {
406
+ id: this.props.id,
407
+ title: title,
408
+ hide_close_button: hide_close_button,
409
+ close_button_attributes: close_button_attributes,
410
+ close_title: close_title,
411
+ mode: mode,
412
+ setBackgroundColor: this.setBackgroundColor,
417
413
  onCloseClickHandler: this.onCloseClickHandler
418
- })
414
+ }
419
415
  }, React.createElement("div", _extends({
420
416
  id: contentId
421
417
  }, contentParams), React.createElement(ScrollView, innerParams, React.createElement("div", {
422
- tabIndex: "-1",
418
+ tabIndex: -1,
423
419
  className: "dnb-modal__content__spacing dnb-no-focus",
424
- style: style,
420
+ style: color ? {
421
+ '--modal-background-color': "var(--color-".concat(color, ")")
422
+ } : null,
425
423
  ref: this._contentRef
426
- }, bar, header, content))), React.createElement("span", _extends({}, overlayParams, {
424
+ }, !barExists && React.createElement(ModalHeaderBar, null, bar_content), !headerExists && React.createElement(ModalHeader, {
425
+ title: title
426
+ }, header_content), React.createElement("div", {
427
+ id: contentId + '-content',
428
+ className: "dnb-modal__content__wrapper"
429
+ }, modal_content)))), React.createElement("span", {
430
+ className: classnames('dnb-modal__overlay', overlay_class, hide && 'dnb-modal__overlay--hide', mode && "dnb-modal__overlay--".concat(mode), isTrue(no_animation) && 'dnb-modal__overlay--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__overlay--no-animation-on-mobile'),
427
431
  "aria-hidden": "true"
428
- })));
432
+ }));
429
433
  }
430
434
  }]);
431
435
 
432
436
  return ModalContent;
433
437
  }(React.PureComponent);
434
438
 
435
- _defineProperty(ModalContent, "defaultProps", {
436
- mode: null,
437
- bar_content: null,
438
- header_content: null,
439
- hide: null,
440
- id: null,
441
- root_id: null,
442
- labelled_by: null,
443
- focus_selector: null,
444
- content_id: null,
445
- title: null,
446
- close_title: null,
447
- dialog_title: null,
448
- hide_close_button: null,
449
- close_button_attributes: null,
450
- spacing: null,
451
- prevent_close: null,
452
- prevent_core_style: null,
453
- animation_duration: null,
454
- no_animation: null,
455
- no_animation_on_mobile: null,
456
- min_width: null,
457
- max_width: null,
458
- fullscreen: null,
459
- align_content: null,
460
- container_placement: null,
461
- class: null,
462
- overlay_class: null,
463
- content_class: null,
464
- closeModal: null,
465
- className: null,
466
- children: null
467
- });
468
-
469
- export { ModalContent as default };
470
- process.env.NODE_ENV !== "production" ? ModalContent.propTypes = {
471
- modal_content: PropTypes.node.isRequired,
472
- mode: PropTypes.oneOf(['modal', 'drawer']),
473
- bar_content: PropTypes.node,
474
- header_content: PropTypes.node,
475
- hide: PropTypes.bool,
476
- id: PropTypes.string,
477
- root_id: PropTypes.string,
478
- labelled_by: PropTypes.string,
479
- focus_selector: PropTypes.string,
480
- content_id: PropTypes.string,
481
- title: PropTypes.node,
482
- close_title: PropTypes.string,
483
- dialog_title: PropTypes.string,
484
- hide_close_button: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
485
- close_button_attributes: PropTypes.object,
486
- spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
487
- prevent_close: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
488
- prevent_core_style: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
489
- animation_duration: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
490
- no_animation: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
491
- no_animation_on_mobile: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
492
- min_width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
493
- max_width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
494
- fullscreen: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
495
- align_content: PropTypes.string,
496
- container_placement: PropTypes.string,
497
- class: PropTypes.string,
498
- content_class: PropTypes.string,
499
- overlay_class: PropTypes.string,
500
- closeModal: PropTypes.func.isRequired,
501
- className: PropTypes.string,
502
- children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func])
503
- } : void 0;
504
- export function getListOfModalRoots() {
505
- var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
506
-
507
- if (typeof window !== 'undefined') {
508
- try {
509
- var stack = window.__modalStack || [];
510
-
511
- if (index !== null) {
512
- if (index === -1 && stack.length) {
513
- return stack[stack.length - 1];
514
- } else if (index > -1) {
515
- return stack[index];
516
- }
517
- }
518
-
519
- return stack;
520
- } catch (e) {
521
- warn(e);
522
- }
523
- }
524
-
525
- return [];
526
- }
439
+ export { ModalContent as default };