@laerdal/life-react-components 2.2.1-dev.23.full → 2.2.1-dev.24

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 (262) hide show
  1. package/dist/Accordion/AccordionItem.cjs +17 -8
  2. package/dist/Accordion/AccordionItem.cjs.map +1 -1
  3. package/dist/Accordion/AccordionItem.d.ts +0 -2
  4. package/dist/Accordion/AccordionItem.js +18 -9
  5. package/dist/Accordion/AccordionItem.js.map +1 -1
  6. package/dist/Accordion/AccordionMenu.cjs +2 -6
  7. package/dist/Accordion/AccordionMenu.cjs.map +1 -1
  8. package/dist/Accordion/AccordionMenu.d.ts +0 -3
  9. package/dist/Accordion/AccordionMenu.js +2 -6
  10. package/dist/Accordion/AccordionMenu.js.map +1 -1
  11. package/dist/Accordion/styles.cjs +11 -7
  12. package/dist/Accordion/styles.cjs.map +1 -1
  13. package/dist/Accordion/styles.d.ts +4 -1
  14. package/dist/Accordion/styles.js +9 -6
  15. package/dist/Accordion/styles.js.map +1 -1
  16. package/dist/AuthPage/AuthPage.js +1 -1
  17. package/dist/Banners/Banner.cjs.map +1 -1
  18. package/dist/Banners/Banner.js.map +1 -1
  19. package/dist/Button/Button.cjs +1 -1
  20. package/dist/Button/Button.cjs.map +1 -1
  21. package/dist/Button/Button.js +2 -2
  22. package/dist/Button/Button.js.map +1 -1
  23. package/dist/Button/Iconbutton.cjs +61 -68
  24. package/dist/Button/Iconbutton.cjs.map +1 -1
  25. package/dist/Button/Iconbutton.d.ts +1 -3
  26. package/dist/Button/Iconbutton.js +61 -68
  27. package/dist/Button/Iconbutton.js.map +1 -1
  28. package/dist/Card/HorizontalCard/HorizontalCard.cjs +9 -12
  29. package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
  30. package/dist/Card/HorizontalCard/HorizontalCard.d.ts +0 -2
  31. package/dist/Card/HorizontalCard/HorizontalCard.js +8 -9
  32. package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
  33. package/dist/Card/HorizontalCard/HorizontalCardActions.cjs +0 -1
  34. package/dist/Card/HorizontalCard/HorizontalCardActions.cjs.map +1 -1
  35. package/dist/Card/HorizontalCard/HorizontalCardActions.js +0 -1
  36. package/dist/Card/HorizontalCard/HorizontalCardActions.js.map +1 -1
  37. package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +9 -13
  38. package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -1
  39. package/dist/Card/HorizontalCard/HorizontalCardBody.d.ts +0 -4
  40. package/dist/Card/HorizontalCard/HorizontalCardBody.js +8 -8
  41. package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -1
  42. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +5 -7
  43. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
  44. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.d.ts +0 -2
  45. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +5 -5
  46. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
  47. package/dist/Card/HorizontalCard/index.cjs +12 -33
  48. package/dist/Card/HorizontalCard/index.cjs.map +1 -1
  49. package/dist/Card/HorizontalCard/index.d.ts +1 -3
  50. package/dist/Card/HorizontalCard/index.js +1 -3
  51. package/dist/Card/HorizontalCard/index.js.map +1 -1
  52. package/dist/Card/HorizontalCard/types.cjs.map +1 -1
  53. package/dist/Card/HorizontalCard/types.d.ts +2 -2
  54. package/dist/Card/HorizontalCard/types.js.map +1 -1
  55. package/dist/ChipsInput/ChipInputField.cjs +1 -1
  56. package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
  57. package/dist/ChipsInput/ChipInputField.js +1 -1
  58. package/dist/ChipsInput/ChipInputField.js.map +1 -1
  59. package/dist/Dropdown/BasicDropdown.cjs +21 -6
  60. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  61. package/dist/Dropdown/BasicDropdown.d.ts +2 -0
  62. package/dist/Dropdown/BasicDropdown.js +22 -7
  63. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  64. package/dist/Dropdown/CommonStyling.cjs +7 -4
  65. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  66. package/dist/Dropdown/CommonStyling.d.ts +3 -1
  67. package/dist/Dropdown/CommonStyling.js +7 -4
  68. package/dist/Dropdown/CommonStyling.js.map +1 -1
  69. package/dist/Dropdown/DropdownButton.cjs +0 -1
  70. package/dist/Dropdown/DropdownButton.cjs.map +1 -1
  71. package/dist/Dropdown/DropdownButton.js +0 -1
  72. package/dist/Dropdown/DropdownButton.js.map +1 -1
  73. package/dist/Dropdown/DropdownButtonTypes.cjs.map +1 -1
  74. package/dist/Dropdown/DropdownButtonTypes.d.ts +0 -2
  75. package/dist/Dropdown/DropdownButtonTypes.js.map +1 -1
  76. package/dist/Dropdown/DropdownContent.cjs +1 -1
  77. package/dist/Dropdown/DropdownContent.js +1 -1
  78. package/dist/Dropdown/DropdownFilter.cjs +16 -3
  79. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  80. package/dist/Dropdown/DropdownFilter.d.ts +1 -0
  81. package/dist/Dropdown/DropdownFilter.js +16 -3
  82. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  83. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
  84. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
  85. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +3 -1
  86. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
  87. package/dist/GlobalNavigationBar/GlobalNavigationBar.js +4 -2
  88. package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
  89. package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
  90. package/dist/GlobalNavigationBar/Logo.js.map +1 -1
  91. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs +7 -2
  92. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.cjs.map +1 -1
  93. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.d.ts +4 -0
  94. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js +6 -5
  95. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.js.map +1 -1
  96. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +166 -56
  97. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
  98. package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +2 -2
  99. package/dist/GlobalNavigationBar/desktop/MainMenu.js +166 -56
  100. package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
  101. package/dist/GlobalNavigationBar/desktop/SubMenu.cjs +245 -0
  102. package/dist/GlobalNavigationBar/desktop/SubMenu.cjs.map +1 -0
  103. package/dist/GlobalNavigationBar/desktop/SubMenu.d.ts +18 -0
  104. package/dist/GlobalNavigationBar/desktop/SubMenu.js +235 -0
  105. package/dist/GlobalNavigationBar/desktop/SubMenu.js.map +1 -0
  106. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +1 -1
  107. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
  108. package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -1
  109. package/dist/GlobalNavigationBar/mobile/MobileMenu.js +2 -2
  110. package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
  111. package/dist/GlobalNavigationBar/types.cjs.map +1 -1
  112. package/dist/GlobalNavigationBar/types.d.ts +12 -2
  113. package/dist/GlobalNavigationBar/types.js.map +1 -1
  114. package/dist/GlobalNavigationBar/utils.cjs +17 -0
  115. package/dist/GlobalNavigationBar/utils.cjs.map +1 -0
  116. package/dist/GlobalNavigationBar/utils.d.ts +2 -0
  117. package/dist/GlobalNavigationBar/utils.js +10 -0
  118. package/dist/GlobalNavigationBar/utils.js.map +1 -0
  119. package/dist/Image/ImageWithFallbacks.js +1 -1
  120. package/dist/InputFields/DatepickerField.cjs +54 -33
  121. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  122. package/dist/InputFields/DatepickerField.d.ts +1 -0
  123. package/dist/InputFields/DatepickerField.js +55 -34
  124. package/dist/InputFields/DatepickerField.js.map +1 -1
  125. package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
  126. package/dist/InputFields/DatepickerFieldHeader.js +1 -1
  127. package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
  128. package/dist/InputFields/Label.cjs +12 -8
  129. package/dist/InputFields/Label.cjs.map +1 -1
  130. package/dist/InputFields/Label.js +12 -8
  131. package/dist/InputFields/Label.js.map +1 -1
  132. package/dist/InputFields/NumberField.cjs +33 -14
  133. package/dist/InputFields/NumberField.cjs.map +1 -1
  134. package/dist/InputFields/NumberField.d.ts +1 -0
  135. package/dist/InputFields/NumberField.js +36 -17
  136. package/dist/InputFields/NumberField.js.map +1 -1
  137. package/dist/InputFields/PasswordField.cjs +50 -44
  138. package/dist/InputFields/PasswordField.cjs.map +1 -1
  139. package/dist/InputFields/PasswordField.js +51 -45
  140. package/dist/InputFields/PasswordField.js.map +1 -1
  141. package/dist/InputFields/SearchBar.cjs +2 -1
  142. package/dist/InputFields/SearchBar.cjs.map +1 -1
  143. package/dist/InputFields/SearchBar.js +3 -2
  144. package/dist/InputFields/SearchBar.js.map +1 -1
  145. package/dist/InputFields/TextField.cjs +14 -2
  146. package/dist/InputFields/TextField.cjs.map +1 -1
  147. package/dist/InputFields/TextField.d.ts +1 -0
  148. package/dist/InputFields/TextField.js +15 -3
  149. package/dist/InputFields/TextField.js.map +1 -1
  150. package/dist/InputFields/Textarea.cjs +3 -8
  151. package/dist/InputFields/Textarea.cjs.map +1 -1
  152. package/dist/InputFields/Textarea.d.ts +7 -3
  153. package/dist/InputFields/Textarea.js +6 -12
  154. package/dist/InputFields/Textarea.js.map +1 -1
  155. package/dist/InputFields/components/SearchField.cjs +1 -1
  156. package/dist/InputFields/components/SearchField.cjs.map +1 -1
  157. package/dist/InputFields/components/SearchField.js +1 -1
  158. package/dist/InputFields/components/SearchField.js.map +1 -1
  159. package/dist/InputFields/styling.cjs +11 -11
  160. package/dist/InputFields/styling.cjs.map +1 -1
  161. package/dist/InputFields/styling.d.ts +2 -3
  162. package/dist/InputFields/styling.js +11 -10
  163. package/dist/InputFields/styling.js.map +1 -1
  164. package/dist/InputFields/types.cjs.map +1 -1
  165. package/dist/InputFields/types.d.ts +8 -4
  166. package/dist/InputFields/types.js.map +1 -1
  167. package/dist/LinearProgress/LinearProgress.js +1 -1
  168. package/dist/Modals/ModalContent.cjs +2 -9
  169. package/dist/Modals/ModalContent.cjs.map +1 -1
  170. package/dist/Modals/ModalContent.d.ts +0 -1
  171. package/dist/Modals/ModalContent.js +2 -9
  172. package/dist/Modals/ModalContent.js.map +1 -1
  173. package/dist/Modals/ModalTypes.cjs.map +1 -1
  174. package/dist/Modals/ModalTypes.d.ts +1 -1
  175. package/dist/Modals/ModalTypes.js.map +1 -1
  176. package/dist/NavItem/NavItem.cjs +2 -1
  177. package/dist/NavItem/NavItem.cjs.map +1 -1
  178. package/dist/NavItem/NavItem.d.ts +1 -0
  179. package/dist/NavItem/NavItem.js +1 -1
  180. package/dist/NavItem/NavItem.js.map +1 -1
  181. package/dist/NavItem/NestedNavItem.cjs +38 -0
  182. package/dist/NavItem/NestedNavItem.cjs.map +1 -0
  183. package/dist/NavItem/NestedNavItem.d.ts +13 -0
  184. package/dist/NavItem/NestedNavItem.js +28 -0
  185. package/dist/NavItem/NestedNavItem.js.map +1 -0
  186. package/dist/Paginator/Paginator.cjs.map +1 -1
  187. package/dist/Paginator/Paginator.js.map +1 -1
  188. package/dist/Table/Table.cjs +1 -2
  189. package/dist/Table/Table.cjs.map +1 -1
  190. package/dist/Table/Table.js +1 -2
  191. package/dist/Table/Table.js.map +1 -1
  192. package/dist/Table/TableFooter.cjs.map +1 -1
  193. package/dist/Table/TableFooter.js +1 -1
  194. package/dist/Table/TableFooter.js.map +1 -1
  195. package/dist/Table/TableStyles.cjs +4 -4
  196. package/dist/Table/TableStyles.cjs.map +1 -1
  197. package/dist/Table/TableStyles.js +4 -4
  198. package/dist/Table/TableStyles.js.map +1 -1
  199. package/dist/Table/TableTypes.cjs.map +1 -1
  200. package/dist/Table/TableTypes.d.ts +1 -2
  201. package/dist/Table/TableTypes.js.map +1 -1
  202. package/dist/Tabs/HorizontalTabs.cjs +12 -10
  203. package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
  204. package/dist/Tabs/HorizontalTabs.d.ts +1 -2
  205. package/dist/Tabs/HorizontalTabs.js +14 -13
  206. package/dist/Tabs/HorizontalTabs.js.map +1 -1
  207. package/dist/Tabs/TabLink.cjs +41 -17
  208. package/dist/Tabs/TabLink.cjs.map +1 -1
  209. package/dist/Tabs/TabLink.d.ts +14 -10
  210. package/dist/Tabs/TabLink.js +41 -17
  211. package/dist/Tabs/TabLink.js.map +1 -1
  212. package/dist/Tabs/VerticalTabs.cjs +2 -0
  213. package/dist/Tabs/VerticalTabs.cjs.map +1 -1
  214. package/dist/Tabs/VerticalTabs.d.ts +1 -0
  215. package/dist/Tabs/VerticalTabs.js +2 -0
  216. package/dist/Tabs/VerticalTabs.js.map +1 -1
  217. package/dist/Tile/TileCommonItems.cjs +2 -4
  218. package/dist/Tile/TileCommonItems.cjs.map +1 -1
  219. package/dist/Tile/TileCommonItems.js +2 -4
  220. package/dist/Tile/TileCommonItems.js.map +1 -1
  221. package/dist/Tile/TileHeader.cjs +10 -18
  222. package/dist/Tile/TileHeader.cjs.map +1 -1
  223. package/dist/Tile/TileHeader.js +10 -18
  224. package/dist/Tile/TileHeader.js.map +1 -1
  225. package/dist/Tile/TileTypes.cjs.map +1 -1
  226. package/dist/Tile/TileTypes.d.ts +2 -5
  227. package/dist/Tile/TileTypes.js.map +1 -1
  228. package/dist/Toggles/ToggleSwitch.cjs +1 -11
  229. package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
  230. package/dist/Toggles/ToggleSwitch.js +2 -12
  231. package/dist/Toggles/ToggleSwitch.js.map +1 -1
  232. package/dist/Toggles/TogglerStyles.cjs +1 -1
  233. package/dist/Toggles/TogglerStyles.cjs.map +1 -1
  234. package/dist/Toggles/TogglerStyles.js +1 -1
  235. package/dist/Toggles/TogglerStyles.js.map +1 -1
  236. package/dist/Tooltips/TooltipOverflow.cjs +112 -0
  237. package/dist/Tooltips/TooltipOverflow.cjs.map +1 -0
  238. package/dist/Tooltips/TooltipOverflow.d.ts +10 -0
  239. package/dist/Tooltips/TooltipOverflow.js +102 -0
  240. package/dist/Tooltips/TooltipOverflow.js.map +1 -0
  241. package/dist/Tooltips/TooltipStyles.cjs +8 -5
  242. package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
  243. package/dist/Tooltips/TooltipStyles.d.ts +3 -1
  244. package/dist/Tooltips/TooltipStyles.js +8 -5
  245. package/dist/Tooltips/TooltipStyles.js.map +1 -1
  246. package/dist/Tooltips/TooltipWrapper.cjs +5 -5
  247. package/dist/Tooltips/TooltipWrapper.cjs.map +1 -1
  248. package/dist/Tooltips/TooltipWrapper.js +3 -3
  249. package/dist/Tooltips/TooltipWrapper.js.map +1 -1
  250. package/dist/assets/index.cjs.map +1 -1
  251. package/dist/assets/index.js.map +1 -1
  252. package/dist/common/ActionWithin.cjs +1 -1
  253. package/dist/common/ActionWithin.js +1 -1
  254. package/dist/common/FocusVisible.cjs +1 -1
  255. package/dist/common/FocusVisible.js +1 -1
  256. package/dist/icons/index.cjs +1 -1
  257. package/dist/icons/index.cjs.map +1 -1
  258. package/dist/icons/index.js +1 -1
  259. package/dist/icons/index.js.map +1 -1
  260. package/dist/icons/systemicons/SystemIcons.cjs.map +1 -1
  261. package/dist/icons/systemicons/SystemIcons.js.map +1 -1
  262. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TableStyles.js","names":["styled","COLORS","focusStyles","scrollBarStyling","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","StyledCheckBox","Size","TableWrapper","div","neutral_200","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumnSortDirection","span","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","neutral_20","StyledTableBodyRow","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","backdrop","StyledTableFooterCollapseButton","button","StyledTableBodyWrapper","Small"],"sources":["../../src/Table/TableStyles.ts"],"sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n\n &.border{\n border-left: 1px solid ${COLORS.neutral_200};\n border-right: 1px solid ${COLORS.neutral_200};\n }\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n border-collapse: collapse;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumnSortDirection = styled.span`\n width: 24px;\n height: 24px;\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.left {\n & > div {\n justify-content: left;\n }\n }\n\n &.right {\n & > div {\n justify-content: right;\n }\n }\n\n &.center {\n & > div {\n justify-content: center;\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n background-color: ${COLORS.white};\n \n &:not(:last-child) {\n border-bottom: 1px solid ${COLORS.neutral_200};\n }\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_100};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${Z_INDEXES.backdrop};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,WAAW,EAAEC,gBAAgB,QAAO,WAAW;AAC/D,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,QACb,sBAAsB;AAC7B,SAAQC,SAAS,QAAO,qBAAqB;AAC7C,SAAQC,cAAc,QAAO,yBAAyB;AACtD,SAAQC,IAAI,QAAO,UAAU;;AAE7B;AACA;AACA;;AAEA,OAAO,IAAMC,YAAY,GAAGZ,MAAM,CAACa,GAAG,wLAITZ,MAAM,CAACa,WAAW,EACjBb,MAAM,CAACa,WAAW,CAE/C;AAGD,OAAO,IAAMC,WAAW,GAAGf,MAAM,CAACgB,KAAK,6OAYtC;AAED,OAAO,IAAMC,iBAAiB,GAAGjB,MAAM,CAACa,GAAG,yEAC1C;AAED,OAAO,IAAMK,sBAAsB,GAAGlB,MAAM,CAACa,GAAG,yEA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ACZlC,MAAM,CAACgC,UAAU,EACtBhC,MAAM,CAACiC,WAAW,EAIhBzB,SAAS,CAAC6B,MAAM,EACbrC,MAAM,CAACmC,WAAW,EACvBnC,MAAM,CAACoC,WAAW,CAO9B;AAGD,OAAO,IAAMuB,sBAAsB,GAAG5D,MAAM,CAACa,GAAG,6OAE5CV,gBAAgB,CAACQ,IAAI,CAACkD,KAAK,CAAC,CAU/B"}
1
+ {"version":3,"file":"TableStyles.js","names":["styled","COLORS","focusStyles","scrollBarStyling","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","StyledCheckBox","Size","TableWrapper","div","StyledTable","table","StyledTableHeader","StyledTableHeaderTitle","StyledTableHeaderTitleContent","neutral_200","Bold","black","StyledTableHeaderRow","thead","StyledTableHeaderColumns","tr","StyledTableHeaderColumnContent","StyledTableHeaderColumnSortDirection","span","StyledTableHeaderColumn","th","neutral_600","white","primary_20","primary_700","hover","primary_100","primary_800","active","neutral_20","StyledTableBodyRow","primary_200","StyledTableNoRowsLabelRow","neutral_50","StyledTableBody","tbody","StyledTableCell","td","StyledTableCellContent","Regular","StyledTableCellIcon","neutral_700","StyledTableCellText","StyledTableFooter","StyledTableFooterContent","StyledTableFooterCurrentInfo","StyledTableFooterControls","StyledTableSpinner","backdrop","StyledTableFooterCollapseButton","button","StyledTableBodyWrapper","Small"],"sources":["../../src/Table/TableStyles.ts"],"sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, focusStyles, scrollBarStyling} from '../styles';\nimport {\n ComponentLStyling,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling\n} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {StyledCheckBox} from '../InputFields/Checkbox';\nimport {Size} from \"../types\";\n\n/**\n * Table styles\n */\n\nexport const TableWrapper = styled.div`\n position: relative;\n`;\n\n\nexport const StyledTable = styled.table`\n background: transparent;\n width: 100%;\n\n &.fixed {\n table-layout: fixed;\n }\n\n &.auto {\n table-layout: auto;\n }\n`;\n\nexport const StyledTableHeader = styled.div`\n`;\n\nexport const StyledTableHeaderTitle = styled.div`\n`;\n\nexport const StyledTableHeaderTitleContent = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n box-sizing: border-box;\n min-height: 56px;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 2px solid ${COLORS.neutral_200};\n padding: 0 16px;\n\n ${ComponentLStyling(ComponentTextStyle.Bold, COLORS.black)}\n .title-menu {\n margin-right: -16px;\n }\n`;\n\nexport const StyledTableHeaderRow = styled.thead`\n`;\n\nexport const StyledTableHeaderColumns = styled.tr`\n`;\n\nexport const StyledTableHeaderColumnContent = styled.div`\n box-sizing: border-box;\n min-height: 56px;\n padding: 0 16px;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-top: 1px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n`;\n\nexport const StyledTableHeaderColumnSortDirection = styled.span`\n width: 24px;\n height: 24px;\n`;\n\nexport const StyledTableHeaderColumn = styled.th`\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n position: relative;\n text-align: unset;\n background-color: ${COLORS.white};\n\n //fixes header heights no idea why\n height: 1px;\n\n &.sortable {\n cursor: pointer;\n\n &:hover {\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n z-index: ${Z_INDEXES.active};\n }\n\n &:focus {\n ${focusStyles}\n }\n }\n\n &.left {\n & > div {\n justify-content: left;\n }\n }\n\n &.right {\n & > div {\n justify-content: right;\n }\n }\n\n &.center {\n & > div {\n justify-content: center;\n }\n }\n\n &.sortable ${StyledTableHeaderColumnContent} > svg {\n opacity: 0;\n }\n\n &.sortable.sorted ${StyledTableHeaderColumnContent} > svg {\n opacity: 1;\n }\n\n &.sorted {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\nexport const StyledTableBodyRow = styled.tr`\n cursor: pointer;\n position: relative;\n outline: none;\n\n &.selected{\n background-color: ${COLORS.primary_100};\n }\n \n &:hover {\n background-color: ${COLORS.primary_200};\n z-index: ${Z_INDEXES.hover};\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n }\n\n`;\n\nexport const StyledTableNoRowsLabelRow = styled.tr`\n position: relative;\n outline: none;\n background-color: ${COLORS.neutral_50};\n`;\n\nexport const StyledTableBody = styled.tbody`\n ${StyledTableBodyRow}:nth-child(odd):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_50};\n }\n\n ${StyledTableBodyRow}:nth-child(even):not(.selected):not(:hover):not(:focus):not(:active) {\n background-color: ${COLORS.neutral_20};\n }\n`;\n\n\nexport const StyledTableCell = styled.td``;\n\nexport const StyledTableCellContent = styled.div`\n min-height: 48px;\n\n padding: 0 16px;\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n display: flex;\n align-items: center;\n justify-content: left;\n gap: 8px;\n\n &.truncate-text,\n &.truncate-text span {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &.left {\n justify-content: left;\n }\n\n &.right {\n justify-content: right;\n }\n\n &.center {\n justify-content: center;\n }\n\n a:first-letter,\n span:first-letter {\n text-transform: uppercase;\n }\n \n ${StyledCheckBox}{\n width: fit-content;\n }\n`;\n\nexport const StyledTableCellIcon = styled.div`\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n\n svg {\n color: ${COLORS.neutral_700};\n width: 24px;\n height: 24px;\n }\n`;\n\nexport const StyledTableCellText = styled.span`\n padding: 12px 0;\n`;\n\n\nexport const StyledTableFooter = styled.div`\n`;\n\nexport const StyledTableFooterContent = styled.div`\n border-top: 2px solid ${COLORS.neutral_200};\n border-bottom: 1px solid ${COLORS.neutral_200};\n box-sizing: border-box;\n min-height: 56px;\n\n display: flex;\n align-items: center;\n justify-content: right;\n\n`;\n\nexport const StyledTableFooterCurrentInfo = styled.span`\n padding: 0 16px;\n ${ComponentXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n`;\n\nexport const StyledTableFooterControls = styled.div`\n display: flex;\n`;\n\nexport const StyledTableSpinner = styled.div`\n height: 100%;\n width: 100%;\n position: absolute;\n background-color: rgba(255, 255, 255, 0.75);\n top: 0;\n z-index: ${Z_INDEXES.backdrop};\n`;\n\nexport const StyledTableFooterCollapseButton = styled.button`\n position: relative;\n border-bottom: 1px solid ${COLORS.neutral_200};\n border-top: 1px solid ${COLORS.neutral_200};\n border-left: none;\n border-right: none;\n box-sizing: border-box;\n min-height: 48px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n gap: 4px;\n background: ${COLORS.white};\n\n cursor: pointer;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n \n &:focus {\n ${focusStyles}\n }\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:active {\n z-index: ${Z_INDEXES.active};\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n }\n\n &:disabled {\n display: none;\n }\n\n`;\n\n\nexport const StyledTableBodyWrapper = styled.div`\n overflow-x: auto;\n ${scrollBarStyling(Size.Small)}\n\n ::-webkit-scrollbar-track {\n margin: 6px;\n }\n\n &.scrollable{\n margin-bottom: 6px;\n padding-bottom: 10px;\n }\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,mBAAmB;;AAEtC;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,WAAW,EAAEC,gBAAgB,QAAO,WAAW;AAC/D,SACEC,iBAAiB,EACjBC,iBAAiB,EACjBC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,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AAO,IAAMmC,yBAAyB,GAAGxD,MAAM,CAACa,GAAG,6FAElD;AAED,OAAO,IAAM4C,kBAAkB,GAAGzD,MAAM,CAACa,GAAG,iNAM/BJ,SAAS,CAACiD,QAAQ,CAC9B;AAED,OAAO,IAAMC,+BAA+B,GAAG3D,MAAM,CAAC4D,MAAM,yoBAE/B3D,MAAM,CAACkB,WAAW,EACrBlB,MAAM,CAACkB,WAAW,EAU5BlB,MAAM,CAAC+B,KAAK,EAIxB3B,iBAAiB,CAACE,kBAAkB,CAACa,IAAI,EAAEnB,MAAM,CAAC8B,WAAW,CAAC,EAG5D7B,WAAW,EAIFO,SAAS,CAAC0B,KAAK,EACZlC,MAAM,CAACgC,UAAU,EACtBhC,MAAM,CAACiC,WAAW,EAIhBzB,SAAS,CAAC6B,MAAM,EACbrC,MAAM,CAACmC,WAAW,EACvBnC,MAAM,CAACoC,WAAW,CAO9B;AAGD,OAAO,IAAMwB,sBAAsB,GAAG7D,MAAM,CAACa,GAAG,6OAE5CV,gBAAgB,CAACQ,IAAI,CAACmD,KAAK,CAAC,CAU/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableTypes.cjs","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n border?: boolean;\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n}\n\nexport interface TableColumn {\n key: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n\n sortable?: boolean;\n}\n\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\n\nexport type TableJustification = 'right' | 'left' | 'center';\n\nexport type TableSortingDirection = 'asc' | 'desc';\n\nexport type TableLayout = 'auto' | 'fixed';\n\nexport interface TablePagination {\n from: number;\n to: number;\n total: number;\n currentPage: number;\n rowsPerPage: number;\n}\n\n// will override component properties in case of button, icon and link\n"],"mappings":""}
1
+ {"version":3,"file":"TableTypes.cjs","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n}\n\nexport interface TableColumn {\n key: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n\n sortable?: boolean;\n}\n\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\n\nexport type TableJustification = 'right' | 'left' | 'center';\n\nexport type TableSortingDirection = 'asc' | 'desc';\n\nexport type TableLayout = 'auto' | 'fixed';\n\nexport interface TablePagination {\n from: number;\n to: number;\n total: number;\n currentPage: number;\n rowsPerPage: number;\n}\n\n// will override component properties in case of button, icon and link\n"],"mappings":""}
@@ -9,7 +9,6 @@ export interface TableProps {
9
9
  title?: string;
10
10
  columns: TableColumn[];
11
11
  rows: any[];
12
- border?: boolean;
13
12
  accordion?: boolean;
14
13
  collapsed?: boolean;
15
14
  collapsedRows?: number;
@@ -48,7 +47,7 @@ export interface TableColumn {
48
47
  shortenText?: boolean;
49
48
  action?: (row: any, event: any) => void;
50
49
  type?: TableColumnTypes;
51
- additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;
50
+ additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled'> | Pick<HyperlinkProps, 'variant'>;
52
51
  customContent?: (row: any, key: string) => any;
53
52
  sortable?: boolean;
54
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TableTypes.js","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n border?: boolean;\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n}\n\nexport interface TableColumn {\n key: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled' | 'tooltip'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n\n sortable?: boolean;\n}\n\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\n\nexport type TableJustification = 'right' | 'left' | 'center';\n\nexport type TableSortingDirection = 'asc' | 'desc';\n\nexport type TableLayout = 'auto' | 'fixed';\n\nexport interface TablePagination {\n from: number;\n to: number;\n total: number;\n currentPage: number;\n rowsPerPage: number;\n}\n\n// will override component properties in case of button, icon and link\n"],"mappings":""}
1
+ {"version":3,"file":"TableTypes.js","names":[],"sources":["../../src/Table/TableTypes.ts"],"sourcesContent":["/**\n * Types for the table.\n */\nimport {DropdownButtonProps} from '../Dropdown/DropdownButtonTypes';\nimport {ButtonProps} from '../Button/Button';\nimport {IconButtonProps} from '../Button/Iconbutton';\nimport {HyperlinkProps} from '../HyperLink/HyperLink';\n\nexport interface TableProps {\n title?: string; // Will render header row\n\n columns: TableColumn[];\n rows: any[];\n\n accordion?: boolean; // Will render accordion table\n collapsed?: boolean; // whether table should be collapsed or not\n collapsedRows?: number; // Number of rows to show when table is collapsed\n sortProps?: TableSortProps;\n\n remoteOperations?: boolean; // Indicates that pagination should be done remotely\n pagination?: TablePagination; // Required only in case remotePagination is set to true\n onPreviousPageClick?: () => void; // Will fire on previous page click in case remotePagination is set to true\n onNextPageClick?: () => void; // Will fire on next page click in case remotePagination is set to true\n onRowsPerPageChange?: (count: number) => void; // Will fire when rows per page changes in case remotePagination is set to true\n onTriggerSortingChange?: (key: string, direction?: TableSortingDirection) => void; // Will fire when the sorting direction changes. Used with remote pagination,\n\n showLoadingIndicator?: boolean;\n rowsPerPageLabel? :string; //label that will be shown next to the rows per page selector\n noRowsLabel?: string; //label that will be shown when there are no rows in the grid\n showMoreLabel?: string; //label that will be shown for 'accordion' grid when there are some rows collapsed\n showFewerLabel?: string; //label that will be shown for 'accordion' grid when user can 'collapse' some of the rows\n\n menu?: Pick<DropdownButtonProps, 'items' | 'onClick' | 'disabled' | 'width' | 'itemsType' | 'multiSelect'>;\n\n selectable?: boolean;\n onSelectionChange?: (value: any | any[]) => void;\n multiSelect?: boolean;\n keyExpr?: string;\n selectedRows?: any[];\n\n layout?: TableLayout;\n}\n\nexport interface TableSortProps {\n column: string;\n direction: TableSortingDirection;\n}\n\nexport interface TableColumn {\n key: string;\n name: string;\n filterValue?: string;\n\n icon?: React.ReactNode;\n\n width?: string | number;\n colorFn?: (row: any, key: string) => string;\n justify?: TableJustification;\n shortenText?: boolean;\n\n action?: (row: any, event: any) => void;\n type?: TableColumnTypes;\n additionalProps?: Pick<ButtonProps, 'variant' | 'size' | 'width' | 'icon'> | Pick<IconButtonProps, 'variant' | 'shape' | 'disabled'> | Pick<HyperlinkProps, 'variant'>;\n customContent?: (row: any, key: string) => any;\n\n sortable?: boolean;\n}\n\nexport type TableColumnTypes = 'text' | 'boolean' | 'number' | 'custom' | 'button' | 'icon' | 'link';\n\nexport type TableJustification = 'right' | 'left' | 'center';\n\nexport type TableSortingDirection = 'asc' | 'desc';\n\nexport type TableLayout = 'auto' | 'fixed';\n\nexport interface TablePagination {\n from: number;\n to: number;\n total: number;\n currentPage: number;\n rowsPerPage: number;\n}\n\n// will override component properties in case of button, icon and link\n"],"mappings":""}
@@ -15,9 +15,11 @@ var React = _interopRequireWildcard(require("react"));
15
15
  var _types = require("../types");
16
16
  var _styles = require("../styles");
17
17
  var _styledComponents = _interopRequireDefault(require("styled-components"));
18
+ var _typography = require("../styles/typography");
19
+ var _zIndexes = require("../styles/z-indexes");
18
20
  var _common = require("../common");
19
21
  var _jsxRuntime = require("react/jsx-runtime");
20
- var _excluded = ["size", "tabs", "sideFill", "fullWidth", "onTabChange", "variant"],
22
+ var _excluded = ["size", "tabs", "sideFill", "fullWidth", "onTabChange"],
21
23
  _excluded2 = ["value", "selected", "to", "disabled", "className"];
22
24
  var _templateObject, _templateObject2, _templateObject3;
23
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -25,9 +27,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
25
27
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
28
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
29
  // Add custom styles
28
- var HorizontalTabContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus {\n ", ";\n }\n\n"])), _styles.focusStyles);
30
+ var HorizontalTabContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus{\n ", ";\n }\n \n"])), _styles.focusStyles);
29
31
  var TabSideFill = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n border-bottom: 1px solid ", ";\n bottom: 0;\n width: 100%;\n\n &.fill {\n background: ", ";\n }\n"])), _styles.COLORS.neutral_100, _styles.COLORS.white);
30
- var TabButton = _styledComponents.default.button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n border: none;\n background-color: transparent;\n position: relative;\n cursor: pointer;\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n &[aria-selected=\"true\"] {\n z-index: ", ";\n }\n\n &.floating {\n border-radius: 2px;\n }\n \n &.selected {\n background-color: ", ";\n color: ", ";\n }\n\n &.selected.floating {\n background-color: ", ";\n }\n\n &.default {\n border-left: 1px solid transparent;\n border-right: 1px solid transparent;\n }\n \n &.default.selected {\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n\n &.selected:after {\n content: \"\";\n position: absolute;\n top: 0;\n left: -1px;\n right: -1px;\n height: 2px;\n background-color: ", ";\n }\n\n &.selected.floating:after {\n top: unset;\n bottom: 1px;\n left: 1px;\n right: 1px;\n height: 2px;\n border-radius: 2px;\n background-color: ", ";\n }\n\n\n &:hover, &:hover.selected {\n background: ", ";\n color: ", ";\n }\n\n &:hover:after {\n background-color: ", ";\n }\n\n &:active, &:active.selected {\n background: ", ";\n color: ", ";\n outline: none;\n }\n\n &:active:after {\n background-color: ", ";\n }\n\n &:disabled {\n color: ", ";\n background: transparent;\n cursor: not-allowed;\n }\n\n // Sizes\n &.", " {\n ", "\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.", " {\n ", "\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.", " {\n ", "\n height: 48px;\n min-width: 96px;\n padding: 0 16px;\n }\n\n &.", " {\n ", "\n height: 56px;\n min-width: 144px;\n padding: 0 16px;\n }\n"])), _styles.COLORS.neutral_600, _styles.Z_INDEXES.active, _styles.COLORS.white, _styles.COLORS.neutral_800, _styles.COLORS.neutral_20, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _styles.COLORS.primary_500, _styles.COLORS.primary_500, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_700, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.primary_800, _styles.COLORS.neutral_300, _types.Size.XSmall, (0, _styles.ComponentXSStyling)(_styles.ComponentTextStyle.Regular, null), _types.Size.Small, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Regular, null), _types.Size.Medium, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, null), _types.Size.Large, (0, _styles.ComponentLStyling)(_styles.ComponentTextStyle.Regular, null));
32
+ var TabButton = _styledComponents.default.button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0px;\n\n &:hover {\n z-index: ", ";\n div {\n background: ", ";\n color: ", ";\n\n &[aria-selected=\"true\"] {\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n }\n }\n &[aria-selected=\"true\"] {\n z-index: ", ";\n }\n\n div {\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n &:hover {\n background: ", ";\n color: ", ";\n\n &.selected {\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n }\n\n &.selected {\n background-color: ", ";\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n\n &:active {\n background: ", ";\n color: ", ";\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n outline: none;\n\n &.selected {\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n }\n\n &.disabled {\n color: ", ";\n cursor: not-allowed;\n box-shadow: none !important;\n\n &:hover {\n background-color: transparent;\n color: ", ";\n }\n }\n\n &.size-", " {\n ", "\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.size-", " {\n ", "\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.size-", " {\n ", "\n height: 48px;\n min-width: 96px;\n padding: 0px 16px;\n }\n\n &.size-", " {\n ", "\n height: 56px;\n min-width: 144px;\n padding: 0px 16px;\n }\n }\n"])), _styles.COLORS.neutral_800, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_700, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_700, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _styles.COLORS.white, _styles.COLORS.primary_500, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.focus_25, _styles.COLORS.focus, _styles.COLORS.primary_800, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300, _types.Size.XSmall, (0, _typography.ComponentXSStyling)(_styles.ComponentTextStyle.Regular, null), _types.Size.Small, (0, _typography.ComponentSStyling)(_styles.ComponentTextStyle.Regular, null), _types.Size.Medium, (0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, null), _types.Size.Large, (0, _typography.ComponentLStyling)(_styles.ComponentTextStyle.Regular, null));
31
33
 
