@laerdal/life-react-components 6.0.0-dev.2.full → 6.0.0-dev.5.full

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 (334) hide show
  1. package/dist/Accordion/ContentAccordion.cjs +40 -11
  2. package/dist/Accordion/ContentAccordion.cjs.map +1 -1
  3. package/dist/Accordion/ContentAccordion.js +40 -11
  4. package/dist/Accordion/ContentAccordion.js.map +1 -1
  5. package/dist/Accordion/styles.cjs +51 -13
  6. package/dist/Accordion/styles.cjs.map +1 -1
  7. package/dist/Accordion/styles.js +51 -13
  8. package/dist/Accordion/styles.js.map +1 -1
  9. package/dist/Banners/Banner.cjs +38 -34
  10. package/dist/Banners/Banner.cjs.map +1 -1
  11. package/dist/Banners/Banner.d.ts +2 -3
  12. package/dist/Banners/Banner.js +38 -34
  13. package/dist/Banners/Banner.js.map +1 -1
  14. package/dist/Banners/styles.cjs +8 -16
  15. package/dist/Banners/styles.cjs.map +1 -1
  16. package/dist/Banners/styles.js +8 -16
  17. package/dist/Banners/styles.js.map +1 -1
  18. package/dist/Breadcrumb/Breadcrumb.cjs +8 -2
  19. package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
  20. package/dist/Breadcrumb/Breadcrumb.js +8 -2
  21. package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
  22. package/dist/Breadcrumb/styles.cjs +15 -4
  23. package/dist/Breadcrumb/styles.cjs.map +1 -1
  24. package/dist/Breadcrumb/styles.js +15 -4
  25. package/dist/Breadcrumb/styles.js.map +1 -1
  26. package/dist/Button/BackButton.cjs +27 -6
  27. package/dist/Button/BackButton.cjs.map +1 -1
  28. package/dist/Button/BackButton.js +27 -6
  29. package/dist/Button/BackButton.js.map +1 -1
  30. package/dist/Button/Button.cjs +184 -47
  31. package/dist/Button/Button.cjs.map +1 -1
  32. package/dist/Button/Button.d.ts +2 -0
  33. package/dist/Button/Button.js +184 -47
  34. package/dist/Button/Button.js.map +1 -1
  35. package/dist/Button/Iconbutton.cjs +83 -21
  36. package/dist/Button/Iconbutton.cjs.map +1 -1
  37. package/dist/Button/Iconbutton.js +83 -21
  38. package/dist/Button/Iconbutton.js.map +1 -1
  39. package/dist/Card/HorizontalCard/HorizontalCard.cjs +20 -5
  40. package/dist/Card/HorizontalCard/HorizontalCard.cjs.map +1 -1
  41. package/dist/Card/HorizontalCard/HorizontalCard.js +20 -5
  42. package/dist/Card/HorizontalCard/HorizontalCard.js.map +1 -1
  43. package/dist/Card/HorizontalCard/HorizontalCardBody.cjs +12 -3
  44. package/dist/Card/HorizontalCard/HorizontalCardBody.cjs.map +1 -1
  45. package/dist/Card/HorizontalCard/HorizontalCardBody.js +12 -3
  46. package/dist/Card/HorizontalCard/HorizontalCardBody.js.map +1 -1
  47. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs +8 -2
  48. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.cjs.map +1 -1
  49. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js +8 -2
  50. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.js.map +1 -1
  51. package/dist/Card/VerticalCard/Card.cjs +20 -5
  52. package/dist/Card/VerticalCard/Card.cjs.map +1 -1
  53. package/dist/Card/VerticalCard/Card.js +20 -5
  54. package/dist/Card/VerticalCard/Card.js.map +1 -1
  55. package/dist/Card/VerticalCard/CardBottomSection.cjs +28 -7
  56. package/dist/Card/VerticalCard/CardBottomSection.cjs.map +1 -1
  57. package/dist/Card/VerticalCard/CardBottomSection.js +28 -7
  58. package/dist/Card/VerticalCard/CardBottomSection.js.map +1 -1
  59. package/dist/Card/VerticalCard/CardMiddleSection.cjs +19 -4
  60. package/dist/Card/VerticalCard/CardMiddleSection.cjs.map +1 -1
  61. package/dist/Card/VerticalCard/CardMiddleSection.js +19 -4
  62. package/dist/Card/VerticalCard/CardMiddleSection.js.map +1 -1
  63. package/dist/Card/VerticalCard/CardTopSection.cjs +9 -2
  64. package/dist/Card/VerticalCard/CardTopSection.cjs.map +1 -1
  65. package/dist/Card/VerticalCard/CardTopSection.js +9 -2
  66. package/dist/Card/VerticalCard/CardTopSection.js.map +1 -1
  67. package/dist/Chips/ChipStyles.cjs +4 -1
  68. package/dist/Chips/ChipStyles.cjs.map +1 -1
  69. package/dist/Chips/ChipStyles.js +4 -1
  70. package/dist/Chips/ChipStyles.js.map +1 -1
  71. package/dist/ChipsInput/ChipInputField.cjs +16 -4
  72. package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
  73. package/dist/ChipsInput/ChipInputField.js +16 -4
  74. package/dist/ChipsInput/ChipInputField.js.map +1 -1
  75. package/dist/Dropdown/BasicDropdown.cjs +12 -3
  76. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  77. package/dist/Dropdown/BasicDropdown.js +12 -3
  78. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  79. package/dist/Dropdown/CommonStyling.cjs +172 -42
  80. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  81. package/dist/Dropdown/CommonStyling.js +172 -42
  82. package/dist/Dropdown/CommonStyling.js.map +1 -1
  83. package/dist/Dropdown/DropdownContent.cjs +36 -10
  84. package/dist/Dropdown/DropdownContent.cjs.map +1 -1
  85. package/dist/Dropdown/DropdownContent.js +36 -10
  86. package/dist/Dropdown/DropdownContent.js.map +1 -1
  87. package/dist/Dropdown/DropdownFilter.cjs +12 -3
  88. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  89. package/dist/Dropdown/DropdownFilter.js +12 -3
  90. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  91. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +4 -1
  92. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
  93. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +4 -1
  94. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
  95. package/dist/GlobalNavigationBar/__tests__/GlobalNavigationBar.tests.d.ts +1 -0
  96. package/dist/GlobalNavigationBar/__tests__/Logo.tests.d.ts +1 -0
  97. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +4 -1
  98. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
  99. package/dist/GlobalNavigationBar/desktop/UserMenu.js +4 -1
  100. package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
  101. package/dist/HyperLink/styling.cjs +38 -8
  102. package/dist/HyperLink/styling.cjs.map +1 -1
  103. package/dist/HyperLink/styling.js +38 -8
  104. package/dist/HyperLink/styling.js.map +1 -1
  105. package/dist/InputFields/Checkbox.cjs +54 -14
  106. package/dist/InputFields/Checkbox.cjs.map +1 -1
  107. package/dist/InputFields/Checkbox.js +54 -14
  108. package/dist/InputFields/Checkbox.js.map +1 -1
  109. package/dist/InputFields/DatepickerField.cjs +148 -42
  110. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  111. package/dist/InputFields/DatepickerField.js +149 -43
  112. package/dist/InputFields/DatepickerField.js.map +1 -1
  113. package/dist/InputFields/DatepickerFieldHeader.cjs +20 -5
  114. package/dist/InputFields/DatepickerFieldHeader.cjs.map +1 -1
  115. package/dist/InputFields/DatepickerFieldHeader.js +20 -5
  116. package/dist/InputFields/DatepickerFieldHeader.js.map +1 -1
  117. package/dist/InputFields/Label.cjs +38 -11
  118. package/dist/InputFields/Label.cjs.map +1 -1
  119. package/dist/InputFields/Label.js +38 -11
  120. package/dist/InputFields/Label.js.map +1 -1
  121. package/dist/InputFields/NumberField.cjs +66 -16
  122. package/dist/InputFields/NumberField.cjs.map +1 -1
  123. package/dist/InputFields/NumberField.js +66 -16
  124. package/dist/InputFields/NumberField.js.map +1 -1
  125. package/dist/InputFields/PasswordField.cjs +4 -1
  126. package/dist/InputFields/PasswordField.cjs.map +1 -1
  127. package/dist/InputFields/PasswordField.d.ts +1 -1
  128. package/dist/InputFields/PasswordField.js +4 -1
  129. package/dist/InputFields/PasswordField.js.map +1 -1
  130. package/dist/InputFields/QuickSearch.cjs +30 -6
  131. package/dist/InputFields/QuickSearch.cjs.map +1 -1
  132. package/dist/InputFields/QuickSearch.js +30 -6
  133. package/dist/InputFields/QuickSearch.js.map +1 -1
  134. package/dist/InputFields/RadioButton.cjs +63 -15
  135. package/dist/InputFields/RadioButton.cjs.map +1 -1
  136. package/dist/InputFields/RadioButton.js +63 -15
  137. package/dist/InputFields/RadioButton.js.map +1 -1
  138. package/dist/InputFields/RichTextField.cjs +60 -15
  139. package/dist/InputFields/RichTextField.cjs.map +1 -1
  140. package/dist/InputFields/RichTextField.js +60 -15
  141. package/dist/InputFields/RichTextField.js.map +1 -1
  142. package/dist/InputFields/SearchBar.cjs +4 -1
  143. package/dist/InputFields/SearchBar.cjs.map +1 -1
  144. package/dist/InputFields/SearchBar.js +4 -1
  145. package/dist/InputFields/SearchBar.js.map +1 -1
  146. package/dist/InputFields/TextField.cjs +8 -2
  147. package/dist/InputFields/TextField.cjs.map +1 -1
  148. package/dist/InputFields/TextField.d.ts +1 -1
  149. package/dist/InputFields/TextField.js +8 -2
  150. package/dist/InputFields/TextField.js.map +1 -1
  151. package/dist/InputFields/Textarea.cjs +68 -17
  152. package/dist/InputFields/Textarea.cjs.map +1 -1
  153. package/dist/InputFields/Textarea.js +68 -17
  154. package/dist/InputFields/Textarea.js.map +1 -1
  155. package/dist/InputFields/components/SearchBarInput.cjs +28 -7
  156. package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
  157. package/dist/InputFields/components/SearchBarInput.js +28 -7
  158. package/dist/InputFields/components/SearchBarInput.js.map +1 -1
  159. package/dist/InputFields/components/SearchField.cjs +60 -15
  160. package/dist/InputFields/components/SearchField.cjs.map +1 -1
  161. package/dist/InputFields/components/SearchField.js +60 -15
  162. package/dist/InputFields/components/SearchField.js.map +1 -1
  163. package/dist/InputFields/styling.cjs +95 -39
  164. package/dist/InputFields/styling.cjs.map +1 -1
  165. package/dist/InputFields/styling.d.ts +1 -2
  166. package/dist/InputFields/styling.js +95 -39
  167. package/dist/InputFields/styling.js.map +1 -1
  168. package/dist/LinearProgress/LinearProgress.cjs +161 -53
  169. package/dist/LinearProgress/LinearProgress.cjs.map +1 -1
  170. package/dist/LinearProgress/LinearProgress.js +161 -53
  171. package/dist/LinearProgress/LinearProgress.js.map +1 -1
  172. package/dist/List/ListRow.cjs +36 -9
  173. package/dist/List/ListRow.cjs.map +1 -1
  174. package/dist/List/ListRow.js +36 -9
  175. package/dist/List/ListRow.js.map +1 -1
  176. package/dist/List/__tests__/ListRow.tests.d.ts +1 -0
  177. package/dist/LoadingIndicator/LoadingIndicator.cjs +4 -1
  178. package/dist/LoadingIndicator/LoadingIndicator.cjs.map +1 -1
  179. package/dist/LoadingIndicator/LoadingIndicator.js +4 -1
  180. package/dist/LoadingIndicator/LoadingIndicator.js.map +1 -1
  181. package/dist/LoadingPage/GlobalLoadingPage.cjs +4 -1
  182. package/dist/LoadingPage/GlobalLoadingPage.cjs.map +1 -1
  183. package/dist/LoadingPage/GlobalLoadingPage.js +4 -1
  184. package/dist/LoadingPage/GlobalLoadingPage.js.map +1 -1
  185. package/dist/MenuItem/MenuItem.cjs +101 -26
  186. package/dist/MenuItem/MenuItem.cjs.map +1 -1
  187. package/dist/MenuItem/MenuItem.js +101 -26
  188. package/dist/MenuItem/MenuItem.js.map +1 -1
  189. package/dist/Modals/Modal.cjs +4 -1
  190. package/dist/Modals/Modal.cjs.map +1 -1
  191. package/dist/Modals/Modal.js +4 -1
  192. package/dist/Modals/Modal.js.map +1 -1
  193. package/dist/Modals/ModalContent.cjs +24 -6
  194. package/dist/Modals/ModalContent.cjs.map +1 -1
  195. package/dist/Modals/ModalContent.js +24 -6
  196. package/dist/Modals/ModalContent.js.map +1 -1
  197. package/dist/Modals/ModalDialog.cjs +12 -3
  198. package/dist/Modals/ModalDialog.cjs.map +1 -1
  199. package/dist/Modals/ModalDialog.js +12 -3
  200. package/dist/Modals/ModalDialog.js.map +1 -1
  201. package/dist/Modals/ModalNote.cjs +16 -4
  202. package/dist/Modals/ModalNote.cjs.map +1 -1
  203. package/dist/Modals/ModalNote.js +16 -4
  204. package/dist/Modals/ModalNote.js.map +1 -1
  205. package/dist/Modals/ModalStyles.cjs +44 -11
  206. package/dist/Modals/ModalStyles.cjs.map +1 -1
  207. package/dist/Modals/ModalStyles.js +44 -11
  208. package/dist/Modals/ModalStyles.js.map +1 -1
  209. package/dist/NavItem/NavItem.cjs +4 -1
  210. package/dist/NavItem/NavItem.cjs.map +1 -1
  211. package/dist/NavItem/NavItem.js +4 -1
  212. package/dist/NavItem/NavItem.js.map +1 -1
  213. package/dist/NotificationDot/NotificationDot.cjs +17 -2
  214. package/dist/NotificationDot/NotificationDot.cjs.map +1 -1
  215. package/dist/NotificationDot/NotificationDot.js +17 -2
  216. package/dist/NotificationDot/NotificationDot.js.map +1 -1
  217. package/dist/Paginator/Paginator.cjs +76 -29
  218. package/dist/Paginator/Paginator.cjs.map +1 -1
  219. package/dist/Paginator/Paginator.js +76 -29
  220. package/dist/Paginator/Paginator.js.map +1 -1
  221. package/dist/Panel/Panel.cjs +4 -1
  222. package/dist/Panel/Panel.cjs.map +1 -1
  223. package/dist/Panel/Panel.js +4 -1
  224. package/dist/Panel/Panel.js.map +1 -1
  225. package/dist/Popover/Popover.cjs +22 -3
  226. package/dist/Popover/Popover.cjs.map +1 -1
  227. package/dist/Popover/Popover.js +22 -3
  228. package/dist/Popover/Popover.js.map +1 -1
  229. package/dist/ProfileButton/ProfileButton.cjs +9 -2
  230. package/dist/ProfileButton/ProfileButton.cjs.map +1 -1
  231. package/dist/ProfileButton/ProfileButton.js +9 -2
  232. package/dist/ProfileButton/ProfileButton.js.map +1 -1
  233. package/dist/SegmentControl/SegmentControl.cjs +46 -11
  234. package/dist/SegmentControl/SegmentControl.cjs.map +1 -1
  235. package/dist/SegmentControl/SegmentControl.js +46 -11
  236. package/dist/SegmentControl/SegmentControl.js.map +1 -1
  237. package/dist/SideMenu/SideMenuHeader.cjs +12 -3
  238. package/dist/SideMenu/SideMenuHeader.cjs.map +1 -1
  239. package/dist/SideMenu/SideMenuHeader.js +12 -3
  240. package/dist/SideMenu/SideMenuHeader.js.map +1 -1
  241. package/dist/Switcher/SwitcherMenuItem.cjs +4 -1
  242. package/dist/Switcher/SwitcherMenuItem.cjs.map +1 -1
  243. package/dist/Switcher/SwitcherMenuItem.js +4 -1
  244. package/dist/Switcher/SwitcherMenuItem.js.map +1 -1
  245. package/dist/Table/TableFooter.cjs +8 -2
  246. package/dist/Table/TableFooter.cjs.map +1 -1
  247. package/dist/Table/TableFooter.js +8 -2
  248. package/dist/Table/TableFooter.js.map +1 -1
  249. package/dist/Table/TableStyles.cjs +132 -33
  250. package/dist/Table/TableStyles.cjs.map +1 -1
  251. package/dist/Table/TableStyles.js +132 -33
  252. package/dist/Table/TableStyles.js.map +1 -1
  253. package/dist/Tabs/HorizontalTabs.cjs +68 -18
  254. package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
  255. package/dist/Tabs/HorizontalTabs.js +68 -18
  256. package/dist/Tabs/HorizontalTabs.js.map +1 -1
  257. package/dist/Tabs/TabLink.cjs +4 -1
  258. package/dist/Tabs/TabLink.cjs.map +1 -1
  259. package/dist/Tabs/TabLink.js +4 -1
  260. package/dist/Tabs/TabLink.js.map +1 -1
  261. package/dist/Tabs/__tests__/TabLink.tests.d.ts +1 -0
  262. package/dist/Tabs/__tests__/Tablist.tests.d.ts +2 -0
  263. package/dist/Tag/Tag.cjs +2 -2
  264. package/dist/Tag/Tag.cjs.map +1 -1
  265. package/dist/Tag/Tag.js +2 -2
  266. package/dist/Tag/Tag.js.map +1 -1
  267. package/dist/Tile/Tile.cjs +8 -2
  268. package/dist/Tile/Tile.cjs.map +1 -1
  269. package/dist/Tile/Tile.js +8 -2
  270. package/dist/Tile/Tile.js.map +1 -1
  271. package/dist/Tile/TileCommonItems.cjs +8 -2
  272. package/dist/Tile/TileCommonItems.cjs.map +1 -1
  273. package/dist/Tile/TileCommonItems.js +8 -2
  274. package/dist/Tile/TileCommonItems.js.map +1 -1
  275. package/dist/Tile/TileFooter.cjs +4 -1
  276. package/dist/Tile/TileFooter.cjs.map +1 -1
  277. package/dist/Tile/TileFooter.js +4 -1
  278. package/dist/Tile/TileFooter.js.map +1 -1
  279. package/dist/Tile/TileHeader.cjs +12 -3
  280. package/dist/Tile/TileHeader.cjs.map +1 -1
  281. package/dist/Tile/TileHeader.js +12 -3
  282. package/dist/Tile/TileHeader.js.map +1 -1
  283. package/dist/Toasters/Toast.cjs +62 -13
  284. package/dist/Toasters/Toast.cjs.map +1 -1
  285. package/dist/Toasters/Toast.js +62 -13
  286. package/dist/Toasters/Toast.js.map +1 -1
  287. package/dist/Toggles/ToggleButton.cjs +9 -3
  288. package/dist/Toggles/ToggleButton.cjs.map +1 -1
  289. package/dist/Toggles/ToggleButton.d.ts +1 -1
  290. package/dist/Toggles/ToggleButton.js +9 -3
  291. package/dist/Toggles/ToggleButton.js.map +1 -1
  292. package/dist/Toggles/TogglerStyles.cjs +22 -8
  293. package/dist/Toggles/TogglerStyles.cjs.map +1 -1
  294. package/dist/Toggles/TogglerStyles.js +22 -8
  295. package/dist/Toggles/TogglerStyles.js.map +1 -1
  296. package/dist/Tooltips/TooltipStyles.cjs +28 -6
  297. package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
  298. package/dist/Tooltips/TooltipStyles.js +28 -6
  299. package/dist/Tooltips/TooltipStyles.js.map +1 -1
  300. package/dist/common/InputStyling.cjs +30 -7
  301. package/dist/common/InputStyling.cjs.map +1 -1
  302. package/dist/common/InputStyling.js +30 -7
  303. package/dist/common/InputStyling.js.map +1 -1
  304. package/dist/common/Link.cjs +45 -0
  305. package/dist/common/Link.cjs.map +1 -0
  306. package/dist/common/Link.d.ts +9 -0
  307. package/dist/common/Link.js +37 -0
  308. package/dist/common/Link.js.map +1 -0
  309. package/dist/common/NavigationHelper.cjs +30 -0
  310. package/dist/common/NavigationHelper.cjs.map +1 -0
  311. package/dist/common/NavigationHelper.d.ts +4 -0
  312. package/dist/common/NavigationHelper.js +23 -0
  313. package/dist/common/NavigationHelper.js.map +1 -0
  314. package/dist/custom.d.ts +2 -0
  315. package/dist/styles/colors.cjs +440 -84
  316. package/dist/styles/colors.cjs.map +1 -1
  317. package/dist/styles/colors.d.ts +200 -11
  318. package/dist/styles/colors.js +440 -84
  319. package/dist/styles/colors.js.map +1 -1
  320. package/dist/styles/global.cjs +19 -2
  321. package/dist/styles/global.cjs.map +1 -1
  322. package/dist/styles/global.d.ts +3 -2
  323. package/dist/styles/global.js +18 -3
  324. package/dist/styles/global.js.map +1 -1
  325. package/dist/styles/index.cjs +16 -4
  326. package/dist/styles/index.cjs.map +1 -1
  327. package/dist/styles/index.js +16 -4
  328. package/dist/styles/index.js.map +1 -1
  329. package/dist/utils/color-tokens.cjs +91 -0
  330. package/dist/utils/color-tokens.cjs.map +1 -0
  331. package/dist/utils/color-tokens.d.ts +19 -0
  332. package/dist/utils/color-tokens.js +82 -0
  333. package/dist/utils/color-tokens.js.map +1 -0
  334. package/package.json +143 -141
