@helsenorge/designsystem-react 7.12.0 → 7.13.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 (357) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/_virtual/dynamic-import-helper.js +11 -4
  3. package/_virtual/dynamic-import-helper.js.map +1 -1
  4. package/_virtual/index.js +2 -2
  5. package/components/AnchorLink/AnchorLink.js +16 -16
  6. package/components/AnchorLink/AnchorLink.js.map +1 -1
  7. package/components/Avatar/Avatar.js +9 -9
  8. package/components/Avatar/Avatar.js.map +1 -1
  9. package/components/Badge/Badge.js +7 -7
  10. package/components/Badge/Badge.js.map +1 -1
  11. package/components/Badge/NotificationBadge.js +5 -5
  12. package/components/Badge/NotificationBadge.js.map +1 -1
  13. package/components/Button/Button.js +23 -23
  14. package/components/Button/Button.js.map +1 -1
  15. package/components/ButtonWithModal/ButtonWithModal.js +5 -5
  16. package/components/ButtonWithModal/ButtonWithModal.js.map +1 -1
  17. package/components/Checkbox/Checkbox.js +41 -42
  18. package/components/Checkbox/Checkbox.js.map +1 -1
  19. package/components/Checkbox/index.js +2 -3
  20. package/components/Checkbox/index.js.map +1 -1
  21. package/components/Checkbox/styles.module.scss +2 -2
  22. package/components/Close/Close.js +9 -9
  23. package/components/Close/Close.js.map +1 -1
  24. package/components/DictionaryTrigger/DictionaryTrigger.js +14 -15
  25. package/components/DictionaryTrigger/DictionaryTrigger.js.map +1 -1
  26. package/components/DictionaryTrigger/styles.module.scss +1 -2
  27. package/components/Dropdown/Dropdown.js +24 -24
  28. package/components/Dropdown/Dropdown.js.map +1 -1
  29. package/components/Dropdown/styles.module.scss +1 -1
  30. package/components/Duolist/Duolist.d.ts +3 -0
  31. package/components/Duolist/Duolist.js +45 -36
  32. package/components/Duolist/Duolist.js.map +1 -1
  33. package/components/Duolist/index.js +5 -5
  34. package/components/Duolist/styles.module.scss +4 -0
  35. package/components/Duolist/styles.module.scss.d.ts +1 -0
  36. package/components/EmptyState/EmptyState.js +3 -3
  37. package/components/EmptyState/EmptyState.js.map +1 -1
  38. package/components/EmptyState/NobodyHome.js +3 -3
  39. package/components/EmptyState/NobodyHome.js.map +1 -1
  40. package/components/ErrorWrapper/ErrorWrapper.js +4 -4
  41. package/components/ErrorWrapper/ErrorWrapper.js.map +1 -1
  42. package/components/ErrorWrapper/index.js +2 -3
  43. package/components/ErrorWrapper/index.js.map +1 -1
  44. package/components/Expander/Expander.js +10 -10
  45. package/components/Expander/Expander.js.map +1 -1
  46. package/components/Expander/styles.module.scss +1 -1
  47. package/components/ExpanderHierarchy/Expander.js +5 -5
  48. package/components/ExpanderHierarchy/Expander.js.map +1 -1
  49. package/components/ExpanderHierarchy/ExpanderButton.js +7 -7
  50. package/components/ExpanderHierarchy/ExpanderButton.js.map +1 -1
  51. package/components/ExpanderHierarchy/ExpanderHierarchy.js +13 -14
  52. package/components/ExpanderHierarchy/ExpanderHierarchy.js.map +1 -1
  53. package/components/ExpanderHierarchy/expander.module.scss +2 -2
  54. package/components/ExpanderList/ExpanderList.js +34 -35
  55. package/components/ExpanderList/ExpanderList.js.map +1 -1
  56. package/components/ExpanderList/index.js +2 -3
  57. package/components/ExpanderList/index.js.map +1 -1
  58. package/components/ExpanderList/styles.module.scss +1 -1
  59. package/components/FormExample/FormExample.d.ts +0 -1
  60. package/components/FormExample/FormExample.js +12 -12
  61. package/components/FormExample/FormExample.js.map +1 -1
  62. package/components/FormExample/index.js +5 -5
  63. package/components/FormGroup/FormGroup.js +37 -38
  64. package/components/FormGroup/FormGroup.js.map +1 -1
  65. package/components/FormGroup/index.js +2 -3
  66. package/components/FormGroup/index.js.map +1 -1
  67. package/components/FormLayout/FormLayout.js +16 -17
  68. package/components/FormLayout/FormLayout.js.map +1 -1
  69. package/components/FormLayout/index.js +4 -4
  70. package/components/GridExample/GridExample.js +3 -3
  71. package/components/GridExample/GridExample.js.map +1 -1
  72. package/components/GridExample/index.js +3 -4
  73. package/components/GridExample/index.js.map +1 -1
  74. package/components/HelpBubble/HelpBubble.js +26 -27
  75. package/components/HelpBubble/HelpBubble.js.map +1 -1
  76. package/components/HelpBubble/styles.module.scss +1 -1
  77. package/components/HelpBubbleExample/HelpBubbleExample.js +3 -3
  78. package/components/HelpBubbleExample/HelpBubbleExample.js.map +1 -1
  79. package/components/HelpPanel/HelpPanel.js +11 -11
  80. package/components/HelpPanel/HelpPanel.js.map +1 -1
  81. package/components/HelpQuestion/HelpQuestion.js +16 -17
  82. package/components/HelpQuestion/HelpQuestion.js.map +1 -1
  83. package/components/HighlightBox/HighlightBox.js +16 -16
  84. package/components/HighlightBox/HighlightBox.js.map +1 -1
  85. package/components/HighlightBox/styles.module.scss +4 -4
  86. package/components/HorizontalScroll/HorizontalScroll.js +4 -4
  87. package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
  88. package/components/HorizontalScroll/index.js +2 -3
  89. package/components/HorizontalScroll/index.js.map +1 -1
  90. package/components/Illustration/Illustration.js +16 -17
  91. package/components/Illustration/Illustration.js.map +1 -1
  92. package/components/Illustration/index.js +5 -5
  93. package/components/Input/Input.js +65 -67
  94. package/components/Input/Input.js.map +1 -1
  95. package/components/Label/Label.js +16 -16
  96. package/components/Label/Label.js.map +1 -1
  97. package/components/LazyIcon/ErrorBoundary.js +7 -8
  98. package/components/LazyIcon/ErrorBoundary.js.map +1 -1
  99. package/components/LazyIcon/LazyIcon.js +4 -4
  100. package/components/LazyIcon/LazyIcon.js.map +1 -1
  101. package/components/LazyIcon/index.js +3 -3
  102. package/components/LazyIllustration/LazyIllustration.js +10 -10
  103. package/components/LazyIllustration/LazyIllustration.js.map +1 -1
  104. package/components/LazyIllustration/index.js +5 -5
  105. package/components/LinkList/LinkList.js +36 -37
  106. package/components/LinkList/LinkList.js.map +1 -1
  107. package/components/LinkList/index.js +2 -3
  108. package/components/LinkList/index.js.map +1 -1
  109. package/components/List/List.js +7 -8
  110. package/components/List/List.js.map +1 -1
  111. package/components/ListHeader/ListHeader.js +1 -1
  112. package/components/ListHeader/ListHeader.js.map +1 -1
  113. package/components/ListHeader/ListHeaderText/ListHeaderText.js +18 -19
  114. package/components/ListHeader/ListHeaderText/ListHeaderText.js.map +1 -1
  115. package/components/ListHeader/ListHeaderText/index.js +2 -3
  116. package/components/ListHeader/ListHeaderText/index.js.map +1 -1
  117. package/components/Loader/Loader.js +2 -2
  118. package/components/Loader/Loader.js.map +1 -1
  119. package/components/Logo/Logo.js +5 -5
  120. package/components/Logo/Logo.js.map +1 -1
  121. package/components/MaxCharacters/MaxCharacters.js +5 -5
  122. package/components/MaxCharacters/MaxCharacters.js.map +1 -1
  123. package/components/Modal/Modal.js +32 -33
  124. package/components/Modal/Modal.js.map +1 -1
  125. package/components/Modal/styles.module.scss +8 -8
  126. package/components/NotificationPanel/NotificationPanel.js +14 -14
  127. package/components/NotificationPanel/NotificationPanel.js.map +1 -1
  128. package/components/NotificationPanel/styles.module.scss +3 -3
  129. package/components/Panel/Panel.js +25 -25
  130. package/components/Panel/Panel.js.map +1 -1
  131. package/components/Panel/styles.module.scss +3 -3
  132. package/components/PanelList/PanelList.js +8 -8
  133. package/components/PanelList/PanelList.js.map +1 -1
  134. package/components/PopMenu/PopMenu.js +14 -14
  135. package/components/PopMenu/PopMenu.js.map +1 -1
  136. package/components/PopMenu/index.js +3 -3
  137. package/components/PopOver/PopOver.js +27 -28
  138. package/components/PopOver/PopOver.js.map +1 -1
  139. package/components/Portal/index.js.map +1 -1
  140. package/components/Progressbar/Progressbar.js +13 -13
  141. package/components/Progressbar/Progressbar.js.map +1 -1
  142. package/components/PromoPanel/PromoPanel.js +16 -16
  143. package/components/PromoPanel/PromoPanel.js.map +1 -1
  144. package/components/RadioButton/RadioButton.js +52 -53
  145. package/components/RadioButton/RadioButton.js.map +1 -1
  146. package/components/RadioButton/index.js +4 -4
  147. package/components/RadioButton/styles.module.scss +2 -2
  148. package/components/Select/Select.js +21 -21
  149. package/components/Select/Select.js.map +1 -1
  150. package/components/Select/index.js +2 -3
  151. package/components/Select/index.js.map +1 -1
  152. package/components/ServiceMessage/ServiceMessage.js +30 -30
  153. package/components/ServiceMessage/ServiceMessage.js.map +1 -1
  154. package/components/ServiceMessage/styles.module.scss +10 -10
  155. package/components/SharingStatus/SharingStatus.js +7 -7
  156. package/components/SharingStatus/SharingStatus.js.map +1 -1
  157. package/components/Slider/Slider.js +15 -17
  158. package/components/Slider/Slider.js.map +1 -1
  159. package/components/Slider/index.js +2 -3
  160. package/components/Slider/index.js.map +1 -1
  161. package/components/Spacer/Spacer.js +4 -4
  162. package/components/Spacer/Spacer.js.map +1 -1
  163. package/components/StatusDot/StatusDot.js +8 -8
  164. package/components/StatusDot/StatusDot.js.map +1 -1
  165. package/components/Step/Step.js +10 -10
  166. package/components/Step/Step.js.map +1 -1
  167. package/components/StepButtons/StepButtons.js +4 -4
  168. package/components/StepButtons/StepButtons.js.map +1 -1
  169. package/components/StepButtons/index.js +2 -3
  170. package/components/StepButtons/index.js.map +1 -1
  171. package/components/Stepper/Dot.js +3 -3
  172. package/components/Stepper/Dot.js.map +1 -1
  173. package/components/Stepper/DotList.js +4 -4
  174. package/components/Stepper/DotList.js.map +1 -1
  175. package/components/Stepper/Stepper.js +10 -10
  176. package/components/Stepper/Stepper.js.map +1 -1
  177. package/components/Table/Table.js +1 -1
  178. package/components/Table/TableBody/TableBody.js +3 -3
  179. package/components/Table/TableBody/TableBody.js.map +1 -1
  180. package/components/Table/TableBody/index.js +3 -4
  181. package/components/Table/TableBody/index.js.map +1 -1
  182. package/components/Table/TableCell/TableCell.js +10 -10
  183. package/components/Table/TableCell/TableCell.js.map +1 -1
  184. package/components/Table/TableCell/index.js +4 -4
  185. package/components/Table/TableExpandedRow/TableExpandedRow.js +8 -8
  186. package/components/Table/TableExpandedRow/TableExpandedRow.js.map +1 -1
  187. package/components/Table/TableExpandedRow/index.js +3 -4
  188. package/components/Table/TableExpandedRow/index.js.map +1 -1
  189. package/components/Table/TableExpanderCell/TableExpanderCell.js +3 -3
  190. package/components/Table/TableExpanderCell/TableExpanderCell.js.map +1 -1
  191. package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +11 -11
  192. package/components/Table/TableExpanderCell/TableExpanderCellMobile.js.map +1 -1
  193. package/components/Table/TableExpanderCell/index.js +3 -4
  194. package/components/Table/TableExpanderCell/index.js.map +1 -1
  195. package/components/Table/TableHead/TableHead.js +9 -9
  196. package/components/Table/TableHead/TableHead.js.map +1 -1
  197. package/components/Table/TableHead/index.js +4 -4
  198. package/components/Table/TableHeadCell/TableHeadCell.js +15 -15
  199. package/components/Table/TableHeadCell/TableHeadCell.js.map +1 -1
  200. package/components/Table/TableHeadCell/index.js +4 -4
  201. package/components/Table/TableRow/TableRow.js +16 -16
  202. package/components/Table/TableRow/TableRow.js.map +1 -1
  203. package/components/Table/TableRow/index.js +3 -4
  204. package/components/Table/TableRow/index.js.map +1 -1
  205. package/components/Table/styles.module.scss +3 -3
  206. package/components/Table/utils.d.ts +1 -1
  207. package/components/Tabs/Tab.js +2 -2
  208. package/components/Tabs/Tab.js.map +1 -1
  209. package/components/Tabs/TabList/TabList.js +43 -38
  210. package/components/Tabs/TabList/TabList.js.map +1 -1
  211. package/components/Tabs/TabList/styles.module.scss +14 -4
  212. package/components/Tabs/TabPanel/TabPanel.d.ts +5 -1
  213. package/components/Tabs/TabPanel/TabPanel.js +13 -9
  214. package/components/Tabs/TabPanel/TabPanel.js.map +1 -1
  215. package/components/Tabs/TabPanel/styles.module.scss +48 -6
  216. package/components/Tabs/TabPanel/styles.module.scss.d.ts +4 -0
  217. package/components/Tabs/Tabs.d.ts +8 -4
  218. package/components/Tabs/Tabs.js +85 -16
  219. package/components/Tabs/Tabs.js.map +1 -1
  220. package/components/Tabs/styles.module.scss +38 -2
  221. package/components/Tabs/styles.module.scss.d.ts +7 -1
  222. package/components/Tag/Tag.js +3 -3
  223. package/components/Tag/Tag.js.map +1 -1
  224. package/components/TagList/TagList.js +1 -1
  225. package/components/TagList/TagList.js.map +1 -1
  226. package/components/Textarea/Textarea.js +48 -49
  227. package/components/Textarea/Textarea.js.map +1 -1
  228. package/components/Tile/Tile.js +14 -15
  229. package/components/Tile/Tile.js.map +1 -1
  230. package/components/Tile/index.js +2 -3
  231. package/components/Tile/index.js.map +1 -1
  232. package/components/Title/Title.js +10 -10
  233. package/components/Title/Title.js.map +1 -1
  234. package/components/Title/index.js +4 -4
  235. package/components/Tooltip/Tooltip.js +4 -4
  236. package/components/Tooltip/Tooltip.js.map +1 -1
  237. package/components/Tooltip/TooltipWord/TooltipWord.js +17 -18
  238. package/components/Tooltip/TooltipWord/TooltipWord.js.map +1 -1
  239. package/components/Tooltip/index.js +5 -5
  240. package/components/TooltipExample/TooltipExample.js +4 -4
  241. package/components/TooltipExample/TooltipExample.js.map +1 -1
  242. package/components/Trigger/HelpSign.js +3 -3
  243. package/components/Trigger/HelpSign.js.map +1 -1
  244. package/components/Trigger/Trigger.js +25 -26
  245. package/components/Trigger/Trigger.js.map +1 -1
  246. package/components/Validation/ErrorList.js +5 -5
  247. package/components/Validation/ErrorList.js.map +1 -1
  248. package/components/Validation/ErrorListItem.js +8 -8
  249. package/components/Validation/ErrorListItem.js.map +1 -1
  250. package/components/Validation/Validation.js +13 -14
  251. package/components/Validation/Validation.js.map +1 -1
  252. package/components/Validation/ValidationSummary.js +4 -4
  253. package/components/Validation/ValidationSummary.js.map +1 -1
  254. package/components/Validation/index.js +3 -4
  255. package/components/Validation/index.js.map +1 -1
  256. package/components/Validation/types.d.ts +0 -1
  257. package/constants.d.ts +2 -1
  258. package/constants.js +1 -1
  259. package/constants.js.map +1 -1
  260. package/hooks/useIcons.d.ts +0 -1
  261. package/hooks/useIcons.js +1 -1
  262. package/hooks/useLayoutEvent.js +1 -2
  263. package/hooks/useLayoutEvent.js.map +1 -1
  264. package/hooks/useSticky.d.ts +1 -1
  265. package/package.json +1 -1
  266. package/scss/_palette.scss +1 -0
  267. package/scss/typography.module.scss +1 -1
  268. package/scss/typography.module.scss.d.ts +1 -1
  269. package/scss/typography.stories.tsx +157 -0
  270. package/theme/currys/color.d.ts +1 -1
  271. package/utils/accessibility.d.ts +2 -1
  272. package/utils/accessibility.js +1 -1
  273. package/utils/accessibility.js.map +1 -1
  274. package/utils/component.d.ts +3 -3
  275. package/utils/refs.d.ts +1 -2
  276. package/_virtual/index2.js +0 -5
  277. package/_virtual/index2.js.map +0 -1
  278. package/_virtual/index3.js +0 -5
  279. package/_virtual/index3.js.map +0 -1
  280. package/components/AnchorLink/AnchorLink.stories.d.ts +0 -31
  281. package/components/Avatar/Avatar.stories.d.ts +0 -36
  282. package/components/Badge/Badge.stories.d.ts +0 -42
  283. package/components/Button/Button.stories.d.ts +0 -56
  284. package/components/Checkbox/Checkbox.stories.d.ts +0 -54
  285. package/components/Close/Close.stories.d.ts +0 -29
  286. package/components/DictionaryTrigger/DictionaryTrigger.stories.d.ts +0 -30
  287. package/components/Dropdown/Dropdown.stories.d.ts +0 -67
  288. package/components/Duolist/Duolist.stories.d.ts +0 -32
  289. package/components/EmptyState/EmptyState.stories.d.ts +0 -26
  290. package/components/Expander/Expander.stories.d.ts +0 -60
  291. package/components/ExpanderHierarchy/ExpanderHierarchy.stories.d.ts +0 -44
  292. package/components/ExpanderList/ExpanderList.stories.d.ts +0 -59
  293. package/components/FormGroup/FormGroup.stories.d.ts +0 -50
  294. package/components/FormLayout/FormLayout.stories.d.ts +0 -32
  295. package/components/HelpBubble/HelpBubble.stories.d.ts +0 -46
  296. package/components/HelpPanel/HelpPanel.stories.d.ts +0 -31
  297. package/components/HelpQuestion/HelpQuestion.stories.d.ts +0 -29
  298. package/components/HighlightBox/HighlightBox.stories.d.ts +0 -42
  299. package/components/Icon/Icon.stories.d.ts +0 -38
  300. package/components/Illustration/Illustration.stories.d.ts +0 -34
  301. package/components/Illustration/Illustrations.stories.d.ts +0 -41
  302. package/components/Input/Input.stories.d.ts +0 -94
  303. package/components/Label/Label.stories.d.ts +0 -25
  304. package/components/LazyIcon/LazyIcon.stories.d.ts +0 -25
  305. package/components/LazyIllustration/LazyIllustration.stories.d.ts +0 -38
  306. package/components/LinkList/LinkList.stories.d.ts +0 -49
  307. package/components/List/List.stories.d.ts +0 -52
  308. package/components/Loader/Loader.stories.d.ts +0 -31
  309. package/components/Logo/Logo.stories.d.ts +0 -37
  310. package/components/Modal/Modal.stories.d.ts +0 -76
  311. package/components/NotificationPanel/NotificationPanel.stories.d.ts +0 -60
  312. package/components/Panel/Panel.stories.d.ts +0 -89
  313. package/components/PanelList/PanelList.stories.d.ts +0 -27
  314. package/components/PopMenu/PopMenu.stories.d.ts +0 -39
  315. package/components/PopOver/PopOver.stories.d.ts +0 -38
  316. package/components/Progressbar/Progressbar.stories.d.ts +0 -43
  317. package/components/PromoPanel/PromoPanel.stories.d.ts +0 -45
  318. package/components/RadioButton/RadioButton.stories.d.ts +0 -57
  319. package/components/Select/Select.stories.d.ts +0 -38
  320. package/components/ServiceMessage/ServiceMessage.stories.d.ts +0 -71
  321. package/components/SharingStatus/SharingStatus.stories.d.ts +0 -31
  322. package/components/Slider/Slider.stories.d.ts +0 -52
  323. package/components/Spacer/Spacer.stories.d.ts +0 -17
  324. package/components/StatusDot/StatusDot.stories.d.ts +0 -31
  325. package/components/Step/Step.stories.d.ts +0 -32
  326. package/components/StepButtons/StepButtons.stories.d.ts +0 -19
  327. package/components/Stepper/Stepper.stories.d.ts +0 -38
  328. package/components/Table/Table.stories.d.ts +0 -90
  329. package/components/Tabs/Tabs.stories.d.ts +0 -50
  330. package/components/Tag/Tag.stories.d.ts +0 -48
  331. package/components/TagList/TagList.stories.d.ts +0 -17
  332. package/components/Textarea/Textarea.stories.d.ts +0 -94
  333. package/components/Tile/Tile.stories.d.ts +0 -65
  334. package/components/Title/Title.stories.d.ts +0 -40
  335. package/components/Tooltip/Tooltip.stories.d.ts +0 -34
  336. package/components/Trigger/Trigger.stories.d.ts +0 -52
  337. package/components/Validation/Validation.stories.d.ts +0 -37
  338. package/hoc/withBreakpoint/withBreakpoint.stories.d.ts +0 -17
  339. package/hooks/useBreakpoint.stories.d.ts +0 -16
  340. package/hooks/useDelayedState.stories.d.ts +0 -27
  341. package/hooks/useElementList.stories.d.ts +0 -16
  342. package/hooks/useFocusToggle.stories.d.ts +0 -16
  343. package/hooks/useFocusTrap.stories.d.ts +0 -16
  344. package/hooks/useFocusableElements.stories.d.ts +0 -16
  345. package/hooks/useHover.stories.d.ts +0 -16
  346. package/hooks/useIntersectionObserver.stories.d.ts +0 -16
  347. package/hooks/useInterval.stories.d.ts +0 -16
  348. package/hooks/useIsVisible.stories.d.ts +0 -27
  349. package/hooks/useKeyboardEvent.stories.d.ts +0 -16
  350. package/hooks/useLayoutEvent.stories.d.ts +0 -16
  351. package/hooks/useOutsideEvent.stories.d.ts +0 -16
  352. package/hooks/usePseudoClasses.stories.d.ts +0 -16
  353. package/hooks/useResizeObserver.stories.d.ts +0 -16
  354. package/hooks/useRovingFocus.stories.d.ts +0 -17
  355. package/hooks/useSize.stories.d.ts +0 -16
  356. package/hooks/useSticky.stories.d.ts +0 -16
  357. package/hooks/useUuid.stories.d.ts +0 -16