32
34
  // Add component-specific types
33
35
 
@@ -37,7 +39,6 @@ var HorizontalTabs = function HorizontalTabs(_ref) {
37
39
  sideFill = _ref.sideFill,
38
40
  fullWidth = _ref.fullWidth,
39
41
  onTabChange = _ref.onTabChange,
40
- variant = _ref.variant,
41
42
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
42
43
  /**
43
44
  * Informs parent component of tab change and clears focus.
@@ -117,7 +118,7 @@ var HorizontalTabs = function HorizontalTabs(_ref) {
117
118
  role: "tablist",
118
119
  "data-testid": 'horizontal-tabs-container'
119
120
  }, rest), {}, {
120
- children: [variant !== 'floating' && /*#__PURE__*/(0, _jsxRuntime.jsx)(TabSideFill, {
121
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TabSideFill, {
121
122
  tabIndex: -1,
122
123
  className: "".concat(sideFill ? 'fill' : '')
123
124
  }), tabs.map(function (tab, index) {
@@ -137,13 +138,15 @@ var HorizontalTabs = function HorizontalTabs(_ref) {
137
138
  style: fullWidth ? {
138
139
  width: "".concat(100 / tabs.length, "%")
139
140
  } : {},
140
- disabled: disabled,
141
- className: "".concat(className || '', " ").concat(size, " ").concat(variant || 'default', " ").concat(tab.selected ? 'selected' : ''),
141
+ className: "".concat(className || '', " size-").concat(size),
142
142
  onClick: function onClick() {
143
143
  return !disabled && changeTabInternal(tab);
144
144
  }
145
145
  }, rest), {}, {
146
- children: tab.value
146
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
147
+ className: "size-".concat(size, " ").concat(tab.selected ? 'selected' : '', " ").concat(tab.disabled ? 'disabled' : ''),
148
+ children: tab.value
149
+ })
147
150
  }), "".concat(tab, "_").concat(index));
