@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 +1 @@
1
- {"version":3,"file":"TableHeadCell.js","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icon';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'th'>, 'style'> {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell: React.FC<Props> = ({\n sortable,\n onClick,\n className,\n children,\n sortDir,\n mode = ModeType.normal,\n scope = 'col',\n ...rest\n}) => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope={scope} className={tableHeadCellDefaultClass} {...rest}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(tableHeadCellDefaultClass, tableStyles['table__head-cell--sortable'], className);\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope={scope} className={sortableClasses} aria-sort={getSortDirection()} {...rest}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","scope","rest","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection","TableHeadCell$1"],"mappings":";;;;;;;;AAUY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA;AAoBL,MAAMC,IAAiC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,MAAM;AACJ,QAAMC,IAA4BC,EAAWC,EAAY,kBAAkB,GAAGT,GAAW;AAAA,IACvF,CAACS,EAAY,2BAA2B,CAAC,GAAGN,MAASC,EAAS;AAAA,EAAA,CAC/D;AAEG,MAAA,CAACN,KAAY,CAACG;AACT,WAAAS,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,EAA2B,CAAA;AAGnD,MAAI,CAACT;AACH,2CACG,MAAG,EAAA,OAAAO,GAAc,WAAWE,GAA4B,GAAGD,KACzDL,CACH;AAIJ,QAAMU,IAAkBH,EAAWD,GAA2BE,EAAY,4BAA4B,GAAGT,CAAS,GAE5GY,IAAiB,MACrBV,qCACG,OAAI,EAAA,WAAWO,EAAY,oCAAoC,EAAA,mCAC7DI,GAAK,EAAA,SAASX,KAAW,QAAoBY,IAAYC,GAAS,MAAMC,EAAS,SAAS,CAC7F,GAGEC,IAAmB,MAAyC;AAChE,YAAQf,GAAS;AAAA,MACf,KAAK;AACI,eAAA;AAAA,MACT,KAAK;AACI,eAAA;AAAA,IACX;AAAA,EAAA;AAGF,SACGQ,gBAAAA,EAAA,cAAA,MAAA,EAAG,OAAAL,GAAc,WAAWM,GAAiB,aAAWM,EAAiB,GAAI,GAAGX,EAAA,GAC9EI,gBAAAA,EAAA,cAAA,UAAA,EAAO,MAAK,UAAS,SAAAX,GAAkB,WAAWU,EAAY,oBAAoB,GAAG,gBAAcP,IAAU,CAAC,CAACA,IAAU,OACvH,GAAAU,EACA,GAAAX,CACH,CACF;AAEJ,GAEAiB,IAAerB;"}
1
+ {"version":3,"file":"TableHeadCell.js","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icon';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'th'>, 'style'> {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell: React.FC<Props> = ({\n sortable,\n onClick,\n className,\n children,\n sortDir,\n mode = ModeType.normal,\n scope = 'col',\n ...rest\n}) => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope={scope} className={tableHeadCellDefaultClass} {...rest}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(tableHeadCellDefaultClass, tableStyles['table__head-cell--sortable'], className);\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope={scope} className={sortableClasses} aria-sort={getSortDirection()} {...rest}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","scope","rest","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection"],"mappings":";;;;;;;;AAUY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA;AAoBL,MAAMC,IAAiC,CAAC;AAAA,EAC7C,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,MAAM;AACJ,QAAMC,IAA4BC,EAAWC,EAAY,kBAAkB,GAAGT,GAAW;AAAA,IACvF,CAACS,EAAY,2BAA2B,CAAC,GAAGN,MAASC,EAAS;AAAA,EAAA,CAC/D;AAEG,MAAA,CAACN,KAAY,CAACG;AACT,WAAAS,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,EAA2B,CAAA;AAGnD,MAAI,CAACT;AACH,2CACG,MAAG,EAAA,OAAAO,GAAc,WAAWE,GAA4B,GAAGD,KACzDL,CACH;AAIJ,QAAMU,IAAkBH,EAAWD,GAA2BE,EAAY,4BAA4B,GAAGT,CAAS,GAE5GY,IAAiB,MACrBV,qCACG,OAAI,EAAA,WAAWO,EAAY,oCAAoC,EAAA,mCAC7DI,GAAK,EAAA,SAASX,KAAW,QAAoBY,IAAYC,GAAS,MAAMC,EAAS,SAAS,CAC7F,GAGEC,IAAmB,MAAyC;AAChE,YAAQf,GAAS;AAAA,MACf,KAAK;AACI,eAAA;AAAA,MACT,KAAK;AACI,eAAA;AAAA,IACX;AAAA,EAAA;AAGF,SACGQ,gBAAAA,EAAA,cAAA,MAAA,EAAG,OAAAL,GAAc,WAAWM,GAAiB,aAAWM,EAAiB,GAAI,GAAGX,EAAA,GAC9EI,gBAAAA,EAAA,cAAA,UAAA,EAAO,MAAK,UAAS,SAAAX,GAAkB,WAAWU,EAAY,oBAAoB,GAAG,gBAAcP,IAAU,CAAC,CAACA,IAAU,OACvH,GAAAU,EACA,GAAAX,CACH,CACF;AAEJ;"}
@@ -1,8 +1,8 @@
1
- import l from "./TableHeadCell.js";
2
- import { SortDirection as a, TableHeadCell as t } from "./TableHeadCell.js";
1
+ import { TableHeadCell as o } from "./TableHeadCell.js";
2
+ import { SortDirection as a } from "./TableHeadCell.js";
3
3
  export {
4
4
  a as SortDirection,
5
- t as TableHeadCell,
6
- l as default
5
+ o as TableHeadCell,
6
+ o as default
7
7
  };
8
8
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,9 @@
1
1
  import e from "react";