@@ -1,23 +1,23 @@
1
- import m from "react";
2
- import n from "classnames";
3
- import p from "../HighlightBox/HighlightBox.js";
1
+ import s from "react";
2
+ import p from "classnames";
3
+ import n from "../HighlightBox/HighlightBox.js";
4
4
  import c from "../Icons/HandWaving.js";
5
5
  import e from "../HelpPanel/styles.module.scss";
6
- const i = ({ className: a, testId: l, size: t, children: o, title: r }) => {
7
- const s = n(e["help-panel"], a);
8
- return /* @__PURE__ */ m.createElement(
9
- p,
6
+ const d = ({ className: a, testId: t, size: l, children: o, title: r }) => {
7
+ const m = p(e["help-panel"], a);
8
+ return /* @__PURE__ */ s.createElement(
9
+ n,
10
10
  {
11
- className: s,
11
+ className: m,
12
12
  contentWrapperClassName: e["help-panel"],
13
- testId: l,
14
- size: t,
13
+ testId: t,
14
+ size: l,
15
15
  svgIcon: c,
16
16
  title: r
17
17
  },
18
18
  o
19
19
  );
20
- }, d = i;
20
+ };
21
21
  export {
22
22
  d as default
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"HelpPanel.js","sources":["../../../src/components/HelpPanel/HelpPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport HighlightBox, { HighlightBoxSize } from '../HighlightBox';\nimport HandWaving from '../Icons/HandWaving';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightBoxSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets title if needed */\n title?: string;\n}\n\nconst HelpPanel: React.FC<HelpPanelProps> = ({ className, testId, size, children, title }) => {\n const helpPanelClassName = classNames(styles['help-panel'], className);\n\n return (\n <HighlightBox\n className={helpPanelClassName}\n contentWrapperClassName={styles['help-panel']}\n testId={testId}\n size={size}\n svgIcon={HandWaving}\n title={title}\n >\n {children}\n </HighlightBox>\n );\n};\n\nexport default HelpPanel;\n"],"names":["HelpPanel","className","testId","size","children","title","helpPanelClassName","classNames","styles","React","HighlightBox","HandWaving","HelpPanel$1"],"mappings":";;;;;AAsBA,MAAMA,IAAsC,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,MAAAC,GAAM,UAAAC,GAAU,OAAAC,QAAY;AAC5F,QAAMC,IAAqBC,EAAWC,EAAO,YAAY,GAAGP,CAAS;AAGnE,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,yBAAyBE,EAAO,YAAY;AAAA,MAC5C,QAAAN;AAAA,MACA,MAAAC;AAAA,MACA,SAASQ;AAAA,MACT,OAAAN;AAAA,IAAA;AAAA,IAECD;AAAA,EAAA;AAGP,GAEAQ,IAAeZ;"}
1
+ {"version":3,"file":"HelpPanel.js","sources":["../../../src/components/HelpPanel/HelpPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport HighlightBox, { HighlightBoxSize } from '../HighlightBox';\nimport HandWaving from '../Icons/HandWaving';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightBoxSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets title if needed */\n title?: string;\n}\n\nconst HelpPanel: React.FC<HelpPanelProps> = ({ className, testId, size, children, title }) => {\n const helpPanelClassName = classNames(styles['help-panel'], className);\n\n return (\n <HighlightBox\n className={helpPanelClassName}\n contentWrapperClassName={styles['help-panel']}\n testId={testId}\n size={size}\n svgIcon={HandWaving}\n title={title}\n >\n {children}\n </HighlightBox>\n );\n};\n\nexport default HelpPanel;\n"],"names":["HelpPanel","className","testId","size","children","title","helpPanelClassName","classNames","styles","React","HighlightBox","HandWaving"],"mappings":";;;;;AAsBM,MAAAA,IAAsC,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,MAAAC,GAAM,UAAAC,GAAU,OAAAC,QAAY;AAC5F,QAAMC,IAAqBC,EAAWC,EAAO,YAAY,GAAGP,CAAS;AAGnE,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,yBAAyBE,EAAO,YAAY;AAAA,MAC5C,QAAAN;AAAA,MACA,MAAAC;AAAA,MACA,SAASQ;AAAA,MACT,OAAAN;AAAA,IAAA;AAAA,IAECD;AAAA,EAAA;AAGP;"}
@@ -1,32 +1,31 @@
1
1
  import t from "react";
2
- import u from "classnames";
3
- import { AnalyticsId as c } from "../../constants.js";
2
+ import f from "classnames";
3
+ import { AnalyticsId as u } from "../../constants.js";
4
4
  import { usePseudoClasses as d } from "../../hooks/usePseudoClasses.js";
5
- import { mergeRefs as y } from "../../utils/refs.js";
6
- import H from "../Trigger/Trigger.js";
5
+ import { mergeRefs as c } from "../../utils/refs.js";
6
+ import y from "../Trigger/Trigger.js";
7
7
  import s from "../HelpQuestion/styles.module.scss";
8
- const a = t.forwardRef(
9
- ({ children: o, selected: e = !1, className: r, onClick: i, testId: m }, l) => {
10
- const { isHovered: n, refObject: p } = d(), f = u(s.helpquestion, e && s["helpquestion--selected"], r);
8
+ const h = t.forwardRef(
9
+ ({ children: a, selected: e = !1, className: r, onClick: o, testId: i }, m) => {
10
+ const { isHovered: l, refObject: p } = d(), n = f(s.helpquestion, e && s["helpquestion--selected"], r);
11
11
  return /* @__PURE__ */ t.createElement(
12
12
  "button",
13
13
  {
14
14
  type: "button",
15
- "data-testid": m,
16
- className: f,
17
- onClick: i,
18
- ref: y([l, p]),
15
+ "data-testid": i,
16
+ className: n,
17
+ onClick: o,
18
+ ref: c([m, p]),
19
19
  "aria-expanded": e,
20
- "data-analyticsid": c.HelpQuestion
20
+ "data-analyticsid": u.HelpQuestion
21
21
  },
22
- /* @__PURE__ */ t.createElement(H, { variant: "help", htmlMarkup: "span", selected: e, isHovered: n }),
23
- o
22
+ /* @__PURE__ */ t.createElement(y, { variant: "help", htmlMarkup: "span", selected: e, isHovered: l }),
23
+ a
24
24
  );
25
25
  }
26
26
  );
27
- a.displayName = "HelpQuestion";
28
- const v = a;
27
+ h.displayName = "HelpQuestion";
29
28
  export {
30
- v as default
29
+ h as default
31
30
  };
32
31
  //# sourceMappingURL=HelpQuestion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HelpQuestion.js","sources":["../../../src/components/HelpQuestion/HelpQuestion.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../utils/refs';\nimport Trigger from '../Trigger';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpQuestionProps extends Pick<React.InputHTMLAttributes<HTMLButtonElement>, 'onClick' | 'aria-controls'> {\n /**\n * Help question contents\n */\n children: string;\n /**\n * Indicates that the help question is in use.\n */\n selected?: boolean;\n /**\n * Classname will be applied to the button element.\n */\n className?: string;\n /**\n * Sets the data-testid attribute.\n */\n testId?: string;\n}\n\nconst HelpQuestion = React.forwardRef<HTMLButtonElement, HelpQuestionProps>(\n ({ children, selected = false, className, onClick, testId }, ref) => {\n const { isHovered, refObject } = usePseudoClasses<HTMLButtonElement>();\n\n const classes = classNames(styles.helpquestion, selected && styles['helpquestion--selected'], className);\n\n return (\n <button\n type=\"button\"\n data-testid={testId}\n className={classes}\n onClick={onClick}\n ref={mergeRefs([ref, refObject])}\n aria-expanded={selected}\n data-analyticsid={AnalyticsId.HelpQuestion}\n >\n <Trigger variant=\"help\" htmlMarkup=\"span\" selected={selected} isHovered={isHovered} />\n {children}\n </button>\n );\n }\n);\n\nHelpQuestion.displayName = 'HelpQuestion';\n\nexport default HelpQuestion;\n"],"names":["HelpQuestion","React","children","selected","className","onClick","testId","ref","isHovered","refObject","usePseudoClasses","classes","classNames","styles","mergeRefs","AnalyticsId","Trigger","HelpQuestion$1"],"mappings":";;;;;;;AA8BA,MAAMA,IAAeC,EAAM;AAAA,EACzB,CAAC,EAAE,UAAAC,GAAU,UAAAC,IAAW,IAAO,WAAAC,GAAW,SAAAC,GAAS,QAAAC,EAAO,GAAGC,MAAQ;AACnE,UAAM,EAAE,WAAAC,GAAW,WAAAC,EAAU,IAAIC,EAAoC,GAE/DC,IAAUC,EAAWC,EAAO,cAAcV,KAAYU,EAAO,wBAAwB,GAAGT,CAAS;AAGrG,WAAAH,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAaK;AAAA,QACb,WAAWK;AAAA,QACX,SAAAN;AAAA,QACA,KAAKS,EAAU,CAACP,GAAKE,CAAS,CAAC;AAAA,QAC/B,iBAAeN;AAAA,QACf,oBAAkBY,EAAY;AAAA,MAAA;AAAA,sCAE7BC,GAAQ,EAAA,SAAQ,QAAO,YAAW,QAAO,UAAAb,GAAoB,WAAAK,GAAsB;AAAA,MACnFN;AAAA,IAAA;AAAA,EAGP;AACF;AAEAF,EAAa,cAAc;AAE3B,MAAAiB,IAAejB;"}
1
+ {"version":3,"file":"HelpQuestion.js","sources":["../../../src/components/HelpQuestion/HelpQuestion.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { mergeRefs } from '../../utils/refs';\nimport Trigger from '../Trigger';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpQuestionProps extends Pick<React.InputHTMLAttributes<HTMLButtonElement>, 'onClick' | 'aria-controls'> {\n /**\n * Help question contents\n */\n children: string;\n /**\n * Indicates that the help question is in use.\n */\n selected?: boolean;\n /**\n * Classname will be applied to the button element.\n */\n className?: string;\n /**\n * Sets the data-testid attribute.\n */\n testId?: string;\n}\n\nconst HelpQuestion = React.forwardRef<HTMLButtonElement, HelpQuestionProps>(\n ({ children, selected = false, className, onClick, testId }, ref) => {\n const { isHovered, refObject } = usePseudoClasses<HTMLButtonElement>();\n\n const classes = classNames(styles.helpquestion, selected && styles['helpquestion--selected'], className);\n\n return (\n <button\n type=\"button\"\n data-testid={testId}\n className={classes}\n onClick={onClick}\n ref={mergeRefs([ref, refObject])}\n aria-expanded={selected}\n data-analyticsid={AnalyticsId.HelpQuestion}\n >\n <Trigger variant=\"help\" htmlMarkup=\"span\" selected={selected} isHovered={isHovered} />\n {children}\n </button>\n );\n }\n);\n\nHelpQuestion.displayName = 'HelpQuestion';\n\nexport default HelpQuestion;\n"],"names":["HelpQuestion","React","children","selected","className","onClick","testId","ref","isHovered","refObject","usePseudoClasses","classes","classNames","styles","mergeRefs","AnalyticsId","Trigger"],"mappings":";;;;;;;AA8BA,MAAMA,IAAeC,EAAM;AAAA,EACzB,CAAC,EAAE,UAAAC,GAAU,UAAAC,IAAW,IAAO,WAAAC,GAAW,SAAAC,GAAS,QAAAC,EAAO,GAAGC,MAAQ;AACnE,UAAM,EAAE,WAAAC,GAAW,WAAAC,EAAU,IAAIC,EAAoC,GAE/DC,IAAUC,EAAWC,EAAO,cAAcV,KAAYU,EAAO,wBAAwB,GAAGT,CAAS;AAGrG,WAAAH,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAaK;AAAA,QACb,WAAWK;AAAA,QACX,SAAAN;AAAA,QACA,KAAKS,EAAU,CAACP,GAAKE,CAAS,CAAC;AAAA,QAC/B,iBAAeN;AAAA,QACf,oBAAkBY,EAAY;AAAA,MAAA;AAAA,sCAE7BC,GAAQ,EAAA,SAAQ,QAAO,YAAW,QAAO,UAAAb,GAAoB,WAAAK,GAAsB;AAAA,MACnFN;AAAA,IAAA;AAAA,EAGP;AACF;AAEAF,EAAa,cAAc;"}
@@ -4,26 +4,26 @@ import "../../theme/grid.js";
4
4
  import { useBreakpoint as w, Breakpoint as y } from "../../hooks/useBreakpoint.js";
5
5
  import { AnalyticsId as p, IconSize as N } from "../../constants.js";
6
6
  import { Icon as C } from "../Icon/Icon.js";
7
- import B from "../LazyIcon/LazyIcon.js";
8
- import W from "../Title/Title.js";
7
+ import { LazyIcon as W } from "../LazyIcon/LazyIcon.js";
8
+ import { Title as z } from "../Title/Title.js";
9
9
  import t from "../HighlightBox/styles.module.scss";
10
- var z = /* @__PURE__ */ ((i) => (i.medium = "medium", i.large = "large", i.fluid = "fluid", i))(z || {});
10
+ var B = /* @__PURE__ */ ((i) => (i.medium = "medium", i.large = "large", i.fluid = "fluid", i))(B || {});
11
11
  const u = ({ className: i, size: r, children: s }) => /* @__PURE__ */ e.createElement("div", { className: i, "data-testid": "highlightbox-wrapper" }, /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__row }, /* @__PURE__ */ e.createElement("div", { className: l(t.highlightbox__col, r === "medium" && t["highlightbox__col--offset"]) }, s))), x = (i) => {
12
12
  const { children: r, className: s } = i, a = l(t["highlightbox__content-wrapper"], s);
13
13
  return /* @__PURE__ */ e.createElement("div", { className: a }, /* @__PURE__ */ e.createElement("div", { className: l(t.highlightbox__row) }, r));
14
- }, H = (i) => {
14
+ }, j = (i) => {
15
15
  const {
16
16
  children: r,
17
17
  color: s = "white",
18
18
  size: a = "medium",
19
- testId: o,
19
+ testId: c,
20
20
  svgIcon: n,
21
21
  htmlMarkup: b = "div",
22
22
  className: v,
23
23
  contentWrapperClassName: I,
24
24
  title: d,
25
25
  titleHtmlMarkup: k = "h2"
26
- } = i, _ = w(), c = l(
26
+ } = i, _ = w(), o = l(
27
27
  t[`highlightbox--${s}`],
28
28
  t[`highlightbox--${a}`],
29
29
  n && t["highlightbox--has-icon"],
@@ -31,31 +31,31 @@ const u = ({ className: i, size: r, children: s }) => /* @__PURE__ */ e.createEl
31
31
  v
32
32
  ), m = () => {
33
33
  if (n) {
34
- const f = a === "large" && _ && _ >= y.md ? N.Medium : N.Small, E = /* @__PURE__ */ e.createElement(W, { testId: "titleId", htmlMarkup: k, appearance: "title4" }, d);
35
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__icon }, typeof n == "string" ? /* @__PURE__ */ e.createElement(B, { iconName: n, size: f }) : /* @__PURE__ */ e.createElement(C, { svgIcon: n, size: f }), d && /* @__PURE__ */ e.createElement("div", { className: t.mobile }, E)), /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__content }, d && /* @__PURE__ */ e.createElement("div", { className: t.desktop, "aria-hidden": "true" }, E), r));
34
+ const f = a === "large" && _ && _ >= y.md ? N.Medium : N.Small, E = /* @__PURE__ */ e.createElement(z, { testId: "titleId", htmlMarkup: k, appearance: "title4" }, d);
35
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__icon }, typeof n == "string" ? /* @__PURE__ */ e.createElement(W, { iconName: n, size: f }) : /* @__PURE__ */ e.createElement(C, { svgIcon: n, size: f }), d && /* @__PURE__ */ e.createElement("div", { className: t.mobile }, E)), /* @__PURE__ */ e.createElement("div", { className: t.highlightbox__content }, d && /* @__PURE__ */ e.createElement("div", { className: t.desktop, "aria-hidden": "true" }, E), r));
36
36
  }