148
151
  })]
149
152
  }));
@@ -156,8 +159,7 @@ HorizontalTabs.propTypes = {
156
159
  })).isRequired,
157
160
  sideFill: _propTypes.default.bool,
158
161
  fullWidth: _propTypes.default.bool,
159
- onTabChange: _propTypes.default.func.isRequired,
160
- variant: _propTypes.default.oneOf(['default', 'floating'])
162
+ onTabChange: _propTypes.default.func.isRequired
161
163
  };
162
164
  var _default = HorizontalTabs;
163
165
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalTabs.cjs","names":["HorizontalTabContainer","styled","div","focusStyles","TabSideFill","COLORS","neutral_100","white","TabButton","button","neutral_600","Z_INDEXES","active","neutral_800","neutral_20","primary_500","primary_20","primary_700","primary_100","primary_800","neutral_300","Size","XSmall","ComponentXSStyling","ComponentTextStyle","Regular","Small","ComponentSStyling","Medium","ComponentMStyling","Large","ComponentLStyling","HorizontalTabs","size","tabs","sideFill","fullWidth","onTabChange","variant","rest","doTabChange","to","document","activeElement","HTMLElement","blur","React","useState","focused","setFocused","currentTab","setCurrentTab","useEffect","selectedTab","find","x","selected","disabled","tabListBlur","tabListFocus","e","changeTabInternal","tab","forEach","tabListKeyDown","key","preventDefault","i","j","length","nextIndex","map","index","value","className","defaultOnMouseDownHandler","width"],"sources":["../../src/Tabs/HorizontalTabs.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\nimport {Size} from '../types';\n\n/**\n * Import custom styles.\n */\nimport {COLORS, ComponentTextStyle, focusStyles} from '../styles';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling} from '../styles';\nimport {Z_INDEXES} from '../styles';\nimport {defaultOnMouseDownHandler} from '../common';\nimport Colors from \"../styles/colors\";\n\n// Add custom styles\nconst HorizontalTabContainer = styled.div`\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus {\n ${focusStyles};\n }\n\n`;\n\nconst TabSideFill = styled.div`\n position: absolute;\n border-bottom: 1px solid ${COLORS.neutral_100};\n bottom: 0;\n width: 100%;\n\n &.fill {\n background: ${COLORS.white};\n }\n`;\n\nconst TabButton = styled.button`\n color: ${COLORS.neutral_600};\n border: none;\n background-color: transparent;\n position: relative;\n cursor: pointer;\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n &[aria-selected=\"true\"] {\n z-index: ${Z_INDEXES.active};\n }\n\n &.floating {\n border-radius: 2px;\n }\n \n &.selected {\n background-color: ${COLORS.white};\n color: ${COLORS.neutral_800};\n }\n\n &.selected.floating {\n background-color: ${COLORS.neutral_20};\n }\n\n &.default {\n border-left: 1px solid transparent;\n border-right: 1px solid transparent;\n }\n \n &.default.selected {\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n\n &.selected:after {\n content: \"\";\n position: absolute;\n top: 0;\n left: -1px;\n right: -1px;\n height: 2px;\n background-color: ${COLORS.primary_500};\n }\n\n &.selected.floating:after {\n top: unset;\n bottom: 1px;\n left: 1px;\n right: 1px;\n height: 2px;\n border-radius: 2px;\n background-color: ${COLORS.primary_500};\n }\n\n\n &:hover, &:hover.selected {\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:hover:after {\n background-color: ${COLORS.primary_700};\n }\n\n &:active, &:active.selected {\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n outline: none;\n }\n\n &:active:after {\n background-color: ${COLORS.primary_800};\n }\n\n &:disabled {\n color: ${COLORS.neutral_300};\n background: transparent;\n cursor: not-allowed;\n }\n\n // Sizes\n &.${Size.XSmall} {\n ${ComponentXSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.${Size.Small} {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.${Size.Medium} {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n height: 48px;\n min-width: 96px;\n padding: 0 16px;\n }\n\n &.${Size.Large} {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n height: 56px;\n min-width: 144px;\n padding: 0 16px;\n }\n`;\n\n// Add component-specific types\ninterface HorizontalTabProps extends React.HTMLAttributes<HTMLDivElement> {\n size: Size;\n tabs: HorizontalTab[];\n sideFill?: boolean;\n fullWidth?: boolean;\n onTabChange: (to: string) => void;\n variant?: 'default' | 'floating';\n}\n\nexport interface HorizontalTab extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'tabIndex' | 'onMouseDown' | 'onClick' | 'style'> {\n value: string;\n selected: boolean;\n to: string;\n}\n\nconst HorizontalTabs = ({size, tabs, sideFill, fullWidth, onTabChange, variant, ...rest}: HorizontalTabProps) => {\n /**\n * Informs parent component of tab change and clears focus.\n * @param to - A link to which user should be navigated.\n */\n const doTabChange = (to: string): void => {\n // Let's inform parent component\n onTabChange(to);\n\n // Let's clear focus\n if (document.activeElement instanceof HTMLElement) {\n document.activeElement!.blur();\n }\n };\n\n const [focused, setFocused] = React.useState<boolean>(false);\n const [currentTab, setCurrentTab] = React.useState<string>();\n\n React.useEffect(() => {\n const selectedTab = tabs.find(x => x.selected && !x.disabled);\n if (selectedTab)\n setCurrentTab(selectedTab.to);\n }, [tabs]);\n\n const tabListBlur = () => setFocused(false);\n\n const tabListFocus = (e: React.FocusEvent<HTMLDivElement, Element>) => setFocused(true);\n\n const changeTabInternal = (tab: HorizontalTab) => {\n tab.selected = true;\n tabs.forEach(x => {\n if (x.to != tab.to)\n x.selected = false;\n });\n setCurrentTab(tab.to);\n onTabChange(tab.to);\n }\n\n const tabListKeyDown = (e: React.KeyboardEvent) => {\n if (focused && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {\n e.preventDefault();\n if (e.key === 'ArrowRight') {\n tabs.forEach((x, i) => {\n if (x.to != currentTab)\n return;\n\n for (let j = 1; j < tabs.length - 1; j++) {\n let nextIndex = j + i;\n if (nextIndex > tabs.length - 1)\n nextIndex = nextIndex - tabs.length;\n if (tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n\n if (e.key === 'ArrowLeft') {\n tabs.forEach((x, i) => {\n if (x.to != currentTab)\n return;\n\n for (let j = 1; j < tabs.length - 1; j++) {\n let nextIndex = i - j;\n if (nextIndex < 0)\n nextIndex = nextIndex + tabs.length;\n if (tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n }\n };\n\n return (\n <HorizontalTabContainer tabIndex={0} onBlur={tabListBlur} onFocus={tabListFocus} onKeyDown={tabListKeyDown}\n role=\"tablist\" data-testid={'horizontal-tabs-container'} {...rest}>\n {\n variant !== 'floating' && <TabSideFill tabIndex={-1} className={`${sideFill ? 'fill' : ''}`}/>\n }\n {tabs.map((tab: HorizontalTab, index: number) => {\n const {value, selected, to, disabled, className, ...rest} = tab;\n return (\n <TabButton\n role=\"tab\"\n data-testid={`tab_${value}`}\n key={`${tab}_${index}`}\n aria-selected={selected}\n aria-expanded={selected}\n tabIndex={-1}\n onMouseDown={defaultOnMouseDownHandler}\n style={fullWidth ? {width: `${100 / tabs.length}%`} : {}}\n disabled={disabled}\n className={`${className || ''} ${size} ${variant || 'default'} ${tab.selected ? 'selected' : ''}`}\n onClick={() => !disabled && changeTabInternal(tab)}\n {...rest}>\n {tab.value}\n </TabButton>\n );\n })}\n </HorizontalTabContainer>\n );\n};\n\nexport default HorizontalTabs;\n"],"mappings":";;;;;;;;;;;;;AAGA;AACA;AAKA;AAKA;AAGA;AAAoD;AAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGpD;AACA,IAAMA,sBAAsB,GAAGC,yBAAM,CAACC,GAAG,wMAOnCC,mBAAW,CAGhB;AAED,IAAMC,WAAW,GAAGH,yBAAM,CAACC,GAAG,yNAEDG,cAAM,CAACC,WAAW,EAK7BD,cAAM,CAACE,KAAK,CAE7B;AAED,IAAMC,SAAS,GAAGP,yBAAM,CAACQ,MAAM,u1DACpBJ,cAAM,CAACK,WAAW,EAYdC,iBAAS,CAACC,MAAM,EAQPP,cAAM,CAACE,KAAK,EACvBF,cAAM,CAACQ,WAAW,EAIPR,cAAM,CAACS,UAAU,EASZT,cAAM,CAACC,WAAW,EACjBD,cAAM,CAACC,WAAW,EAUxBD,cAAM,CAACU,WAAW,EAUlBV,cAAM,CAACU,WAAW,EAKxBV,cAAM,CAACW,UAAU,EACtBX,cAAM,CAACY,WAAW,EAIPZ,cAAM,CAACY,WAAW,EAIxBZ,cAAM,CAACa,WAAW,EACvBb,cAAM,CAACc,WAAW,EAKPd,cAAM,CAACc,WAAW,EAI7Bd,cAAM,CAACe,WAAW,EAMzBC,WAAI,CAACC,MAAM,EACX,IAAAC,0BAAkB,EAACC,0BAAkB,CAACC,OAAO,EAAE,IAAI,CAAC,EAMpDJ,WAAI,CAACK,KAAK,EACV,IAAAC,yBAAiB,EAACH,0BAAkB,CAACC,OAAO,EAAE,IAAI,CAAC,EAMnDJ,WAAI,CAACO,MAAM,EACX,IAAAC,yBAAiB,EAACL,0BAAkB,CAACC,OAAO,EAAE,IAAI,CAAC,EAMnDJ,WAAI,CAACS,KAAK,EACV,IAAAC,yBAAiB,EAACP,0BAAkB,CAACC,OAAO,EAAE,I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AK,EAAEvC,SAAS,GAAG;UAACwC,KAAK,YAAK,GAAG,GAAG1C,IAAI,CAACmC,MAAM;QAAG,CAAC,GAAG,CAAC,CAAE;QACzD,QAAQ,EAAEZ,QAAS;QACnB,SAAS,YAAKiB,SAAS,IAAI,EAAE,cAAIzC,IAAI,cAAIK,OAAO,IAAI,SAAS,cAAIwB,GAAG,CAACN,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAG;QAClG,OAAO,EAAE;UAAA,OAAM,CAACC,QAAQ,IAAII,iBAAiB,CAACC,GAAG,CAAC;QAAA;MAAC,GAC/CvB,IAAI;QAAA,UACPuB,GAAG,CAACW;MAAK,cAVFX,GAAG,cAAIU,KAAK,EAWV;IAEhB,CAAC,CAAC;EAAA,GACqB;AAE7B,CAAC;AAAC;EAtHAtC,IAAI;IAQJuC,KAAK;IACLjB,QAAQ;IACRf,EAAE;EAAA;EATFN,QAAQ;EACRC,SAAS;EACTC,WAAW;EACXC,OAAO,4BAAG,SAAS,EAAG,UAAU;AAAA;AAAA,eAoHnBN,cAAc;AAAA"}
1
+ {"version":3,"file":"HorizontalTabs.cjs","names":["HorizontalTabContainer","styled","div","focusStyles","TabSideFill","COLORS","neutral_100","white","TabButton","button","neutral_800","Z_INDEXES","hover","primary_20","primary_700","active","primary_500","primary_100","primary_800","focus_25","focus","neutral_300","Size","XSmall","ComponentXSStyling","ComponentTextStyle","Regular","Small","ComponentSStyling","Medium","ComponentMStyling","Large","ComponentLStyling","HorizontalTabs","size","tabs","sideFill","fullWidth","onTabChange","rest","doTabChange","to","document","activeElement","HTMLElement","blur","React","useState","focused","setFocused","currentTab","setCurrentTab","useEffect","selectedTab","find","x","selected","disabled","tabListBlur","tabListFocus","e","changeTabInternal","tab","forEach","tabListKeyDown","key","preventDefault","i","j","length","nextIndex","map","index","value","className","defaultOnMouseDownHandler","width"],"sources":["../../src/Tabs/HorizontalTabs.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\nimport { Size } from '../types';\n\n/**\n * Import custom styles.\n */\nimport { COLORS, ComponentTextStyle, focusStyles } from '../styles';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\nimport { Z_INDEXES } from '../styles/z-indexes';\nimport { defaultOnMouseDownHandler } from '../common';\n\n// Add custom styles\nconst HorizontalTabContainer = styled.div`\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus{\n ${focusStyles};\n }\n \n`;\n\nconst TabSideFill = styled.div`\n position: absolute;\n border-bottom: 1px solid ${COLORS.neutral_100};\n bottom: 0;\n width: 100%;\n\n &.fill {\n background: ${COLORS.white};\n }\n`;\n\nconst TabButton = styled.button`\n color: ${COLORS.neutral_800};\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0px;\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n div {\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n\n &[aria-selected=\"true\"] {\n border-top: 2px solid ${COLORS.primary_700};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n }\n }\n &[aria-selected=\"true\"] {\n z-index: ${Z_INDEXES.active};\n }\n\n div {\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n &:hover {\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n\n &.selected {\n border-top: 2px solid ${COLORS.primary_700};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n }\n\n &.selected {\n background-color: ${COLORS.white};\n border-top: 2px solid ${COLORS.primary_500};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n\n &:active {\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n\n &.selected {\n border-top: 2px solid ${COLORS.primary_800};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n }\n\n &.disabled {\n color: ${COLORS.neutral_300};\n cursor: not-allowed;\n box-shadow: none !important;\n\n &:hover {\n background-color: transparent;\n color: ${COLORS.neutral_300};\n }\n }\n\n &.size-${Size.XSmall} {\n ${ComponentXSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.size-${Size.Small} {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.size-${Size.Medium} {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n height: 48px;\n min-width: 96px;\n padding: 0px 16px;\n }\n\n &.size-${Size.Large} {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n height: 56px;\n min-width: 144px;\n padding: 0px 16px;\n }\n }\n`;\n\n// Add component-specific types\ninterface HorizontalTabProps extends React.HTMLAttributes<HTMLDivElement>{\n size: Size;\n tabs: HorizontalTab[];\n sideFill?: boolean;\n fullWidth?: boolean;\n onTabChange: (to: string) => void;\n}\n\nexport interface HorizontalTab extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'tabIndex' | 'onMouseDown' | 'onClick' | 'style'> {\n value: string;\n selected: boolean;\n to: string;\n}\n\nconst HorizontalTabs = ({ size, tabs, sideFill, fullWidth, onTabChange, ...rest }: HorizontalTabProps) => {\n /**\n * Informs parent component of tab change and clears focus.\n * @param to - A link to which user should be navigated.\n */\n const doTabChange = (to: string): void => {\n // Let's inform parent component\n onTabChange(to);\n\n // Let's clear focus\n if (document.activeElement instanceof HTMLElement) {\n document.activeElement!.blur();\n }\n };\n\n const [focused, setFocused ] = React.useState<boolean>(false);\n const [currentTab, setCurrentTab] = React.useState<string>();\n\n React.useEffect(() => {\n const selectedTab = tabs.find(x => x.selected && !x.disabled);\n if(selectedTab)\n setCurrentTab(selectedTab.to);\n }, [tabs]);\n\n const tabListBlur = () => setFocused(false);\n\n const tabListFocus = (e: React.FocusEvent<HTMLDivElement, Element>) => setFocused(true);\n\n const changeTabInternal = (tab: HorizontalTab) => {\n tab.selected = true;\n tabs.forEach(x => {\n if(x.to != tab.to)\n x.selected = false;\n });\n setCurrentTab(tab.to);\n onTabChange(tab.to);\n }\n\n const tabListKeyDown = (e:React.KeyboardEvent) => {\n if (focused && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {\n e.preventDefault();\n if(e.key === 'ArrowRight')\n {\n tabs.forEach((x, i) => {\n if(x.to != currentTab)\n return;\n\n for(let j = 1; j < tabs.length - 1; j++)\n {\n let nextIndex = j + i;\n if(nextIndex > tabs.length - 1)\n nextIndex = nextIndex - tabs.length;\n if(tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n\n if(e.key === 'ArrowLeft')\n {\n tabs.forEach((x, i) => {\n if(x.to != currentTab)\n return;\n\n for(let j = 1; j < tabs.length - 1; j++)\n {\n let nextIndex = i - j;\n if(nextIndex < 0)\n nextIndex = nextIndex + tabs.length;\n if(tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n }\n };\n\n return (\n <HorizontalTabContainer tabIndex={0} onBlur={tabListBlur} onFocus={tabListFocus} onKeyDown={tabListKeyDown} role=\"tablist\" data-testid={'horizontal-tabs-container'} {...rest}>\n <TabSideFill tabIndex={-1} className={`${sideFill ? 'fill' : ''}`} />\n {tabs.map((tab: HorizontalTab, index: number) => {\n const { value, selected, to, disabled, className, ...rest } = tab;\n return (\n <TabButton\n role=\"tab\"\n data-testid={`tab_${value}`}\n key={`${tab}_${index}`}\n aria-selected={selected}\n aria-expanded={selected}\n tabIndex={-1}\n onMouseDown={defaultOnMouseDownHandler}\n style={fullWidth ? {width: `${100 / tabs.length}%`} : {}}\n className={`${className || ''} size-${size}`}\n onClick={() => !disabled && changeTabInternal(tab)}\n {...rest}>\n <div\n className={`size-${size} ${tab.selected ? 'selected' : ''} ${tab.disabled ? 'disabled' : ''}`}>{tab.value}</div>\n </TabButton>\n );\n })}\n </HorizontalTabContainer>\n );\n};\n\nexport default HorizontalTabs;\n"],"mappings":";;;;;;;;;;;;;AAGA;AACA;AAKA;AAKA;AACA;AACA;AACA;AAAsD;AAAA;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEtD;AACA,IAAMA,sBAAsB,GAAGC,yBAAM,CAACC,GAAG,yMAOnCC,mBAAW,CAGhB;AAED,IAAMC,WAAW,GAAGH,yBAAM,CAACC,GAAG,yNAEDG,cAAM,CAACC,WAAW,EAK7BD,cAAM,CAACE,KAAK,CAE7B;AAED,IAAMC,SAAS,GAAGP,yBAAM,CAACQ,MAAM,mgEACpBJ,cAAM,CAACK,WAAW,EAOdC,mBAAS,CAACC,KAAK,EAEVP,cAAM,CAACQ,UAAU,EACtBR,cAAM,CAACS,WAAW,EAGDT,cAAM,CAACS,WAAW,EAEjBT,cAAM,CAACC,WAAW,EACjBD,cAAM,CAACC,WAAW,EAKrCK,mBAAS,CAACI,MAAM,EASXV,cAAM,CAACQ,UAAU,EACtBR,cAAM,CAACS,WAAW,EAGDT,cAAM,CAACS,WAAW,EAEjBT,cAAM,CAACC,WAAW,EACjBD,cAAM,CAACC,WAAW,EAK1BD,cAAM,CAACE,KAAK,EACRF,cAAM,CAACW,WAAW,EAEjBX,cAAM,CAACC,WAAW,EACjBD,cAAM,CAACC,WAAW,EAI9BD,cAAM,CAACY,WAAW,EACvBZ,cAAM,CAACa,WAAW,EACAb,cAAM,CAACc,QAAQ,EAAiBd,cAAM,CAACe,KAAK,EAI7Cf,cAAM,CAACa,WAAW,EAEjBb,cAAM,CAACC,WAAW,EACjBD,cAAM,CAACC,WAAW,EAKrCD,cAAM,CAACgB,WAAW,EAMhBhB,cAAM,CAACgB,WAAW,EA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B,QAAQ,GAAyBK,GAAG,CAApCL,QAAQ;QAAEiB,SAAS,GAAcZ,GAAG,CAA1BY,SAAS;QAAKnC,IAAI,0CAAKuB,GAAG;MACjE,oBACE,qBAAC,SAAS;QACR,IAAI,EAAC,KAAK;QACV,6BAAoBW,KAAK,CAAG;QAE5B,iBAAejB,QAAS;QACxB,iBAAeA,QAAS;QACxB,QAAQ,EAAE,CAAC,CAAE;QACb,WAAW,EAAEmB,iCAA0B;QACvC,KAAK,EAAEtC,SAAS,GAAG;UAACuC,KAAK,YAAK,GAAG,GAAGzC,IAAI,CAACkC,MAAM;QAAG,CAAC,GAAG,CAAC,CAAE;QACzD,SAAS,YAAKK,SAAS,IAAI,EAAE,mBAASxC,IAAI,CAAG;QAC7C,OAAO,EAAE;UAAA,OAAM,CAACuB,QAAQ,IAAII,iBAAiB,CAACC,GAAG,CAAC;QAAA;MAAC,GAC/CvB,IAAI;QAAA,uBACR;UACE,SAAS,iBAAUL,IAAI,cAAI4B,GAAG,CAACN,QAAQ,GAAG,UAAU,GAAG,EAAE,cAAIM,GAAG,CAACL,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAG;UAAA,UAAEK,GAAG,CAACW;QAAK;MAAO,cAV1GX,GAAG,cAAIU,KAAK,EAWV;IAEhB,CAAC,CAAC;EAAA,GACqB;AAE7B,CAAC;AAAC;EAtHArC,IAAI;IAOJsC,KAAK;IACLjB,QAAQ;IACRf,EAAE;EAAA;EARFL,QAAQ;EACRC,SAAS;EACTC,WAAW;AAAA;AAAA,eAqHEL,cAAc;AAAA"}
@@ -9,12 +9,11 @@ interface HorizontalTabProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  sideFill?: boolean;
10
10
  fullWidth?: boolean;
