@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
@@ -0,0 +1,95 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+
4
+ // Components
5
+ import { createSkeletonClass } from '../skeleton/SkeletonHelper'
6
+ import { createSpacingClasses } from '../space/SpacingHelper'
7
+ import Icon, { IconPrimaryIcon } from '../icon-primary/IconPrimary'
8
+
9
+ // Shared
10
+ import Context from '../../shared/Context'
11
+ import { ISpacingProps, SkeletonTypes } from '../../shared/interfaces'
12
+ import { extendPropsWithContext } from '../../shared/component-helper'
13
+
14
+ export interface TagProps {
15
+ /**
16
+ * The content of the tag element, can be a string or a React Element.
17
+ * Default: null
18
+ */
19
+ text?: React.ReactNode
20
+
21
+ /**
22
+ * Icon displaying on the left side
23
+ * Default: null
24
+ */
25
+ icon?: IconPrimaryIcon
26
+
27
+ /**
28
+ * Custom className on the component root
29
+ * Default: null
30
+ */
31
+ className?: string
32
+
33
+ /**
34
+ * Skeleton should be applied when loading content
35
+ * Default: null
36
+ */
37
+ skeleton?: SkeletonTypes
38
+
39
+ /**
40
+ * The content of the tag element, can be a string or a React Element. Will be overwritten by text prop
41
+ * Default: null
42
+ */
43
+ children?: string | React.ReactNode // ReactNode allows multiple elements, strings, numbers, fragments, portals...
44
+ }
45
+
46
+ export const defaultProps = {
47
+ className: null,
48
+ skeleton: false,
49
+ text: null,
50
+ children: null,
51
+ icon: null,
52
+ }
53
+
54
+ function Tag(localProps: TagProps & ISpacingProps) {
55
+ // Every component should have a context
56
+ const context = React.useContext(Context)
57
+ // Extract additional props from global context
58
+ const { className, skeleton, children, icon, text, ...props } =
59
+ extendPropsWithContext(
60
+ { ...defaultProps, ...localProps },
61
+ defaultProps,
62
+ context?.translation?.Tag,
63
+ context?.Tag
64
+ )
65
+ const skeletonClasses = createSkeletonClass('shape', skeleton, context)
66
+ const spacingClasses = createSpacingClasses(props)
67
+
68
+ const content = text || children
69
+
70
+ return (
71
+ <div
72
+ className={classnames(
73
+ 'dnb-tag',
74
+ skeletonClasses,
75
+ spacingClasses,
76
+ className
77
+ )}
78
+ data-testid="tag"
79
+ {...props}
80
+ >
81
+ {icon && (
82
+ <span data-testid="tag-icon" className="dnb-tag__icon">
83
+ <Icon icon={icon} right="x-small" />
84
+ </span>
85
+ )}
86
+ {content && (
87
+ <span data-testid="tag-text" className="dnb-tag__text">
88
+ {content}
89
+ </span>
90
+ )}
91
+ </div>
92
+ )
93
+ }
94
+
95
+ export default Tag
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Component Entry
3
+ *
4
+ */
5
+
6
+ import Tag from './Tag'
7
+ export default Tag
8
+ export * from './Tag'
@@ -0,0 +1,3 @@
1
+ import Tag from './Tag';
2
+ export default Tag;
3
+ export * from './Tag';
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Tag component
3
+ *
4
+ */
5
+
6
+ :root {
7
+ --tag-border-radius: 2.5rem;
8
+ }
9
+
10
+ .dnb-tag {
11
+ display: inline-flex;
12
+ flex-direction: row;
13
+ justify-content: center;
14
+ align-items: center;
15
+ padding: var(--spacing-xx-small) var(--spacing-x-small);
16
+ font-size: var(--font-size-x-small);
17
+ background-color: var(--color-black-8);
18
+ border-radius: var(--tag-border-radius);
19
+ &__icon {
20
+ display: flex;
21
+ align-items: center;
22
+ }
23
+ &__text {
24
+ color: var(--color-black-80);
25
+ }
26
+ }
@@ -0,0 +1,109 @@
1
+ /*
2
+ * DNB Tag
3
+ *
4
+ */
5
+ /**
6
+ * This file is only used to make components independent
7
+ * so that they can get imported individually, without the core styles
8
+ *
9
+ */
10
+ /*
11
+ * Utilities
12
+ */
13
+ /*
14
+ * Scopes
15
+ *
16
+ */
17
+ /*
18
+ * Document Reset
19
+ *
20
+ */
21
+ .dnb-tag {
22
+ font-family: 'DNB', sans-serif;
23
+ font-family: var(--font-family-default);
24
+ font-weight: normal;
25
+ font-weight: var(--font-weight-basis);
26
+ font-size: 1rem;
27
+ font-size: var(--font-size-small);
28
+ font-style: normal;
29
+ line-height: 1.5rem;
30
+ line-height: var(--line-height-basis);
31
+ color: #333;
32
+ color: var(--color-black-80, #333);
33
+ -moz-osx-font-smoothing: grayscale;
34
+ -webkit-font-smoothing: antialiased;
35
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
36
+ /**
37
+ * Ensure consistency and use the same as HTML reset -> html {...}
38
+ * between base and code package
39
+ */
40
+ -moz-tab-size: 4;
41
+ -o-tab-size: 4;
42
+ tab-size: 4;
43
+ -ms-text-size-adjust: 100%;
44
+ -webkit-text-size-adjust: 100%;
45
+ word-break: break-word;
46
+ /**
47
+ * 1. Remove repeating backgrounds in all browsers (opinionated).
48
+ * 2. Add border box sizing in all browsers (opinionated).
49
+ */
50
+ /**
51
+ * 1. Add text decoration inheritance in all browsers (opinionated).
52
+ * 2. Add vertical alignment inheritance in all browsers (opinionated).
53
+ */
54
+ margin: 0;
55
+ padding: 0; }
56
+ .dnb-tag *,
57
+ .dnb-tag ::before,
58
+ .dnb-tag ::after {
59
+ background-repeat: no-repeat;
60
+ /* 1 */
61
+ -webkit-box-sizing: border-box;
62
+ box-sizing: border-box;
63
+ /* 2 */ }
64
+ .dnb-tag ::before,
65
+ .dnb-tag ::after {
66
+ text-decoration: inherit;
67
+ /* 1 */
68
+ vertical-align: inherit;
69
+ /* 2 */ }
70
+
71
+ /*
72
+ * Tag component
73
+ *
74
+ */
75
+ :root {
76
+ --tag-border-radius: 2.5rem; }
77
+
78
+ .dnb-tag {
79
+ display: -webkit-inline-box;
80
+ display: -ms-inline-flexbox;
81
+ display: inline-flex;
82
+ -webkit-box-orient: horizontal;
83
+ -webkit-box-direction: normal;
84
+ -ms-flex-direction: row;
85
+ flex-direction: row;
86
+ -webkit-box-pack: center;
87
+ -ms-flex-pack: center;
88
+ justify-content: center;
89
+ -webkit-box-align: center;
90
+ -ms-flex-align: center;
91
+ align-items: center;
92
+ padding: 0.25rem 0.5rem;
93
+ padding: var(--spacing-xx-small) var(--spacing-x-small);
94
+ font-size: 0.875rem;
95
+ font-size: var(--font-size-x-small);
96
+ background-color: #ebebeb;
97
+ background-color: var(--color-black-8);
98
+ border-radius: 2.5rem;
99
+ border-radius: var(--tag-border-radius); }
100
+ .dnb-tag__icon {
101
+ display: -webkit-box;
102
+ display: -ms-flexbox;
103
+ display: flex;
104
+ -webkit-box-align: center;
105
+ -ms-flex-align: center;
106
+ align-items: center; }
107
+ .dnb-tag__text {
108
+ color: #333;
109
+ color: var(--color-black-80); }
@@ -0,0 +1 @@
1
+ .dnb-tag{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;color:var(--color-black-80,#333);font-family:DNB,sans-serif;font-family:var(--font-family-default);font-size:1rem;font-size:var(--font-size-small);font-style:normal;font-weight:400;font-weight:var(--font-weight-basis);line-height:1.5rem;line-height:var(--line-height-basis);margin:0;padding:0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-break:break-word}.dnb-tag *,.dnb-tag :after,.dnb-tag :before{background-repeat:no-repeat;-webkit-box-sizing:border-box;box-sizing:border-box}.dnb-tag :after,.dnb-tag :before{text-decoration:inherit;vertical-align:inherit}:root{--tag-border-radius:2.5rem}.dnb-tag{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:center;-ms-flex-pack:center;background-color:#ebebeb;background-color:var(--color-black-8);border-radius:2.5rem;border-radius:var(--tag-border-radius);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;font-size:.875rem;font-size:var(--font-size-x-small);justify-content:center;padding:.25rem .5rem;padding:var(--spacing-xx-small) var(--spacing-x-small)}.dnb-tag,.dnb-tag__icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.dnb-tag__icon{display:-webkit-box;display:-ms-flexbox;display:flex}.dnb-tag__text{color:#333;color:var(--color-black-80)}
@@ -0,0 +1,12 @@
1
+ /*
2
+ * DNB Tag
3
+ *
4
+ */
5
+
6
+ @import '../../../style/components/imports.scss';
7
+
8
+ .dnb-tag {
9
+ @include componentReset();
10
+ }
11
+
12
+ @import './_tag.scss';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Web Style Import
3
+ *
4
+ */
5
+
6
+ import './dnb-tag.scss'
@@ -0,0 +1 @@
1
+ import "./dnb-tag.min.css";
@@ -0,0 +1 @@
1
+ import "./style/dnb-tag.min.css";
@@ -96,7 +96,7 @@ export interface TextareaProps extends React.HTMLProps<HTMLElement> {
96
96
  textarea_state?: string;
97
97
 
98
98
  /**
99
- * Defines the state of the status. Currently there are two statuses `[error, info]`. Defaults to `error`.
99
+ * Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.
100
100
  */
101
101
  status_state?: string;
102
102
 
@@ -154,7 +154,7 @@ export interface TextareaProps extends React.HTMLProps<HTMLElement> {
154
154
  textarea_class?: string;
155
155
 
156
156
  /**
157
- * Provide the Textarea element with any attributes by using an Object `textarea_attributes={{size:&#39;2&#39;}}` or a JSON Object `textarea_attributes=&#39;{"size":"2"}&#39;`. "NB:" Keep in mind, that also every not listed component property will be send along and set as a Textarea element attribute.
157
+ * Provide the Textarea element with any attributes by using an Object `textarea_attributes={{size:&#39;2&#39;}}` or a JSON Object `textarea_attributes=&#39;{"size":"2"}&#39;`. "NB:" Keep in mind, that also every not listed component property will be sent along and set as a Textarea element attribute.
158
158
  */
159
159
  textarea_attributes?: TextareaTextareaAttributes;
160
160
  readOnly?: TextareaReadOnly;
@@ -162,7 +162,7 @@ export interface TextareaProps extends React.HTMLProps<HTMLElement> {
162
162
  cols?: TextareaCols;
163
163
 
164
164
  /**
165
- * By providing a React.ref we can get the internal used Textarea element (DOM). E.g. `inner_ref={myRef}` by using `React.createRef()` or `React.useRef()`.
165
+ * By providing a React.ref we can get the internally used Textarea element (DOM). E.g. `inner_ref={myRef}` by using `React.createRef()` or `React.useRef()`.
166
166
  */
167
167
  inner_ref?: TextareaInnerRef;
168
168
 
@@ -202,7 +202,7 @@ export interface TextareaProps extends React.HTMLProps<HTMLElement> {
202
202
  on_change?: (...args: any[]) => any;
203
203
 
204
204
  /**
205
- * Will be called on focus set by the user. Returns `{ value, event }`.
205
+ * Will be called on the focus set by the user. Returns `{ value, event }`.
206
206
  */
207
207
  on_focus?: (...args: any[]) => any;
208
208
 
@@ -64,12 +64,12 @@ export type ToggleButtonChildren = string | ((...args: any[]) => any);
64
64
  */
65
65
  export interface ToggleButtonProps extends React.HTMLProps<HTMLElement> {
66
66
  /**
67
- * The text show in the ToggleButton.
67
+ * The text shown in the ToggleButton.
68
68
  */
69
69
  text?: string;
70
70
 
71
71
  /**
72
- * Use either the `label` property or provide custom one.
72
+ * Use either the `label` property or provide a custom one.
73
73
  */
74
74
  label?: ToggleButtonLabel;
75
75
  label_direction?: ToggleButtonLabelDirection;
@@ -81,7 +81,7 @@ export interface ToggleButtonProps extends React.HTMLProps<HTMLElement> {
81
81
  title?: string;
82
82
 
83
83
  /**
84
- * Determine whether the ToggleButton is checked or not. Default will be `false`.
84
+ * Determine whether the ToggleButton is checked or not. The default will be `false`.
85
85
  */
86
86
  checked?: ToggleButtonChecked;
87
87
  variant?: ToggleButtonVariant;
@@ -100,7 +100,7 @@ export interface ToggleButtonProps extends React.HTMLProps<HTMLElement> {
100
100
  status?: ToggleButtonStatus;
101
101
 
102
102
  /**
103
- * Defines the state of the status. Currently there are two statuses `[error, info]`. Defaults to `error`.
103
+ * Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.
104
104
  */
105
105
  status_state?: string;
106
106
 
@@ -131,7 +131,7 @@ export interface ToggleButtonProps extends React.HTMLProps<HTMLElement> {
131
131
  icon?: ToggleButtonIcon;
132
132
 
133
133
  /**
134
- * Position of icon inside the toggle button. Set to `left` or `right`. Defaults to `right` if not set.
134
+ * Position of the icon inside the toggle button. Set to `left` or `right`. Defaults to `right` if not set.
135
135
  */
136
136
  icon_position?: ToggleButtonIconPosition;
137
137
 
@@ -173,7 +173,7 @@ export interface ToggleButtonProps extends React.HTMLProps<HTMLElement> {
173
173
  custom_method?: (...args: any[]) => any;
174
174
 
175
175
  /**
176
- * Will be called on state changes made by the user. Returns an boolean and string `{ checked, value, event }`.
176
+ * Will be called on state changes made by the user. Returns a boolean and string `{ checked, value, event }`.
177
177
  */
178
178
  on_change?: (...args: any[]) => any;
179
179
  on_state_update?: (...args: any[]) => any;
@@ -65,7 +65,7 @@ export type ToggleButtonGroupChildren =
65
65
  export interface ToggleButtonGroupProps
66
66
  extends React.HTMLProps<HTMLElement> {
67
67
  /**
68
- * Use either the `label` property or provide custom one.
68
+ * Use either the `label` property or provide a custom one.
69
69
  */
70
70
  label?: ToggleButtonGroupLabel;
71
71
  label_direction?: ToggleButtonGroupLabelDirection;
@@ -94,7 +94,7 @@ export interface ToggleButtonGroupProps
94
94
  status?: ToggleButtonGroupStatus;
95
95
 
96
96
  /**
97
- * Defines the state of the status. Currently there are two statuses `[error, info]`. Defaults to `error`.
97
+ * Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.
98
98
  */
99
99
  status_state?: string;
100
100
 
@@ -158,7 +158,7 @@ export interface ToggleButtonGroupProps
158
158
  custom_method?: (...args: any[]) => any;
159
159
 
160
160
  /**
161
- * Will be called on state changes made by the user. Returns an boolean and string `{ checked, value, event }`.
161
+ * Will be called on state changes made by the user. Returns a boolean and string `{ checked, value, event }`.
162
162
  */
163
163
  on_change?: (...args: any[]) => any;
164
164
  }
@@ -57,7 +57,7 @@ export interface TooltipProps extends React.HTMLProps<HTMLElement> {
57
57
  id?: string;
58
58
 
59
59
  /**
60
- * If the tooltip should animate from one target to the next, define an unique ID.
60
+ * If the tooltip should animate from one target to the next, define a unique ID.
61
61
  */
62
62
  group?: string;
63
63
 
@@ -72,7 +72,7 @@ export interface TooltipProps extends React.HTMLProps<HTMLElement> {
72
72
  active?: TooltipActive;
73
73
 
74
74
  /**
75
- * Defines the offset position in corporation to the target element the arrow appears. Can be `top`, `right`, `left` and `bottom`. Defaults to `top`.
75
+ * Defines the offset position to the target element the arrow appears. Can be `top`, `right`, `left` and `bottom`. Defaults to `top`.
76
76
  */
77
77
  position?: TooltipPosition;
78
78
 
@@ -82,13 +82,13 @@ export interface TooltipProps extends React.HTMLProps<HTMLElement> {
82
82
  arrow?: TooltipArrow;
83
83
 
84
84
  /**
85
- * Defines the offset alignment in corporation to the target element the arrow appears. Can be `center`, `right` and `left`.Defaults to `center`.
85
+ * Defines the offset alignment to the target element the arrow appears. Can be `center`, `right` and `left`.Defaults to `center`.
86
86
  */
87
87
  align?: TooltipAlign;
88
88
  animate_position?: TooltipAnimatePosition;
89
89
 
90
90
  /**
91
- * If set to `true`, the Tooltip will be fixed in it&#39;s scroll position by using CSS `position: fixed;`. Defaults to `false`.
91
+ * If set to `true`, the Tooltip will be fixed in its scroll position by using CSS `position: fixed;`. Defaults to `false`.
92
92
  */
93
93
  fixed_position?: TooltipFixedPosition;
94
94
 
@@ -98,7 +98,7 @@ export interface TooltipProps extends React.HTMLProps<HTMLElement> {
98
98
  no_animation?: TooltipNoAnimation;
99
99
 
100
100
  /**
101
- * Define the delay until the tooltip should show up after initial hover / active state.
101
+ * Define the delay until the tooltip should show up after the initial hover / active state.
102
102
  */
103
103
  show_delay?: TooltipShowDelay;
104
104
 
@@ -28,7 +28,7 @@ export interface TooltipContainerProps
28
28
  active?: TooltipContainerActive;
29
29
 
30
30
  /**
31
- * Defines the offset position in corporation to the target element the arrow appears. Can be `top`, `right`, `left` and `bottom`. Defaults to `top`.
31
+ * Defines the offset position to the target element the arrow appears. Can be `top`, `right`, `left` and `bottom`. Defaults to `top`.
32
32
  */
33
33
  position?: string;
34
34
 
@@ -38,13 +38,13 @@ export interface TooltipContainerProps
38
38
  arrow?: string;
39
39
 
40
40
  /**
41
- * Defines the offset alignment in corporation to the target element the arrow appears. Can be `center`, `right` and `left`.Defaults to `center`.
41
+ * Defines the offset alignment to the target element the arrow appears. Can be `center`, `right` and `left`.Defaults to `center`.
42
42
  */
43
43
  align?: string;
44
44
  animate_position?: TooltipContainerAnimatePosition;
45
45
 
46
46
  /**
47
- * If set to `true`, the Tooltip will be fixed in it&#39;s scroll position by using CSS `position: fixed;`. Defaults to `false`.
47
+ * If set to `true`, the Tooltip will be fixed in its scroll position by using CSS `position: fixed;`. Defaults to `false`.
48
48
  */
49
49
  fixed_position?: TooltipContainerFixedPosition;
50
50
 
@@ -15,7 +15,7 @@ export interface TooltipPortalProps extends React.HTMLProps<HTMLElement> {
15
15
  active?: boolean;
16
16
 
17
17
  /**
18
- * If the tooltip should animate from one target to the next, define an unique ID.
18
+ * If the tooltip should animate from one target to the next, define a unique ID.
19
19
  */
20
20
  group?: string;
21
21
 
@@ -18,7 +18,7 @@ export interface TooltipWithEventsProps
18
18
  internal_id?: string;
19
19
 
20
20
  /**
21
- * Define the delay until the tooltip should show up after initial hover / active state.
21
+ * Define the delay until the tooltip should show up after the initial hover / active state.
22
22
  */
23
23
  show_delay?: TooltipWithEventsShowDelay;
24
24
  target?: TooltipWithEventsTarget;
@@ -8,17 +8,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
8
8
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
9
9
 
10
10
  import React from 'react';
11
- import PropTypes from 'prop-types';
12
11
  import classnames from 'classnames';
13
- import { extendPropsWithContext, registerElement, validateDOMAttributes, processChildren } from '../../shared/component-helper';
12
+ import { validateDOMAttributes, processChildren, extendPropsWithContext } from '../../shared/component-helper';
14
13
  import Context from '../../shared/Context';
15
- import { spacingPropTypes, createSpacingClasses } from '../../components/space/SpacingHelper';
14
+ import { createSpacingClasses } from '../../components/space/SpacingHelper';
16
15
 
17
16
  class ScrollView extends React.PureComponent {
18
- static enableWebComponent() {
19
- registerElement(ScrollView.tagName, ScrollView, ScrollView.defaultProps);
20
- }
21
-
22
17
  static getContent(props) {
23
18
  if (props.text) return props.text;
24
19
  return processChildren(props);
@@ -26,6 +21,9 @@ class ScrollView extends React.PureComponent {
26
21
 
27
22
  constructor(props) {
28
23
  super(props);
24
+
25
+ _defineProperty(this, "ref", void 0);
26
+
29
27
  this.ref = props.innerRef || React.createRef();
30
28
  }
31
29
 
@@ -33,9 +31,9 @@ class ScrollView extends React.PureComponent {
33
31
  const props = extendPropsWithContext(this.props, ScrollView.defaultProps, this.context.FormRow, this.context.ScrollView);
34
32
 
35
33
  const {
36
- className,
34
+ className = null,
37
35
  class: _className,
38
- innerRef
36
+ innerRef = null
39
37
  } = props,
40
38
  attributes = _objectWithoutProperties(props, _excluded);
41
39
 
@@ -64,12 +62,6 @@ _defineProperty(ScrollView, "defaultProps", {
64
62
  class: null
65
63
  });
66
64
 
67
- process.env.NODE_ENV !== "production" ? ScrollView.propTypes = _objectSpread(_objectSpread({}, spacingPropTypes), {}, {
68
- className: PropTypes.string,
69
- children: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.node]),
70
- innerRef: PropTypes.object,
71
- class: PropTypes.string
72
- }) : void 0;
73
65
  export default React.forwardRef(function ScrollViewRef(props, ref) {
74
66
  return React.createElement(ScrollView, _extends({
75
67
  innerRef: ref
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Web ScrollView Component
3
+ *
4
+ */
5
+
6
+ import React from 'react'
7
+ import classnames from 'classnames'
8
+ import {
9
+ validateDOMAttributes,
10
+ processChildren,
11
+ extendPropsWithContext,
12
+ } from '../../shared/component-helper'
13
+ import Context from '../../shared/Context'
14
+ import { createSpacingClasses } from '../../components/space/SpacingHelper'
15
+ import { ISpacingProps } from '../../shared/interfaces'
16
+
17
+ interface ScrollViewProps extends ISpacingProps {
18
+ className: string
19
+ children: string | React.ReactNode | ((...args: any[]) => any)
20
+ innerRef: any
21
+ class: string
22
+ // All other props
23
+ [x: string]: any
24
+ }
25
+
26
+ class ScrollView extends React.PureComponent<ScrollViewProps> {
27
+ static tagName = 'dnb-scroll-view'
28
+ static contextType = Context
29
+ ref: any
30
+
31
+ static getContent(props) {
32
+ if (props.text) return props.text
33
+ return processChildren(props)
34
+ }
35
+
36
+ static defaultProps = {
37
+ className: null,
38
+ children: null,
39
+ innerRef: null,
40
+
41
+ class: null,
42
+ }
43
+
44
+ constructor(props) {
45
+ super(props)
46
+ this.ref = props.innerRef || React.createRef()
47
+ }
48
+
49
+ render() {
50
+ // use only the props from context, who are available here anyway
51
+ const props = extendPropsWithContext(
52
+ this.props,
53
+ ScrollView.defaultProps,
54
+ this.context.FormRow,
55
+ this.context.ScrollView
56
+ )
57
+
58
+ const {
59
+ className = null,
60
+ class: _className,
61
+ innerRef = null, // eslint-disable-line
62
+ ...attributes
63
+ } = props
64
+
65
+ const contentToRender = ScrollView.getContent(props)
66
+
67
+ const mainParams = {
68
+ className: classnames(
69
+ 'dnb-scroll-view',
70
+ createSpacingClasses(props),
71
+ _className,
72
+ className
73
+ ),
74
+ ...attributes,
75
+ }
76
+
77
+ validateDOMAttributes(this.props, mainParams)
78
+
79
+ return (
80
+ <div {...mainParams} ref={this.ref}>
81
+ {contentToRender}
82
+ </div>
83
+ )
84
+ }
85
+ }
86
+
87
+ export default React.forwardRef(function ScrollViewRef(
88
+ props: ScrollViewProps,
89
+ ref
90
+ ) {
91
+ return <ScrollView innerRef={ref} {...props} />
92
+ })
package/es/index.d.ts CHANGED
@@ -42,6 +42,7 @@ import Space from './components/space/Space'
42
42
  import StepIndicator from './components/step-indicator/StepIndicator'
43
43
  import Switch from './components/switch/Switch'
44
44
  import Tabs from './components/tabs/Tabs'
45
+ import Tag from './components/tag/Tag'
45
46
  import Textarea from './components/textarea/Textarea'
46
47
  import ToggleButton from './components/toggle-button/ToggleButton'
47
48
  import Tooltip from './components/tooltip/Tooltip'
@@ -109,6 +110,7 @@ export {
109
110
  StepIndicator,
110
111
  Switch,
111
112
  Tabs,
113
+ Tag,
112
114
  Textarea,
113
115
  ToggleButton,
114
116
  Tooltip,
package/es/index.js CHANGED
@@ -30,6 +30,7 @@ import Space from './components/space/Space';
30
30
  import StepIndicator from './components/step-indicator/StepIndicator';
31
31
  import Switch from './components/switch/Switch';
32
32
  import Tabs from './components/tabs/Tabs';
33
+ import Tag from './components/tag/Tag';
33
34
  import Textarea from './components/textarea/Textarea';
34
35
  import ToggleButton from './components/toggle-button/ToggleButton';
35
36
  import Tooltip from './components/tooltip/Tooltip';
@@ -62,5 +63,5 @@ import Td from './elements/Td';
62
63
  import Th from './elements/Th';
63
64
  import Tr from './elements/Tr';
64
65
  import Ul from './elements/Ul';
65
- export { Accordion, Autocomplete, Breadcrumb, Button, Checkbox, DatePicker, Dropdown, FormLabel, FormRow, FormSet, FormStatus, GlobalError, GlobalStatus, Heading, HelpButton, Icon, IconPrimary, Input, InputMasked, Logo, Modal, NumberFormat, Pagination, ProgressIndicator, Radio, Section, Skeleton, Slider, Space, StepIndicator, Switch, Tabs, Textarea, ToggleButton, Tooltip, Anchor, Blockquote, Code, Dd, Div, Dl, Dt, H, H1, H2, H3, H4, H5, H6, Hr, Img, Ingress, Lead, Li, Link, Ol, P, Paragraph, Span, Table, Td, Th, Tr, Ul };
66
+ export { Accordion, Autocomplete, Breadcrumb, Button, Checkbox, DatePicker, Dropdown, FormLabel, FormRow, FormSet, FormStatus, GlobalError, GlobalStatus, Heading, HelpButton, Icon, IconPrimary, Input, InputMasked, Logo, Modal, NumberFormat, Pagination, ProgressIndicator, Radio, Section, Skeleton, Slider, Space, StepIndicator, Switch, Tabs, Tag, Textarea, ToggleButton, Tooltip, Anchor, Blockquote, Code, Dd, Div, Dl, Dt, H, H1, H2, H3, H4, H5, H6, Hr, Img, Ingress, Lead, Li, Link, Ol, P, Paragraph, Span, Table, Td, Th, Tr, Ul };
66
67
  export default {};
@@ -44,7 +44,8 @@ export const prepareContext = (props = {}) => {
44
44
  }, props), {}, {
45
45
  translation,
46
46
  Breadcrumb: {},
47
- BreadcrumbItem: {}
47
+ BreadcrumbItem: {},
48
+ Tag: {}
48
49
  });
49
50
 
50
51
  return context;