37
37
  return r;
38
38
  }, h = b, g = l(t["highlightbox__content-wrapper"], I);
39
- return a === "medium" ? /* @__PURE__ */ e.createElement(u, { className: c, size: a }, /* @__PURE__ */ e.createElement(h, { className: g, "data-testid": o, "data-analyticsid": p.HighlightBox }, m())) : a === "large" && n ? /* @__PURE__ */ e.createElement(u, { className: c, size: a }, /* @__PURE__ */ e.createElement(x, { className: g }, /* @__PURE__ */ e.createElement(
39
+ return a === "medium" ? /* @__PURE__ */ e.createElement(u, { className: o, size: a }, /* @__PURE__ */ e.createElement(h, { className: g, "data-testid": c, "data-analyticsid": p.HighlightBox }, m())) : a === "large" && n ? /* @__PURE__ */ e.createElement(u, { className: o, size: a }, /* @__PURE__ */ e.createElement(x, { className: g }, /* @__PURE__ */ e.createElement(
40
40
  h,
41
41
  {
42
42
  className: l(t.highlightbox__col, t["highlightbox__col--large-with-icon"]),
43
- "data-testid": o,
43
+ "data-testid": c,
44
44
  "data-analyticsid": p.HighlightBox
45
45
  },
46
46
  m()
47
- ))) : a === "large" ? /* @__PURE__ */ e.createElement(u, { className: c, size: a }, /* @__PURE__ */ e.createElement(x, { className: g }, /* @__PURE__ */ e.createElement(
47
+ ))) : a === "large" ? /* @__PURE__ */ e.createElement(u, { className: o, size: a }, /* @__PURE__ */ e.createElement(x, { className: g }, /* @__PURE__ */ e.createElement(
48
48
  h,
49
49
  {
50
50
  className: l(t.highlightbox__col, t["highlightbox__col--offset"]),
51
- "data-testid": o,
51
+ "data-testid": c,
52
52
  "data-analyticsid": p.HighlightBox
53
53
  },
54
54
  m()
55
- ))) : a === "fluid" ? /* @__PURE__ */ e.createElement(h, { className: c, "data-testid": o }, m()) : null;
56
- }, q = H;
55
+ ))) : a === "fluid" ? /* @__PURE__ */ e.createElement(h, { className: o, "data-testid": c }, m()) : null;
56
+ };
57
57
  export {
58
- z as HighlightBoxSize,
59
- q as default
58
+ B as HighlightBoxSize,
59
+ j as default
60
60
  };