11
11
  onTabChange: (to: string) => void;
12
- variant?: 'default' | 'floating';
13
12
  }
14
13
  export interface HorizontalTab extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'tabIndex' | 'onMouseDown' | 'onClick' | 'style'> {
15
14
  value: string;
16
15
  selected: boolean;
17
16
  to: string;
18
17
  }
19
- declare const HorizontalTabs: ({ size, tabs, sideFill, fullWidth, onTabChange, variant, ...rest }: HorizontalTabProps) => JSX.Element;
18
+ declare const HorizontalTabs: ({ size, tabs, sideFill, fullWidth, onTabChange, ...rest }: HorizontalTabProps) => JSX.Element;
20
19
  export default HorizontalTabs;
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
5
5
  import _pt from "prop-types";
6
- var _excluded = ["size", "tabs", "sideFill", "fullWidth", "onTabChange", "variant"],
6
+ var _excluded = ["size", "tabs", "sideFill", "fullWidth", "onTabChange"],
7
7
  _excluded2 = ["value", "selected", "to", "disabled", "className"];
8
8
  var _templateObject, _templateObject2, _templateObject3;
9
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -23,15 +23,16 @@ import { COLORS, ComponentTextStyle, focusStyles } from '../styles';
23
23
  * Import third-party libraries.