@@ -1 +1 @@
1
- {"version":3,"file":"Card.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_CardTopSection","_CardMiddleSection","_CardBottomSection","_index","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","CardTopLevelContainerStyles","exports","styled","div","props","COLORS","getColor","theme","BOXSHADOWS","BOXSHADOW_L1","CardContainerStyles","focusStyles","BOXSHADOW_L3","BOXSHADOW_L2","Card","_ref","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","disabled","variant","className","maxWidth","rest","_objectWithoutProperties2","actionsRefs","setActionsRefs","useState","checkBoxRef","useRef","containerRef","useActionWithin","cls","jsx","ref","tabIndex","onMouseDown","defaultOnMouseDownHandler","onKeyDown","key","onClick","children","jsxs","style","instance","propTypes","_propTypes","func","bool","oneOfType","number","string","oneOf","_default"],"sources":["../../../src/Card/VerticalCard/Card.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport CardTopSection, {CardTopSectionProps} from './CardTopSection';\r\nimport CardMiddleSection, {CardMiddleSectionProps} from './CardMiddleSection';\r\nimport CardBottomSection, {CardBottomSectionProps} from './CardBottomSection';\r\nimport {BOXSHADOWS, COLORS, defaultOnMouseDownHandler, focusStyles, useActionWithin} from '../../index';\r\n\r\nexport const CardTopLevelContainerStyles = styled.div`\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n min-width: 240px;\r\n overflow: hidden;\r\n\r\n border-radius: 8px;\r\n\r\n background-clip: padding-box;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n .elevated & {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L1};\r\n }\r\n\r\n .outline & {\r\n border: 1px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n }\r\n`;\r\n\r\n\r\nexport const CardContainerStyles = styled.div`\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.interactive:not(.disabled) {\r\n cursor: pointer;\r\n\r\n &.outline:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n }\r\n\r\n &:active, &.active-state {\r\n background-color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n }\r\n }\r\n }\r\n\r\n &.elevated:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L3};\r\n }\r\n\r\n &:active, &.active-state {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\r\n }\r\n }\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n ${CardTopLevelContainerStyles}{\r\n border: 1px solid ${props => COLORS.getColor('neutral_100', props.theme)};\r\n }\r\n }\r\n`;\r\n\r\n\r\nexport interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onMouseDown' | 'onKeyDown' | 'onClick'> {\r\n /** Action to be executed when Card is clicked. */\r\n onCardClicked?: () => void;\r\n /** If disabled then users can not click on the card, also styles are greyed out.*/\r\n disabled?: boolean;\r\n /** Maximum width of the card. */\r\n maxWidth?: number | string;\r\n /** Properties of Card top section. */\r\n topSectionProps?: CardTopSectionProps;\r\n /** Properties of Card middle section. */\r\n middleSectionProps?: CardMiddleSectionProps;\r\n /** Properties of Card bottom section. */\r\n bottomSectionProps?: CardBottomSectionProps;\r\n /** Card container style variant. */\r\n variant?: 'outline' | 'elevated';\r\n}\r\n\r\nconst Card: React.FunctionComponent<CardProps> = ({\r\n onCardClicked,\r\n topSectionProps,\r\n middleSectionProps,\r\n bottomSectionProps,\r\n disabled,\r\n variant = 'elevated',\r\n className,\r\n maxWidth = 560,\r\n ...rest\r\n }: CardProps) => {\r\n\r\n\r\n const [actionsRefs, setActionsRefs] = React.useState<React.RefObject<HTMLElement | null>[]>([]);\r\n const checkBoxRef = React.useRef<HTMLDivElement>(null);\r\n const containerRef = React.useRef<HTMLDivElement>(null);\r\n\r\n useActionWithin(containerRef, [...actionsRefs, checkBoxRef]);\r\n\r\n const cls = `${!!onCardClicked ? 'interactive' : ''} ${disabled ? 'disabled' : ''} ${variant} ${className || ''}`;\r\n\r\n return (\r\n <CardContainerStyles ref={containerRef}\r\n className={cls}\r\n tabIndex={!!onCardClicked && !disabled ? 0 : -1}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyDown={a => a.key === 'Enter' && !disabled && onCardClicked && onCardClicked()}\r\n onClick={e => !disabled && onCardClicked && onCardClicked()}\r\n data-testid={'card-wrapper'}\r\n {...rest}>\r\n <CardTopLevelContainerStyles style={{maxWidth: maxWidth}}>\r\n {\r\n topSectionProps &&\r\n <CardTopSection ref={checkBoxRef}\r\n {...topSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n middleSectionProps &&\r\n <CardMiddleSection {...middleSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n bottomSectionProps &&\r\n <CardBottomSection ref={instance => {\r\n setActionsRefs(instance ?? []);\r\n }}\r\n {...bottomSectionProps} disabled={disabled}/>\r\n }\r\n </CardTopLevelContainerStyles>\r\n </CardContainerStyles>\r\n );\r\n};\r\n\r\nexport default Card;\r\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,kBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,kBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAwG,IAAAO,WAAA,GAAAP,OAAA;AAAA,MAAAQ,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBA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A0B,UAAA,CAAA5E,OAAA,CAAAkF,KAAA,EAAG,SAAS,EAAG,UAAU;AAAA;AAAA,IAAAC,QAAA,GAAArD,OAAA,CAAA9B,OAAA,GAuDnB2C,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Card.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","_CardTopSection","_CardMiddleSection","_CardBottomSection","_index","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","CardTopLevelContainerStyles","exports","styled","div","props","COLORS","generateToken","componentType","defaultVariant","theme","BOXSHADOWS","BOXSHADOW_L1","CardContainerStyles","focusStyles","state","BOXSHADOW_L3","BOXSHADOW_L2","Card","_ref","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","disabled","variant","className","maxWidth","rest","_objectWithoutProperties2","actionsRefs","setActionsRefs","useState","checkBoxRef","useRef","containerRef","useActionWithin","cls","jsx","ref","tabIndex","onMouseDown","defaultOnMouseDownHandler","onKeyDown","key","onClick","children","jsxs","style","instance","propTypes","_propTypes","func","bool","oneOfType","number","string","oneOf","_default"],"sources":["../../../src/Card/VerticalCard/Card.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport CardTopSection, {CardTopSectionProps} from './CardTopSection';\r\nimport CardMiddleSection, {CardMiddleSectionProps} from './CardMiddleSection';\r\nimport CardBottomSection, {CardBottomSectionProps} from './CardBottomSection';\r\nimport {BOXSHADOWS, COLORS, defaultOnMouseDownHandler, focusStyles, useActionWithin} from '../../index';\r\n\r\nexport const CardTopLevelContainerStyles = styled.div`\r\n background-color: ${props => COLORS.generateToken({componentType:'bg-surface', defaultVariant:'default'}, props.theme)};\r\n min-width: 240px;\r\n overflow: hidden;\r\n\r\n border-radius: 8px;\r\n\r\n background-clip: padding-box;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n .elevated & {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L1};\r\n }\r\n\r\n .outline & {\r\n border: 1px solid ${props => COLORS.generateToken({componentType:'border', defaultVariant: 'subtle'}, props.theme)};\r\n }\r\n`;\r\n\r\n\r\nexport const CardContainerStyles = styled.div`\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.interactive:not(.disabled) {\r\n cursor: pointer;\r\n\r\n &.outline:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n background-color: ${props => COLORS.generateToken({componentType:'bg-surface', state:'hover'}, props.theme)};\r\n }\r\n\r\n &:active, &.active-state {\r\n background-color: ${props => COLORS.generateToken({componentType:'bg-surface', state:'active'}, props.theme)};\r\n }\r\n }\r\n }\r\n\r\n &.elevated:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L3};\r\n }\r\n\r\n &:active, &.active-state {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\r\n }\r\n }\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n ${CardTopLevelContainerStyles}{\r\n border: 1px solid ${props => COLORS.generateToken({componentType:'border', state:'disabled'}, props.theme)};\r\n }\r\n }\r\n`;\r\n\r\n\r\nexport interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onMouseDown' | 'onKeyDown' | 'onClick'> {\r\n /** Action to be executed when Card is clicked. */\r\n onCardClicked?: () => void;\r\n /** If disabled then users can not click on the card, also styles are greyed out.*/\r\n disabled?: boolean;\r\n /** Maximum width of the card. */\r\n maxWidth?: number | string;\r\n /** Properties of Card top section. */\r\n topSectionProps?: CardTopSectionProps;\r\n /** Properties of Card middle section. */\r\n middleSectionProps?: CardMiddleSectionProps;\r\n /** Properties of Card bottom section. */\r\n bottomSectionProps?: CardBottomSectionProps;\r\n /** Card container style variant. */\r\n variant?: 'outline' | 'elevated';\r\n}\r\n\r\nconst Card: React.FunctionComponent<CardProps> = ({\r\n onCardClicked,\r\n topSectionProps,\r\n middleSectionProps,\r\n bottomSectionProps,\r\n disabled,\r\n variant = 'elevated',\r\n className,\r\n maxWidth = 560,\r\n ...rest\r\n }: CardProps) => {\r\n\r\n\r\n const [actionsRefs, setActionsRefs] = React.useState<React.RefObject<HTMLElement | null>[]>([]);\r\n const checkBoxRef = React.useRef<HTMLDivElement>(null);\r\n const containerRef = React.useRef<HTMLDivElement>(null);\r\n\r\n useActionWithin(containerRef, [...actionsRefs, checkBoxRef]);\r\n\r\n const cls = `${!!onCardClicked ? 'interactive' : ''} ${disabled ? 'disabled' : ''} ${variant} ${className || ''}`;\r\n\r\n return (\r\n <CardContainerStyles ref={containerRef}\r\n className={cls}\r\n tabIndex={!!onCardClicked && !disabled ? 0 : -1}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyDown={a => a.key === 'Enter' && !disabled && onCardClicked && onCardClicked()}\r\n onClick={e => !disabled && onCardClicked && onCardClicked()}\r\n data-testid={'card-wrapper'}\r\n {...rest}>\r\n <CardTopLevelContainerStyles style={{maxWidth: maxWidth}}>\r\n {\r\n topSectionProps &&\r\n <CardTopSection ref={checkBoxRef}\r\n {...topSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n middleSectionProps &&\r\n <CardMiddleSection {...middleSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n bottomSectionProps &&\r\n <CardBottomSection ref={instance => {\r\n setActionsRefs(instance ?? []);\r\n }}\r\n {...bottomSectionProps} disabled={disabled}/>\r\n }\r\n </CardTopLevelContainerStyles>\r\n </CardContainerStyles>\r\n );\r\n};\r\n\r\nexport default Card;\r\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IA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oreList":[]}
@@ -12,7 +12,10 @@ import CardBottomSection from './CardBottomSection';
12
12
  import { BOXSHADOWS, COLORS, defaultOnMouseDownHandler, focusStyles, useActionWithin } from '../../index';
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  export const CardTopLevelContainerStyles = styled.div`
15
- background-color: ${props => COLORS.getColor('white', props.theme)};
15
+ background-color: ${props => COLORS.generateToken({
16
+ componentType: 'bg-surface',
17
+ defaultVariant: 'default'
18
+ }, props.theme)};
16
19
  min-width: 240px;
17
20
  overflow: hidden;
18
21
 
@@ -28,7 +31,10 @@ export const CardTopLevelContainerStyles = styled.div`
28
31
  }