61
61
  //# sourceMappingURL=HighlightBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HighlightBox.js","sources":["../../../src/components/HighlightBox/HighlightBox.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightBoxColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport enum HighlightBoxSize {\n medium = 'medium',\n large = 'large',\n fluid = 'fluid',\n}\n\nexport type HighlightBoxTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport interface HighlightBoxProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightBoxColors;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightBoxSize;\n /** Adds an icon to the highlightbox. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightBoxTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the content-wrapper */\n contentWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\ninterface WrapperProps {\n className: string;\n size?: keyof typeof HighlightBoxSize;\n}\n\nconst Wrapper: React.FC<WrapperProps> = ({ className, size, children }) => (\n <div className={className} data-testid={'highlightbox-wrapper'}>\n <div className={styles.highlightbox__row}>\n <div className={classNames(styles.highlightbox__col, size === HighlightBoxSize.medium && styles['highlightbox__col--offset'])}>\n {children}\n </div>\n </div>\n </div>\n);\n\ninterface ContentWrapperProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst ContentWrapper: React.FC<ContentWrapperProps> = props => {\n const { children, className } = props;\n const contentWrapperClasses = classNames(styles['highlightbox__content-wrapper'], className);\n\n return (\n <div className={contentWrapperClasses}>\n <div className={classNames(styles.highlightbox__row)}>{children}</div>\n </div>\n );\n};\n\nconst HighlightBox: React.FC<HighlightBoxProps> = props => {\n const {\n children,\n color = 'white',\n size = HighlightBoxSize.medium,\n testId,\n svgIcon,\n htmlMarkup = 'div',\n className,\n contentWrapperClassName,\n title,\n titleHtmlMarkup = 'h2',\n } = props;\n const breakpoint = useBreakpoint();\n\n const containerClassName = classNames(\n styles[`highlightbox--${color}`],\n styles[`highlightbox--${size}`],\n svgIcon && styles['highlightbox--has-icon'],\n { container: size === 'medium' || size === 'large' },\n className\n );\n\n const renderContent = () => {\n if (svgIcon) {\n const iconSize = size === HighlightBoxSize.large && breakpoint && breakpoint >= Breakpoint.md ? IconSize.Medium : IconSize.Small;\n\n const titleElement = (\n <Title testId=\"titleId\" htmlMarkup={titleHtmlMarkup} appearance=\"title4\">\n {title}\n </Title>\n );\n\n return (\n <>\n <div className={styles.highlightbox__icon}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n {title && <div className={styles['mobile']}>{titleElement}</div>}\n </div>\n <div className={styles.highlightbox__content}>\n {title && (\n <div className={styles['desktop']} aria-hidden=\"true\">\n {titleElement}\n </div>\n )}\n {children}\n </div>\n </>\n );\n }\n\n return children;\n };\n\n const CustomTag = htmlMarkup;\n\n const contentWrapperClasses = classNames(styles['highlightbox__content-wrapper'], contentWrapperClassName);\n\n if (size === HighlightBoxSize.medium) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <CustomTag className={contentWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.HighlightBox}>\n {renderContent()}\n </CustomTag>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.large && svgIcon) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightbox__col, styles['highlightbox__col--large-with-icon'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightBox}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.large) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightbox__col, styles['highlightbox__col--offset'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightBox}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.fluid) {\n return (\n <CustomTag className={containerClassName} data-testid={testId}>\n {renderContent()}\n </CustomTag>\n );\n }\n\n return null;\n};\n\nexport default HighlightBox;\n"],"names":["HighlightBoxSize","Wrapper","className","size","children","React","styles","classNames","ContentWrapper","props","contentWrapperClasses","HighlightBox","color","testId","svgIcon","htmlMarkup","contentWrapperClassName","title","titleHtmlMarkup","breakpoint","useBreakpoint","containerClassName","renderContent","iconSize","Breakpoint","IconSize","titleElement","Title","LazyIcon","Icon","CustomTag","AnalyticsId","HighlightBox$1"],"mappings":";;;;;;;;;AAgBY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;AAuCZ,MAAMC,IAAkC,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,UAAAC,EAC1D,MAAAC,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAAH,GAAsB,eAAa,uBAAA,mCACrC,OAAI,EAAA,WAAWI,EAAO,kBAAA,GACpBD,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWE,EAAWD,EAAO,mBAAmBH,MAAS,YAA2BG,EAAO,2BAA2B,CAAC,KACzHF,CACH,CACF,CACF,GAQII,IAAgD,CAASC,MAAA;AACvD,QAAA,EAAE,UAAAL,GAAU,WAAAF,EAAc,IAAAO,GAC1BC,IAAwBH,EAAWD,EAAO,+BAA+B,GAAGJ,CAAS;AAE3F,SACGG,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWK,EAAA,GACbL,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWE,EAAWD,EAAO,iBAAiB,EAAI,GAAAF,CAAS,CAClE;AAEJ,GAEMO,IAA4C,CAASF,MAAA;AACnD,QAAA;AAAA,IACJ,UAAAL;AAAA,IACA,OAAAQ,IAAQ;AAAA,IACR,MAAAT,IAAO;AAAA,IACP,QAAAU;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,WAAAb;AAAA,IACA,yBAAAc;AAAA,IACA,OAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,EAChB,IAAAT,GACEU,IAAaC,KAEbC,IAAqBd;AAAA,IACzBD,EAAO,iBAAiBM,CAAK,EAAE;AAAA,IAC/BN,EAAO,iBAAiBH,CAAI,EAAE;AAAA,IAC9BW,KAAWR,EAAO,wBAAwB;AAAA,IAC1C,EAAE,WAAWH,MAAS,YAAYA,MAAS,QAAQ;AAAA,IACnDD;AAAA,EAAA,GAGIoB,IAAgB,MAAM;AAC1B,QAAIR,GAAS;AACL,YAAAS,IAAWpB,MAAS,WAA0BgB,KAAcA,KAAcK,EAAW,KAAKC,EAAS,SAASA,EAAS,OAErHC,oCACHC,GAAM,EAAA,QAAO,WAAU,YAAYT,GAAiB,YAAW,SAAA,GAC7DD,CACH;AAIA,aAAAZ,gBAAAA,EAAA,cAAAA,EAAA,UAAA,sCACG,OAAI,EAAA,WAAWC,EAAO,mBACpB,GAAA,OAAOQ,KAAY,WAAYT,gBAAAA,EAAA,cAAAuB,GAAA,EAAS,UAAUd,GAAS,MAAMS,EAAU,CAAA,IAAKlB,gBAAAA,EAAA,cAACwB,KAAK,SAAAf,GAAkB,MAAMS,EAAU,CAAA,GACxHN,KAASZ,gBAAAA,EAAA,cAAC,SAAI,WAAWC,EAAO,OAAY,GAAAoB,CAAa,CAC5D,GACArB,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWC,EAAO,sBAAA,GACpBW,KACEZ,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWC,EAAO,SAAY,eAAY,OAC5C,GAAAoB,CACH,GAEDtB,CACH,CACF;AAAA,IAEJ;AAEO,WAAAA;AAAA,EAAA,GAGH0B,IAAYf,GAEZL,IAAwBH,EAAWD,EAAO,+BAA+B,GAAGU,CAAuB;AAEzG,SAAIb,MAAS,2CAERF,GAAQ,EAAA,WAAWoB,GAAoB,MAAAlB,EAAA,mCACrC2B,GAAU,EAAA,WAAWpB,GAAuB,eAAaG,GAAQ,oBAAkBkB,EAAY,aAC7F,GAAAT,EACH,CAAA,CACF,IAIAnB,MAAS,WAA0BW,IAEnCT,gBAAAA,EAAA,cAACJ,KAAQ,WAAWoB,GAAoB,MAAAlB,KACrCE,gBAAAA,EAAA,cAAAG,GAAA,EAAe,WAAWE,EACzB,GAAAL,gBAAAA,EAAA;AAAA,IAACyB;AAAA,IAAA;AAAA,MACC,WAAWvB,EAAWD,EAAO,mBAAmBA,EAAO,oCAAoC,CAAC;AAAA,MAC5F,eAAaO;AAAA,MACb,oBAAkBkB,EAAY;AAAA,IAAA;AAAA,IAE7BT,EAAc;AAAA,EAEnB,CAAA,CACF,IAIAnB,MAAS,UAETE,gBAAAA,EAAA,cAACJ,KAAQ,WAAWoB,GAAoB,MAAAlB,KACrCE,gBAAAA,EAAA,cAAAG,GAAA,EAAe,WAAWE,EACzB,GAAAL,gBAAAA,EAAA;AAAA,IAACyB;AAAA,IAAA;AAAA,MACC,WAAWvB,EAAWD,EAAO,mBAAmBA,EAAO,2BAA2B,CAAC;AAAA,MACnF,eAAaO;AAAA,MACb,oBAAkBkB,EAAY;AAAA,IAAA;AAAA,IAE7BT,EAAc;AAAA,EAEnB,CAAA,CACF,IAIAnB,MAAS,0CAER2B,GAAU,EAAA,WAAWT,GAAoB,eAAaR,EAAA,GACpDS,GACH,IAIG;AACT,GAEAU,IAAerB;"}