24
24
  */
25
25
  import styled from 'styled-components';
26
- import { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles';
27
- import { Z_INDEXES } from '../styles';
26
+ import { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';
27
+ import { Z_INDEXES } from '../styles/z-indexes';
28
28
  import { defaultOnMouseDownHandler } from '../common';
29
+
30
+ // Add custom styles
29
31
  import { jsx as _jsx } from "react/jsx-runtime";
30
32
  import { jsxs as _jsxs } from "react/jsx-runtime";
31
- // Add custom styles
32
- var HorizontalTabContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus {\n ", ";\n }\n\n"])), focusStyles);
33
+ var HorizontalTabContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus{\n ", ";\n }\n \n"])), focusStyles);
33
34
  var TabSideFill = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n border-bottom: 1px solid ", ";\n bottom: 0;\n width: 100%;\n\n &.fill {\n background: ", ";\n }\n"])), COLORS.neutral_100, COLORS.white);
34
- var TabButton = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n border: none;\n background-color: transparent;\n position: relative;\n cursor: pointer;\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n &[aria-selected=\"true\"] {\n z-index: ", ";\n }\n\n &.floating {\n border-radius: 2px;\n }\n \n &.selected {\n background-color: ", ";\n color: ", ";\n }\n\n &.selected.floating {\n background-color: ", ";\n }\n\n &.default {\n border-left: 1px solid transparent;\n border-right: 1px solid transparent;\n }\n \n &.default.selected {\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n\n &.selected:after {\n content: \"\";\n position: absolute;\n top: 0;\n left: -1px;\n right: -1px;\n height: 2px;\n background-color: ", ";\n }\n\n &.selected.floating:after {\n top: unset;\n bottom: 1px;\n left: 1px;\n right: 1px;\n height: 2px;\n border-radius: 2px;\n background-color: ", ";\n }\n\n\n &:hover, &:hover.selected {\n background: ", ";\n color: ", ";\n }\n\n &:hover:after {\n background-color: ", ";\n }\n\n &:active, &:active.selected {\n background: ", ";\n color: ", ";\n outline: none;\n }\n\n &:active:after {\n background-color: ", ";\n }\n\n &:disabled {\n color: ", ";\n background: transparent;\n cursor: not-allowed;\n }\n\n // Sizes\n &.", " {\n ", "\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.", " {\n ", "\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.", " {\n ", "\n height: 48px;\n min-width: 96px;\n padding: 0 16px;\n }\n\n &.", " {\n ", "\n height: 56px;\n min-width: 144px;\n padding: 0 16px;\n }\n"])), COLORS.neutral_600, Z_INDEXES.active, COLORS.white, COLORS.neutral_800, COLORS.neutral_20, COLORS.neutral_100, COLORS.neutral_100, COLORS.primary_500, COLORS.primary_500, COLORS.primary_20, COLORS.primary_700, COLORS.primary_700, COLORS.primary_100, COLORS.primary_800, COLORS.primary_800, COLORS.neutral_300, Size.XSmall, ComponentXSStyling(ComponentTextStyle.Regular, null), Size.Small, ComponentSStyling(ComponentTextStyle.Regular, null), Size.Medium, ComponentMStyling(ComponentTextStyle.Regular, null), Size.Large, ComponentLStyling(ComponentTextStyle.Regular, null));
35
+ var TabButton = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0px;\n\n &:hover {\n z-index: ", ";\n div {\n background: ", ";\n color: ", ";\n\n &[aria-selected=\"true\"] {\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n }\n }\n &[aria-selected=\"true\"] {\n z-index: ", ";\n }\n\n div {\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n &:hover {\n background: ", ";\n color: ", ";\n\n &.selected {\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n }\n\n &.selected {\n background-color: ", ";\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n\n &:active {\n background: ", ";\n color: ", ";\n box-shadow: 0px 4px 12px ", ", 0px 0px 8px ", " !important;\n outline: none;\n\n &.selected {\n border-top: 2px solid ", ";\n border-bottom: 0px;\n border-left: 1px solid ", ";\n border-right: 1px solid ", ";\n }\n }\n\n &.disabled {\n color: ", ";\n cursor: not-allowed;\n box-shadow: none !important;\n\n &:hover {\n background-color: transparent;\n color: ", ";\n }\n }\n\n &.size-", " {\n ", "\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.size-", " {\n ", "\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.size-", " {\n ", "\n height: 48px;\n min-width: 96px;\n padding: 0px 16px;\n }\n\n &.size-", " {\n ", "\n height: 56px;\n min-width: 144px;\n padding: 0px 16px;\n }\n }\n"])), COLORS.neutral_800, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, COLORS.primary_700, COLORS.neutral_100, COLORS.neutral_100, Z_INDEXES.active, COLORS.primary_20, COLORS.primary_700, COLORS.primary_700, COLORS.neutral_100, COLORS.neutral_100, COLORS.white, COLORS.primary_500, COLORS.neutral_100, COLORS.neutral_100, COLORS.primary_100, COLORS.primary_800, COLORS.focus_25, COLORS.focus, COLORS.primary_800, COLORS.neutral_100, COLORS.neutral_100, COLORS.neutral_300, COLORS.neutral_300, Size.XSmall, ComponentXSStyling(ComponentTextStyle.Regular, null), Size.Small, ComponentSStyling(ComponentTextStyle.Regular, null), Size.Medium, ComponentMStyling(ComponentTextStyle.Regular, null), Size.Large, ComponentLStyling(ComponentTextStyle.Regular, null));
35
36
 