2
- import w from "classnames";
3
- import r from "../../Table/styles.module.scss";
4
- import { ModeType as E } from "../Table.js";
5
- import d from "../TableExpanderCell/TableExpanderCellMobile.js";
6
- const R = ({
2
+ import E from "classnames";
3
+ import o from "../../Table/styles.module.scss";
4
+ import { ModeType as d } from "../Table.js";
5
+ import w from "../TableExpanderCell/TableExpanderCellMobile.js";
6
+ const x = ({
7
7
  rowKey: m,
8
8
  hideDetailsText: s,
9
9
  showDetailsText: n,
@@ -11,19 +11,19 @@ const R = ({
11
11
  expanded: p,
12
12
  onClick: a,
13
13
  className: b,
14
- children: c,
15
- mode: l = E.normal,
16
- ...f
14
+ children: f,
15
+ mode: l = d.normal,
16
+ ...i
17
17
  }) => {
18
- const i = w(
19
- r["table-row"],
18
+ const c = E(
19
+ o["table-row"],
20
20
  {
21
- [r["table__row--expandable"]]: t
21
+ [o["table__row--expandable"]]: t
22
22
  },
23
23
  b
24
24
  );
25
- return /* @__PURE__ */ e.createElement("tr", { className: i, onClick: a, key: m, ...f }, e.Children.map(c, (o) => e.isValidElement(o) && e.cloneElement(o, { mode: l })), t && /* @__PURE__ */ e.createElement(
26
- d,
25
+ return /* @__PURE__ */ e.createElement("tr", { className: c, onClick: a, key: m, ...i }, e.Children.map(f, (r) => e.isValidElement(r) && e.cloneElement(r, { mode: l })), t && /* @__PURE__ */ e.createElement(
26
+ w,
27
27
  {
28
28
  expanded: p,
29
29
  onClick: a,
@@ -32,9 +32,9 @@ const R = ({
32
32
  mode: l
33
33
  }
34
34
  ));
35
- }, C = R;
35
+ };
36
36
  export {
37
- R as TableRow,
38
- C as default
37
+ x as TableRow,
38
+ x as default
39
39
  };
40
40
  //# sourceMappingURL=TableRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.js","sources":["../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\nimport TableExpanderCellMobile from '../TableExpanderCell/TableExpanderCellMobile';\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'tr'>, 'style'> {\n /** Sets if expanded row can be expanded */\n expandable?: boolean;\n /** Sets if expanded row is expanded */\n expanded?: boolean;\n /** When hide/show button for expanded row is clicked. */\n onClick?: () => void;\n /** Text for expanded row hide button. */\n hideDetailsText?: string;\n /** Text for expanded row show button. */\n showDetailsText?: string;\n /** Key attribute for row */\n rowKey?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the cells of the table row element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableRow: React.FC<Props> = ({\n rowKey,\n hideDetailsText,\n showDetailsText,\n expandable,\n expanded,\n onClick,\n className,\n children,\n mode = ModeType.normal,\n ...rest\n}) => {\n const tableRowClass = classNames(\n tableStyles['table-row'],\n {\n [tableStyles['table__row--expandable']]: expandable,\n },\n className\n );\n\n return (\n <tr className={tableRowClass} onClick={onClick} key={rowKey} {...rest}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n {expandable && (\n <TableExpanderCellMobile\n expanded={expanded}\n onClick={onClick}\n hideDetailsText={hideDetailsText}\n showDetailsText={showDetailsText}\n mode={mode}\n />\n )}\n </tr>\n );\n};\n\nexport default TableRow;\n"],"names":["TableRow","rowKey","hideDetailsText","showDetailsText","expandable","expanded","onClick","className","children","mode","ModeType","rest","tableRowClass","classNames","tableStyles","React","child","TableExpanderCellMobile","TableRow$1"],"mappings":";;;;;AA6BO,MAAMA,IAA4B,CAAC;AAAA,EACxC,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAgBC;AAAA,IACpBC,EAAY,WAAW;AAAA,IACvB;AAAA,MACE,CAACA,EAAY,wBAAwB,CAAC,GAAGV;AAAA,IAC3C;AAAA,IACAG;AAAA,EAAA;AAIA,SAAAQ,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,GAAe,SAAAN,GAAkB,KAAKL,GAAS,GAAGU,EAAA,GAC9DI,EAAM,SAAS,IAAIP,GAAU,OAASO,EAAM,eAAoCC,CAAK,KAAKD,EAAM,aAAaC,GAAO,EAAE,MAAAP,EAAM,CAAA,CAAC,GAC7HL,KACCW,gBAAAA,EAAA;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAZ;AAAA,MACA,SAAAC;AAAA,MACA,iBAAAJ;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAM;AAAA,IAAA;AAAA,EAAA,CAGN;AAEJ,GAEAS,IAAelB;"}
1
+ {"version":3,"file":"TableRow.js","sources":["../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\nimport TableExpanderCellMobile from '../TableExpanderCell/TableExpanderCellMobile';\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'tr'>, 'style'> {\n /** Sets if expanded row can be expanded */\n expandable?: boolean;\n /** Sets if expanded row is expanded */\n expanded?: boolean;\n /** When hide/show button for expanded row is clicked. */\n onClick?: () => void;\n /** Text for expanded row hide button. */\n hideDetailsText?: string;\n /** Text for expanded row show button. */\n showDetailsText?: string;\n /** Key attribute for row */\n rowKey?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the cells of the table row element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableRow: React.FC<Props> = ({\n rowKey,\n hideDetailsText,\n showDetailsText,\n expandable,\n expanded,\n onClick,\n className,\n children,\n mode = ModeType.normal,\n ...rest\n}) => {\n const tableRowClass = classNames(\n tableStyles['table-row'],\n {\n [tableStyles['table__row--expandable']]: expandable,\n },\n className\n );\n\n return (\n <tr className={tableRowClass} onClick={onClick} key={rowKey} {...rest}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n {expandable && (\n <TableExpanderCellMobile\n expanded={expanded}\n onClick={onClick}\n hideDetailsText={hideDetailsText}\n showDetailsText={showDetailsText}\n mode={mode}\n />\n )}\n </tr>\n );\n};\n\nexport default TableRow;\n"],"names":["TableRow","rowKey","hideDetailsText","showDetailsText","expandable","expanded","onClick","className","children","mode","ModeType","rest","tableRowClass","classNames","tableStyles","React","child","TableExpanderCellMobile"],"mappings":";;;;;AA6BO,MAAMA,IAA4B,CAAC;AAAA,EACxC,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAgBC;AAAA,IACpBC,EAAY,WAAW;AAAA,IACvB;AAAA,MACE,CAACA,EAAY,wBAAwB,CAAC,GAAGV;AAAA,IAC3C;AAAA,IACAG;AAAA,EAAA;AAIA,SAAAQ,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,GAAe,SAAAN,GAAkB,KAAKL,GAAS,GAAGU,EAAA,GAC9DI,EAAM,SAAS,IAAIP,GAAU,OAASO,EAAM,eAAoCC,CAAK,KAAKD,EAAM,aAAaC,GAAO,EAAE,MAAAP,EAAM,CAAA,CAAC,GAC7HL,KACCW,gBAAAA,EAAA;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAZ;AAAA,MACA,SAAAC;AAAA,MACA,iBAAAJ;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAM;AAAA,IAAA;AAAA,EAAA,CAGN;AAEJ;"}
@@ -1,7 +1,6 @@
1
- import e from "./TableRow.js";
2
- import { TableRow as t } from "./TableRow.js";
1
+ import { TableRow as a } from "./TableRow.js";
3
2
  export {
4
- t as TableRow,
5
- e as default
3
+ a as TableRow,
4
+ a 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":";"}
@@ -134,7 +134,7 @@ table .table-body .table-row {
134
134
  width: 100%;
135
135
  border-collapse: collapse;
136
136
 
137
- @each $breakpoint in map-keys($grid-breakpoints) {
137
+ @each $breakpoint in map.keys($grid-breakpoints) {
138
138
  &--centeredoverflow-#{$breakpoint} {
139
139
  @include media-breakpoint-down($breakpoint) {
140
140
  @include centeredoverflow;
@@ -215,13 +215,13 @@ table .table-body .table-row {
215
215
  }
216
216
 
217
217
  &--compact {
218
- padding: getSpacer(2xs) getSpacer(3xs) getSpacer(4xs) getSpacer(3xs);
218
+ padding: getSpacer(2xs) getSpacer(3xs) getSpacer(4xs);
219
219
  line-height: 18px;
220
220
  font-size: 14px;
221
221
  height: unset;
222
222
 
223
223
  @media (min-width: map.get($grid-breakpoints, sm)) {
224
- padding: getSpacer(s) getSpacer(3xs) getSpacer(3xs) getSpacer(3xs);
224
+ padding: getSpacer(s) getSpacer(3xs) getSpacer(3xs);
225
225
  line-height: 20px;
226
226
  font-size: $font-size-xs;
227
227
  height: unset;
@@ -8,7 +8,7 @@ import { Breakpoint } from '../../hooks/useBreakpoint';
8
8
  * @param tableWidth Bredde på tabell i px
9
9
  * @returns Konfigurasjon for responsiv oppførsel uten fallbackVariant
10
10
  */
11
- export declare const getCurrentConfig: (config: BreakpointConfig | BreakpointConfig[], breakpoint: Breakpoint, tableWidth: number, windowWidth: number) => Omit<BreakpointConfig, 'fallbackVariant'> | undefined;
11
+ export declare const getCurrentConfig: (config: BreakpointConfig | BreakpointConfig[], breakpoint: Breakpoint, tableWidth: number, windowWidth: number) => Omit<BreakpointConfig, "fallbackVariant"> | undefined;
12
12
  /**
13
13
  * Finn klassenavn for responsiv oppførsel
14
14
  * @param config Konfigurasjon for responsiv oppførsel
@@ -1,6 +1,6 @@
1
1
  import e from "react";
2
- const a = (t) => /* @__PURE__ */ e.createElement(e.Fragment, null, t.children ?? null), n = a;
2
+ const r = (t) => /* @__PURE__ */ e.createElement(e.Fragment, null, t.children ?? null);
3
3
  export {
4
- n as default
4
+ r as default
5
5
  };
6
6
  //# sourceMappingURL=Tab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.js","sources":["../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\n\nexport interface TabProps {\n /** Sets the tab panel content */\n children?: React.ReactNode;\n /** Optional icon on the tab */\n icon?: SvgIcon | IconName;\n /** Called when tab is selected */\n onTabClick?: (index: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Title on the tab */\n title?: string;\n}\n\nconst Tab: React.FC<TabProps> = props => {\n return <>{props.children ?? null}</>;\n};\n\nexport default Tab;\n"],"names":["Tab","props","React","Tab$1"],"mappings":";AAkBA,MAAMA,IAA0B,CAASC,MAChCC,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAGD,EAAM,YAAY,IAAK,GAGnCE,IAAeH;"}
1
+ {"version":3,"file":"Tab.js","sources":["../../../src/components/Tabs/Tab.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\n\nexport interface TabProps {\n /** Sets the tab panel content */\n children?: React.ReactNode;\n /** Optional icon on the tab */\n icon?: SvgIcon | IconName;\n /** Called when tab is selected */\n onTabClick?: (index: number) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Title on the tab */\n title?: string;\n}\n\nconst Tab: React.FC<TabProps> = props => {\n return <>{props.children ?? null}</>;\n};\n\nexport default Tab;\n"],"names":["Tab","props","React"],"mappings":";AAkBA,MAAMA,IAA0B,CAASC,MAChCC,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAGD,EAAM,YAAY,IAAK;"}
@@ -1,51 +1,56 @@
1
- import t, { useRef as p } from "react";
2
- import u from "classnames";
3
- import { useRovingFocus as N } from "../../../hooks/useRovingFocus.js";
4
- import { palette as s } from "../../../theme/palette.js";
5
- import { isComponent as $ } from "../../../utils/component.js";
6
- import { uuid as L } from "../../../utils/uuid.js";
7
- import { Icon as S } from "../../Icon/Icon.js";
8
- import { IconSize as _ } from "../../../constants.js";
9
- import g from "../../LazyIcon/LazyIcon.js";
10
- import v from "../Tab.js";
11
- import e from "../../Tabs/TabList/styles.module.scss";
12
- const X = (d) => {
13
- const { selectedTab: C, onTabListClick: i, children: n, color: k = "white", type: y = "normal" } = d, c = p(null), l = p(t.Children.map(n, () => t.createRef()));
14
- N(i, l, c, !0);
15
- const R = u(e["tab-list"], e[`tab-list--${y}`]), E = L();
16
- return /* @__PURE__ */ t.createElement("ul", { className: R, ref: c, role: "tablist", "aria-orientation": "horizontal" }, t.Children.map(n, (m, o) => {
17
- if ($(m, v)) {
18
- const r = o === C, { title: b, onTabClick: f, icon: a, testId: T } = m.props, h = () => {
19
- f && f(o), i(o);
20
- }, z = u(e["tab-list__tab"], e[`tab-list__tab--${k}`], {
21
- [e["tab-list__tab--selected"]]: r,
22
- [e["tab-list__tab--first"]]: o == 0
23
- }), I = l.current && l.current[o];
24
- return /* @__PURE__ */ t.createElement("li", { role: "presentation" }, /* @__PURE__ */ t.createElement(
1
+ import t, { useRef as k } from "react";
2
+ import C from "classnames";
3
+ import { useIsVisible as L } from "../../../hooks/useIsVisible.js";
4
+ import { useRovingFocus as V } from "../../../hooks/useRovingFocus.js";
5
+ import { palette as a } from "../../../theme/palette.js";
6
+ import { isComponent as w } from "../../../utils/component.js";
7
+ import { uuid as X } from "../../../utils/uuid.js";
8
+ import { Icon as B } from "../../Icon/Icon.js";
9
+ import { IconSize as y } from "../../../constants.js";
10
+ import { LazyIcon as F } from "../../LazyIcon/LazyIcon.js";
11
+ import j from "../Tab.js";
12
+ import o from "../../Tabs/TabList/styles.module.scss";
13
+ const W = (h) => {
14
+ const { selectedTab: I, onTabListClick: m, children: b, color: T = "white", type: E = "normal" } = h, i = k(null), r = k(t.Children.map(b, () => t.createRef()));
15
+ V(m, r, i, !0);
16
+ const R = C(o["tab-list"], o[`tab-list--${E}`]), f = X(), $ = L(i);
17
+ return /* @__PURE__ */ t.createElement("ul", { className: R, ref: i, role: "tablist", "aria-orientation": "horizontal" }, t.Children.map(b, (u, e) => {
18
+ if (w(u, j)) {
19
+ const s = e === I, { title: n, onTabClick: p, icon: l, testId: z } = u.props, N = () => {
20
+ p && p(e), m(e), _(e);
21
+ }, S = C(o["tab-list__tab"], o[`tab-list__tab--${T}`], {
22
+ [o["tab-list__tab--selected"]]: s,
23
+ [o["tab-list__tab--first"]]: e == 0
24
+ }), g = r.current && r.current[e], _ = (v) => {
25
+ var d;
26
+ const c = r.current && r.current[v];
27
+ (d = c == null ? void 0 : c.current) == null || d.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
28
+ };
29
+ return s && $ && _(e), /* @__PURE__ */ t.createElement("li", { role: "presentation", key: `${n}-${f}` }, /* @__PURE__ */ t.createElement(
25
30
  "button",
26
31
  {
27
32
  role: "tab",
28
- "aria-selected": r,
29
- onClick: h,
30
- className: z,
31
- key: `${b}-${E}`,
32
- "data-testid": T,
33
- ref: I
33
+ "aria-selected": s,
34
+ onClick: N,
35
+ className: S,
36
+ key: `${n}-${f}`,
37
+ "data-testid": z,
38
+ ref: g
34
39
  },
35
- /* @__PURE__ */ t.createElement("span", { className: e["tab-list__tab__title-and-icon"] }, a && (typeof a == "string" ? /* @__PURE__ */ t.createElement(
36
- g,
40
+ /* @__PURE__ */ t.createElement("span", { className: o["tab-list__tab__title-and-icon"] }, l && (typeof l == "string" ? /* @__PURE__ */ t.createElement(
41
+ F,
37
42
  {
38
- iconName: a,
39
- size: _.XSmall,
40
- color: r ? s.black : s.blueberry500
43
+ iconName: l,
44
+ size: y.XSmall,
45
+ color: s ? a.black : a.blueberry500
41
46
  }
42
- ) : /* @__PURE__ */ t.createElement(S, { svgIcon: a, size: _.XSmall, color: r ? s.black : s.blueberry500 })), b)
47
+ ) : /* @__PURE__ */ t.createElement(B, { svgIcon: l, size: y.XSmall, color: s ? a.black : a.blueberry500 })), n)
43
48
  ));
44
49
  }
45
50
  return null;
46
51
  }));
47
- }, M = X;
52
+ };
48
53
  export {
49
- M as default
54
+ W as default
50
55
  };
51
56
  //# sourceMappingURL=TabList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabList.js","sources":["../../../../src/components/Tabs/TabList/TabList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useRovingFocus } from '../../../hooks/useRovingFocus';\nimport { palette } from '../../../theme/palette';\nimport { isComponent } from '../../../utils/component';\nimport uuid from '../../../utils/uuid';\nimport Icon, { IconSize } from '../../Icon';\nimport { IconName } from '../../Icons/IconNames';\nimport LazyIcon from '../../LazyIcon';\nimport Tab from '../Tab';\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\ninterface TabListProps {\n children: React.ReactNode;\n onTabListClick: (index: number) => void;\n selectedTab: number;\n color?: TabsColors;\n type?: TabsType;\n}\n\nconst TabList: React.FC<TabListProps> = props => {\n const { selectedTab, onTabListClick, children, color = 'white', type = 'normal' } = props;\n\n const listRef = useRef<HTMLUListElement>(null);\n\n const tabRefs = useRef(React.Children.map(children, () => React.createRef<HTMLButtonElement>()));\n useRovingFocus(onTabListClick, tabRefs, listRef, true);\n\n const tablistClasses = classNames(styles['tab-list'], styles[`tab-list--${type}`]);\n\n const id = uuid();\n\n return (\n <ul className={tablistClasses} ref={listRef} role=\"tablist\" aria-orientation=\"horizontal\">\n {React.Children.map(children, (child, index) => {\n if (isComponent(child, Tab)) {\n const isSelected = index === selectedTab;\n const { title, onTabClick, icon, testId } = child.props;\n const handleClick = (): void => {\n onTabClick && onTabClick(index);\n onTabListClick(index);\n };\n const tabButtonClasses = classNames(styles['tab-list__tab'], styles[`tab-list__tab--${color}`], {\n [styles['tab-list__tab--selected']]: isSelected,\n [styles['tab-list__tab--first']]: index == 0,\n });\n\n const currentRef = tabRefs.current && tabRefs.current[index];\n\n return (\n <li role=\"presentation\">\n <button\n role=\"tab\"\n aria-selected={isSelected}\n onClick={handleClick}\n className={tabButtonClasses}\n key={`${title}-${id}`}\n data-testid={testId}\n ref={currentRef as React.RefObject<HTMLButtonElement>}\n >\n <span className={styles['tab-list__tab__title-and-icon']}>\n {icon &&\n (typeof icon === 'string' ? (\n <LazyIcon\n iconName={icon as IconName}\n size={IconSize.XSmall}\n color={isSelected ? palette[`black`] : palette['blueberry500']}\n />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} color={isSelected ? palette[`black`] : palette['blueberry500']} />\n ))}\n {title}\n </span>\n </button>\n </li>\n );\n }\n return null;\n })}\n </ul>\n );\n};\n\nexport default TabList;\n"],"names":["TabList","props","selectedTab","onTabListClick","children","color","type","listRef","useRef","tabRefs","React","useRovingFocus","tablistClasses","classNames","styles","id","uuid","child","index","isComponent","Tab","isSelected","title","onTabClick","icon","testId","handleClick","tabButtonClasses","currentRef","LazyIcon","IconSize","palette","Icon","TabList$1"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,IAAkC,CAASC,MAAA;AACzC,QAAA,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,UAAAC,GAAU,OAAAC,IAAQ,SAAS,MAAAC,IAAO,SAAa,IAAAL,GAE9EM,IAAUC,EAAyB,IAAI,GAEvCC,IAAUD,EAAOE,EAAM,SAAS,IAAIN,GAAU,MAAMM,EAAM,UAA8B,CAAA,CAAC;AAChF,EAAAC,EAAAR,GAAgBM,GAASF,GAAS,EAAI;AAE/C,QAAAK,IAAiBC,EAAWC,EAAO,UAAU,GAAGA,EAAO,aAAaR,CAAI,EAAE,CAAC,GAE3ES,IAAKC;AAEX,yCACG,MAAG,EAAA,WAAWJ,GAAgB,KAAKL,GAAS,MAAK,WAAU,oBAAiB,aAAA,GAC1EG,EAAM,SAAS,IAAIN,GAAU,CAACa,GAAOC,MAAU;AAC1C,QAAAC,EAAYF,GAAOG,CAAG,GAAG;AAC3B,YAAMC,IAAaH,MAAUhB,GACvB,EAAE,OAAAoB,GAAO,YAAAC,GAAY,MAAAC,GAAM,QAAAC,MAAWR,EAAM,OAC5CS,IAAc,MAAY;AAC9B,QAAAH,KAAcA,EAAWL,CAAK,GAC9Bf,EAAee,CAAK;AAAA,MAAA,GAEhBS,IAAmBd,EAAWC,EAAO,eAAe,GAAGA,EAAO,kBAAkBT,CAAK,EAAE,GAAG;AAAA,QAC9F,CAACS,EAAO,yBAAyB,CAAC,GAAGO;AAAA,QACrC,CAACP,EAAO,sBAAsB,CAAC,GAAGI,KAAS;AAAA,MAAA,CAC5C,GAEKU,IAAanB,EAAQ,WAAWA,EAAQ,QAAQS,CAAK;AAGzD,aAAAR,gBAAAA,EAAA,cAAC,MAAG,EAAA,MAAK,eACP,GAAAA,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,iBAAeW;AAAA,UACf,SAASK;AAAA,UACT,WAAWC;AAAA,UACX,KAAK,GAAGL,CAAK,IAAIP,CAAE;AAAA,UACnB,eAAaU;AAAA,UACb,KAAKG;AAAA,QAAA;AAAA,QAELlB,gBAAAA,EAAA,cAAC,UAAK,WAAWI,EAAO,+BAA+B,EACpD,GAAAU,MACE,OAAOA,KAAS,WACfd,gBAAAA,EAAA;AAAA,UAACmB;AAAA,UAAA;AAAA,YACC,UAAUL;AAAA,YACV,MAAMM,EAAS;AAAA,YACf,OAAOT,IAAaU,EAAQ,QAAWA,EAAQ;AAAA,UAAc;AAAA,QAAA,IAG9DrB,gBAAAA,EAAA,cAAAsB,GAAA,EAAK,SAASR,GAAM,MAAMM,EAAS,QAAQ,OAAOT,IAAaU,EAAQ,QAAWA,EAAQ,aAAc,CAAG,IAE/GT,CACH;AAAA,MAAA,CAEJ;AAAA,IAEJ;AACO,WAAA;AAAA,EACR,CAAA,CACH;AAEJ,GAEAW,IAAejC;"}
1
+ {"version":3,"file":"TabList.js","sources":["../../../../src/components/Tabs/TabList/TabList.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../../hooks/useIsVisible';\nimport { useRovingFocus } from '../../../hooks/useRovingFocus';\nimport { palette } from '../../../theme/palette';\nimport { isComponent } from '../../../utils/component';\nimport uuid from '../../../utils/uuid';\nimport Icon, { IconSize } from '../../Icon';\nimport { IconName } from '../../Icons/IconNames';\nimport LazyIcon from '../../LazyIcon';\nimport Tab from '../Tab';\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\ninterface TabListProps {\n children: React.ReactNode;\n onTabListClick: (index: number) => void;\n selectedTab: number;\n color?: TabsColors;\n type?: TabsType;\n}\n\nconst TabList: React.FC<TabListProps> = props => {\n const { selectedTab, onTabListClick, children, color = 'white', type = 'normal' } = props;\n\n const listRef = useRef<HTMLUListElement>(null);\n\n const tabRefs = useRef(React.Children.map(children, () => React.createRef<HTMLButtonElement>()));\n useRovingFocus(onTabListClick, tabRefs, listRef, true);\n\n const tablistClasses = classNames(styles['tab-list'], styles[`tab-list--${type}`]);\n\n const id = uuid();\n const isVisible = useIsVisible(listRef);\n\n return (\n <ul className={tablistClasses} ref={listRef} role=\"tablist\" aria-orientation=\"horizontal\">\n {React.Children.map(children, (child, index) => {\n if (isComponent(child, Tab)) {\n const isSelected = index === selectedTab;\n const { title, onTabClick, icon, testId } = child.props;\n const handleClick = (): void => {\n onTabClick && onTabClick(index);\n onTabListClick(index);\n scrollToTab(index);\n };\n const tabButtonClasses = classNames(styles['tab-list__tab'], styles[`tab-list__tab--${color}`], {\n [styles['tab-list__tab--selected']]: isSelected,\n [styles['tab-list__tab--first']]: index == 0,\n });\n\n const currentRef = tabRefs.current && tabRefs.current[index];\n\n const scrollToTab = (index: number): void => {\n const currentRef = tabRefs.current && tabRefs.current[index];\n currentRef?.current?.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' });\n };\n\n if (isSelected && isVisible) scrollToTab(index);\n\n return (\n <li role=\"presentation\" key={`${title}-${id}`}>\n <button\n role=\"tab\"\n aria-selected={isSelected}\n onClick={handleClick}\n className={tabButtonClasses}\n key={`${title}-${id}`}\n data-testid={testId}\n ref={currentRef as React.RefObject<HTMLButtonElement>}\n >\n <span className={styles['tab-list__tab__title-and-icon']}>\n {icon &&\n (typeof icon === 'string' ? (\n <LazyIcon\n iconName={icon as IconName}\n size={IconSize.XSmall}\n color={isSelected ? palette[`black`] : palette['blueberry500']}\n />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} color={isSelected ? palette[`black`] : palette['blueberry500']} />\n ))}\n {title}\n </span>\n </button>\n </li>\n );\n }\n return null;\n })}\n </ul>\n );\n};\n\nexport default TabList;\n"],"names":["TabList","props","selectedTab","onTabListClick","children","color","type","listRef","useRef","tabRefs","React","useRovingFocus","tablistClasses","classNames","styles","id","uuid","isVisible","useIsVisible","child","index","isComponent","Tab","isSelected","title","onTabClick","icon","testId","handleClick","scrollToTab","tabButtonClasses","currentRef","LazyIcon","IconSize","palette","Icon"],"mappings":";;;;;;;;;;;;AAwBA,MAAMA,IAAkC,CAASC,MAAA;AACzC,QAAA,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,UAAAC,GAAU,OAAAC,IAAQ,SAAS,MAAAC,IAAO,SAAa,IAAAL,GAE9EM,IAAUC,EAAyB,IAAI,GAEvCC,IAAUD,EAAOE,EAAM,SAAS,IAAIN,GAAU,MAAMM,EAAM,UAA8B,CAAA,CAAC;AAChF,EAAAC,EAAAR,GAAgBM,GAASF,GAAS,EAAI;AAE/C,QAAAK,IAAiBC,EAAWC,EAAO,UAAU,GAAGA,EAAO,aAAaR,CAAI,EAAE,CAAC,GAE3ES,IAAKC,KACLC,IAAYC,EAAaX,CAAO;AAEtC,yCACG,MAAG,EAAA,WAAWK,GAAgB,KAAKL,GAAS,MAAK,WAAU,oBAAiB,aAAA,GAC1EG,EAAM,SAAS,IAAIN,GAAU,CAACe,GAAOC,MAAU;AAC1C,QAAAC,EAAYF,GAAOG,CAAG,GAAG;AAC3B,YAAMC,IAAaH,MAAUlB,GACvB,EAAE,OAAAsB,GAAO,YAAAC,GAAY,MAAAC,GAAM,QAAAC,MAAWR,EAAM,OAC5CS,IAAc,MAAY;AAC9B,QAAAH,KAAcA,EAAWL,CAAK,GAC9BjB,EAAeiB,CAAK,GACpBS,EAAYT,CAAK;AAAA,MAAA,GAEbU,IAAmBjB,EAAWC,EAAO,eAAe,GAAGA,EAAO,kBAAkBT,CAAK,EAAE,GAAG;AAAA,QAC9F,CAACS,EAAO,yBAAyB,CAAC,GAAGS;AAAA,QACrC,CAACT,EAAO,sBAAsB,CAAC,GAAGM,KAAS;AAAA,MAAA,CAC5C,GAEKW,IAAatB,EAAQ,WAAWA,EAAQ,QAAQW,CAAK,GAErDS,IAAc,CAACT,MAAwB;;AAC3C,cAAMW,IAAatB,EAAQ,WAAWA,EAAQ,QAAQW,CAAK;AAC3DW,SAAAA,IAAAA,KAAAA,gBAAAA,EAAY,YAAZA,QAAAA,EAAqB,eAAe,EAAE,UAAU,UAAU,QAAQ,UAAU,OAAO,UAAA;AAAA,MAAW;AAG5F,aAAAR,KAAcN,KAAWY,EAAYT,CAAK,GAG5CV,gBAAAA,EAAA,cAAC,QAAG,MAAK,gBAAe,KAAK,GAAGc,CAAK,IAAIT,CAAE,GACzC,GAAAL,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,iBAAea;AAAA,UACf,SAASK;AAAA,UACT,WAAWE;AAAA,UACX,KAAK,GAAGN,CAAK,IAAIT,CAAE;AAAA,UACnB,eAAaY;AAAA,UACb,KAAKI;AAAA,QAAA;AAAA,QAELrB,gBAAAA,EAAA,cAAC,UAAK,WAAWI,EAAO,+BAA+B,EACpD,GAAAY,MACE,OAAOA,KAAS,WACfhB,gBAAAA,EAAA;AAAA,UAACsB;AAAA,UAAA;AAAA,YACC,UAAUN;AAAA,YACV,MAAMO,EAAS;AAAA,YACf,OAAOV,IAAaW,EAAQ,QAAWA,EAAQ;AAAA,UAAc;AAAA,QAAA,IAG9DxB,gBAAAA,EAAA,cAAAyB,GAAA,EAAK,SAAST,GAAM,MAAMO,EAAS,QAAQ,OAAOV,IAAaW,EAAQ,QAAWA,EAAQ,aAAc,CAAG,IAE/GV,CACH;AAAA,MAAA,CAEJ;AAAA,IAEJ;AACO,WAAA;AAAA,EACR,CAAA,CACH;AAEJ;"}
@@ -1,4 +1,6 @@
1
+ @use 'sass:map';
1
2
  @import '../../../scss/supernova/styles/colors';
3
+ @import '../../../scss/breakpoints';
2
4
 
3
5
  .tab-list {
4
6
  $tab-list: &;
@@ -9,12 +11,12 @@
9
11
  gap: 0.25rem;
10
12
  list-style-type: none;
11
13
  white-space: nowrap;
12
- overflow-x: initial;
13
- overflow-y: initial;
14
+ overflow: hidden;
14
15
  height: 3rem;
15
16
  z-index: 0;
16
17
  margin: 0;
17
18
  margin-bottom: -1px;
19
+ background-color: var(--color-base-background-white);
18
20
 
19
21
  &__tab {
20
22
  display: flex;
@@ -56,11 +58,19 @@
56
58
  }
57
59
 
58
60
  &--normal {
59
- padding-left: 1rem;
61
+ padding-left: 0.5rem;
62
+
63
+ @media (min-width: map.get($grid-breakpoints, md)) {
64
+ padding-left: 1rem;
65
+ }
60
66
  }
61
67
 
62
68
  &--framed {
63
- padding-left: 0;
69
+ padding-left: 0.5rem;
70
+
71
+ @media (min-width: map.get($grid-breakpoints, md)) {
72
+ padding-left: 0;
73
+ }
64
74
 
65
75
  #{$tab-list}__tab {
66
76
  background-color: var(--color-base-background-white);
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
2
  import { TabsColors, TabsType } from '../Tabs';
3
3
  interface TabPanelProps {
4
+ children?: React.ReactNode;
4
5
  color?: TabsColors;
5
6
  type?: TabsType;
6
7
  isFirst?: boolean;
8
+ translateX?: number;
9
+ style?: React.CSSProperties;
10
+ animate: 'left' | 'right' | null;
7
11
  }
8
- declare const TabPanel: React.FC<TabPanelProps>;
12
+ declare const TabPanel: React.ForwardRefExoticComponent<TabPanelProps & React.RefAttributes<HTMLDivElement>>;
9
13
  export default TabPanel;
@@ -1,13 +1,17 @@
1
- import r from "react";
2
- import o from "classnames";
1
+ import s, { forwardRef as y } from "react";
2
+ import l from "classnames";
3
3
  import a from "../../Tabs/TabPanel/styles.module.scss";
4
- const m = ({ children: e, color: t = "white", type: l = "normal", isFirst: s = !1 }) => {
5
- const n = o(a["tab-panel"], a[`tab-panel--${t}`], a[`tab-panel--${l}`], {
6
- [a["tab-panel--first"]]: s
7
- });
8
- return /* @__PURE__ */ r.createElement("div", { className: n }, e);
9
- }, f = m;
4
+ const h = y((n, r) => {
5
+ const { children: o, animate: t, color: m = "white", type: i = "normal", isFirst: c = !1, translateX: e, style: f } = n, p = l(a["tab-panel"], a[`tab-panel--${m}`], a[`tab-panel--${i}`], {
6
+ [a["tab-panel--first"]]: c
7
+ }), b = l({
8
+ [a["tab-panel--animate-left"]]: t === "left",
9
+ [a["tab-panel--animate-right"]]: t === "right"
10
+ }), d = e != 0 ? { transform: `translateX(${e}px)` } : {};
11
+ return /* @__PURE__ */ s.createElement("div", { ref: r, className: p, style: f }, /* @__PURE__ */ s.createElement("div", { className: b, style: d }, o));
12
+ });
13
+ h.displayName = "TabPanel";
10
14
  export {
11
- f as default
15
+ h as default
12
16
  };
13
17
  //# sourceMappingURL=TabPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabPanel.js","sources":["../../../../src/components/Tabs/TabPanel/TabPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\n\ninterface TabPanelProps {\n color?: TabsColors;\n type?: TabsType;\n isFirst?: boolean;\n}\n\nconst TabPanel: React.FC<TabPanelProps> = ({ children, color = 'white', type = 'normal', isFirst = false }) => {\n const tabPanelClasses = classNames(styles['tab-panel'], styles[`tab-panel--${color}`], styles[`tab-panel--${type}`], {\n [styles['tab-panel--first']]: isFirst,\n });\n return <div className={tabPanelClasses}>{children}</div>;\n};\n\nexport default TabPanel;\n"],"names":["TabPanel","children","color","type","isFirst","tabPanelClasses","classNames","styles","React","TabPanel$1"],"mappings":";;;AAcA,MAAMA,IAAoC,CAAC,EAAE,UAAAC,GAAU,OAAAC,IAAQ,SAAS,MAAAC,IAAO,UAAU,SAAAC,IAAU,SAAY;AAC7G,QAAMC,IAAkBC,EAAWC,EAAO,WAAW,GAAGA,EAAO,cAAcL,CAAK,EAAE,GAAGK,EAAO,cAAcJ,CAAI,EAAE,GAAG;AAAA,IACnH,CAACI,EAAO,kBAAkB,CAAC,GAAGH;AAAA,EAAA,CAC/B;AACD,SAAQI,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWH,EAAA,GAAkBJ,CAAS;AACpD,GAEAQ,IAAeT;"}
1
+ {"version":3,"file":"TabPanel.js","sources":["../../../../src/components/Tabs/TabPanel/TabPanel.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { TabsColors, TabsType } from '../Tabs';\n\nimport styles from './styles.module.scss';\n\ninterface TabPanelProps {\n children?: React.ReactNode;\n color?: TabsColors;\n type?: TabsType;\n isFirst?: boolean;\n translateX?: number;\n style?: React.CSSProperties;\n animate: 'left' | 'right' | null;\n}\n\nconst TabPanel = forwardRef<HTMLDivElement, TabPanelProps>((props, ref) => {\n const { children, animate, color = 'white', type = 'normal', isFirst = false, translateX, style } = props;\n const tabPanelClasses = classNames(styles['tab-panel'], styles[`tab-panel--${color}`], styles[`tab-panel--${type}`], {\n [styles['tab-panel--first']]: isFirst,\n });\n const contentClasses = classNames({\n [styles['tab-panel--animate-left']]: animate === 'left',\n [styles['tab-panel--animate-right']]: animate === 'right',\n });\n const transformStyle: React.CSSProperties = translateX != 0 ? { transform: `translateX(${translateX}px)` } : {};\n\n return (\n <div ref={ref} className={tabPanelClasses} style={style}>\n <div className={contentClasses} style={transformStyle}>\n {children}\n </div>\n </div>\n );\n});\n\nTabPanel.displayName = 'TabPanel';\nexport default TabPanel;\n"],"names":["TabPanel","forwardRef","props","ref","children","animate","color","type","isFirst","translateX","style","tabPanelClasses","classNames","styles","contentClasses","transformStyle","React"],"mappings":";;;AAkBA,MAAMA,IAAWC,EAA0C,CAACC,GAAOC,MAAQ;AACnE,QAAA,EAAE,UAAAC,GAAU,SAAAC,GAAS,OAAAC,IAAQ,SAAS,MAAAC,IAAO,UAAU,SAAAC,IAAU,IAAO,YAAAC,GAAY,OAAAC,EAAA,IAAUR,GAC9FS,IAAkBC,EAAWC,EAAO,WAAW,GAAGA,EAAO,cAAcP,CAAK,EAAE,GAAGO,EAAO,cAAcN,CAAI,EAAE,GAAG;AAAA,IACnH,CAACM,EAAO,kBAAkB,CAAC,GAAGL;AAAA,EAAA,CAC/B,GACKM,IAAiBF,EAAW;AAAA,IAChC,CAACC,EAAO,yBAAyB,CAAC,GAAGR,MAAY;AAAA,IACjD,CAACQ,EAAO,0BAA0B,CAAC,GAAGR,MAAY;AAAA,EAAA,CACnD,GACKU,IAAsCN,KAAc,IAAI,EAAE,WAAW,cAAcA,CAAU,MAAM,IAAI;AAE7G,SACGO,gBAAAA,EAAA,cAAA,OAAA,EAAI,KAAAb,GAAU,WAAWQ,GAAiB,OAAAD,KACxCM,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWF,GAAgB,OAAOC,EAAA,GACpCX,CACH,CACF;AAEJ,CAAC;AAEDJ,EAAS,cAAc;"}
@@ -8,24 +8,38 @@
8
8
  .tab-panel {
9
9
  $tab-panel: &;
10
10
 
11
- border-top: 1px solid var(--color-action-border-onlight-focus);
12
11
  padding: 2rem;
13
- position: relative;
14
- z-index: 1;
15
12
 
16
13
  $colors: 'blueberry', 'neutral', 'white';
17
14
 
15
+ width: 100%;
16
+ padding-left: 0;
17
+
18
+ @media (min-width: map.get($grid-breakpoints, md)) {
19
+ width: 100%;
20
+ }
21
+
18
22
  &--normal {
19
23
  padding: 0;
20
24
  }
21
25
 
22
26
  &--framed {
23
27
  padding: 2rem;
24
- border: 1px solid var(--color-action-border-onlight-focus);
25
- border-radius: 0.5rem;
28
+ border-bottom: 1px solid var(--color-action-border-onlight-focus);
29
+ border-radius: 0;
30
+
31
+ @media (min-width: map.get($grid-breakpoints, md)) {
32
+ border-radius: 0 0 0.5rem 0.5rem;
33
+ border: 1px solid var(--color-action-border-onlight-focus);
34
+ border-top: 0;
35
+ }
26
36
 
27
37
  &#{$tab-panel}--first {
28
- border-radius: 0 0.5rem 0.5rem;
38
+ border-radius: 0;
39
+
40
+ @media (min-width: map.get($grid-breakpoints, md)) {
41
+ border-radius: 0 0 0.5rem 0.5rem;
42
+ }
29
43
  }
30
44
 
31
45
  @each $color in $colors {
@@ -35,3 +49,31 @@
35
49
  }
36
50
  }
37
51
  }
52
+
53
+ .tab-panel--animate-left {
54
+ animation: slide-left 0.5s forwards;
55
+ }
56
+
57
+ .tab-panel--animate-right {
58
+ animation: slide-right 0.5s forwards;
59
+ }
60
+
61
+ @keyframes slide-right {
62
+ 0% {
63
+ transform: translateX(-100%);
64
+ }
65
+
66
+ 100% {
67
+ transform: translateX(0%);
68
+ }
69
+ }
70
+
71
+ @keyframes slide-left {
72
+ 0% {
73
+ transform: translateX(100%);
74
+ }
75
+
76
+ 100% {
77
+ transform: translateX(0%);
78
+ }
79
+ }
@@ -1,5 +1,9 @@
1
1
  export type Styles = {
2
+ 'slide-left': string;
3
+ 'slide-right': string;
2
4
  'tab-panel': string;
5
+ 'tab-panel--animate-left': string;
6
+ 'tab-panel--animate-right': string;
3
7
  'tab-panel--blueberry': string;
4
8
  'tab-panel--first': string;
5
9
  'tab-panel--framed': string;
@@ -5,14 +5,18 @@ export type { TabProps } from './Tab';
5
5
  export type TabsColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'white'>;
6
6
  export type TabsType = 'normal' | 'framed';
7
7
  export interface TabsProps {
8
- /** Sets the data-testid attribute. */
9
- testId?: string;
8
+ /** Controlled state for Tabs component */
9
+ activeTab?: number;
10
+ /** Adds custom classes to the element. */
11
+ className?: string;
10
12
  /** Sets the color of the tabs. Default: white */
11
13
  color?: TabsColors;
14
+ /** Whether the tab list should be sticky */
15
+ sticky?: boolean;
16
+ /** Sets the data-testid attribute. */
17
+ testId?: string;
12
18
  /** Sets the visual type of the tabs */
13
19
  type?: TabsType;
14
- /** Controlled state for Tabs component */
15
- activeTab?: number;
16
20
  }
17
21
  declare const TabsRoot: React.FC<TabsProps>;
18
22
  type TabsComponent = typeof TabsRoot & {