1
+ {"version":3,"file":"HighlightBox.js","sources":["../../../src/components/HighlightBox/HighlightBox.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightBoxColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport enum HighlightBoxSize {\n medium = 'medium',\n large = 'large',\n fluid = 'fluid',\n}\n\nexport type HighlightBoxTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport interface HighlightBoxProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightBoxColors;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightBoxSize;\n /** Adds an icon to the highlightbox. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightBoxTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the content-wrapper */\n contentWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\ninterface WrapperProps {\n className: string;\n size?: keyof typeof HighlightBoxSize;\n}\n\nconst Wrapper: React.FC<WrapperProps> = ({ className, size, children }) => (\n <div className={className} data-testid={'highlightbox-wrapper'}>\n <div className={styles.highlightbox__row}>\n <div className={classNames(styles.highlightbox__col, size === HighlightBoxSize.medium && styles['highlightbox__col--offset'])}>\n {children}\n </div>\n </div>\n </div>\n);\n\ninterface ContentWrapperProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst ContentWrapper: React.FC<ContentWrapperProps> = props => {\n const { children, className } = props;\n const contentWrapperClasses = classNames(styles['highlightbox__content-wrapper'], className);\n\n return (\n <div className={contentWrapperClasses}>\n <div className={classNames(styles.highlightbox__row)}>{children}</div>\n </div>\n );\n};\n\nconst HighlightBox: React.FC<HighlightBoxProps> = props => {\n const {\n children,\n color = 'white',\n size = HighlightBoxSize.medium,\n testId,\n svgIcon,\n htmlMarkup = 'div',\n className,\n contentWrapperClassName,\n title,\n titleHtmlMarkup = 'h2',\n } = props;\n const breakpoint = useBreakpoint();\n\n const containerClassName = classNames(\n styles[`highlightbox--${color}`],\n styles[`highlightbox--${size}`],\n svgIcon && styles['highlightbox--has-icon'],\n { container: size === 'medium' || size === 'large' },\n className\n );\n\n const renderContent = () => {\n if (svgIcon) {\n const iconSize = size === HighlightBoxSize.large && breakpoint && breakpoint >= Breakpoint.md ? IconSize.Medium : IconSize.Small;\n\n const titleElement = (\n <Title testId=\"titleId\" htmlMarkup={titleHtmlMarkup} appearance=\"title4\">\n {title}\n </Title>\n );\n\n return (\n <>\n <div className={styles.highlightbox__icon}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n {title && <div className={styles['mobile']}>{titleElement}</div>}\n </div>\n <div className={styles.highlightbox__content}>\n {title && (\n <div className={styles['desktop']} aria-hidden=\"true\">\n {titleElement}\n </div>\n )}\n {children}\n </div>\n </>\n );\n }\n\n return children;\n };\n\n const CustomTag = htmlMarkup;\n\n const contentWrapperClasses = classNames(styles['highlightbox__content-wrapper'], contentWrapperClassName);\n\n if (size === HighlightBoxSize.medium) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <CustomTag className={contentWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.HighlightBox}>\n {renderContent()}\n </CustomTag>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.large && svgIcon) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightbox__col, styles['highlightbox__col--large-with-icon'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightBox}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.large) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightbox__col, styles['highlightbox__col--offset'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightBox}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightBoxSize.fluid) {\n return (\n <CustomTag className={containerClassName} data-testid={testId}>\n {renderContent()}\n </CustomTag>\n );\n }\n\n return null;\n};\n\nexport default HighlightBox;\n"],"names":["HighlightBoxSize","Wrapper","className","size","children","React","styles","classNames","ContentWrapper","props","contentWrapperClasses","HighlightBox","color","testId","svgIcon","htmlMarkup","contentWrapperClassName","title","titleHtmlMarkup","breakpoint","useBreakpoint","containerClassName","renderContent","iconSize","Breakpoint","IconSize","titleElement","Title","LazyIcon","Icon","CustomTag","AnalyticsId"],"mappings":"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"}
@@ -77,10 +77,10 @@
77
77
 