36
37
  // Add component-specific types
37
38
 
@@ -41,7 +42,6 @@ var HorizontalTabs = function HorizontalTabs(_ref) {
41
42
  sideFill = _ref.sideFill,
42
43
  fullWidth = _ref.fullWidth,
43
44
  onTabChange = _ref.onTabChange,
44
- variant = _ref.variant,
45
45
  rest = _objectWithoutProperties(_ref, _excluded);
46
46
  /**
47
47
  * Informs parent component of tab change and clears focus.
@@ -121,7 +121,7 @@ var HorizontalTabs = function HorizontalTabs(_ref) {
121
121
  role: "tablist",
122
122
  "data-testid": 'horizontal-tabs-container'
123
123
  }, rest), {}, {
124
- children: [variant !== 'floating' && /*#__PURE__*/_jsx(TabSideFill, {
124
+ children: [/*#__PURE__*/_jsx(TabSideFill, {
125
125
  tabIndex: -1,
126
126
  className: "".concat(sideFill ? 'fill' : '')
127
127
  }), tabs.map(function (tab, index) {
@@ -141,13 +141,15 @@ var HorizontalTabs = function HorizontalTabs(_ref) {
141
141
  style: fullWidth ? {
142
142
  width: "".concat(100 / tabs.length, "%")
143
143
  } : {},
144
- disabled: disabled,
145
- className: "".concat(className || '', " ").concat(size, " ").concat(variant || 'default', " ").concat(tab.selected ? 'selected' : ''),
144
+ className: "".concat(className || '', " size-").concat(size),
146
145
  onClick: function onClick() {
147
146
  return !disabled && changeTabInternal(tab);
148
147
  }
149
148
  }, rest), {}, {
150
- children: tab.value
149
+ children: /*#__PURE__*/_jsx("div", {
150
+ className: "size-".concat(size, " ").concat(tab.selected ? 'selected' : '', " ").concat(tab.disabled ? 'disabled' : ''),
151
+ children: tab.value
152
+ })
151
153
  }), "".concat(tab, "_").concat(index));
152
154
  })]
153
155
  }));
@@ -160,8 +162,7 @@ HorizontalTabs.propTypes = {
160
162
  })).isRequired,
161
163
  sideFill: _pt.bool,
162
164
  fullWidth: _pt.bool,
163
- onTabChange: _pt.func.isRequired,
164
- variant: _pt.oneOf(['default', 'floating'])
165
+ onTabChange: _pt.func.isRequired
165
166
  };
166
167
  export default HorizontalTabs;