29
32
 
30
33
  .outline & {
31
- border: 1px solid ${props => COLORS.getColor('neutral_200', props.theme)};
34
+ border: 1px solid ${props => COLORS.generateToken({
35
+ componentType: 'border',
36
+ defaultVariant: 'subtle'
37
+ }, props.theme)};
32
38
  }
33
39
  `;
34
40
  export const CardContainerStyles = styled.div`
@@ -42,11 +48,17 @@ export const CardContainerStyles = styled.div`
42
48
  &.outline:not(.action-within) {
43
49
  ${CardTopLevelContainerStyles} {
44
50
  &:hover {
45
- background-color: ${props => COLORS.getColor('primary_20', props.theme)};
51
+ background-color: ${props => COLORS.generateToken({
52
+ componentType: 'bg-surface',
53
+ state: 'hover'
54
+ }, props.theme)};
46
55
  }
47
56
 
48
57
  &:active, &.active-state {
49
- background-color: ${props => COLORS.getColor('primary_100', props.theme)};
58
+ background-color: ${props => COLORS.generateToken({
59
+ componentType: 'bg-surface',
60
+ state: 'active'
61
+ }, props.theme)};
50
62
  }
51
63
  }
52
64
  }
@@ -67,7 +79,10 @@ export const CardContainerStyles = styled.div`
67
79
  &.disabled {
68
80
  cursor: not-allowed;
69
81
  ${CardTopLevelContainerStyles}{
70
- border: 1px solid ${props => COLORS.getColor('neutral_100', props.theme)};
82
+ border: 1px solid ${props => COLORS.generateToken({
83
+ componentType: 'border',
84
+ state: 'disabled'
85
+ }, props.theme)};
71
86
  }
72
87
  }