78
78
  &--medium {
79
79
  #{$box}__content-wrapper {
80
- padding: getSpacer(m) getSpacer(s) getSpacer(l) getSpacer(s);
80
+ padding: getSpacer(m) getSpacer(s) getSpacer(l);
81
81
 
82
82
  @media (min-width: map.get($grid-breakpoints, md)) {
83
- padding: getSpacer(m) getSpacer(m) getSpacer(l) getSpacer(m);
83
+ padding: getSpacer(m) getSpacer(m) getSpacer(l);
84
84
  }
85
85
 
86
86
  @media (min-width: map.get($grid-breakpoints, lg)) {
@@ -91,10 +91,10 @@
91
91
 
92
92
  // fluid skal ha bakgrunnsfarge på den ytre containeren
93
93
  &--fluid {
94
- padding: getSpacer(m) getSpacer(s) getSpacer(l) getSpacer(s);
94
+ padding: getSpacer(m) getSpacer(s) getSpacer(l);
95
95
 
96
96
  @media (min-width: map.get($grid-breakpoints, lg)) {
97
- padding: getSpacer(m) getSpacer(m) getSpacer(l) getSpacer(m);
97
+ padding: getSpacer(m) getSpacer(m) getSpacer(l);
98
98
  }
99
99
 
100
100
  @each $color in $colors {
@@ -3,7 +3,7 @@ import i from "classnames";
3
3
  import { useIsVisible as c } from "../../hooks/useIsVisible.js";
4
4
  import { useSize as g } from "../../hooks/useSize.js";
5
5
  import o from "../HorizontalScroll/styles.module.scss";
6
- const d = "3px", p = ({ children: m, childWidth: _, testId: f, ...l }) => {
6
+ const d = "3px", O = ({ children: m, childWidth: _, testId: f, ...l }) => {
7
7
  const t = e(null), a = e(null), s = e(null), h = c(a, 1, { root: t == null ? void 0 : t.current, rootMargin: d }, !0), u = c(s, 1, { root: t == null ? void 0 : t.current, rootMargin: d }, !0), { width: v = 0 } = g(t) || {}, z = _ > v, b = i(o.horizontalscroll__viewport, z && o["horizontalscroll__viewport--overflow"]), n = l["aria-label"] || l["aria-labelledby"];
8
8
  return /* @__PURE__ */ r.createElement("div", { className: o.horizontalscroll, "data-testid": f }, /* @__PURE__ */ r.createElement(
9
9
  "div",
@@ -38,9 +38,9 @@ const d = "3px", p = ({ children: m, childWidth: _, testId: f, ...l }) => {
38
38
  m,
39
39
  /* @__PURE__ */ r.createElement("div", { ref: s })
40
40
  ));
41
- }, S = p;
41
+ };
42
42
  export {
43
- p as HorizontalScroll,
44
- S as default
43
+ O as HorizontalScroll,
44
+ O as default
45
45
  };
46
46
  //# sourceMappingURL=HorizontalScroll.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalScroll.js","sources":["../../../src/components/HorizontalScroll/HorizontalScroll.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useSize } from '../../hooks/useSize';\nimport { AriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\n// Scrolle-indikator vises/skjules når det er x px igjen til venstre eller høyre side\nconst ROOT_MARGIN_OFFSET = '3px';\n\ninterface HorizontalScrollProps {\n /**\n * Bredden på elementet som potensielt vil scrolle horisontalt i px\n */\n childWidth: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const HorizontalScroll: React.FC<HorizontalScrollProps & AriaLabelAttributes> = ({ children, childWidth, testId, ...rest }) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const leftRef = useRef<HTMLDivElement>(null);\n const rightRef = useRef<HTMLDivElement>(null);\n const leftIsVisible = useIsVisible(leftRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const rightIsVisible = useIsVisible(rightRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const { width: viewPortWidth = 0 } = useSize(viewportRef) || {};\n\n const isOverflowing = childWidth > viewPortWidth;\n const viewportClasses = classNames(styles.horizontalscroll__viewport, isOverflowing && styles['horizontalscroll__viewport--overflow']);\n const hasAriaAttributes = rest['aria-label'] || rest['aria-labelledby'];\n\n return (\n <div className={styles.horizontalscroll} data-testid={testId}>\n {/* viewport-diven må ta tabIndex for å løse et annet UU-problem, at div med overflow: scroll må kunne navigeres med keyboard. */}\n {/* Enten aria-label eller aria-labelledbyid må settes */}\n <div\n className={viewportClasses}\n ref={viewportRef}\n tabIndex={hasAriaAttributes ? 0 : undefined}\n role={hasAriaAttributes ? 'region' : undefined}\n {...rest}\n >\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--left'],\n !leftIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--right'],\n !rightIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div ref={leftRef} />\n {children}\n <div ref={rightRef} />\n </div>\n </div>\n );\n};\n\nexport default HorizontalScroll;\n"],"names":["ROOT_MARGIN_OFFSET","HorizontalScroll","children","childWidth","testId","rest","viewportRef","useRef","leftRef","rightRef","leftIsVisible","useIsVisible","rightIsVisible","viewPortWidth","useSize","isOverflowing","viewportClasses","classNames","styles","hasAriaAttributes","React","HorizontalScroll$1"],"mappings":";;;;;AAWA,MAAMA,IAAqB,OAWdC,IAA0E,CAAC,EAAE,UAAAC,GAAU,YAAAC,GAAY,QAAAC,GAAQ,GAAGC,QAAW;AAC9H,QAAAC,IAAcC,EAAuB,IAAI,GACzCC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAuB,IAAI,GACtCG,IAAgBC,EAAaH,GAAS,GAAG,EAAE,MAAMF,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC7GY,IAAiBD,EAAaF,GAAU,GAAG,EAAE,MAAMH,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC/G,EAAE,OAAOa,IAAgB,MAAMC,EAAQR,CAAW,KAAK,IAEvDS,IAAgBZ,IAAaU,GAC7BG,IAAkBC,EAAWC,EAAO,4BAA4BH,KAAiBG,EAAO,sCAAsC,CAAC,GAC/HC,IAAoBd,EAAK,YAAY,KAAKA,EAAK,iBAAiB;AAEtE,yCACG,OAAI,EAAA,WAAWa,EAAO,kBAAkB,eAAad,EAGpD,GAAAgB,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,KAAKV;AAAA,MACL,UAAUa,IAAoB,IAAI;AAAA,MAClC,MAAMA,IAAoB,WAAW;AAAA,MACpC,GAAGd;AAAA,IAAA;AAAA,IAEJe,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,mCAAmC;AAAA,UAC1C,CAACR,KAAiBQ,EAAO,sCAAsC;AAAA,QACjE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,oCAAoC;AAAA,UAC3C,CAACN,KAAkBM,EAAO,sCAAsC;AAAA,QAClE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKZ,EAAS,CAAA;AAAA,IAClBN;AAAA,IACDkB,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKX,EAAU,CAAA;AAAA,EAAA,CAExB;AAEJ,GAEAY,IAAepB;"}
1
+ {"version":3,"file":"HorizontalScroll.js","sources":["../../../src/components/HorizontalScroll/HorizontalScroll.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useSize } from '../../hooks/useSize';\nimport { AriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\n// Scrolle-indikator vises/skjules når det er x px igjen til venstre eller høyre side\nconst ROOT_MARGIN_OFFSET = '3px';\n\ninterface HorizontalScrollProps {\n /**\n * Bredden på elementet som potensielt vil scrolle horisontalt i px\n */\n childWidth: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const HorizontalScroll: React.FC<HorizontalScrollProps & AriaLabelAttributes> = ({ children, childWidth, testId, ...rest }) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const leftRef = useRef<HTMLDivElement>(null);\n const rightRef = useRef<HTMLDivElement>(null);\n const leftIsVisible = useIsVisible(leftRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const rightIsVisible = useIsVisible(rightRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const { width: viewPortWidth = 0 } = useSize(viewportRef) || {};\n\n const isOverflowing = childWidth > viewPortWidth;\n const viewportClasses = classNames(styles.horizontalscroll__viewport, isOverflowing && styles['horizontalscroll__viewport--overflow']);\n const hasAriaAttributes = rest['aria-label'] || rest['aria-labelledby'];\n\n return (\n <div className={styles.horizontalscroll} data-testid={testId}>\n {/* viewport-diven må ta tabIndex for å løse et annet UU-problem, at div med overflow: scroll må kunne navigeres med keyboard. */}\n {/* Enten aria-label eller aria-labelledbyid må settes */}\n <div\n className={viewportClasses}\n ref={viewportRef}\n tabIndex={hasAriaAttributes ? 0 : undefined}\n role={hasAriaAttributes ? 'region' : undefined}\n {...rest}\n >\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--left'],\n !leftIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--right'],\n !rightIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div ref={leftRef} />\n {children}\n <div ref={rightRef} />\n </div>\n </div>\n );\n};\n\nexport default HorizontalScroll;\n"],"names":["ROOT_MARGIN_OFFSET","HorizontalScroll","children","childWidth","testId","rest","viewportRef","useRef","leftRef","rightRef","leftIsVisible","useIsVisible","rightIsVisible","viewPortWidth","useSize","isOverflowing","viewportClasses","classNames","styles","hasAriaAttributes","React"],"mappings":";;;;;AAWA,MAAMA,IAAqB,OAWdC,IAA0E,CAAC,EAAE,UAAAC,GAAU,YAAAC,GAAY,QAAAC,GAAQ,GAAGC,QAAW;AAC9H,QAAAC,IAAcC,EAAuB,IAAI,GACzCC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAuB,IAAI,GACtCG,IAAgBC,EAAaH,GAAS,GAAG,EAAE,MAAMF,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC7GY,IAAiBD,EAAaF,GAAU,GAAG,EAAE,MAAMH,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC/G,EAAE,OAAOa,IAAgB,MAAMC,EAAQR,CAAW,KAAK,IAEvDS,IAAgBZ,IAAaU,GAC7BG,IAAkBC,EAAWC,EAAO,4BAA4BH,KAAiBG,EAAO,sCAAsC,CAAC,GAC/HC,IAAoBd,EAAK,YAAY,KAAKA,EAAK,iBAAiB;AAEtE,yCACG,OAAI,EAAA,WAAWa,EAAO,kBAAkB,eAAad,EAGpD,GAAAgB,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,KAAKV;AAAA,MACL,UAAUa,IAAoB,IAAI;AAAA,MAClC,MAAMA,IAAoB,WAAW;AAAA,MACpC,GAAGd;AAAA,IAAA;AAAA,IAEJe,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,mCAAmC;AAAA,UAC1C,CAACR,KAAiBQ,EAAO,sCAAsC;AAAA,QACjE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWH;AAAA,UACTC,EAAO;AAAA,UACPA,EAAO,oCAAoC;AAAA,UAC3C,CAACN,KAAkBM,EAAO,sCAAsC;AAAA,QAClE;AAAA,MAAA;AAAA,IACF;AAAA,IACAE,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKZ,EAAS,CAAA;AAAA,IAClBN;AAAA,IACDkB,gBAAAA,EAAA,cAAC,OAAI,EAAA,KAAKX,EAAU,CAAA;AAAA,EAAA,CAExB;AAEJ;"}
@@ -1,7 +1,6 @@
1
- import r from "./HorizontalScroll.js";
2
- import { HorizontalScroll as a } from "./HorizontalScroll.js";
1
+ import { HorizontalScroll as r } from "./HorizontalScroll.js";
3
2
  export {
4
- a as HorizontalScroll,
3
+ r as HorizontalScroll,
5
4
  r as default
6
5
  };
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,42 +1,41 @@
1
1
  import a from "react";
2
- import { getIllustration as p } from "./utils.js";
3
- import { AnalyticsId as I } from "../../constants.js";
2
+ import { getIllustration as f } from "./utils.js";
3
+ import { AnalyticsId as p } from "../../constants.js";
4
4
  import { useUuid as g } from "../../hooks/useUuid.js";
5
5
  var h = /* @__PURE__ */ ((e) => (e.Medium = "0 0 512 512", e.Small = "0 0 200 200", e))(h || {});
6
- const o = a.forwardRef((e, s) => {
7
- const { illustration: n, ariaLabel: l, className: d = "", size: t = 512, color: i = "neutral", testId: m, ...u } = e, r = g(), c = p({
6
+ const v = a.forwardRef((e, o) => {
7
+ const { illustration: s, ariaLabel: l, className: n = "", size: t = 512, color: i = "neutral", testId: d, ...m } = e, r = g(), u = f({
8
8
  size: t,
9
9
  medium: "0 0 512 512",
10
10
  small: "0 0 200 200"
11
11
  /* Small */
12
- }), f = {
13
- "data-testid": m,
14
- "data-analyticsid": I.Illustration,
15
- ref: s,
16
- className: d,
12
+ }), c = {
13
+ "data-testid": d,
14
+ "data-analyticsid": p.Illustration,
15
+ ref: o,
16
+ className: n,
17
17
  role: l ? "img" : "presentation",
18
18
  "aria-labelledby": l ? r : void 0,
19
19
  focusable: !1,
20
20
  "aria-hidden": l ? void 0 : !0,
21
- viewBox: c,
21
+ viewBox: u,
22
22
  style: { minWidth: t, minHeight: t },
23
23
  width: t,
24
24
  height: t,
25
25
  fill: i,
26
- ...u
26
+ ...m
27
27
  };
28
- return a.createElement(n, {
28
+ return a.createElement(s, {
29
29
  size: t,
30
30
  color: i,
31
- svgProperties: f,
31
+ svgProperties: c,
32
32
  title: l && /* @__PURE__ */ a.createElement("title", { id: r }, l)
33
33
  });
34
34
  });
35
- o.displayName = "Illustration";
36
- const N = o;
35
+ v.displayName = "Illustration";
37
36
  export {
38
- o as Illustration,
37
+ v as Illustration,
39
38
  h as ViewBoxSize,
40
- N as default
39
+ v as default
41
40
  };
42
41
  //# sourceMappingURL=Illustration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Illustration.js","sources":["../../../src/components/Illustration/Illustration.tsx"],"sourcesContent":["import React from 'react';\n\nimport { getIllustration } from './utils';\nimport { AnalyticsId } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\n\nexport type IllustrationColor = 'neutral' | 'cherry' | 'blueberry';\n\nexport enum ViewBoxSize {\n Medium = '0 0 512 512',\n Small = '0 0 200 200',\n}\n\nexport interface BaseSvgIllustrationProps {\n color: IllustrationColor;\n svgProperties: React.SVGProps<SVGSVGElement>;\n title: React.ReactNode;\n}\nexport interface SvgIllustrationProps extends BaseSvgIllustrationProps {\n size: number;\n}\n\nexport type SvgIllustration = React.ComponentType<SvgIllustrationProps>;\n\nexport interface BaseIllustrationProps {\n /* aria-label for the <svg> element. Used as <title> tag. */\n ariaLabel?: string;\n /* Changes the size of the illustration. */\n size?: number;\n /* Changes the color of the illustration. */\n color?: IllustrationColor;\n /* Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport interface IllustrationProps extends BaseIllustrationProps {\n /* Sets which illustration should be displayed. */\n illustration: SvgIllustration;\n}\n\nexport const Illustration = React.forwardRef<SVGSVGElement, IllustrationProps>((props, ref) => {\n const { illustration, ariaLabel, className = '', size = 512, color = 'neutral', testId, ...other } = props;\n\n const titleId = useUuid();\n const viewBox = getIllustration({ size, medium: ViewBoxSize.Medium, small: ViewBoxSize.Small });\n\n const svgProperties = {\n 'data-testid': testId,\n 'data-analyticsid': AnalyticsId.Illustration,\n ref,\n className,\n role: ariaLabel ? 'img' : 'presentation',\n 'aria-labelledby': ariaLabel ? titleId : undefined,\n focusable: false,\n 'aria-hidden': ariaLabel ? undefined : true,\n viewBox,\n style: { minWidth: size, minHeight: size },\n width: size,\n height: size,\n fill: color,\n ...other,\n };\n\n const svgElement = React.createElement(illustration, {\n size,\n color,\n svgProperties: svgProperties,\n title: ariaLabel && <title id={titleId}>{ariaLabel}</title>,\n });\n\n return svgElement;\n});\n\nIllustration.displayName = 'Illustration';\n\nexport default Illustration;\n"],"names":["ViewBoxSize","Illustration","React","props","ref","illustration","ariaLabel","className","size","color","testId","other","titleId","useUuid","viewBox","getIllustration","svgProperties","AnalyticsId","Illustration$1"],"mappings":";;;;AAQY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,eACTA,EAAA,QAAQ,eAFEA,IAAAA,KAAA,CAAA,CAAA;AAkCL,MAAMC,IAAeC,EAAM,WAA6C,CAACC,GAAOC,MAAQ;AAC7F,QAAM,EAAE,cAAAC,GAAc,WAAAC,GAAW,WAAAC,IAAY,IAAI,MAAAC,IAAO,KAAK,OAAAC,IAAQ,WAAW,QAAAC,GAAQ,GAAGC,EAAA,IAAUR,GAE/FS,IAAUC,KACVC,IAAUC,EAAgB;AAAA,IAAE,MAAAP;AAAA,IAAM,QAAQ;AAAA,IAAoB,OAAO;AAAA;AAAA,GAAmB,GAExFQ,IAAgB;AAAA,IACpB,eAAeN;AAAA,IACf,oBAAoBO,EAAY;AAAA,IAChC,KAAAb;AAAA,IACA,WAAAG;AAAA,IACA,MAAMD,IAAY,QAAQ;AAAA,IAC1B,mBAAmBA,IAAYM,IAAU;AAAA,IACzC,WAAW;AAAA,IACX,eAAeN,IAAY,SAAY;AAAA,IACvC,SAAAQ;AAAA,IACA,OAAO,EAAE,UAAUN,GAAM,WAAWA,EAAK;AAAA,IACzC,OAAOA;AAAA,IACP,QAAQA;AAAA,IACR,MAAMC;AAAA,IACN,GAAGE;AAAA,EAAA;AAUE,SAPYT,EAAM,cAAcG,GAAc;AAAA,IACnD,MAAAG;AAAA,IACA,OAAAC;AAAA,IACA,eAAAO;AAAA,IACA,OAAOV,KAAaJ,gBAAAA,EAAA,cAAC,SAAM,EAAA,IAAIU,KAAUN,CAAU;AAAA,EAAA,CACpD;AAGH,CAAC;AAEDL,EAAa,cAAc;AAE3B,MAAAiB,IAAejB;"}
1
+ {"version":3,"file":"Illustration.js","sources":["../../../src/components/Illustration/Illustration.tsx"],"sourcesContent":["import React from 'react';\n\nimport { getIllustration } from './utils';\nimport { AnalyticsId } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\n\nexport type IllustrationColor = 'neutral' | 'cherry' | 'blueberry';\n\nexport enum ViewBoxSize {\n Medium = '0 0 512 512',\n Small = '0 0 200 200',\n}\n\nexport interface BaseSvgIllustrationProps {\n color: IllustrationColor;\n svgProperties: React.SVGProps<SVGSVGElement>;\n title: React.ReactNode;\n}\nexport interface SvgIllustrationProps extends BaseSvgIllustrationProps {\n size: number;\n}\n\nexport type SvgIllustration = React.ComponentType<SvgIllustrationProps>;\n\nexport interface BaseIllustrationProps {\n /* aria-label for the <svg> element. Used as <title> tag. */\n ariaLabel?: string;\n /* Changes the size of the illustration. */\n size?: number;\n /* Changes the color of the illustration. */\n color?: IllustrationColor;\n /* Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport interface IllustrationProps extends BaseIllustrationProps {\n /* Sets which illustration should be displayed. */\n illustration: SvgIllustration;\n}\n\nexport const Illustration = React.forwardRef<SVGSVGElement, IllustrationProps>((props, ref) => {\n const { illustration, ariaLabel, className = '', size = 512, color = 'neutral', testId, ...other } = props;\n\n const titleId = useUuid();\n const viewBox = getIllustration({ size, medium: ViewBoxSize.Medium, small: ViewBoxSize.Small });\n\n const svgProperties = {\n 'data-testid': testId,\n 'data-analyticsid': AnalyticsId.Illustration,\n ref,\n className,\n role: ariaLabel ? 'img' : 'presentation',\n 'aria-labelledby': ariaLabel ? titleId : undefined,\n focusable: false,\n 'aria-hidden': ariaLabel ? undefined : true,\n viewBox,\n style: { minWidth: size, minHeight: size },\n width: size,\n height: size,\n fill: color,\n ...other,\n };\n\n const svgElement = React.createElement(illustration, {\n size,\n color,\n svgProperties: svgProperties,\n title: ariaLabel && <title id={titleId}>{ariaLabel}</title>,\n });\n\n return svgElement;\n});\n\nIllustration.displayName = 'Illustration';\n\nexport default Illustration;\n"],"names":["ViewBoxSize","Illustration","React","props","ref","illustration","ariaLabel","className","size","color","testId","other","titleId","useUuid","viewBox","getIllustration","svgProperties","AnalyticsId"],"mappings":";;;;AAQY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,eACTA,EAAA,QAAQ,eAFEA,IAAAA,KAAA,CAAA,CAAA;AAkCL,MAAMC,IAAeC,EAAM,WAA6C,CAACC,GAAOC,MAAQ;AAC7F,QAAM,EAAE,cAAAC,GAAc,WAAAC,GAAW,WAAAC,IAAY,IAAI,MAAAC,IAAO,KAAK,OAAAC,IAAQ,WAAW,QAAAC,GAAQ,GAAGC,EAAA,IAAUR,GAE/FS,IAAUC,KACVC,IAAUC,EAAgB;AAAA,IAAE,MAAAP;AAAA,IAAM,QAAQ;AAAA,IAAoB,OAAO;AAAA;AAAA,GAAmB,GAExFQ,IAAgB;AAAA,IACpB,eAAeN;AAAA,IACf,oBAAoBO,EAAY;AAAA,IAChC,KAAAb;AAAA,IACA,WAAAG;AAAA,IACA,MAAMD,IAAY,QAAQ;AAAA,IAC1B,mBAAmBA,IAAYM,IAAU;AAAA,IACzC,WAAW;AAAA,IACX,eAAeN,IAAY,SAAY;AAAA,IACvC,SAAAQ;AAAA,IACA,OAAO,EAAE,UAAUN,GAAM,WAAWA,EAAK;AAAA,IACzC,OAAOA;AAAA,IACP,QAAQA;AAAA,IACR,MAAMC;AAAA,IACN,GAAGE;AAAA,EAAA;AAUE,SAPYT,EAAM,cAAcG,GAAc;AAAA,IACnD,MAAAG;AAAA,IACA,OAAAC;AAAA,IACA,eAAAO;AAAA,IACA,OAAOV,KAAaJ,gBAAAA,EAAA,cAAC,SAAM,EAAA,IAAIU,KAAUN,CAAU;AAAA,EAAA,CACpD;AAGH,CAAC;AAEDL,EAAa,cAAc;"}
@@ -1,8 +1,8 @@
1
- import t from "./Illustration.js";
2
- import { Illustration as i, ViewBoxSize as l } from "./Illustration.js";
1
+ import { Illustration as r } from "./Illustration.js";
2
+ import { ViewBoxSize as i } from "./Illustration.js";
3
3
  export {
4
- i as Illustration,
5
- l as ViewBoxSize,
6
- t as default
4
+ r as Illustration,
5
+ i as ViewBoxSize,
6
+ r as default
7
7
  };
8
8
  //# sourceMappingURL=index.js.map
@@ -1,118 +1,116 @@
1
- import r, { useRef as D, useState as K, useEffect as Ce } from "react";
1
+ import r, { useRef as K, useState as $, useEffect as xe } from "react";
2
2
  import v from "classnames";
3
- import { FormMode as l, FormSize as _e, IconSize as B, AnalyticsId as ve, AVERAGE_CHARACTER_WIDTH_PX as ye } from "../../constants.js";
4
- import { useBreakpoint as Ee, Breakpoint as ke } from "../../hooks/useBreakpoint.js";
3
+ import { FormMode as l, FormSize as Ce, IconSize as B, AnalyticsId as _e, AVERAGE_CHARACTER_WIDTH_PX as ve } from "../../constants.js";
4
+ import { useBreakpoint as ye, Breakpoint as Ee } from "../../hooks/useBreakpoint.js";
5
5
  import { useUuid as U } from "../../hooks/useUuid.js";
6
6
  import { getColor as F } from "../../theme/currys/color.js";
7
- import { getAriaDescribedBy as we } from "../../utils/accessibility.js";
8
- import Ie from "../ErrorWrapper/ErrorWrapper.js";
7
+ import { getAriaDescribedBy as ke } from "../../utils/accessibility.js";
8
+ import { ErrorWrapper as we } from "../ErrorWrapper/ErrorWrapper.js";
9
9
  import { Icon as Ne } from "../Icon/Icon.js";
10
- import { renderLabel as Re } from "../Label/Label.js";
11
- import We from "../LazyIcon/LazyIcon.js";
12
- import Se from "../MaxCharacters/MaxCharacters.js";
10
+ import { renderLabel as Ie } from "../Label/Label.js";
11
+ import { LazyIcon as Re } from "../LazyIcon/LazyIcon.js";
12
+ import We from "../MaxCharacters/MaxCharacters.js";
13
13
  import t from "../Input/styles.module.scss";
14
- var ze = /* @__PURE__ */ ((e) => (e.text = "text", e.number = "number", e.email = "email", e.password = "password", e.search = "search", e.tel = "tel", e.url = "url", e.date = "date", e.time = "time", e))(ze || {});
15
- const Ae = (e, s, p) => {
14
+ var Se = /* @__PURE__ */ ((e) => (e.text = "text", e.number = "number", e.email = "email", e.password = "password", e.search = "search", e.tel = "tel", e.url = "url", e.date = "date", e.time = "time", e))(Se || {});
15
+ const ze = (e, s, p) => {
16
16
  const i = s ? "1.5rem" : "2rem", f = s ? `${p}px` : "0px";
17
- return `calc(${e * ye}px + ${i} + ${f} + 4px)`;
18
- }, L = r.forwardRef((e, s) => {
17
+ return `calc(${e * ve}px + ${i} + ${f} + 4px)`;
18
+ }, Ae = r.forwardRef((e, s) => {
19
19
  const {
20
20
  className: p,
21
21
  defaultValue: i,
22
22
  placeholder: f,
23
23
  type: h = "text",
24
- name: M,
25
- transparent: P = !1,
24
+ name: L,
25
+ transparent: M = !1,
26
26
  icon: a,
27
27
  iconRight: b,
28
- inputId: H,
29
- inputWrapperRef: O,
28
+ inputId: P,
29
+ inputWrapperRef: H,
30
30
  mode: c = l.onwhite,
31
- size: X,
31
+ size: O,
32
32
  baseIncrementValue: y,
33
- label: q,
34
- error: G,
33
+ label: X,
34
+ error: q,
35
35
  errorText: E,
36
- errorTextId: j,
37
- testId: J,
36
+ errorTextId: G,
37
+ testId: j,
38
38
  disabled: u,
39
- readOnly: Q,
40
- autoComplete: T = "off",
41
- afterInputChildren: Y,
42
- rightOfInput: Z,
39
+ readOnly: J,
40
+ autoComplete: Q = "off",
41
+ afterInputChildren: T,
42
+ rightOfInput: Y,
43
43
  width: k,
44
- required: ee,
44
+ required: Z,
45
45
  onChange: w,
46
- onKeyDown: I,
47
- autoFocus: te,
46
+ onKeyDown: N,
47
+ autoFocus: ee,
48
48
  maxCharacters: d,
49
- maxText: ne,
50
- ...re
51
- } = e, ae = Ee(), m = D(null), N = U(H), [R, W] = K(i || ""), [oe, ie] = K(void 0), g = D(!1), S = U(j), z = /^[0-9]$/;
52
- Ce(() => {
49
+ maxText: te,
50
+ ...ne
51
+ } = e, re = ye(), m = K(null), I = U(P), [R, W] = $(i || ""), [ae, oe] = $(void 0), g = K(!1), S = U(G), z = /^[0-9]$/;
52
+ xe(() => {
53
53
  W(i || "");
54
54
  }, [i]);
55
- const ce = c === l.ondark, le = c === l.onblueberry, se = !!d && R.toString().length > d, x = c === l.oninvalid || !!E || !!G || se, C = X === _e.large, ue = P && c !== l.ondark && !x, de = v(t["input-wrapper"], p), me = v(t["input-container"], {
56
- [t["input-container--transparent"]]: ue,
57
- [t["input-container--on-blueberry"]]: le,
58
- [t["input-container--on-dark"]]: ce,
55
+ const ie = c === l.ondark, ce = c === l.onblueberry, le = !!d && R.toString().length > d, x = c === l.oninvalid || !!E || !!q || le, C = O === Ce.large, se = M && c !== l.ondark && !x, ue = v(t["input-wrapper"], p), de = v(t["input-container"], {
56
+ [t["input-container--transparent"]]: se,
57
+ [t["input-container--on-blueberry"]]: ce,
58
+ [t["input-container--on-dark"]]: ie,
59
59
  [t["input-container--invalid"]]: x,
60
60
  [t["input-container--large"]]: C,
61
61
  [t["input-container--disabled"]]: u,
62
62
  [t["input-container--with-icon"]]: a
63
- }), pe = v(t["input-container__input"], {
63
+ }), me = v(t["input-container__input"], {
64
64
  [t["input-container__input--large"]]: C,
65
65
  [t["input-container__input--disabled"]]: u
66
- }), A = u ? F("neutral", 700) : F("black"), _ = ae === ke.xs || !C ? B.XSmall : B.Small, V = () => {
66
+ }), A = u ? F("neutral", 700) : F("black"), _ = re === Ee.xs || !C ? B.XSmall : B.Small, V = () => {
67
67
  if (a)
68
- return typeof a == "string" ? /* @__PURE__ */ r.createElement(We, { className: t["input-container__input__icon"], color: A, size: _, iconName: a }) : /* @__PURE__ */ r.createElement(Ne, { className: t["input-container__input__icon"], color: A, size: _, svgIcon: a });
69
- }, fe = (n) => {
68
+ return typeof a == "string" ? /* @__PURE__ */ r.createElement(Re, { className: t["input-container__input__icon"], color: A, size: _, iconName: a }) : /* @__PURE__ */ r.createElement(Ne, { className: t["input-container__input__icon"], color: A, size: _, svgIcon: a });
69
+ }, pe = (n) => {
70
70
  if (m && m.current && a) {
71
71
  const o = b ? 0 : 1;
72
72
  m.current.children[o].focus(), e.onClick && e.onClick(n);
73
73
  }
74
+ }, fe = (n) => {
75
+ const o = he(n);
76
+ w && w(n), W(o), oe(o);
74
77
  }, he = (n) => {
75
- const o = be(n);
76
- w && w(n), W(o), ie(o);
77
- }, be = (n) => {
78
- if (typeof y > "u" || h !== "number")
79
- return n.target.value;
78
+ if (typeof y > "u" || h !== "number") return n.target.value;
80
79
  const o = Number(n.target.value);
81
- return !oe && !g.current && (o === 1 || o === -1) && (n.target.value = y + ""), n.target.value;
80
+ return !ae && !g.current && (o === 1 || o === -1) && (n.target.value = y + ""), n.target.value;
81
+ }, be = (n) => {
82
+ z.test(n.key) && (g.current = !0), N && N(n);
82
83
  }, ge = (n) => {
83
- z.test(n.key) && (g.current = !0), I && I(n);
84
- }, xe = (n) => {
85
84
  z.test(n.key) && (g.current = !1);
86
- }, $ = k ? Ae(k, !!a, _) : void 0;
87
- return /* @__PURE__ */ r.createElement(Ie, { errorText: E, errorTextId: S }, /* @__PURE__ */ r.createElement("div", { "data-testid": J, "data-analyticsid": ve.Input, className: de, ref: O }, Re(q, N, c), /* @__PURE__ */ r.createElement("div", { className: t["content-wrapper"] }, /* @__PURE__ */ r.createElement("div", { onClick: fe, ref: m, className: me, style: { maxWidth: $ } }, !b && V(), /* @__PURE__ */ r.createElement(
85
+ }, D = k ? ze(k, !!a, _) : void 0;
86
+ return /* @__PURE__ */ r.createElement(we, { errorText: E, errorTextId: S }, /* @__PURE__ */ r.createElement("div", { "data-testid": j, "data-analyticsid": _e.Input, className: ue, ref: H }, Ie(X, I, c), /* @__PURE__ */ r.createElement("div", { className: t["content-wrapper"] }, /* @__PURE__ */ r.createElement("div", { onClick: pe, ref: m, className: de, style: { maxWidth: D } }, !b && V(), /* @__PURE__ */ r.createElement(
88
87
  "input",
89
88
  {
90
- onChange: he,
91
- onKeyDown: ge,
92
- onKeyUp: xe,
93
- name: M,
89
+ onChange: fe,
90
+ onKeyDown: be,
91
+ onKeyUp: ge,
92
+ name: L,
94
93
  type: h,
95
94
  defaultValue: i,
96
- id: N,
97
- className: pe,
95
+ id: I,
96
+ className: me,
98
97
  ref: s,
99
98
  "aria-labelledby": e["aria-labelledby"] ?? void 0,
100
- "aria-describedby": we(e, S),
99
+ "aria-describedby": ke(e, S),
101
100
  "aria-invalid": !!x,
102
101
  disabled: u,
103
102
  placeholder: f,
104
- readOnly: Q,
105
- autoComplete: T || "off",
106
- required: ee,
107
- autoFocus: te,
108
- ...re
103
+ readOnly: J,
104
+ autoComplete: Q || "off",
105
+ required: Z,
106
+ autoFocus: ee,
107
+ ...ne
109
108
  }
110
- ), b && V()), /* @__PURE__ */ r.createElement("div", { className: t["content-wrapper__right-of-input"] }, Z)), d && /* @__PURE__ */ r.createElement(Se, { maxCharacters: d, length: R.toString().length, maxText: ne, mode: c, maxWidth: $ }), Y));
109
+ ), b && V()), /* @__PURE__ */ r.createElement("div", { className: t["content-wrapper__right-of-input"] }, Y)), d && /* @__PURE__ */ r.createElement(We, { maxCharacters: d, length: R.toString().length, maxText: te, mode: c, maxWidth: D }), T));
111
110
  });
112
- L.displayName = "Input";
113
- const Ge = L;
111
+ Ae.displayName = "Input";
114
112
  export {
115
- ze as InputTypes,
116
- Ge as default
113
+ Se as InputTypes,
114
+ Ae as default
117
115
  };
118
116
  //# sourceMappingURL=Input.js.map