167
168
  //# sourceMappingURL=HorizontalTabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HorizontalTabs.js","names":["React","Size","COLORS","ComponentTextStyle","focusStyles","styled","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXSStyling","Z_INDEXES","defaultOnMouseDownHandler","HorizontalTabContainer","div","TabSideFill","neutral_100","white","TabButton","button","neutral_600","active","neutral_800","neutral_20","primary_500","primary_20","primary_700","primary_100","primary_800","neutral_300","XSmall","Regular","Small","Medium","Large","HorizontalTabs","size","tabs","sideFill","fullWidth","onTabChange","variant","rest","doTabChange","to","document","activeElement","HTMLElement","blur","useState","focused","setFocused","currentTab","setCurrentTab","useEffect","selectedTab","find","x","selected","disabled","tabListBlur","tabListFocus","e","changeTabInternal","tab","forEach","tabListKeyDown","key","preventDefault","i","j","length","nextIndex","map","index","value","className","width"],"sources":["../../src/Tabs/HorizontalTabs.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\nimport {Size} from '../types';\n\n/**\n * Import custom styles.\n */\nimport {COLORS, ComponentTextStyle, focusStyles} from '../styles';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling} from '../styles';\nimport {Z_INDEXES} from '../styles';\nimport {defaultOnMouseDownHandler} from '../common';\nimport Colors from \"../styles/colors\";\n\n// Add custom styles\nconst HorizontalTabContainer = styled.div`\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus {\n ${focusStyles};\n }\n\n`;\n\nconst TabSideFill = styled.div`\n position: absolute;\n border-bottom: 1px solid ${COLORS.neutral_100};\n bottom: 0;\n width: 100%;\n\n &.fill {\n background: ${COLORS.white};\n }\n`;\n\nconst TabButton = styled.button`\n color: ${COLORS.neutral_600};\n border: none;\n background-color: transparent;\n position: relative;\n cursor: pointer;\n display: flex;\n box-sizing: border-box;\n justify-content: center;\n align-items: center;\n padding: 0;\n\n &[aria-selected=\"true\"] {\n z-index: ${Z_INDEXES.active};\n }\n\n &.floating {\n border-radius: 2px;\n }\n \n &.selected {\n background-color: ${COLORS.white};\n color: ${COLORS.neutral_800};\n }\n\n &.selected.floating {\n background-color: ${COLORS.neutral_20};\n }\n\n &.default {\n border-left: 1px solid transparent;\n border-right: 1px solid transparent;\n }\n \n &.default.selected {\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n\n &.selected:after {\n content: \"\";\n position: absolute;\n top: 0;\n left: -1px;\n right: -1px;\n height: 2px;\n background-color: ${COLORS.primary_500};\n }\n\n &.selected.floating:after {\n top: unset;\n bottom: 1px;\n left: 1px;\n right: 1px;\n height: 2px;\n border-radius: 2px;\n background-color: ${COLORS.primary_500};\n }\n\n\n &:hover, &:hover.selected {\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n }\n\n &:hover:after {\n background-color: ${COLORS.primary_700};\n }\n\n &:active, &:active.selected {\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n outline: none;\n }\n\n &:active:after {\n background-color: ${COLORS.primary_800};\n }\n\n &:disabled {\n color: ${COLORS.neutral_300};\n background: transparent;\n cursor: not-allowed;\n }\n\n // Sizes\n &.${Size.XSmall} {\n ${ComponentXSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.${Size.Small} {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.${Size.Medium} {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n height: 48px;\n min-width: 96px;\n padding: 0 16px;\n }\n\n &.${Size.Large} {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n height: 56px;\n min-width: 144px;\n padding: 0 16px;\n }\n`;\n\n// Add component-specific types\ninterface HorizontalTabProps extends React.HTMLAttributes<HTMLDivElement> {\n size: Size;\n tabs: HorizontalTab[];\n sideFill?: boolean;\n fullWidth?: boolean;\n onTabChange: (to: string) => void;\n variant?: 'default' | 'floating';\n}\n\nexport interface HorizontalTab extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'tabIndex' | 'onMouseDown' | 'onClick' | 'style'> {\n value: string;\n selected: boolean;\n to: string;\n}\n\nconst HorizontalTabs = ({size, tabs, sideFill, fullWidth, onTabChange, variant, ...rest}: HorizontalTabProps) => {\n /**\n * Informs parent component of tab change and clears focus.\n * @param to - A link to which user should be navigated.\n */\n const doTabChange = (to: string): void => {\n // Let's inform parent component\n onTabChange(to);\n\n // Let's clear focus\n if (document.activeElement instanceof HTMLElement) {\n document.activeElement!.blur();\n }\n };\n\n const [focused, setFocused] = React.useState<boolean>(false);\n const [currentTab, setCurrentTab] = React.useState<string>();\n\n React.useEffect(() => {\n const selectedTab = tabs.find(x => x.selected && !x.disabled);\n if (selectedTab)\n setCurrentTab(selectedTab.to);\n }, [tabs]);\n\n const tabListBlur = () => setFocused(false);\n\n const tabListFocus = (e: React.FocusEvent<HTMLDivElement, Element>) => setFocused(true);\n\n const changeTabInternal = (tab: HorizontalTab) => {\n tab.selected = true;\n tabs.forEach(x => {\n if (x.to != tab.to)\n x.selected = false;\n });\n setCurrentTab(tab.to);\n onTabChange(tab.to);\n }\n\n const tabListKeyDown = (e: React.KeyboardEvent) => {\n if (focused && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {\n e.preventDefault();\n if (e.key === 'ArrowRight') {\n tabs.forEach((x, i) => {\n if (x.to != currentTab)\n return;\n\n for (let j = 1; j < tabs.length - 1; j++) {\n let nextIndex = j + i;\n if (nextIndex > tabs.length - 1)\n nextIndex = nextIndex - tabs.length;\n if (tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n\n if (e.key === 'ArrowLeft') {\n tabs.forEach((x, i) => {\n if (x.to != currentTab)\n return;\n\n for (let j = 1; j < tabs.length - 1; j++) {\n let nextIndex = i - j;\n if (nextIndex < 0)\n nextIndex = nextIndex + tabs.length;\n if (tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n }\n };\n\n return (\n <HorizontalTabContainer tabIndex={0} onBlur={tabListBlur} onFocus={tabListFocus} onKeyDown={tabListKeyDown}\n role=\"tablist\" data-testid={'horizontal-tabs-container'} {...rest}>\n {\n variant !== 'floating' && <TabSideFill tabIndex={-1} className={`${sideFill ? 'fill' : ''}`}/>\n }\n {tabs.map((tab: HorizontalTab, index: number) => {\n const {value, selected, to, disabled, className, ...rest} = tab;\n return (\n <TabButton\n role=\"tab\"\n data-testid={`tab_${value}`}\n key={`${tab}_${index}`}\n aria-selected={selected}\n aria-expanded={selected}\n tabIndex={-1}\n onMouseDown={defaultOnMouseDownHandler}\n style={fullWidth ? {width: `${100 / tabs.length}%`} : {}}\n disabled={disabled}\n className={`${className || ''} ${size} ${variant || 'default'} ${tab.selected ? 'selected' : ''}`}\n onClick={() => !disabled && changeTabInternal(tab)}\n {...rest}>\n {tab.value}\n </TabButton>\n );\n })}\n </HorizontalTabContainer>\n );\n};\n\nexport default HorizontalTabs;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAAQC,IAAI,QAAO,UAAU;;AAE7B;AACA;AACA;AACA,SAAQC,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,QAAO,WAAW;;AAEjE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,iBAAiB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,kBAAkB,QAAO,WAAW;AACrG,SAAQC,SAAS,QAAO,WAAW;AACnC,SAAQC,yBAAyB,QAAO,WAAW;AAAC;AAAA;AAGpD;AACA,IAAMC,sBAAsB,GAAGP,MAAM,CAACQ,GAAG,0LAOnCT,WAAW,CAGhB;AAED,IAAMU,WAAW,GAAGT,MAAM,CAACQ,GAAG,2MAEDX,MAAM,CAACa,WAAW,EAK7Bb,MAAM,CAACc,KAAK,CAE7B;AAED,IAAMC,SAAS,GAAGZ,MAAM,CAACa,MAAM,y0DACpBhB,MAAM,CAACiB,WAAW,EAYdT,SAAS,CAACU,MAAM,EAQPlB,MAAM,CAACc,KAAK,EACvBd,MAAM,CAACmB,WAAW,EAIPnB,MAAM,CAACoB,UAAU,EASZpB,MAAM,CAACa,WAAW,EACjBb,MAAM,CAACa,WAAW,EAUxBb,MAAM,CAACqB,WAAW,EAUlBrB,MAAM,CAACqB,WAAW,EAKxBrB,MAAM,CAACsB,UAAU,EACtBtB,MAAM,CAACuB,WAAW,EAIPvB,MAAM,CAACuB,WAAW,EAIxB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AACT,GAAkB,EAAEU,KAAa,EAAK;MAC/C,IAAOC,KAAK,GAAgDX,GAAG,CAAxDW,KAAK;QAAEjB,QAAQ,GAAsCM,GAAG,CAAjDN,QAAQ;QAAEd,EAAE,GAAkCoB,GAAG,CAAvCpB,EAAE;QAAEe,QAAQ,GAAwBK,GAAG,CAAnCL,QAAQ;QAAEiB,SAAS,GAAaZ,GAAG,CAAzBY,SAAS;QAAKlC,IAAI,4BAAIsB,GAAG;MAC/D,oBACE,KAAC,SAAS;QACR,IAAI,EAAC,KAAK;QACV,6BAAoBW,KAAK,CAAG;QAE5B,iBAAejB,QAAS;QACxB,iBAAeA,QAAS;QACxB,QAAQ,EAAE,CAAC,CAAE;QACb,WAAW,EAAE9C,yBAA0B;QACvC,KAAK,EAAE2B,SAAS,GAAG;UAACsC,KAAK,YAAK,GAAG,GAAGxC,IAAI,CAACkC,MAAM;QAAG,CAAC,GAAG,CAAC,CAAE;QACzD,QAAQ,EAAEZ,QAAS;QACnB,SAAS,YAAKiB,SAAS,IAAI,EAAE,cAAIxC,IAAI,cAAIK,OAAO,IAAI,SAAS,cAAIuB,GAAG,CAACN,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAG;QAClG,OAAO,EAAE;UAAA,OAAM,CAACC,QAAQ,IAAII,iBAAiB,CAACC,GAAG,CAAC;QAAA;MAAC,GAC/CtB,IAAI;QAAA,UACPsB,GAAG,CAACW;MAAK,cAVFX,GAAG,cAAIU,KAAK,EAWV;IAEhB,CAAC,CAAC;EAAA,GACqB;AAE7B,CAAC;AAAC;EAtHArC,IAAI;IAQJsC,KAAK;IACLjB,QAAQ;IACRd,EAAE;EAAA;EATFN,QAAQ;EACRC,SAAS;EACTC,WAAW;EACXC,OAAO,aAAG,SAAS,EAAG,UAAU;AAAA;AAoHlC,eAAeN,cAAc"}