73
88
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","names":["React","styled","CardTopSection","CardMiddleSection","CardBottomSection","BOXSHADOWS","COLORS","defaultOnMouseDownHandler","focusStyles","useActionWithin","jsx","_jsx","jsxs","_jsxs","CardTopLevelContainerStyles","div","props","getColor","theme","BOXSHADOW_L1","CardContainerStyles","BOXSHADOW_L3","BOXSHADOW_L2","Card","_ref","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","disabled","variant","className","maxWidth","rest","_objectWithoutProperties","_excluded","actionsRefs","setActionsRefs","useState","checkBoxRef","useRef","containerRef","cls","_objectSpread","ref","tabIndex","onMouseDown","onKeyDown","a","key","onClick","e","children","style","instance","propTypes","_pt","func","bool","oneOfType","number","string","oneOf"],"sources":["../../../src/Card/VerticalCard/Card.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport CardTopSection, {CardTopSectionProps} from './CardTopSection';\r\nimport CardMiddleSection, {CardMiddleSectionProps} from './CardMiddleSection';\r\nimport CardBottomSection, {CardBottomSectionProps} from './CardBottomSection';\r\nimport {BOXSHADOWS, COLORS, defaultOnMouseDownHandler, focusStyles, useActionWithin} from '../../index';\r\n\r\nexport const CardTopLevelContainerStyles = styled.div`\r\n background-color: ${props => COLORS.getColor('white', props.theme)};\r\n min-width: 240px;\r\n overflow: hidden;\r\n\r\n border-radius: 8px;\r\n\r\n background-clip: padding-box;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n .elevated & {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L1};\r\n }\r\n\r\n .outline & {\r\n border: 1px solid ${props => COLORS.getColor('neutral_200', props.theme)};\r\n }\r\n`;\r\n\r\n\r\nexport const CardContainerStyles = styled.div`\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.interactive:not(.disabled) {\r\n cursor: pointer;\r\n\r\n &.outline:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n background-color: ${props => COLORS.getColor('primary_20', props.theme)};\r\n }\r\n\r\n &:active, &.active-state {\r\n background-color: ${props => COLORS.getColor('primary_100', props.theme)};\r\n }\r\n }\r\n }\r\n\r\n &.elevated:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L3};\r\n }\r\n\r\n &:active, &.active-state {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\r\n }\r\n }\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n ${CardTopLevelContainerStyles}{\r\n border: 1px solid ${props => COLORS.getColor('neutral_100', props.theme)};\r\n }\r\n }\r\n`;\r\n\r\n\r\nexport interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onMouseDown' | 'onKeyDown' | 'onClick'> {\r\n /** Action to be executed when Card is clicked. */\r\n onCardClicked?: () => void;\r\n /** If disabled then users can not click on the card, also styles are greyed out.*/\r\n disabled?: boolean;\r\n /** Maximum width of the card. */\r\n maxWidth?: number | string;\r\n /** Properties of Card top section. */\r\n topSectionProps?: CardTopSectionProps;\r\n /** Properties of Card middle section. */\r\n middleSectionProps?: CardMiddleSectionProps;\r\n /** Properties of Card bottom section. */\r\n bottomSectionProps?: CardBottomSectionProps;\r\n /** Card container style variant. */\r\n variant?: 'outline' | 'elevated';\r\n}\r\n\r\nconst Card: React.FunctionComponent<CardProps> = ({\r\n onCardClicked,\r\n topSectionProps,\r\n middleSectionProps,\r\n bottomSectionProps,\r\n disabled,\r\n variant = 'elevated',\r\n className,\r\n maxWidth = 560,\r\n ...rest\r\n }: CardProps) => {\r\n\r\n\r\n const [actionsRefs, setActionsRefs] = React.useState<React.RefObject<HTMLElement | null>[]>([]);\r\n const checkBoxRef = React.useRef<HTMLDivElement>(null);\r\n const containerRef = React.useRef<HTMLDivElement>(null);\r\n\r\n useActionWithin(containerRef, [...actionsRefs, checkBoxRef]);\r\n\r\n const cls = `${!!onCardClicked ? 'interactive' : ''} ${disabled ? 'disabled' : ''} ${variant} ${className || ''}`;\r\n\r\n return (\r\n <CardContainerStyles ref={containerRef}\r\n className={cls}\r\n tabIndex={!!onCardClicked && !disabled ? 0 : -1}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyDown={a => a.key === 'Enter' && !disabled && onCardClicked && onCardClicked()}\r\n onClick={e => !disabled && onCardClicked && onCardClicked()}\r\n data-testid={'card-wrapper'}\r\n {...rest}>\r\n <CardTopLevelContainerStyles style={{maxWidth: maxWidth}}>\r\n {\r\n topSectionProps &&\r\n <CardTopSection ref={checkBoxRef}\r\n {...topSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n middleSectionProps &&\r\n <CardMiddleSection {...middleSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n bottomSectionProps &&\r\n <CardBottomSection ref={instance => {\r\n setActionsRefs(instance ?? []);\r\n }}\r\n {...bottomSectionProps} disabled={disabled}/>\r\n }\r\n </CardTopLevelContainerStyles>\r\n </CardContainerStyles>\r\n );\r\n};\r\n\r\nexport default Card;\r\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,cAAc,MAA6B,kBAAkB;AACpE,OAAOC,iBAAiB,MAAgC,qBAAqB;AAC7E,OAAOC,iBAAiB,MAAgC,qBAAqB;AAC7E,SAAQC,UAAU,EAAEC,MAAM,EAAEC,yBAAyB,EAAEC,WAAW,EAAEC,eAAe,QAAO,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExG,OAAO,MAAMC,2BAA2B,GAAGb,MAAM,CAACc,GAAG;AACrD,sBAAsBC,KAAK,IAAIV,MAAM,CAACW,QAAQ,CAAC,OAAO,EAAED,KAAK,CAACE,KAAK,CAAC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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C,GAAG,EAAEU,QAAQ,IAAI;UAClCjB,cAAc,CAACiB,QAAQ,IAAI,EAAE,CAAC;QAChC;MAAE,GACqB1B,kBAAkB;QAAEC,QAAQ,EAAEA;MAAS,EAAC,CAAC;IAAA,CAEvC;EAAC,EACX,CAAC;AAE1B,CAAC;AAACN,IAAA,CAAAgC,SAAA;EAjEA9B,aAAa,EAAA+B,GAAA,CAAAC,IAAA;EAEb5B,QAAQ,EAAA2B,GAAA,CAAAE,IAAA;EAER1B,QAAQ,EAAAwB,GAAA,CAAAG,SAAA,EAAAH,GAAA,CAAAI,MAAA,EAAAJ,GAAA,CAAAK,MAAA;EAQR/B,OAAO,EAAA0B,GAAA,CAAAM,KAAA,EAAG,SAAS,EAAG,UAAU;AAAA;AAuDlC,eAAevC,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Card.js","names":["React","styled","CardTopSection","CardMiddleSection","CardBottomSection","BOXSHADOWS","COLORS","defaultOnMouseDownHandler","focusStyles","useActionWithin","jsx","_jsx","jsxs","_jsxs","CardTopLevelContainerStyles","div","props","generateToken","componentType","defaultVariant","theme","BOXSHADOW_L1","CardContainerStyles","state","BOXSHADOW_L3","BOXSHADOW_L2","Card","_ref","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","disabled","variant","className","maxWidth","rest","_objectWithoutProperties","_excluded","actionsRefs","setActionsRefs","useState","checkBoxRef","useRef","containerRef","cls","_objectSpread","ref","tabIndex","onMouseDown","onKeyDown","a","key","onClick","e","children","style","instance","propTypes","_pt","func","bool","oneOfType","number","string","oneOf"],"sources":["../../../src/Card/VerticalCard/Card.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport CardTopSection, {CardTopSectionProps} from './CardTopSection';\r\nimport CardMiddleSection, {CardMiddleSectionProps} from './CardMiddleSection';\r\nimport CardBottomSection, {CardBottomSectionProps} from './CardBottomSection';\r\nimport {BOXSHADOWS, COLORS, defaultOnMouseDownHandler, focusStyles, useActionWithin} from '../../index';\r\n\r\nexport const CardTopLevelContainerStyles = styled.div`\r\n background-color: ${props => COLORS.generateToken({componentType:'bg-surface', defaultVariant:'default'}, props.theme)};\r\n min-width: 240px;\r\n overflow: hidden;\r\n\r\n border-radius: 8px;\r\n\r\n background-clip: padding-box;\r\n box-sizing: border-box;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n .elevated & {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L1};\r\n }\r\n\r\n .outline & {\r\n border: 1px solid ${props => COLORS.generateToken({componentType:'border', defaultVariant: 'subtle'}, props.theme)};\r\n }\r\n`;\r\n\r\n\r\nexport const CardContainerStyles = styled.div`\r\n &.interactive:focus {\r\n ${focusStyles}\r\n }\r\n\r\n &.interactive:not(.disabled) {\r\n cursor: pointer;\r\n\r\n &.outline:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n background-color: ${props => COLORS.generateToken({componentType:'bg-surface', state:'hover'}, props.theme)};\r\n }\r\n\r\n &:active, &.active-state {\r\n background-color: ${props => COLORS.generateToken({componentType:'bg-surface', state:'active'}, props.theme)};\r\n }\r\n }\r\n }\r\n\r\n &.elevated:not(.action-within) {\r\n ${CardTopLevelContainerStyles} {\r\n &:hover {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L3};\r\n }\r\n\r\n &:active, &.active-state {\r\n box-shadow: ${BOXSHADOWS.BOXSHADOW_L2};\r\n }\r\n }\r\n }\r\n }\r\n\r\n &.disabled {\r\n cursor: not-allowed;\r\n ${CardTopLevelContainerStyles}{\r\n border: 1px solid ${props => COLORS.generateToken({componentType:'border', state:'disabled'}, props.theme)};\r\n }\r\n }\r\n`;\r\n\r\n\r\nexport interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'tabIndex' | 'onMouseDown' | 'onKeyDown' | 'onClick'> {\r\n /** Action to be executed when Card is clicked. */\r\n onCardClicked?: () => void;\r\n /** If disabled then users can not click on the card, also styles are greyed out.*/\r\n disabled?: boolean;\r\n /** Maximum width of the card. */\r\n maxWidth?: number | string;\r\n /** Properties of Card top section. */\r\n topSectionProps?: CardTopSectionProps;\r\n /** Properties of Card middle section. */\r\n middleSectionProps?: CardMiddleSectionProps;\r\n /** Properties of Card bottom section. */\r\n bottomSectionProps?: CardBottomSectionProps;\r\n /** Card container style variant. */\r\n variant?: 'outline' | 'elevated';\r\n}\r\n\r\nconst Card: React.FunctionComponent<CardProps> = ({\r\n onCardClicked,\r\n topSectionProps,\r\n middleSectionProps,\r\n bottomSectionProps,\r\n disabled,\r\n variant = 'elevated',\r\n className,\r\n maxWidth = 560,\r\n ...rest\r\n }: CardProps) => {\r\n\r\n\r\n const [actionsRefs, setActionsRefs] = React.useState<React.RefObject<HTMLElement | null>[]>([]);\r\n const checkBoxRef = React.useRef<HTMLDivElement>(null);\r\n const containerRef = React.useRef<HTMLDivElement>(null);\r\n\r\n useActionWithin(containerRef, [...actionsRefs, checkBoxRef]);\r\n\r\n const cls = `${!!onCardClicked ? 'interactive' : ''} ${disabled ? 'disabled' : ''} ${variant} ${className || ''}`;\r\n\r\n return (\r\n <CardContainerStyles ref={containerRef}\r\n className={cls}\r\n tabIndex={!!onCardClicked && !disabled ? 0 : -1}\r\n onMouseDown={defaultOnMouseDownHandler}\r\n onKeyDown={a => a.key === 'Enter' && !disabled && onCardClicked && onCardClicked()}\r\n onClick={e => !disabled && onCardClicked && onCardClicked()}\r\n data-testid={'card-wrapper'}\r\n {...rest}>\r\n <CardTopLevelContainerStyles style={{maxWidth: maxWidth}}>\r\n {\r\n topSectionProps &&\r\n <CardTopSection ref={checkBoxRef}\r\n {...topSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n middleSectionProps &&\r\n <CardMiddleSection {...middleSectionProps} disabled={disabled}/>\r\n }\r\n {\r\n bottomSectionProps &&\r\n <CardBottomSection ref={instance => {\r\n setActionsRefs(instance ?? []);\r\n }}\r\n {...bottomSectionProps} disabled={disabled}/>\r\n }\r\n </CardTopLevelContainerStyles>\r\n </C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AA;EAQR/B,OAAO,EAAA0B,GAAA,CAAAM,KAAA,EAAG,SAAS,EAAG,UAAU;AAAA;AAuDlC,eAAevC,IAAI","ignoreList":[]}
@@ -24,7 +24,10 @@ const CardBottomSectionProgressStyles = exports.CardBottomSectionProgressStyles
24
24
  const CardBottomSectionNotesStyles = exports.CardBottomSectionNotesStyles = _styledComponents.default.div`
25
25
  height: 48px;
26
26
  position: relative;
27
- color: ${props => _index.COLORS.getColor('neutral_500', props.theme)};
27
+ color: ${props => _index.COLORS.generateToken({
28
+ componentType: 'text',
29
+ defaultVariant: 'subtle'
30
+ }, props.theme)};
28
31
  display: flex;
29
32
  flex-direction: row;
30
33
  align-items: center;
@@ -46,7 +49,10 @@ const CardBottomSectionAuthorStyles = exports.CardBottomSectionAuthorStyles = _s
46
49
  }
47
50
 
48
51
  ${props => props.$disabled ? `
49
- color: ${_index.COLORS.getColor('neutral_300', props.theme)};
52
+ color: ${_index.COLORS.generateToken({
53
+ componentType: 'text',
54
+ state: 'disabled'
55
+ }, props.theme)};
50
56
  svg, img {
51
57
  filter: grayscale(100%);
52
58
  }
@@ -55,7 +61,10 @@ const CardBottomSectionAuthorStyles = exports.CardBottomSectionAuthorStyles = _s
55
61
  `;
56
62
  const CardBottomSectionDivider = exports.CardBottomSectionDivider = _styledComponents.default.div`
57
63
  border-top: 1px;
58
- border-top-color: ${props => _index.COLORS.getColor('neutral_100', props.theme)};
64
+ border-top-color: ${props => _index.COLORS.generateToken({
65
+ componentType: 'border',
66
+ defaultVariant: 'subtle'
67
+ }, props.theme)};
59
68
  border-top-style: solid;
60
69
  width: 100%;
61
70
  `;
@@ -91,7 +100,10 @@ const CardBottomSectionButtonRowContainerStyles = exports.CardBottomSectionButto
91
100
  justify-content: flex-end;
92
101
  align-items: center;
93
102
  border-top: 1px;
94
- border-top-color: ${props => _index.COLORS.getColor('neutral_100', props.theme)};
103
+ border-top-color: ${props => _index.COLORS.generateToken({
104
+ componentType: 'border',
105
+ defaultVariant: 'subtle'
106
+ }, props.theme)};
95
107
  border-top-style: solid;
96
108
 
97
109
  button:last-child {
@@ -103,7 +115,10 @@ const CardBottomSectionButtonRowContainerStyles = exports.CardBottomSectionButto
103
115
  }
104
116
 
105
117
  svg {
106
- color: ${props => _index.COLORS.getColor('neutral_600', props.theme)};
118
+ color: ${props => _index.COLORS.generateToken({
119
+ componentType: 'icon',
120
+ defaultVariant: 'subtle'
121
+ }, props.theme)};
107
122
  }
108
123
  `;