1
+ {"version":3,"file":"HorizontalTabs.js","names":["React","Size","COLORS","ComponentTextStyle","focusStyles","styled","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentXSStyling","Z_INDEXES","defaultOnMouseDownHandler","HorizontalTabContainer","div","TabSideFill","neutral_100","white","TabButton","button","neutral_800","hover","primary_20","primary_700","active","primary_500","primary_100","primary_800","focus_25","focus","neutral_300","XSmall","Regular","Small","Medium","Large","HorizontalTabs","size","tabs","sideFill","fullWidth","onTabChange","rest","doTabChange","to","document","activeElement","HTMLElement","blur","useState","focused","setFocused","currentTab","setCurrentTab","useEffect","selectedTab","find","x","selected","disabled","tabListBlur","tabListFocus","e","changeTabInternal","tab","forEach","tabListKeyDown","key","preventDefault","i","j","length","nextIndex","map","index","value","className","width"],"sources":["../../src/Tabs/HorizontalTabs.tsx"],"sourcesContent":["/**\n * Import React libraries.\n */\nimport * as React from 'react';\nimport { Size } from '../types';\n\n/**\n * Import custom styles.\n */\nimport { COLORS, ComponentTextStyle, focusStyles } from '../styles';\n\n/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\nimport { ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentXSStyling } from '../styles/typography';\nimport { Z_INDEXES } from '../styles/z-indexes';\nimport { defaultOnMouseDownHandler } from '../common';\n\n// Add custom styles\nconst HorizontalTabContainer = styled.div`\n width: 100%;\n display: flex;\n position: relative;\n flex-direction: row;\n\n &:focus{\n ${focusStyles};\n }\n \n`;\n\nconst TabSideFill = styled.div`\n position: absolute;\n border-bottom: 1px solid ${COLORS.neutral_100};\n bottom: 0;\n width: 100%;\n\n &.fill {\n background: ${COLORS.white};\n }\n`;\n\nconst TabButton = styled.button`\n color: ${COLORS.neutral_800};\n border: none;\n background-color: transparent;\n cursor: pointer;\n padding: 0px;\n\n &:hover {\n z-index: ${Z_INDEXES.hover};\n div {\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n\n &[aria-selected=\"true\"] {\n border-top: 2px solid ${COLORS.primary_700};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n }\n }\n &[aria-selected=\"true\"] {\n z-index: ${Z_INDEXES.active};\n }\n\n div {\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n &:hover {\n background: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n\n &.selected {\n border-top: 2px solid ${COLORS.primary_700};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n }\n\n &.selected {\n background-color: ${COLORS.white};\n border-top: 2px solid ${COLORS.primary_500};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n\n &:active {\n background: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n\n &.selected {\n border-top: 2px solid ${COLORS.primary_800};\n border-bottom: 0px;\n border-left: 1px solid ${COLORS.neutral_100};\n border-right: 1px solid ${COLORS.neutral_100};\n }\n }\n\n &.disabled {\n color: ${COLORS.neutral_300};\n cursor: not-allowed;\n box-shadow: none !important;\n\n &:hover {\n background-color: transparent;\n color: ${COLORS.neutral_300};\n }\n }\n\n &.size-${Size.XSmall} {\n ${ComponentXSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 32px;\n margin-top: 16px;\n }\n\n &.size-${Size.Small} {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n padding: 0px 16px;\n height: 40px;\n margin-top: 8px;\n }\n\n &.size-${Size.Medium} {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n height: 48px;\n min-width: 96px;\n padding: 0px 16px;\n }\n\n &.size-${Size.Large} {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n height: 56px;\n min-width: 144px;\n padding: 0px 16px;\n }\n }\n`;\n\n// Add component-specific types\ninterface HorizontalTabProps extends React.HTMLAttributes<HTMLDivElement>{\n size: Size;\n tabs: HorizontalTab[];\n sideFill?: boolean;\n fullWidth?: boolean;\n onTabChange: (to: string) => void;\n}\n\nexport interface HorizontalTab extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'tabIndex' | 'onMouseDown' | 'onClick' | 'style'> {\n value: string;\n selected: boolean;\n to: string;\n}\n\nconst HorizontalTabs = ({ size, tabs, sideFill, fullWidth, onTabChange, ...rest }: HorizontalTabProps) => {\n /**\n * Informs parent component of tab change and clears focus.\n * @param to - A link to which user should be navigated.\n */\n const doTabChange = (to: string): void => {\n // Let's inform parent component\n onTabChange(to);\n\n // Let's clear focus\n if (document.activeElement instanceof HTMLElement) {\n document.activeElement!.blur();\n }\n };\n\n const [focused, setFocused ] = React.useState<boolean>(false);\n const [currentTab, setCurrentTab] = React.useState<string>();\n\n React.useEffect(() => {\n const selectedTab = tabs.find(x => x.selected && !x.disabled);\n if(selectedTab)\n setCurrentTab(selectedTab.to);\n }, [tabs]);\n\n const tabListBlur = () => setFocused(false);\n\n const tabListFocus = (e: React.FocusEvent<HTMLDivElement, Element>) => setFocused(true);\n\n const changeTabInternal = (tab: HorizontalTab) => {\n tab.selected = true;\n tabs.forEach(x => {\n if(x.to != tab.to)\n x.selected = false;\n });\n setCurrentTab(tab.to);\n onTabChange(tab.to);\n }\n\n const tabListKeyDown = (e:React.KeyboardEvent) => {\n if (focused && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {\n e.preventDefault();\n if(e.key === 'ArrowRight')\n {\n tabs.forEach((x, i) => {\n if(x.to != currentTab)\n return;\n\n for(let j = 1; j < tabs.length - 1; j++)\n {\n let nextIndex = j + i;\n if(nextIndex > tabs.length - 1)\n nextIndex = nextIndex - tabs.length;\n if(tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n\n if(e.key === 'ArrowLeft')\n {\n tabs.forEach((x, i) => {\n if(x.to != currentTab)\n return;\n\n for(let j = 1; j < tabs.length - 1; j++)\n {\n let nextIndex = i - j;\n if(nextIndex < 0)\n nextIndex = nextIndex + tabs.length;\n if(tabs[nextIndex].disabled)\n continue;\n changeTabInternal(tabs[nextIndex]);\n break;\n }\n });\n }\n }\n };\n\n return (\n <HorizontalTabContainer tabIndex={0} onBlur={tabListBlur} onFocus={tabListFocus} onKeyDown={tabListKeyDown} role=\"tablist\" data-testid={'horizontal-tabs-container'} {...rest}>\n <TabSideFill tabIndex={-1} className={`${sideFill ? 'fill' : ''}`} />\n {tabs.map((tab: HorizontalTab, index: number) => {\n const { value, selected, to, disabled, className, ...rest } = tab;\n return (\n <TabButton\n role=\"tab\"\n data-testid={`tab_${value}`}\n key={`${tab}_${index}`}\n aria-selected={selected}\n aria-expanded={selected}\n tabIndex={-1}\n onMouseDown={defaultOnMouseDownHandler}\n style={fullWidth ? {width: `${100 / tabs.length}%`} : {}}\n className={`${className || ''} size-${size}`}\n onClick={() => !disabled && changeTabInternal(tab)}\n {...rest}>\n <div\n className={`size-${size} ${tab.selected ? 'selected' : ''} ${tab.disabled ? 'disabled' : ''}`}>{tab.value}</div>\n </TabButton>\n );\n })}\n </HorizontalTabContainer>\n );\n};\n\nexport default HorizontalTabs;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,UAAU;;AAE/B;AACA;AACA;AACA,SAASC,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,QAAQ,WAAW;;AAEnE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,iBAAiB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,kBAAkB,QAAQ,sBAAsB;AAClH,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,yBAAyB,QAAQ,WAAW;;AAErD;AAAA;AAAA;AACA,IAAMC,sBAAsB,GAAGP,MAAM,CAACQ,GAAG,2LAOnCT,WAAW,CAGhB;AAED,IAAMU,WAAW,GAAGT,MAAM,CAACQ,GAAG,2MAEDX,MAAM,CAACa,WAAW,EAK7Bb,MAAM,CA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CAAG;QAC7C,OAAO,EAAE;UAAA,OAAM,CAACsB,QAAQ,IAAII,iBAAiB,CAACC,GAAG,CAAC;QAAA;MAAC,GAC/CtB,IAAI;QAAA,uBACR;UACE,SAAS,iBAAUL,IAAI,cAAI2B,GAAG,CAACN,QAAQ,GAAG,UAAU,GAAG,EAAE,cAAIM,GAAG,CAACL,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAG;UAAA,UAAEK,GAAG,CAACW;QAAK;MAAO,cAV1GX,GAAG,cAAIU,KAAK,EAWV;IAEhB,CAAC,CAAC;EAAA,GACqB;AAE7B,CAAC;AAAC;EAtHApC,IAAI;IAOJqC,KAAK;IACLjB,QAAQ;IACRd,EAAE;EAAA;EARFL,QAAQ;EACRC,SAAS;EACTC,WAAW;AAAA;AAqHb,eAAeL,cAAc"}
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
13
  var React = _interopRequireWildcard(require("react"));
12
14
  var _reactRouterDom = require("react-router-dom");
@@ -17,21 +19,25 @@ var _styles = require("../styles");
17
19
  var _zIndexes = require("../styles/z-indexes");
18
20
  var _common = require("../common");
19
21
  var _jsxRuntime = require("react/jsx-runtime");
22
+ var _excluded = ["to", "disabled", "requiredLine", "optionalLine", "OptionalLineIcon", "onLinkClick", "forceDeactivate", "testId", "showNotificationDot", "size", "endLineIcon", "onActiveStateChanged", "variant", "children", "containerOnMouseEnter", "containerOnMouseLeave", "className"];
20
23
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
21
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
- var StyledTabLink = (0, _styledComponents.default)(_reactRouterDom.NavLink)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n font-size: 16px;\n line-height: 120%;\n color: ", ";\n\n background-color: ", ";\n cursor: ", ";\n border-left: 1px solid transparent;\n text-decoration: none;\n position: relative;\n border-radius: 2px;\n\n &:not(:last-child) {\n margin-bottom: 4px;\n }\n\n &:focus {\n ", "\n }\n\n &.active {\n z-index: ", ";\n background-color: ", ";\n }\n\n &.active:hover {\n background-color: ", ";\n }\n\n &:hover {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n }\n\n &:active {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n }\n\n &.active {\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 0;\n bottom: 0;\n left: -1px;\n background-color: ", ";\n\n border-radius: 2px;\n }\n }\n\n &.active:hover {\n &::after {\n background-color: ", ";\n }\n }\n\n &.active:active {\n background-color: ", ";\n\n &::after {\n background-color: ", ";\n }\n }\n\n &.disabled {\n background-color: ", ";\n color: ", ";\n\n span {\n color: ", ";\n }\n\n &::after {\n background-color: ", ";\n }\n }\n"])), _styles.COLORS.neutral_600, function (props) {
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
+ var OptionalLineWrapperWithIcon = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n\n span {\n margin: 0 0 0 4px !important;\n font-size: 12px;\n line-height: 16px;\n }\n"])));
29
+ var TopWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n\n span:not(:only-child) {\n width: calc(100% - 32px);\n }\n"])));
30
+ var TextContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n margin: auto 0 auto 16px !important;\n"])));
31
+ var StyledNotification = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 15px 0 0 !important;\n"])));
32
+ var EndLineIcon = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 15px 0 0 !important;\n"])));
33
+ var OptionalLineWrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n"])));
34
+ //replaced styledTabLink because 'className' and 'styled' functions for some reason were not being executed
35
+ var Wrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n &.disabled {\n cursor: not-allowed;\n\n a {\n pointer-events: none;\n }\n }\n\n a {\n \n display: flex;\n flex-direction: row;\n align-items: center;\n \n font-size: 16px;\n line-height: 120%;\n color: ", ";\n \n background-color: ", ";\n cursor: ", ";\n border-left: 1px solid transparent;\n text-decoration: none;\n position: relative;\n border-radius: 2px;\n \n &:not(:last-child) {\n margin-bottom: 4px;\n }\n \n &:focus {\n ", "\n }\n \n &.active {\n z-index: ", ";\n background-color: ", ";\n }\n \n &.active:hover, &.active.dropdown-hover {\n background-color: ", ";\n }\n \n &:hover, &.dropdown-hover {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n }\n \n &:active {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n }\n \n &.active {\n &::after {\n position: absolute;\n content: ' ';\n width: 4px;\n top: 6px;\n bottom: 6px;\n left: 3px;\n background-color: ", ";\n \n border-radius: 4px;\n }\n }\n \n &.active:hover, &.active.dropdown-hover {\n &::after {\n background-color: ", ";\n }\n }\n \n &.active:active {\n background-color: ", ";\n \n &::after {\n background-color: ", ";\n }\n }\n \n &.disabled {\n background-color: ", ";\n color: ", ";\n \n span {\n color: ", ";\n }\n \n &::after {\n background-color: ", ";\n }\n }\n }\n"])), _styles.COLORS.neutral_600, function (props) {
24
36
  return props.disabled ? _styles.COLORS.neutral_100 : 'transparent';
25
37
  }, function (props) {
26
38
  return props.disabled ? 'not-allowed' : 'pointer';
27
39
  }, _styles.focusStyles, _zIndexes.Z_INDEXES.active, _styles.COLORS.neutral_20, _styles.COLORS.primary_20, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_600, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.primary_500, _styles.COLORS.primary_600, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.white, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300);
28
- var OptionalLineWrapperWithIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n\n span {\n margin: 0 0 0 4px !important;\n font-size: 12px;\n line-height: 16px;\n }\n"])));
29
- var TopWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n\n span:not(:only-child) {\n width: calc(100% - 32px);\n }\n"])));
30
- var TextContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n margin: auto 0 auto 16px !important;\n"])));
31
- var StyledNotification = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 15px 0 0 !important;\n"])));
32
- var OptionalLineWrapper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n"])));
33
- var Wrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n &.disabled {\n cursor: not-allowed;\n\n ", " {\n pointer-events: none;\n }\n }\n"])), StyledTabLink);
34
- var TabLink = function TabLink(_ref) {
40
+ var TabLink = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
35
41
  var to = _ref.to,
36
42
  _ref$disabled = _ref.disabled,
37
43
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
@@ -39,25 +45,40 @@ var TabLink = function TabLink(_ref) {
39
45
  optionalLine = _ref.optionalLine,
40
46
  OptionalLineIcon = _ref.OptionalLineIcon,
41
47
  onLinkClick = _ref.onLinkClick,
48
+ forceDeactivate = _ref.forceDeactivate,
42
49
  testId = _ref.testId,
43
50
  _ref$showNotification = _ref.showNotificationDot,
44
51
  showNotificationDot = _ref$showNotification === void 0 ? false : _ref$showNotification,
45
52
  _ref$size = _ref.size,
46
53
  size = _ref$size === void 0 ? _types.Size.Small : _ref$size,
54
+ endLineIcon = _ref.endLineIcon,
55
+ onActiveStateChanged = _ref.onActiveStateChanged,
47
56
  _ref$variant = _ref.variant,
48
- variant = _ref$variant === void 0 ? 'critical' : _ref$variant;
49
- var ref = React.useRef(null);
57
+ variant = _ref$variant === void 0 ? 'critical' : _ref$variant,
58
+ children = _ref.children,
59
+ containerOnMouseEnter = _ref.containerOnMouseEnter,
60
+ containerOnMouseLeave = _ref.containerOnMouseLeave,
61
+ className = _ref.className,
62
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
50
63
  var _useState = (0, React.useState)(false),
51
64
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
52
65
  activeState = _useState2[0],
53
66
  setActiveState = _useState2[1];
54
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
68
+ disabled: disabled,
55
69
  className: disabled ? 'disabled' : '',
56
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledTabLink, {
57
- to: to.toString(),
58
- disabled: disabled,
70
+ onMouseEnter: containerOnMouseEnter,
71
+ onMouseLeave: containerOnMouseLeave,
72
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactRouterDom.NavLink, _objectSpread(_objectSpread({
73
+ to: forceDeactivate ? 'invalid' : to.toString()
74
+ //disabled={disabled}
75
+ ,
59
76
  className: function className(_ref2) {
60
77
  var isActive = _ref2.isActive;
78
+ onActiveStateChanged && onActiveStateChanged(activeState);
79
+ if (forceDeactivate) {
80
+ if (disabled) return 'disabled';else return '';
81
+ }
61
82
  if (isActive != activeState) setActiveState(isActive);
62
83
  return (isActive ? 'active ' : '') + (disabled ? 'disabled' : '');
63
84
  },
@@ -69,7 +90,8 @@ var TabLink = function TabLink(_ref) {
69
90
  return !disabled && onLinkClick && onLinkClick(e);
70
91
  },
71
92
  ref: ref,
72
- "data-testid": testId,
93
+ "data-testid": testId
94
+ }, rest), {}, {
73
95
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(TextContainer, {
74
96
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TopWrapper, {
75
97
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -90,10 +112,12 @@ var TabLink = function TabLink(_ref) {
90
112
  size: size,
91
113
  variant: variant
92
114
  })
115
+ }), endLineIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(EndLineIcon, {
116
+ children: endLineIcon
93
117
  })]
94
- })
118
+ })), children]
95
119
  });
96
- };
120
+ });
97
121
  var _default = TabLink;
98
122
  exports.default = _default;
99
123
  //# sourceMappingURL=TabLink.cjs.map