109
124
  const CardBottomSectionContainer = exports.CardBottomSectionContainer = _styledComponents.default.div`
@@ -168,13 +183,19 @@ const CardBottomSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
168
183
  }), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionNotesStyles, {
169
184
  children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionNoteLeftStyles, {
170
185
  children: [noteLeftIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
171
- color: _index.COLORS.getColor('neutral_500', theme),
186
+ color: _index.COLORS.generateToken({
187
+ componentType: 'icon',
188
+ defaultVariant: 'subtle'
189
+ }, theme),
172
190
  textStyle: _index.ComponentTextStyle.Bold,
173
191
  children: noteLeft
174
192
  })]
175
193
  }), (noteRight || noteRightIcon) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardBottomSectionNoteRightStyles, {
176
194
  children: [noteRightIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXXS, {
177
- color: _index.COLORS.getColor('neutral_500', theme),
195
+ color: _index.COLORS.generateToken({
196
+ componentType: 'icon',
197
+ defaultVariant: 'subtle'
198
+ }, theme),
178
199
  textStyle: _index.ComponentTextStyle.Bold,
179
200
  children: noteRight
180
201
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"CardBottomSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_Button","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","CardBottomSectionProgressStyles","exports","styled","div","CardBottomSectionNotesStyles","props","COLORS","getColor","theme","CardBottomSectionAuthorStyles","$disabled","CardBottomSectionDivider","CardBottomSectionNoteLeftStyles","CardBottomSectionNoteRightStyles","CardBottomSectionButtonRowContainerStyles","CardBottomSectionContainer","LeftItemContainer","RightItemContainer","CardBottomSection","forwardRef","_ref","ref","progressLevel","progressMax","progressType","LinearProgressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","leftButton","authorName","logo","actions","disabled","elRefs","setElRefs","useState","useTheme","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","renderLeftButton","buttonText","rest","_objectWithoutProperties2","jsx","Button","size","Size","XSmall","XXSmall","includes","Small","Large","Medium","children","jsxs","LinearProgress","type","variant","LinearProgressVariant","Normal","value","max","ComponentXXS","color","textStyle","ComponentTextStyle","Bold","x","index","IconButton","shape","action","onClick","icon","propTypes","_propTypes","number","string","node","arrayOf","isRequired","func","bool","_default"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXS,\r\n LinearProgress,\r\n LinearProgressType,\r\n LinearProgressVariant,\r\n Size,\r\n} from '../../index';\r\nimport { Button, ButtonProps, IconButton } from '../../Button';\r\n\r\nexport interface ActionItem {\r\n icon: React.ReactNode;\r\n onClick: () => void;\r\n}\r\n\r\nexport type CardStandardButton = Pick<ButtonProps, 'width' | 'variant' | 'loading' | 'icon' | 'onClick' | 'disabled'> & {\r\n buttonText: string;\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n}\r\n\r\nexport interface CardBottomSectionProps {\r\n /** Optional. Current progress level shown in the progress bar. */\r\n progressLevel?: number;\r\n /** Optional. Maximum level of progress in the progress bar. */\r\n progressMax?: number;\r\n /** Optional. Type of the progress bar. */\r\n progressType?: LinearProgressType;\r\n\r\n /** Optional. Note text shown on the left side of the section. */\r\n noteLeft?: string;\r\n /** Optional. Note icon shown on the left side of the section. */\r\n noteLeftIcon?: React.ReactNode;\r\n /** Optional. Note text shown on the right side of the section. */\r\n noteRight?: string;\r\n /** Optional. Note icon shown on the right side of the section. */\r\n noteRightIcon?: React.ReactNode;\r\n\r\n /** Optional. Note icon/Hyperlink/button shown on the left side of the section. */\r\n leftButton?: CardStandardButton;\r\n\r\n /** Author name shown at the bottom-left part of the section. */\r\n authorName?: string;\r\n /** Array of actions shown on the bottom-right corner of the section. */\r\n actions?: ActionItem[];\r\n /** Logo shown on the right side of the section, in front of AuthorName. */\r\n logo?: React.ReactNode;\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardBottomSectionProgressStyles = styled.div`\r\n padding: 8px 0;\r\n`;\r\n\r\nexport const CardBottomSectionNotesStyles = styled.div`\r\n height: 48px;\r\n position: relative;\r\n color: ${props => COLORS.getColor('neutral_500', props.theme)};\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nexport const CardBottomSectionAuthorStyles = styled.div<{ $disabled?: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n height: 48px;\r\n\r\n div:first-child {\r\n flex-grow: 2;\r\n }\r\n\r\n svg, img {\r\n width: 80px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n\r\n ${props => props.$disabled ? `\r\n color: ${COLORS.getColor('neutral_300', props.theme)};\r\n svg, img {\r\n filter: grayscale(100%);\r\n }\r\n \r\n ` : ''}\r\n`;\r\n\r\nexport const CardBottomSectionDivider = styled.div`\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n border-top-style: solid;\r\n width: 100%;\r\n`;\r\n\r\nexport const CardBottomSectionNoteLeftStyles = styled.div`\r\n position: absolute;\r\n left: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionNoteRightStyles = styled.div`\r\n position: absolute;\r\n right: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n align-items: center;\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n border-top-style: solid;\r\n\r\n button:last-child {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n button:not(:last-child) {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionContainer = styled.div`\r\n padding: 0px 16px 8px 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nconst LeftItemContainer = styled.div`\r\n flex: 1\r\n`;\r\n\r\nconst RightItemContainer = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n`;\r\n\r\nconst CardBottomSection = React.forwardRef(({\r\n progressLevel,\r\n progressMax,\r\n progressType = LinearProgressType.Line,\r\n noteLeft,\r\n noteLeftIcon,\r\n noteRight,\r\n noteRightIcon,\r\n leftButton,\r\n authorName,\r\n logo,\r\n actions,\r\n disabled\r\n}: CardBottomSectionProps,\r\n ref: React.Ref<React.RefObject<HTMLButtonElement | null>[]>) => {\r\n\r\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement | null>[]>([]);\r\n const theme = useTheme();\r\n const length = actions?.length || 0;\r\n\r\n React.useEffect(() => {\r\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\r\n }, [length]);\r\n\r\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\r\n\r\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName || leftButton;\r\n\r\n const renderLeftButton = () => {\r\n if (leftButton){\r\n const {buttonText, ...rest} = leftButton;\r\n return (<Button \r\n size={ leftButton.size && [Size.XSmall, Size.XSmall, Size.XXSmall].includes(leftButton.size) ? Size.Small: \r\n leftButton.size == Size.Large ? Size.Large : Size.Medium}\r\n {...rest}>\r\n {buttonText}\r\n </Button>)\r\n }\r\n}\r\n\r\n return (\r\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\r\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\r\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\r\n <LinearProgress size={Size.Small}\r\n type={progressType}\r\n variant={LinearProgressVariant.Normal}\r\n value={progressLevel}\r\n max={progressMax ?? progressLevel}/>\r\n </CardBottomSectionProgressStyles>}\r\n\r\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\r\n {(noteLeft || noteLeftIcon) && (\r\n <CardBottomSectionNoteLeftStyles>\r\n {noteLeftIcon}\r\n <ComponentXXS color={COLORS.getColor('neutral_500', theme)} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\r\n </CardBottomSectionNoteLeftStyles>\r\n )}\r\n {(noteRight || noteRightIcon) && (\r\n <CardBottomSectionNoteRightStyles>\r\n {noteRightIcon}\r\n <ComponentXXS color={COLORS.getColor('neutral_500', theme)} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\r\n </CardBottomSectionNoteRightStyles>\r\n )}\r\n </CardBottomSectionNotesStyles>}\r\n\r\n {(authorName || logo) && <CardBottomSectionAuthorStyles $disabled={disabled} data-testid={'card-bottomSection-author'}>\r\n <ComponentXXS>{authorName}</ComponentXXS>\r\n {logo}\r\n </CardBottomSectionAuthorStyles>}\r\n\r\n {(actions || leftButton) && <CardBottomSectionButtonRowContainerStyles>\r\n <LeftItemContainer>\r\n {leftButton && renderLeftButton()}\r\n </LeftItemContainer>\r\n\r\n { actions && <RightItemContainer>{actions.map((x, index) => (\r\n <IconButton ref={elRefs[index]}\r\n key={index}\r\n disabled={disabled}\r\n variant=\"secondary\"\r\n shape=\"circular\"\r\n action={(e) => {\r\n x.onClick();\r\n }}>\r\n {x.icon}\r\n </IconButton>\r\n ))}\r\n </RightItemContainer>\r\n }\r\n </CardBottomSectionButtonRowContainerStyles>}\r\n </CardBottomSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardBottomSection;\r\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AASA,IAAAG,OAAA,GAAAH,OAAA;AAA+D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,MAAAK,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CA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,CAAC,CAACK,OAAO,CAAC,CAAC;UACb,CAAE;UAAAnB,QAAA,EACDc,CAAC,CAACM;QAAI,GAPFL,KAQK,CACb;MAAC,CACkB,CAAC;IAAA,CAEkB,CAAC;EAAA,CAClB,CAAC;AAEjC,CAAC,CAAC;AAAC3D,iBAAA,CAAAiE,SAAA;EAxOD7D,aAAa,EAAA8D,UAAA,CAAAjH,OAAA,CAAAkH,MAAA;EAEb9D,WAAW,EAAA6D,UAAA,CAAAjH,OAAA,CAAAkH,MAAA;EAKX1D,QAAQ,EAAAyD,UAAA,CAAAjH,OAAA,CAAAmH,MAAA;EAER1D,YAAY,EAAAwD,UAAA,CAAAjH,OAAA,CAAAoH,IAAA;EAEZ1D,SAAS,EAAAuD,UAAA,CAAAjH,OAAA,CAAAmH,MAAA;EAETxD,aAAa,EAAAsD,UAAA,CAAAjH,OAAA,CAAAoH,IAAA;EAMbvD,UAAU,EAAAoD,UAAA,CAAAjH,OAAA,CAAAmH,MAAA;EAEVpD,OAAO,EAAAkD,UAAA,CAAAjH,OAAA,CAAAqH,OAAA,CAAAJ,UAAA,CAAAjH,OAAA,CAAA4G,KAAA;IAhCPG,IAAI,EAAAE,UAAA,CAAAjH,OAAA,CAAAoH,IAAA,CAAAE,UAAA;IACJR,OAAO,EAAAG,UAAA,CAAAjH,OAAA,CAAAuH,IAAA,CAAAD;EAAA;EAiCPxD,IAAI,EAAAmD,UAAA,CAAAjH,OAAA,CAAAoH,IAAA;EAEJpD,QAAQ,EAAAiD,UAAA,CAAAjH,OAAA,CAAAwH;AAAA;AAAA,IAAAC,QAAA,GAAA3F,OAAA,CAAA9B,OAAA,GAiNK+C,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"CardBottomSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_Button","_jsxRuntime","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","CardBottomSectionProgressStyles","exports","styled","div","CardBottomSectionNotesStyles","props","COLORS","generateToken","componentType","defaultVariant","theme","CardBottomSectionAuthorStyles","$disabled","state","CardBottomSectionDivider","CardBottomSectionNoteLeftStyles","CardBottomSectionNoteRightStyles","CardBottomSectionButtonRowContainerStyles","CardBottomSectionContainer","LeftItemContainer","RightItemContainer","getColor","CardBottomSection","forwardRef","_ref","ref","progressLevel","progressMax","progressType","LinearProgressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","leftButton","authorName","logo","actions","disabled","elRefs","setElRefs","useState","useTheme","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","renderLeftButton","buttonText","rest","_objectWithoutProperties2","jsx","Button","size","Size","XSmall","XXSmall","includes","Small","Large","Medium","children","jsxs","LinearProgress","type","variant","LinearProgressVariant","Normal","value","max","ComponentXXS","color","textStyle","ComponentTextStyle","Bold","x","index","IconButton","shape","action","onClick","icon","propTypes","_propTypes","number","string","node","arrayOf","isRequired","func","bool","_default"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXS,\r\n LinearProgress,\r\n LinearProgressType,\r\n LinearProgressVariant,\r\n Size,\r\n} from '../../index';\r\nimport { Button, ButtonProps, IconButton } from '../../Button';\r\n\r\nexport interface ActionItem {\r\n icon: React.ReactNode;\r\n onClick: () => void;\r\n}\r\n\r\nexport type CardStandardButton = Pick<ButtonProps, 'width' | 'variant' | 'loading' | 'icon' | 'onClick' | 'disabled'> & {\r\n buttonText: string;\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n}\r\n\r\nexport interface CardBottomSectionProps {\r\n /** Optional. Current progress level shown in the progress bar. */\r\n progressLevel?: number;\r\n /** Optional. Maximum level of progress in the progress bar. */\r\n progressMax?: number;\r\n /** Optional. Type of the progress bar. */\r\n progressType?: LinearProgressType;\r\n\r\n /** Optional. Note text shown on the left side of the section. */\r\n noteLeft?: string;\r\n /** Optional. Note icon shown on the left side of the section. */\r\n noteLeftIcon?: React.ReactNode;\r\n /** Optional. Note text shown on the right side of the section. */\r\n noteRight?: string;\r\n /** Optional. Note icon shown on the right side of the section. */\r\n noteRightIcon?: React.ReactNode;\r\n\r\n /** Optional. Note icon/Hyperlink/button shown on the left side of the section. */\r\n leftButton?: CardStandardButton;\r\n\r\n /** Author name shown at the bottom-left part of the section. */\r\n authorName?: string;\r\n /** Array of actions shown on the bottom-right corner of the section. */\r\n actions?: ActionItem[];\r\n /** Logo shown on the right side of the section, in front of AuthorName. */\r\n logo?: React.ReactNode;\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardBottomSectionProgressStyles = styled.div`\r\n padding: 8px 0;\r\n`;\r\n\r\nexport const CardBottomSectionNotesStyles = styled.div`\r\n height: 48px;\r\n position: relative;\r\n color: ${props => COLORS.generateToken({ componentType:'text', defaultVariant:'subtle' }, props.theme)};\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nexport const CardBottomSectionAuthorStyles = styled.div<{ $disabled?: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n height: 48px;\r\n\r\n div:first-child {\r\n flex-grow: 2;\r\n }\r\n\r\n svg, img {\r\n width: 80px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n\r\n ${props => props.$disabled ? `\r\n color: ${COLORS.generateToken({ componentType: 'text', state: 'disabled' }, props.theme)};\r\n svg, img {\r\n filter: grayscale(100%);\r\n }\r\n \r\n ` : ''}\r\n`;\r\n\r\nexport const CardBottomSectionDivider = styled.div`\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.generateToken({componentType:'border', defaultVariant:'subtle'}, props.theme)};\r\n border-top-style: solid;\r\n width: 100%;\r\n`;\r\n\r\nexport const CardBottomSectionNoteLeftStyles = styled.div`\r\n position: absolute;\r\n left: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionNoteRightStyles = styled.div`\r\n position: absolute;\r\n right: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n align-items: center;\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.generateToken({componentType:'border', defaultVariant:'subtle'}, props.theme)};\r\n border-top-style: solid;\r\n\r\n button:last-child {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n button:not(:last-child) {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({componentType:'icon', defaultVariant:'subtle' }, props.theme)};\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionContainer = styled.div`\r\n padding: 0px 16px 8px 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nconst LeftItemContainer = styled.div`\r\n flex: 1\r\n`;\r\n\r\nconst RightItemContainer = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n`;\r\n\r\nconst CardBottomSection = React.forwardRef(({\r\n progressLevel,\r\n progressMax,\r\n progressType = LinearProgressType.Line,\r\n noteLeft,\r\n noteLeftIcon,\r\n noteRight,\r\n noteRightIcon,\r\n leftButton,\r\n authorName,\r\n logo,\r\n actions,\r\n disabled\r\n}: CardBottomSectionProps,\r\n ref: React.Ref<React.RefObject<HTMLButtonElement | null>[]>) => {\r\n\r\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement | null>[]>([]);\r\n const theme = useTheme();\r\n const length = actions?.length || 0;\r\n\r\n React.useEffect(() => {\r\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\r\n }, [length]);\r\n\r\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\r\n\r\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName || leftButton;\r\n\r\n const renderLeftButton = () => {\r\n if (leftButton){\r\n const {buttonText, ...rest} = leftButton;\r\n return (<Button \r\n size={ leftButton.size && [Size.XSmall, Size.XSmall, Size.XXSmall].includes(leftButton.size) ? Size.Small: \r\n leftButton.size == Size.Large ? Size.Large : Size.Medium}\r\n {...rest}>\r\n {buttonText}\r\n </Button>)\r\n }\r\n}\r\n\r\n return (\r\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\r\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\r\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\r\n <LinearProgress size={Size.Small}\r\n type={progressType}\r\n variant={LinearProgressVariant.Normal}\r\n value={progressLevel}\r\n max={progressMax ?? progressLevel}/>\r\n </CardBottomSectionProgressStyles>}\r\n\r\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\r\n {(noteLeft || noteLeftIcon) && (\r\n <CardBottomSectionNoteLeftStyles>\r\n {noteLeftIcon}\r\n <ComponentXXS color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\r\n </CardBottomSectionNoteLeftStyles>\r\n )}\r\n {(noteRight || noteRightIcon) && (\r\n <CardBottomSectionNoteRightStyles>\r\n {noteRightIcon}\r\n <ComponentXXS color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\r\n </CardBottomSectionNoteRightStyles>\r\n )}\r\n </CardBottomSectionNotesStyles>}\r\n\r\n {(authorName || logo) && <CardBottomSectionAuthorStyles $disabled={disabled} data-testid={'card-bottomSection-author'}>\r\n <ComponentXXS>{authorName}</ComponentXXS>\r\n {logo}\r\n </CardBottomSectionAuthorStyles>}\r\n\r\n {(actions || leftButton) && <CardBottomSectionButtonRowContainerStyles>\r\n <LeftItemContainer>\r\n {leftButton && renderLeftButton()}\r\n </LeftItemContainer>\r\n\r\n { actions && <RightItemContainer>{actions.map((x, index) => (\r\n <IconButton ref={elRefs[index]}\r\n key={index}\r\n disabled={disabled}\r\n variant=\"secondary\"\r\n shape=\"circular\"\r\n action={(e) => {\r\n x.onClick();\r\n }}>\r\n {x.icon}\r\n </IconButton>\r\n ))}\r\n </RightItemContainer>\r\n }\r\n </CardBottomSectionButtonRowContainerStyles>}\r\n </CardBottomSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardBottomSection;\r\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AASA,IAAAG,OAAA,GAAAH,OAAA;AAA+D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,MAAAK,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAA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AAA;EAiCPxD,IAAI,EAAAmD,UAAA,CAAArH,OAAA,CAAAwH,IAAA;EAEJpD,QAAQ,EAAAiD,UAAA,CAAArH,OAAA,CAAA4H;AAAA;AAAA,IAAAC,QAAA,GAAA/F,OAAA,CAAA9B,OAAA,GAiNKmD,iBAAiB","ignoreList":[]}
@@ -15,7 +15,10 @@ export const CardBottomSectionProgressStyles = styled.div`
15
15
  export const CardBottomSectionNotesStyles = styled.div`
16
16
  height: 48px;
17
17
  position: relative;
18
- color: ${props => COLORS.getColor('neutral_500', props.theme)};
18
+ color: ${props => COLORS.generateToken({
19
+ componentType: 'text',
20
+ defaultVariant: 'subtle'
21
+ }, props.theme)};
19
22
  display: flex;
20
23
  flex-direction: row;
21
24
  align-items: center;
@@ -37,7 +40,10 @@ export const CardBottomSectionAuthorStyles = styled.div`
37
40
  }
38
41
 
39
42
  ${props => props.$disabled ? `
40
- color: ${COLORS.getColor('neutral_300', props.theme)};
43
+ color: ${COLORS.generateToken({
44
+ componentType: 'text',
45
+ state: 'disabled'
46
+ }, props.theme)};
41
47
  svg, img {
42
48
  filter: grayscale(100%);
43
49
  }
@@ -46,7 +52,10 @@ export const CardBottomSectionAuthorStyles = styled.div`
46
52
  `;
47
53
  export const CardBottomSectionDivider = styled.div`
48
54
  border-top: 1px;
49
- border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};
55
+ border-top-color: ${props => COLORS.generateToken({
56
+ componentType: 'border',
57
+ defaultVariant: 'subtle'
58
+ }, props.theme)};
50
59
  border-top-style: solid;
51
60
  width: 100%;
52
61
  `;
@@ -82,7 +91,10 @@ export const CardBottomSectionButtonRowContainerStyles = styled.div`
82
91
  justify-content: flex-end;
83
92
  align-items: center;
84
93
  border-top: 1px;
85
- border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};
94
+ border-top-color: ${props => COLORS.generateToken({
95
+ componentType: 'border',
96
+ defaultVariant: 'subtle'
97
+ }, props.theme)};
86
98
  border-top-style: solid;
87
99
 
88
100
  button:last-child {
@@ -94,7 +106,10 @@ export const CardBottomSectionButtonRowContainerStyles = styled.div`
94
106
  }
95
107
 
96
108
  svg {
97
- color: ${props => COLORS.getColor('neutral_600', props.theme)};
109
+ color: ${props => COLORS.generateToken({
110
+ componentType: 'icon',
111
+ defaultVariant: 'subtle'
112
+ }, props.theme)};
98
113
  }
99
114
  `;
100
115
  export const CardBottomSectionContainer = styled.div`
@@ -159,13 +174,19 @@ const CardBottomSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
159
174
  }), (noteLeft || noteLeftIcon || noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNotesStyles, {
160
175
  children: [(noteLeft || noteLeftIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNoteLeftStyles, {
161
176
  children: [noteLeftIcon, /*#__PURE__*/_jsx(ComponentXXS, {
162
- color: COLORS.getColor('neutral_500', theme),
177
+ color: COLORS.generateToken({
178
+ componentType: 'icon',
179
+ defaultVariant: 'subtle'
180
+ }, theme),
163
181
  textStyle: ComponentTextStyle.Bold,
164
182
  children: noteLeft
165
183
  })]
166
184
  }), (noteRight || noteRightIcon) && /*#__PURE__*/_jsxs(CardBottomSectionNoteRightStyles, {
167
185
  children: [noteRightIcon, /*#__PURE__*/_jsx(ComponentXXS, {
168
- color: COLORS.getColor('neutral_500', theme),
186
+ color: COLORS.generateToken({
187
+ componentType: 'icon',
188
+ defaultVariant: 'subtle'
189
+ }, theme),
169
190
  textStyle: ComponentTextStyle.Bold,
170
191
  children: noteRight
171
192
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"CardBottomSection.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXXS","LinearProgress","LinearProgressType","LinearProgressVariant","Size","Button","IconButton","jsx","_jsx","jsxs","_jsxs","CardBottomSectionProgressStyles","div","CardBottomSectionNotesStyles","props","getColor","theme","CardBottomSectionAuthorStyles","$disabled","CardBottomSectionDivider","CardBottomSectionNoteLeftStyles","CardBottomSectionNoteRightStyles","CardBottomSectionButtonRowContainerStyles","CardBottomSectionContainer","LeftItemContainer","RightItemContainer","CardBottomSection","forwardRef","_ref","ref","progressLevel","progressMax","progressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","leftButton","authorName","logo","actions","disabled","elRefs","setElRefs","useState","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","renderLeftButton","buttonText","rest","_objectWithoutProperties","_excluded","_objectSpread","size","XSmall","XXSmall","includes","Small","Large","Medium","children","type","variant","Normal","value","max","color","textStyle","Bold","x","index","shape","action","e","onClick","icon","propTypes","_pt","number","string","node","arrayOf","isRequired","func","bool"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXS,\r\n LinearProgress,\r\n LinearProgressType,\r\n LinearProgressVariant,\r\n Size,\r\n} from '../../index';\r\nimport { Button, ButtonProps, IconButton } from '../../Button';\r\n\r\nexport interface ActionItem {\r\n icon: React.ReactNode;\r\n onClick: () => void;\r\n}\r\n\r\nexport type CardStandardButton = Pick<ButtonProps, 'width' | 'variant' | 'loading' | 'icon' | 'onClick' | 'disabled'> & {\r\n buttonText: string;\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n}\r\n\r\nexport interface CardBottomSectionProps {\r\n /** Optional. Current progress level shown in the progress bar. */\r\n progressLevel?: number;\r\n /** Optional. Maximum level of progress in the progress bar. */\r\n progressMax?: number;\r\n /** Optional. Type of the progress bar. */\r\n progressType?: LinearProgressType;\r\n\r\n /** Optional. Note text shown on the left side of the section. */\r\n noteLeft?: string;\r\n /** Optional. Note icon shown on the left side of the section. */\r\n noteLeftIcon?: React.ReactNode;\r\n /** Optional. Note text shown on the right side of the section. */\r\n noteRight?: string;\r\n /** Optional. Note icon shown on the right side of the section. */\r\n noteRightIcon?: React.ReactNode;\r\n\r\n /** Optional. Note icon/Hyperlink/button shown on the left side of the section. */\r\n leftButton?: CardStandardButton;\r\n\r\n /** Author name shown at the bottom-left part of the section. */\r\n authorName?: string;\r\n /** Array of actions shown on the bottom-right corner of the section. */\r\n actions?: ActionItem[];\r\n /** Logo shown on the right side of the section, in front of AuthorName. */\r\n logo?: React.ReactNode;\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardBottomSectionProgressStyles = styled.div`\r\n padding: 8px 0;\r\n`;\r\n\r\nexport const CardBottomSectionNotesStyles = styled.div`\r\n height: 48px;\r\n position: relative;\r\n color: ${props => COLORS.getColor('neutral_500', props.theme)};\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nexport const CardBottomSectionAuthorStyles = styled.div<{ $disabled?: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n height: 48px;\r\n\r\n div:first-child {\r\n flex-grow: 2;\r\n }\r\n\r\n svg, img {\r\n width: 80px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n\r\n ${props => props.$disabled ? `\r\n color: ${COLORS.getColor('neutral_300', props.theme)};\r\n svg, img {\r\n filter: grayscale(100%);\r\n }\r\n \r\n ` : ''}\r\n`;\r\n\r\nexport const CardBottomSectionDivider = styled.div`\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n border-top-style: solid;\r\n width: 100%;\r\n`;\r\n\r\nexport const CardBottomSectionNoteLeftStyles = styled.div`\r\n position: absolute;\r\n left: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionNoteRightStyles = styled.div`\r\n position: absolute;\r\n right: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n align-items: center;\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.getColor('neutral_100', props.theme)};\r\n border-top-style: solid;\r\n\r\n button:last-child {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n button:not(:last-child) {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionContainer = styled.div`\r\n padding: 0px 16px 8px 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nconst LeftItemContainer = styled.div`\r\n flex: 1\r\n`;\r\n\r\nconst RightItemContainer = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n`;\r\n\r\nconst CardBottomSection = React.forwardRef(({\r\n progressLevel,\r\n progressMax,\r\n progressType = LinearProgressType.Line,\r\n noteLeft,\r\n noteLeftIcon,\r\n noteRight,\r\n noteRightIcon,\r\n leftButton,\r\n authorName,\r\n logo,\r\n actions,\r\n disabled\r\n}: CardBottomSectionProps,\r\n ref: React.Ref<React.RefObject<HTMLButtonElement | null>[]>) => {\r\n\r\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement | null>[]>([]);\r\n const theme = useTheme();\r\n const length = actions?.length || 0;\r\n\r\n React.useEffect(() => {\r\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\r\n }, [length]);\r\n\r\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\r\n\r\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName || leftButton;\r\n\r\n const renderLeftButton = () => {\r\n if (leftButton){\r\n const {buttonText, ...rest} = leftButton;\r\n return (<Button \r\n size={ leftButton.size && [Size.XSmall, Size.XSmall, Size.XXSmall].includes(leftButton.size) ? Size.Small: \r\n leftButton.size == Size.Large ? Size.Large : Size.Medium}\r\n {...rest}>\r\n {buttonText}\r\n </Button>)\r\n }\r\n}\r\n\r\n return (\r\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\r\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\r\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\r\n <LinearProgress size={Size.Small}\r\n type={progressType}\r\n variant={LinearProgressVariant.Normal}\r\n value={progressLevel}\r\n max={progressMax ?? progressLevel}/>\r\n </CardBottomSectionProgressStyles>}\r\n\r\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\r\n {(noteLeft || noteLeftIcon) && (\r\n <CardBottomSectionNoteLeftStyles>\r\n {noteLeftIcon}\r\n <ComponentXXS color={COLORS.getColor('neutral_500', theme)} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\r\n </CardBottomSectionNoteLeftStyles>\r\n )}\r\n {(noteRight || noteRightIcon) && (\r\n <CardBottomSectionNoteRightStyles>\r\n {noteRightIcon}\r\n <ComponentXXS color={COLORS.getColor('neutral_500', theme)} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\r\n </CardBottomSectionNoteRightStyles>\r\n )}\r\n </CardBottomSectionNotesStyles>}\r\n\r\n {(authorName || logo) && <CardBottomSectionAuthorStyles $disabled={disabled} data-testid={'card-bottomSection-author'}>\r\n <ComponentXXS>{authorName}</ComponentXXS>\r\n {logo}\r\n </CardBottomSectionAuthorStyles>}\r\n\r\n {(actions || leftButton) && <CardBottomSectionButtonRowContainerStyles>\r\n <LeftItemContainer>\r\n {leftButton && renderLeftButton()}\r\n </LeftItemContainer>\r\n\r\n { actions && <RightItemContainer>{actions.map((x, index) => (\r\n <IconButton ref={elRefs[index]}\r\n key={index}\r\n disabled={disabled}\r\n variant=\"secondary\"\r\n shape=\"circular\"\r\n action={(e) => {\r\n x.onClick();\r\n }}>\r\n {x.icon}\r\n </IconButton>\r\n ))}\r\n </RightItemContainer>\r\n }\r\n </CardBottomSectionButtonRowContainerStyles>}\r\n </CardBottomSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardBottomSection;\r\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SACEC,MAAM,EACNC,kBAAkB,EAClBC,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,qBAAqB,EACrBC,IAAI,QACC,aAAa;AACpB,SAASC,MAAM,EAAeC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA0C/D,OAAO,MAAMC,+BAA+B,GAAGf,MAAM,CAACgB,GAAG;AACzD;AACA,CAAC;AAED,OAAO,MAAMC,4BAA4B,GAAGjB,MAAM,CAACgB,GAAG;AACtD;AACA;AACA,WAAWE,KAAK,IAAIhB,MAAM,CAACiB,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAC/D;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,6BAA6B,GAAGrB,MAAM,CAACgB,GAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIE,KAAK,IAAIA,KAAK,CAACI,SAAS,GAAG;AAC/B,aAAapB,MAAM,CAACiB,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AACxD;AACA;AACA;AACA;AACA,GAAG,GAAG,EAAE;AACR,CAAC;AAED,OAAO,MAAMG,wBAAwB,GAAGvB,MAAM,CAACgB,GAAG;AAClD;AACA,sBAAsBE,KAAK,IAAIhB,MAAM,CAACiB,QAAQ,CAAC,aAAa,EAAED,KAAK,CAACE,KAAK,CAAC;AAC1E;A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AhCPI,IAAI,EAAAE,GAAA,CAAAG,IAAA,CAAAE,UAAA;IACJR,OAAO,EAAAG,GAAA,CAAAM,IAAA,CAAAD;EAAA;EAiCPlD,IAAI,EAAA6C,GAAA,CAAAG,IAAA;EAEJ9C,QAAQ,EAAA2C,GAAA,CAAAO;AAAA;AAiNV,eAAelE,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"CardBottomSection.js","names":["React","styled","useTheme","COLORS","ComponentTextStyle","ComponentXXS","LinearProgress","LinearProgressType","LinearProgressVariant","Size","Button","IconButton","jsx","_jsx","jsxs","_jsxs","CardBottomSectionProgressStyles","div","CardBottomSectionNotesStyles","props","generateToken","componentType","defaultVariant","theme","CardBottomSectionAuthorStyles","$disabled","state","CardBottomSectionDivider","CardBottomSectionNoteLeftStyles","CardBottomSectionNoteRightStyles","CardBottomSectionButtonRowContainerStyles","CardBottomSectionContainer","LeftItemContainer","RightItemContainer","getColor","CardBottomSection","forwardRef","_ref","ref","progressLevel","progressMax","progressType","Line","noteLeft","noteLeftIcon","noteRight","noteRightIcon","leftButton","authorName","logo","actions","disabled","elRefs","setElRefs","useState","length","useEffect","Array","fill","map","createRef","useImperativeHandle","haveAtLeastSomething","undefined","renderLeftButton","buttonText","rest","_objectWithoutProperties","_excluded","_objectSpread","size","XSmall","XXSmall","includes","Small","Large","Medium","children","type","variant","Normal","value","max","color","textStyle","Bold","x","index","shape","action","e","onClick","icon","propTypes","_pt","number","string","node","arrayOf","isRequired","func","bool"],"sources":["../../../src/Card/VerticalCard/CardBottomSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport {\r\n COLORS,\r\n ComponentTextStyle,\r\n ComponentXXS,\r\n LinearProgress,\r\n LinearProgressType,\r\n LinearProgressVariant,\r\n Size,\r\n} from '../../index';\r\nimport { Button, ButtonProps, IconButton } from '../../Button';\r\n\r\nexport interface ActionItem {\r\n icon: React.ReactNode;\r\n onClick: () => void;\r\n}\r\n\r\nexport type CardStandardButton = Pick<ButtonProps, 'width' | 'variant' | 'loading' | 'icon' | 'onClick' | 'disabled'> & {\r\n buttonText: string;\r\n size?: Size.Small | Size.Medium | Size.Large;\r\n}\r\n\r\nexport interface CardBottomSectionProps {\r\n /** Optional. Current progress level shown in the progress bar. */\r\n progressLevel?: number;\r\n /** Optional. Maximum level of progress in the progress bar. */\r\n progressMax?: number;\r\n /** Optional. Type of the progress bar. */\r\n progressType?: LinearProgressType;\r\n\r\n /** Optional. Note text shown on the left side of the section. */\r\n noteLeft?: string;\r\n /** Optional. Note icon shown on the left side of the section. */\r\n noteLeftIcon?: React.ReactNode;\r\n /** Optional. Note text shown on the right side of the section. */\r\n noteRight?: string;\r\n /** Optional. Note icon shown on the right side of the section. */\r\n noteRightIcon?: React.ReactNode;\r\n\r\n /** Optional. Note icon/Hyperlink/button shown on the left side of the section. */\r\n leftButton?: CardStandardButton;\r\n\r\n /** Author name shown at the bottom-left part of the section. */\r\n authorName?: string;\r\n /** Array of actions shown on the bottom-right corner of the section. */\r\n actions?: ActionItem[];\r\n /** Logo shown on the right side of the section, in front of AuthorName. */\r\n logo?: React.ReactNode;\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CardBottomSectionProgressStyles = styled.div`\r\n padding: 8px 0;\r\n`;\r\n\r\nexport const CardBottomSectionNotesStyles = styled.div`\r\n height: 48px;\r\n position: relative;\r\n color: ${props => COLORS.generateToken({ componentType:'text', defaultVariant:'subtle' }, props.theme)};\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n`;\r\n\r\nexport const CardBottomSectionAuthorStyles = styled.div<{ $disabled?: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n height: 48px;\r\n\r\n div:first-child {\r\n flex-grow: 2;\r\n }\r\n\r\n svg, img {\r\n width: 80px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n\r\n ${props => props.$disabled ? `\r\n color: ${COLORS.generateToken({ componentType: 'text', state: 'disabled' }, props.theme)};\r\n svg, img {\r\n filter: grayscale(100%);\r\n }\r\n \r\n ` : ''}\r\n`;\r\n\r\nexport const CardBottomSectionDivider = styled.div`\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.generateToken({componentType:'border', defaultVariant:'subtle'}, props.theme)};\r\n border-top-style: solid;\r\n width: 100%;\r\n`;\r\n\r\nexport const CardBottomSectionNoteLeftStyles = styled.div`\r\n position: absolute;\r\n left: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionNoteRightStyles = styled.div`\r\n position: absolute;\r\n right: 0px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n\r\n svg {\r\n margin-right: 4px;\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionButtonRowContainerStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n align-items: center;\r\n border-top: 1px;\r\n border-top-color: ${props => COLORS.generateToken({componentType:'border', defaultVariant:'subtle'}, props.theme)};\r\n border-top-style: solid;\r\n\r\n button:last-child {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n button:not(:last-child) {\r\n margin: 8px 0px 0px 0px;\r\n }\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({componentType:'icon', defaultVariant:'subtle' }, props.theme)};\r\n }\r\n`;\r\n\r\nexport const CardBottomSectionContainer = styled.div`\r\n padding: 0px 16px 8px 16px;\r\n width: calc(100% - 32px);\r\n`;\r\n\r\nconst LeftItemContainer = styled.div`\r\n flex: 1\r\n`;\r\n\r\nconst RightItemContainer = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n color: ${props => COLORS.getColor('neutral_600', props.theme)};\r\n`;\r\n\r\nconst CardBottomSection = React.forwardRef(({\r\n progressLevel,\r\n progressMax,\r\n progressType = LinearProgressType.Line,\r\n noteLeft,\r\n noteLeftIcon,\r\n noteRight,\r\n noteRightIcon,\r\n leftButton,\r\n authorName,\r\n logo,\r\n actions,\r\n disabled\r\n}: CardBottomSectionProps,\r\n ref: React.Ref<React.RefObject<HTMLButtonElement | null>[]>) => {\r\n\r\n const [elRefs, setElRefs] = React.useState<React.RefObject<HTMLButtonElement | null>[]>([]);\r\n const theme = useTheme();\r\n const length = actions?.length || 0;\r\n\r\n React.useEffect(() => {\r\n setElRefs(Array(length || 0).fill(null).map(() => React.createRef<HTMLButtonElement>()));\r\n }, [length]);\r\n\r\n React.useImperativeHandle(ref, () => elRefs, [elRefs]);\r\n\r\n const haveAtLeastSomething = progressLevel != undefined || noteLeft || noteLeftIcon || noteRight || noteRightIcon || authorName || leftButton;\r\n\r\n const renderLeftButton = () => {\r\n if (leftButton){\r\n const {buttonText, ...rest} = leftButton;\r\n return (<Button \r\n size={ leftButton.size && [Size.XSmall, Size.XSmall, Size.XXSmall].includes(leftButton.size) ? Size.Small: \r\n leftButton.size == Size.Large ? Size.Large : Size.Medium}\r\n {...rest}>\r\n {buttonText}\r\n </Button>)\r\n }\r\n}\r\n\r\n return (\r\n <CardBottomSectionContainer data-testid={'card-bottomSection'}>\r\n {haveAtLeastSomething && <CardBottomSectionDivider/>}\r\n {progressLevel != undefined && <CardBottomSectionProgressStyles>\r\n <LinearProgress size={Size.Small}\r\n type={progressType}\r\n variant={LinearProgressVariant.Normal}\r\n value={progressLevel}\r\n max={progressMax ?? progressLevel}/>\r\n </CardBottomSectionProgressStyles>}\r\n\r\n {(noteLeft || noteLeftIcon || noteRight || noteRightIcon) && <CardBottomSectionNotesStyles>\r\n {(noteLeft || noteLeftIcon) && (\r\n <CardBottomSectionNoteLeftStyles>\r\n {noteLeftIcon}\r\n <ComponentXXS color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} textStyle={ComponentTextStyle.Bold}>{noteLeft}</ComponentXXS>\r\n </CardBottomSectionNoteLeftStyles>\r\n )}\r\n {(noteRight || noteRightIcon) && (\r\n <CardBottomSectionNoteRightStyles>\r\n {noteRightIcon}\r\n <ComponentXXS color={COLORS.generateToken({componentType:'icon', defaultVariant:'subtle'}, theme)} textStyle={ComponentTextStyle.Bold}>{noteRight}</ComponentXXS>\r\n </CardBottomSectionNoteRightStyles>\r\n )}\r\n </CardBottomSectionNotesStyles>}\r\n\r\n {(authorName || logo) && <CardBottomSectionAuthorStyles $disabled={disabled} data-testid={'card-bottomSection-author'}>\r\n <ComponentXXS>{authorName}</ComponentXXS>\r\n {logo}\r\n </CardBottomSectionAuthorStyles>}\r\n\r\n {(actions || leftButton) && <CardBottomSectionButtonRowContainerStyles>\r\n <LeftItemContainer>\r\n {leftButton && renderLeftButton()}\r\n </LeftItemContainer>\r\n\r\n { actions && <RightItemContainer>{actions.map((x, index) => (\r\n <IconButton ref={elRefs[index]}\r\n key={index}\r\n disabled={disabled}\r\n variant=\"secondary\"\r\n shape=\"circular\"\r\n action={(e) => {\r\n x.onClick();\r\n }}>\r\n {x.icon}\r\n </IconButton>\r\n ))}\r\n </RightItemContainer>\r\n }\r\n </CardBottomSectionButtonRowContainerStyles>}\r\n </CardBottomSectionContainer>\r\n );\r\n});\r\n\r\nexport default CardBottomSection;\r\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,IAAIC,QAAQ,QAAQ,mBAAmB;AACpD,SACEC,MAAM,EACNC,kBAAkB,EAClBC,YAAY,EACZC,cAAc,EACdC,kBAAkB,EAClBC,qBAAqB,EACrBC,IAAI,QACC,aAAa;AACpB,SAASC,MAAM,EAAeC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA0C/D,OAAO,MAAMC,+BAA+B,GAAGf,MAAM,CAACgB,GAAG;AACzD;AACA,CAA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-50,7 +50,10 @@ const CardMiddleSectionCategoryStyles = exports.CardMiddleSectionCategoryStyles
50
50
  gap: 6px;
51
51
 
52
52
  svg {
53
- color: ${props => _index.COLORS.getColor('neutral_500', props.theme)};
53
+ color: ${props => _index.COLORS.generateToken({
54
+ componentType: 'text',
55
+ defaultVariant: 'subtle'
56
+ }, props.theme)};
54
57
  flex-grow: 0;
55
58
  flex-shrink: 0;
56
59
  }
@@ -76,17 +79,29 @@ const CardMiddleSection = _ref => {
76
79
  $bottomMargin: Boolean(categoryIcon || categoryLabel),
77
80
  children: [categoryIcon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
78
81
  textStyle: _index.ComponentTextStyle.Bold,
79
- color: _index.COLORS.getColor('neutral_500', theme),
82
+ color: _index.COLORS.generateToken({
83
+ componentType: 'text',
84
+ defaultVariant: 'subtle'
85
+ }, theme),
80
86
  children: categoryLabel
81
87
  })]
82
88
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentXL, {
83
89
  className: "titleBlock",
84
90
  textStyle: _index.ComponentTextStyle.Bold,
85
- color: disabled ? _index.COLORS.getColor('neutral_500', theme) : _index.COLORS.getColor('black', theme),
91
+ color: disabled ? _index.COLORS.generateToken({
92
+ componentType: 'text',
93
+ defaultVariant: 'subtle'
94
+ }, theme) : _index.COLORS.generateToken({
95
+ componentType: 'text',
96
+ defaultVariant: 'default'
97
+ }, theme),
86
98
  children: title
87
99
  }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ComponentS, {
88
100
  className: "descriptionBlock",
89
- color: _index.COLORS.getColor('neutral_600', theme),
101
+ color: _index.COLORS.generateToken({
102
+ componentType: 'text',
103
+ defaultVariant: 'subtle'
104
+ }, theme),
90
105
  children: description
91
106
  }), tags && /*#__PURE__*/(0, _jsxRuntime.jsx)(CardMiddleSectionTagsStyles, {
92
107
  children: tags.map((x, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Tag, {
@@ -1 +1 @@
1
- {"version":3,"file":"CardMiddleSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardMiddleSectionContainer","exports","styled","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","COLORS","getColor","theme","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","useTheme","jsxs","children","jsx","$extraTopMargin","Boolean","$bottomMargin","ComponentS","textStyle","ComponentTextStyle","Bold","color","ComponentXL","className","map","x","index","Tag","label","variant","icon","_default"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface CardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: CardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: CardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport interface CardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const CardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const CardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const CardMiddleSectionCategoryStyles = styled.div<{ $extraTopMargin: boolean; $bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.getColor('neutral_500', props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n return (\r\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <CardMiddleSectionCategoryStyles $extraTopMargin={Boolean(colorBandColor)} $bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.getColor('neutral_500', theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <ComponentXL className=\"titleBlock\" textStyle={ComponentTextStyle.Bold} color={disabled ? COLORS.getColor('neutral_500', theme) : COLORS.getColor('black', theme)}>\r\n {title}\r\n </ComponentXL>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.getColor('neutral_600', theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n </CardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default CardMiddleSection;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAoG,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CA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EAAEC,KAAK,CAAE;MAAAa,QAAA,EACnFN;IAAW,CACF,CACb,EACAC,IAAI,iBACH,IAAAxC,WAAA,CAAA8C,GAAA,EAAClB,2BAA2B;MAAAiB,QAAA,EACzBL,IAAI,CAACiB,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,kBACjB,IAAA3D,WAAA,CAAA8C,GAAA,EAAC/C,MAAA,CAAA6D,GAAG;QAA6BC,KAAK,EAAEH,CAAC,CAACG,KAAM;QAACC,OAAO,EAAEJ,CAAC,CAACI,OAAO,IAAI,SAAU;QAACC,IAAI,EAAEL,CAAC,CAACK;MAAK,GAArF,GAAGL,CAAC,CAACG,KAAK,IAAIF,KAAK,EAAoE,CAClG;IAAC,CACyB,CAC9B,EACAlB,QAAQ,iBACP,IAAAzC,WAAA,CAAA8C,GAAA,EAAClB,2BAA2B;MAAAiB,QAAA,EACzBJ,QAAQ,CAACgB,GAAG,CAAC,CAACC,CAAC,EAAEC,KAAK,kBACrB,IAAA3D,WAAA,CAAA8C,GAAA,EAAC/C,MAAA,CAAA6D,GAAG;QAA6BC,KAAK,EAAEH,CAAC,CAACG,KAAM;QAACC,OAAO,EAAEJ,CAAC,CAACI,OAAO,IAAI,SAAU;QAACC,IAAI,EAAEL,CAAC,CAACK;MAAK,GAArF,GAAGL,CAAC,CAACG,KAAK,IAAIF,KAAK,EAAoE,CAClG;IAAC,CACyB,CAC9B;EAAA,CACyB,CAAC;AAEjC,CAAC;AAAC,IAAAK,QAAA,GAAA1C,OAAA,CAAAf,OAAA,GAEa0B,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"CardMiddleSection.cjs","names":["React","_interopRequireWildcard","require","_styledComponents","_index","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CardMiddleSectionContainer","exports","styled","div","CardMiddleSectionColorBandStyles","props","$color","CardMiddleSectionTagsStyles","CardMiddleSectionCategoryStyles","COLORS","generateToken","componentType","defaultVariant","theme","CardMiddleSection","_ref","colorBandColor","categoryIcon","categoryLabel","title","description","tags","row2Tags","disabled","useTheme","jsxs","children","jsx","$extraTopMargin","Boolean","$bottomMargin","ComponentS","textStyle","ComponentTextStyle","Bold","color","ComponentXL","className","map","x","index","Tag","label","variant","icon","_default"],"sources":["../../../src/Card/VerticalCard/CardMiddleSection.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport styled, { useTheme } from 'styled-components';\r\nimport { COLORS, ComponentS, ComponentTextStyle, ComponentXL, Tag, TagVariants } from '../../index';\r\nimport { ReactNode } from 'react';\r\n\r\nexport interface CardMiddleSectionProps {\r\n /** Color of the band to be shown on the top of middle section. */\r\n colorBandColor?: string;\r\n /** Icon to be shown on the left side of the categoryLabel. */\r\n categoryIcon?: React.ReactNode;\r\n /** Label to be shown at the top part of the middle section. */\r\n categoryLabel?: string;\r\n /** Main title of the Card component. */\r\n title: string;\r\n /** Description of the Card. */\r\n description?: string;\r\n /** Tags to be shown under the description. */\r\n tags?: CardTag[];\r\n /** Second row of tags if needed. */\r\n row2Tags?: CardTag[];\r\n /** This property is set by Card component itself and is based on 'disabled' flag of CardProps. */\r\n disabled?: boolean;\r\n}\r\n\r\nexport interface CardTag {\r\n label: string;\r\n variant?: TagVariants;\r\n icon?: ReactNode\r\n}\r\n\r\nexport const CardMiddleSectionContainer = styled.div`\r\n display: flex;\r\n flex-grow: 1;\r\n width: calc(100% - 32px);\r\n position: relative;\r\n flex-direction: column;\r\n padding: 16px;\r\n gap: 8px;\r\n\r\n .descriptionBlock {\r\n padding: 2px 0;\r\n }\r\n\r\n .titleBlock {\r\n padding: 2px 0;\r\n }\r\n`;\r\n\r\nexport const CardMiddleSectionColorBandStyles = styled.div<{ $color: string }>`\r\n position: absolute;\r\n width: 100%;\r\n top: 0px;\r\n left: 0px;\r\n height: 8px;\r\n background-color: ${(props) => props.$color};\r\n`;\r\n\r\nexport const CardMiddleSectionTagsStyles = styled.div`\r\n display: flex;\r\n flex-direction: row;\r\n padding: 4px 0;\r\n gap: 4px;\r\n flex-wrap: wrap;\r\n`;\r\n\r\nexport const CardMiddleSectionCategoryStyles = styled.div<{ $extraTopMargin: boolean; $bottomMargin: boolean }>`\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n padding: none;\r\n gap: 6px;\r\n\r\n svg {\r\n color: ${props => COLORS.generateToken({ componentType: 'text', defaultVariant: 'subtle' }, props.theme)};\r\n flex-grow: 0;\r\n flex-shrink: 0;\r\n }\r\n`;\r\n\r\nconst CardMiddleSection: React.FunctionComponent<CardMiddleSectionProps> = ({\r\n colorBandColor,\r\n categoryIcon,\r\n categoryLabel,\r\n title,\r\n description,\r\n tags,\r\n row2Tags,\r\n disabled,\r\n}: CardMiddleSectionProps) => {\r\n const theme = useTheme();\r\n return (\r\n <CardMiddleSectionContainer data-testid={'card-middleSection'} >\r\n {colorBandColor && <CardMiddleSectionColorBandStyles $color={colorBandColor} />}\r\n {\r\n (categoryIcon || categoryLabel) &&\r\n <CardMiddleSectionCategoryStyles $extraTopMargin={Boolean(colorBandColor)} $bottomMargin={Boolean(categoryIcon || categoryLabel)}>\r\n {categoryIcon}\r\n <ComponentS textStyle={ComponentTextStyle.Bold} color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {categoryLabel}\r\n </ComponentS>\r\n </CardMiddleSectionCategoryStyles>\r\n }\r\n <ComponentXL className=\"titleBlock\" textStyle={ComponentTextStyle.Bold} color={disabled ? COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme) \r\n : COLORS.generateToken({componentType:'text',defaultVariant:'default'}, theme)}>\r\n {title}\r\n </ComponentXL>\r\n {description && (\r\n <ComponentS className=\"descriptionBlock\" color={COLORS.generateToken({componentType:'text',defaultVariant:'subtle'}, theme)}>\r\n {description}\r\n </ComponentS>\r\n )}\r\n {tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n {row2Tags && (\r\n <CardMiddleSectionTagsStyles>\r\n {row2Tags.map((x, index) => (\r\n <Tag key={`${x.label}_${index}`} label={x.label} variant={x.variant ?? 'neutral'} icon={x.icon} />\r\n ))}\r\n </CardMiddleSectionTagsStyles>\r\n )}\r\n </CardMiddleSectionContainer>\r\n );\r\n};\r\n\r\nexport default CardMiddleSection;\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAoG,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,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