@salesforcedevs/arch-components 1.20.17-alpha1

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 (363) hide show
  1. package/lwc.config.json +7 -0
  2. package/package.json +19 -0
  3. package/src/modules/common/context/context.html +1 -0
  4. package/src/modules/common/context/context.ts +137 -0
  5. package/src/modules/common/effectAdapter/__tests__/effectAdapter.test.ts +12 -0
  6. package/src/modules/common/effectAdapter/effectAdapter.html +1 -0
  7. package/src/modules/common/effectAdapter/effectAdapter.ts +18 -0
  8. package/src/modules/common/reflectedElement/__tests__/modules/test/select/select.html +3 -0
  9. package/src/modules/common/reflectedElement/__tests__/modules/test/select/select.ts +7 -0
  10. package/src/modules/common/reflectedElement/__tests__/modules/test/selectTransform/selectTransform.html +3 -0
  11. package/src/modules/common/reflectedElement/__tests__/modules/test/selectTransform/selectTransform.ts +18 -0
  12. package/src/modules/common/reflectedElement/__tests__/reflectedElement.test.ts +75 -0
  13. package/src/modules/common/reflectedElement/reflectedElement.ts +50 -0
  14. package/src/modules/common/slot/__tests__/slot.test.ts +96 -0
  15. package/src/modules/common/slot/slot.ts +20 -0
  16. package/src/modules/sa/coverage/coverage.css +35 -0
  17. package/src/modules/sa/coverage/coverage.html +15 -0
  18. package/src/modules/sa/coverage/coverage.ts +406 -0
  19. package/src/modules/sa/coverage/types.d.ts +26 -0
  20. package/src/modules/sa/expandableSection/expandableSection.css +24 -0
  21. package/src/modules/sa/expandableSection/expandableSection.html +20 -0
  22. package/src/modules/sa/expandableSection/expandableSection.stories.ts +37 -0
  23. package/src/modules/sa/expandableSection/expandableSection.ts +24 -0
  24. package/src/modules/sa/explorer/explorer.css +303 -0
  25. package/src/modules/sa/explorer/explorer.html +403 -0
  26. package/src/modules/sa/explorer/explorer.ts +664 -0
  27. package/src/modules/sa/explorer/types.d.ts +60 -0
  28. package/src/modules/sa/gallery/gallery.css +358 -0
  29. package/src/modules/sa/gallery/gallery.html +65 -0
  30. package/src/modules/sa/gallery/gallery.ts +300 -0
  31. package/src/modules/sa/gallery/types.d.ts +35 -0
  32. package/src/modules/sa/socialShare/socialShare.css +49 -0
  33. package/src/modules/sa/socialShare/socialShare.html +56 -0
  34. package/src/modules/sa/socialShare/socialShare.ts +29 -0
  35. package/src/modules/shared/a11y/a11y.ts +25 -0
  36. package/src/modules/shared/children/children.ts +29 -0
  37. package/src/modules/shared/color/color.ts +52 -0
  38. package/src/modules/shared/debounce/debounce.ts +32 -0
  39. package/src/modules/shared/dialog/dialog.ts +154 -0
  40. package/src/modules/shared/elements/__tests__/overflow.test.ts +39 -0
  41. package/src/modules/shared/elements/overflow.ts +71 -0
  42. package/src/modules/shared/fetch/fetch.ts +52 -0
  43. package/src/modules/shared/helpers/helpers.ts +141 -0
  44. package/src/modules/shared/i18n/i18n.ts +74 -0
  45. package/src/modules/shared/labels/__tests__/helpers.test.ts +107 -0
  46. package/src/modules/shared/labels/__tests__/pointHelpers.test.ts +33 -0
  47. package/src/modules/shared/labels/__tests__/timeHelpers.test.ts +89 -0
  48. package/src/modules/shared/labels/helpers.ts +23 -0
  49. package/src/modules/shared/labels/pointHelpers.ts +47 -0
  50. package/src/modules/shared/labels/timeHelpers.ts +182 -0
  51. package/src/modules/shared/labels/types.d.ts +5 -0
  52. package/src/modules/shared/logger/logger.ts +33 -0
  53. package/src/modules/shared/menu/menu.ts +239 -0
  54. package/src/modules/shared/overflow/__tests__/overflow.test.ts +39 -0
  55. package/src/modules/shared/overflow/overflow.ts +71 -0
  56. package/src/modules/shared/polling-request.ts +97 -0
  57. package/src/modules/shared/testutils.ts +118 -0
  58. package/src/modules/shared/track/track.ts +23 -0
  59. package/src/modules/shared/trailhead.ts +123 -0
  60. package/src/modules/shared/types.d.ts +1 -0
  61. package/src/modules/shared/useEffectAttr.ts +16 -0
  62. package/src/modules/shared/withState.ts +21 -0
  63. package/src/modules/tds/appLauncher/__fixtures__/index.ts +34 -0
  64. package/src/modules/tds/appLauncher/__tests__/appLauncher.test.ts +119 -0
  65. package/src/modules/tds/appLauncher/appLauncher.css +65 -0
  66. package/src/modules/tds/appLauncher/appLauncher.html +38 -0
  67. package/src/modules/tds/appLauncher/appLauncher.stories.ts +39 -0
  68. package/src/modules/tds/appLauncher/appLauncher.ts +79 -0
  69. package/src/modules/tds/appLauncher/types.ts +8 -0
  70. package/src/modules/tds/avatar/__tests__/avatar.test.ts +11 -0
  71. package/src/modules/tds/avatar/avatar.css +77 -0
  72. package/src/modules/tds/avatar/avatar.html +36 -0
  73. package/src/modules/tds/avatar/avatar.stories.ts +64 -0
  74. package/src/modules/tds/avatar/avatar.ts +50 -0
  75. package/src/modules/tds/badge/__tests__/badge.test.js +11 -0
  76. package/src/modules/tds/badge/badge.css +22 -0
  77. package/src/modules/tds/badge/badge.html +5 -0
  78. package/src/modules/tds/badge/badge.stories.ts +10 -0
  79. package/src/modules/tds/badge/badge.ts +9 -0
  80. package/src/modules/tds/button/__tests__/button.test.ts +52 -0
  81. package/src/modules/tds/button/button.css +1 -0
  82. package/src/modules/tds/button/button.html +20 -0
  83. package/src/modules/tds/button/button.stories.js +54 -0
  84. package/src/modules/tds/button/button.ts +59 -0
  85. package/src/modules/tds/buttonIcon/__tests__/buttonIcon.test.ts +17 -0
  86. package/src/modules/tds/buttonIcon/buttonIcon.css +1 -0
  87. package/src/modules/tds/buttonIcon/buttonIcon.html +12 -0
  88. package/src/modules/tds/buttonIcon/buttonIcon.stories.js +38 -0
  89. package/src/modules/tds/buttonIcon/buttonIcon.ts +6 -0
  90. package/src/modules/tds/buttonIconLink/buttonIconLink.css +1 -0
  91. package/src/modules/tds/buttonIconLink/buttonIconLink.html +14 -0
  92. package/src/modules/tds/buttonIconLink/buttonIconLink.stories.ts +32 -0
  93. package/src/modules/tds/buttonIconLink/buttonIconLink.ts +9 -0
  94. package/src/modules/tds/buttonLink/__tests__/buttonLink.test.ts +17 -0
  95. package/src/modules/tds/buttonLink/buttonLink.css +1 -0
  96. package/src/modules/tds/buttonLink/buttonLink.html +19 -0
  97. package/src/modules/tds/buttonLink/buttonLink.stories.js +24 -0
  98. package/src/modules/tds/buttonLink/buttonLink.ts +8 -0
  99. package/src/modules/tds/buttonStyles/buttonStyles.css +232 -0
  100. package/src/modules/tds/childSummary/__tests__/childSummary.test.js +99 -0
  101. package/src/modules/tds/childSummary/childSummary.css +74 -0
  102. package/src/modules/tds/childSummary/childSummary.html +38 -0
  103. package/src/modules/tds/childSummary/childSummary.stories.ts +40 -0
  104. package/src/modules/tds/childSummary/childSummary.ts +63 -0
  105. package/src/modules/tds/childSummary/types.d.ts +10 -0
  106. package/src/modules/tds/contentChildListItem/__tests__/contentChildListItem.test.ts +32 -0
  107. package/src/modules/tds/contentChildListItem/contentChildListItem.css +1 -0
  108. package/src/modules/tds/contentChildListItem/contentChildListItem.html +10 -0
  109. package/src/modules/tds/contentChildListItem/contentChildListItem.stories.ts +46 -0
  110. package/src/modules/tds/contentChildListItem/contentChildListItem.ts +34 -0
  111. package/src/modules/tds/contentIcon/contentIcon.css +47 -0
  112. package/src/modules/tds/contentIcon/contentIcon.html +15 -0
  113. package/src/modules/tds/contentIcon/contentIcon.stories.js +110 -0
  114. package/src/modules/tds/contentIcon/contentIcon.ts +66 -0
  115. package/src/modules/tds/contextAdapter/__tests__/contextAdapter.test.ts +76 -0
  116. package/src/modules/tds/contextAdapter/constants.ts +1 -0
  117. package/src/modules/tds/contextAdapter/contextAdapter.html +1 -0
  118. package/src/modules/tds/contextAdapter/contextAdapter.ts +54 -0
  119. package/src/modules/tds/dialogStyles/dialogStyles.css +90 -0
  120. package/src/modules/tds/footerLinks/__tests__/__snapshots__/footerLinks.test.ts.snap +3 -0
  121. package/src/modules/tds/footerLinks/__tests__/footerLinks.test.ts +142 -0
  122. package/src/modules/tds/footerLinks/footerLinks.css +80 -0
  123. package/src/modules/tds/footerLinks/footerLinks.html +30 -0
  124. package/src/modules/tds/footerLinks/footerLinks.ts +48 -0
  125. package/src/modules/tds/footerLinks/types.ts +11 -0
  126. package/src/modules/tds/footerMfe/footerMfe.html +3 -0
  127. package/src/modules/tds/footerMfe/footerMfe.ts +19 -0
  128. package/src/modules/tds/headerAvatar/__tests__/headerAvatar.test.ts +43 -0
  129. package/src/modules/tds/headerAvatar/headerAvatar.css +45 -0
  130. package/src/modules/tds/headerAvatar/headerAvatar.html +25 -0
  131. package/src/modules/tds/headerAvatar/headerAvatar.ts +15 -0
  132. package/src/modules/tds/headerHelpButton/__tests__/headerHelpButton.test.ts +32 -0
  133. package/src/modules/tds/headerHelpButton/headerHelpButton.css +14 -0
  134. package/src/modules/tds/headerHelpButton/headerHelpButton.html +19 -0
  135. package/src/modules/tds/headerHelpButton/headerHelpButton.ts +12 -0
  136. package/src/modules/tds/heading/__tests__/heading.test.ts +50 -0
  137. package/src/modules/tds/heading/heading.css +1 -0
  138. package/src/modules/tds/heading/heading.html +9 -0
  139. package/src/modules/tds/heading/heading.stories.ts +36 -0
  140. package/src/modules/tds/heading/heading.ts +36 -0
  141. package/src/modules/tds/icon/icon.css +28 -0
  142. package/src/modules/tds/icon/icon.html +17 -0
  143. package/src/modules/tds/icon/icon.stories.js +18 -0
  144. package/src/modules/tds/icon/icon.ts +79 -0
  145. package/src/modules/tds/input/__tests__/input.test.ts +41 -0
  146. package/src/modules/tds/input/input.css +34 -0
  147. package/src/modules/tds/input/input.html +12 -0
  148. package/src/modules/tds/input/input.stories.ts +25 -0
  149. package/src/modules/tds/input/input.ts +41 -0
  150. package/src/modules/tds/instrumentation/instrumentation.css +0 -0
  151. package/src/modules/tds/instrumentation/instrumentation.html +1 -0
  152. package/src/modules/tds/instrumentation/instrumentation.ts +113 -0
  153. package/src/modules/tds/pbCard/pbCard.css +28 -0
  154. package/src/modules/tds/pbCard/pbCard.html +21 -0
  155. package/src/modules/tds/pbCard/pbCard.ts +18 -0
  156. package/src/modules/tds/pill/__tests__/pill.test.ts +56 -0
  157. package/src/modules/tds/pill/pill.css +70 -0
  158. package/src/modules/tds/pill/pill.html +17 -0
  159. package/src/modules/tds/pill/pill.stories.ts +41 -0
  160. package/src/modules/tds/pill/pill.ts +34 -0
  161. package/src/modules/tds/progressBar/__tests__/progressBar.test.js +11 -0
  162. package/src/modules/tds/progressBar/progressBar.css +42 -0
  163. package/src/modules/tds/progressBar/progressBar.html +14 -0
  164. package/src/modules/tds/progressBar/progressBar.stories.ts +24 -0
  165. package/src/modules/tds/progressBar/progressBar.ts +14 -0
  166. package/src/modules/tds/radio/__tests__/radio.test.ts +29 -0
  167. package/src/modules/tds/radio/radio.css +89 -0
  168. package/src/modules/tds/radio/radio.html +17 -0
  169. package/src/modules/tds/radio/radio.stories.ts +31 -0
  170. package/src/modules/tds/radio/radio.ts +32 -0
  171. package/src/modules/tds/reset/reset.css +39 -0
  172. package/src/modules/tds/search/__fixtures__/index.ts +32 -0
  173. package/src/modules/tds/search/__tests__/search.test.ts +235 -0
  174. package/src/modules/tds/search/lib/__tests__/__snapshots__/listbox.test.ts.snap +115 -0
  175. package/src/modules/tds/search/lib/__tests__/listbox.test.ts +192 -0
  176. package/src/modules/tds/search/lib/listbox.ts +209 -0
  177. package/src/modules/tds/search/search.css +122 -0
  178. package/src/modules/tds/search/search.html +21 -0
  179. package/src/modules/tds/search/search.stories.ts +20 -0
  180. package/src/modules/tds/search/search.ts +107 -0
  181. package/src/modules/tds/search/types.d.ts +22 -0
  182. package/src/modules/tds/searchList/searchList.css +120 -0
  183. package/src/modules/tds/searchList/searchList.html +43 -0
  184. package/src/modules/tds/searchList/searchList.stories.ts +10 -0
  185. package/src/modules/tds/searchList/searchList.ts +53 -0
  186. package/src/modules/tds/select/__tests__/select.test.ts +150 -0
  187. package/src/modules/tds/select/select.css +42 -0
  188. package/src/modules/tds/select/select.html +24 -0
  189. package/src/modules/tds/select/select.stories.ts +59 -0
  190. package/src/modules/tds/select/select.ts +60 -0
  191. package/src/modules/tds/spinner/__tests__/spinner.test.ts +11 -0
  192. package/src/modules/tds/spinner/spinner.css +194 -0
  193. package/src/modules/tds/spinner/spinner.html +9 -0
  194. package/src/modules/tds/spinner/spinner.stories.ts +20 -0
  195. package/src/modules/tds/spinner/spinner.ts +15 -0
  196. package/src/modules/tds/styles/styles.css +24 -0
  197. package/src/modules/tds/summary/__tests__/summary.test.ts +135 -0
  198. package/src/modules/tds/summary/summary.css +135 -0
  199. package/src/modules/tds/summary/summary.html +69 -0
  200. package/src/modules/tds/summary/summary.stories.js +148 -0
  201. package/src/modules/tds/summary/summary.ts +95 -0
  202. package/src/modules/tds/tab/__tests__/tab.test.ts +25 -0
  203. package/src/modules/tds/tab/tab.css +3 -0
  204. package/src/modules/tds/tab/tab.html +5 -0
  205. package/src/modules/tds/tab/tab.ts +46 -0
  206. package/src/modules/tds/tabset/__tests__/tabset.test.ts +108 -0
  207. package/src/modules/tds/tabset/tabset.css +112 -0
  208. package/src/modules/tds/tabset/tabset.html +63 -0
  209. package/src/modules/tds/tabset/tabset.stories.ts +32 -0
  210. package/src/modules/tds/tabset/tabset.ts +232 -0
  211. package/src/modules/tds/themeProvider/themeProvider.css +502 -0
  212. package/src/modules/tds/themeProvider/themeProvider.html +3 -0
  213. package/src/modules/tds/themeProvider/themeProvider.ts +37 -0
  214. package/src/modules/tds/tile/tile.css +23 -0
  215. package/src/modules/tds/tile/tile.html +5 -0
  216. package/src/modules/tds/tile/tile.stories.js +14 -0
  217. package/src/modules/tds/tile/tile.ts +12 -0
  218. package/src/modules/tds/xsfMfeEvents/xsfMfeEvents.html +1 -0
  219. package/src/modules/tds/xsfMfeEvents/xsfMfeEvents.ts +47 -0
  220. package/src/modules/th/contextAdapter/__tests__/contextAdapter.test.ts +104 -0
  221. package/src/modules/th/contextAdapter/contextAdapter.html +1 -0
  222. package/src/modules/th/contextAdapter/contextAdapter.ts +49 -0
  223. package/src/modules/th/favoriteButton/__tests__/favoriteButton.test.ts +56 -0
  224. package/src/modules/th/favoriteButton/favoriteButton.css +3 -0
  225. package/src/modules/th/favoriteButton/favoriteButton.html +15 -0
  226. package/src/modules/th/favoriteButton/favoriteButton.stories.js +30 -0
  227. package/src/modules/th/favoriteButton/favoriteButton.ts +84 -0
  228. package/src/modules/th/favoriteButton/mocks/index.ts +12 -0
  229. package/src/modules/th/search/__fixtures__/index.ts +14 -0
  230. package/src/modules/th/search/__tests__/search.test.ts +233 -0
  231. package/src/modules/th/search/constants.ts +2 -0
  232. package/src/modules/th/search/mocks/index.ts +30 -0
  233. package/src/modules/th/search/mocks/responses.ts +54 -0
  234. package/src/modules/th/search/search.css +4 -0
  235. package/src/modules/th/search/search.html +12 -0
  236. package/src/modules/th/search/search.ts +172 -0
  237. package/src/modules/th/search/types.d.ts +29 -0
  238. package/src/modules/th/tbid/__tests__/__snapshots__/tbid.test.ts.snap +3 -0
  239. package/src/modules/th/tbid/__tests__/tbid.test.ts +242 -0
  240. package/src/modules/th/tbid/tbid.html +1 -0
  241. package/src/modules/th/tbid/tbid.stories.mdx +25 -0
  242. package/src/modules/th/tbid/tbid.ts +215 -0
  243. package/src/modules/tm/card/__tests__/card.test.ts +65 -0
  244. package/src/modules/tm/card/card.css +131 -0
  245. package/src/modules/tm/card/card.html +81 -0
  246. package/src/modules/tm/card/card.ts +269 -0
  247. package/src/modules/tm/cardBase/cardBase.css +11 -0
  248. package/src/modules/tm/cardGridA/cardGridA.css +11 -0
  249. package/src/modules/tm/cardGridA/cardGridA.html +21 -0
  250. package/src/modules/tm/cardGridA/cardGridA.stories.js +107 -0
  251. package/src/modules/tm/cardGridA/cardGridA.ts +24 -0
  252. package/src/modules/tm/cardGridB/cardGridB.css +88 -0
  253. package/src/modules/tm/cardGridB/cardGridB.html +20 -0
  254. package/src/modules/tm/cardGridB/cardGridB.stories.js +58 -0
  255. package/src/modules/tm/cardGridB/cardGridB.ts +19 -0
  256. package/src/modules/tm/cardGridC/cardGridC.css +24 -0
  257. package/src/modules/tm/cardGridC/cardGridC.html +22 -0
  258. package/src/modules/tm/cardGridC/cardGridC.stories.js +42 -0
  259. package/src/modules/tm/cardGridC/cardGridC.ts +11 -0
  260. package/src/modules/tm/cardGridD/cardGridD.css +17 -0
  261. package/src/modules/tm/cardGridD/cardGridD.html +20 -0
  262. package/src/modules/tm/cardGridD/cardGridD.stories.js +34 -0
  263. package/src/modules/tm/cardGridD/cardGridD.ts +7 -0
  264. package/src/modules/tm/cardNew/cardNew.css +31 -0
  265. package/src/modules/tm/cardNew/cardNew.html +29 -0
  266. package/src/modules/tm/cardNew/cardNew.ts +66 -0
  267. package/src/modules/tm/content/__fixtures__/index.ts +884 -0
  268. package/src/modules/tm/content/__tests__/content.test.ts +95 -0
  269. package/src/modules/tm/content/content.css +641 -0
  270. package/src/modules/tm/content/content.html +53 -0
  271. package/src/modules/tm/content/content.stories.js +14 -0
  272. package/src/modules/tm/content/content.ts +171 -0
  273. package/src/modules/tm/endCapA/__tests__/endCapA.test.ts +52 -0
  274. package/src/modules/tm/endCapA/endCapA.css +64 -0
  275. package/src/modules/tm/endCapA/endCapA.html +21 -0
  276. package/src/modules/tm/endCapA/endCapA.stories.js +37 -0
  277. package/src/modules/tm/endCapA/endCapA.ts +23 -0
  278. package/src/modules/tm/eventsA/eventsA.css +107 -0
  279. package/src/modules/tm/eventsA/eventsA.html +26 -0
  280. package/src/modules/tm/eventsA/eventsA.stories.js +51 -0
  281. package/src/modules/tm/eventsA/eventsA.ts +48 -0
  282. package/src/modules/tm/faqA/faqA.css +87 -0
  283. package/src/modules/tm/faqA/faqA.html +27 -0
  284. package/src/modules/tm/faqA/faqA.stories.js +25 -0
  285. package/src/modules/tm/faqA/faqA.ts +40 -0
  286. package/src/modules/tm/featureGridA/__tests__/featureGridA.test.ts +116 -0
  287. package/src/modules/tm/featureGridA/featureGridA.css +95 -0
  288. package/src/modules/tm/featureGridA/featureGridA.html +34 -0
  289. package/src/modules/tm/featureGridA/featureGridA.stories.js +45 -0
  290. package/src/modules/tm/featureGridA/featureGridA.ts +59 -0
  291. package/src/modules/tm/footnote/footnote.css +28 -0
  292. package/src/modules/tm/footnote/footnote.html +3 -0
  293. package/src/modules/tm/footnote/footnote.stories.js +29 -0
  294. package/src/modules/tm/footnote/footnote.ts +35 -0
  295. package/src/modules/tm/heroA/__tests__/heroA.test.ts +51 -0
  296. package/src/modules/tm/heroA/heroA.css +116 -0
  297. package/src/modules/tm/heroA/heroA.html +27 -0
  298. package/src/modules/tm/heroA/heroA.stories.js +49 -0
  299. package/src/modules/tm/heroA/heroA.ts +56 -0
  300. package/src/modules/tm/heroB/heroB.css +78 -0
  301. package/src/modules/tm/heroB/heroB.html +26 -0
  302. package/src/modules/tm/heroB/heroB.stories.js +44 -0
  303. package/src/modules/tm/heroB/heroB.ts +26 -0
  304. package/src/modules/tm/page/__tests__/page.test.ts +35 -0
  305. package/src/modules/tm/page/page.css +3 -0
  306. package/src/modules/tm/page/page.html +3 -0
  307. package/src/modules/tm/page/page.stories.js +10 -0
  308. package/src/modules/tm/page/page.ts +3 -0
  309. package/src/modules/tm/pageHeaderA/pageHeaderA.css +82 -0
  310. package/src/modules/tm/pageHeaderA/pageHeaderA.html +24 -0
  311. package/src/modules/tm/pageHeaderA/pageHeaderA.stories.js +18 -0
  312. package/src/modules/tm/pageHeaderA/pageHeaderA.ts +51 -0
  313. package/src/modules/tm/pageNavigationA/pageNavigationA.css +41 -0
  314. package/src/modules/tm/pageNavigationA/pageNavigationA.html +9 -0
  315. package/src/modules/tm/pageNavigationA/pageNavigationA.stories.js +34 -0
  316. package/src/modules/tm/pageNavigationA/pageNavigationA.ts +18 -0
  317. package/src/modules/tm/promoA/__tests__/promoA.test.ts +89 -0
  318. package/src/modules/tm/promoA/promoA.css +95 -0
  319. package/src/modules/tm/promoA/promoA.html +22 -0
  320. package/src/modules/tm/promoA/promoA.stories.js +38 -0
  321. package/src/modules/tm/promoA/promoA.ts +62 -0
  322. package/src/modules/tm/sectionA/sectionA.css +64 -0
  323. package/src/modules/tm/sectionA/sectionA.html +21 -0
  324. package/src/modules/tm/sectionA/sectionA.stories.js +18 -0
  325. package/src/modules/tm/sectionA/sectionA.ts +27 -0
  326. package/src/modules/tm/sectionSpacer/sectionSpacer.css +4 -0
  327. package/src/modules/tm/sectionSpacer/sectionSpacer.html +1 -0
  328. package/src/modules/tm/sectionSpacer/sectionSpacer.ts +3 -0
  329. package/src/modules/tm/skillsCardA/skillsCardA.css +73 -0
  330. package/src/modules/tm/skillsCardA/skillsCardA.html +37 -0
  331. package/src/modules/tm/skillsCardA/skillsCardA.ts +38 -0
  332. package/src/modules/tm/skillsGridA/skillsGridA.css +12 -0
  333. package/src/modules/tm/skillsGridA/skillsGridA.html +5 -0
  334. package/src/modules/tm/skillsGridA/skillsGridA.stories.ts +65 -0
  335. package/src/modules/tm/skillsGridA/skillsGridA.ts +3 -0
  336. package/src/modules/tm/statsA/statsA.css +26 -0
  337. package/src/modules/tm/statsA/statsA.html +10 -0
  338. package/src/modules/tm/statsA/statsA.stories.js +29 -0
  339. package/src/modules/tm/statsA/statsA.ts +20 -0
  340. package/src/modules/tm/textItem/textItem.css +53 -0
  341. package/src/modules/tm/textItem/textItem.html +18 -0
  342. package/src/modules/tm/textItem/textItem.ts +32 -0
  343. package/src/modules/tm/textItemGridA/textItemGridA.css +11 -0
  344. package/src/modules/tm/textItemGridA/textItemGridA.html +15 -0
  345. package/src/modules/tm/textItemGridA/textItemGridA.stories.js +67 -0
  346. package/src/modules/tm/textItemGridA/textItemGridA.ts +20 -0
  347. package/src/modules/tm/threeCardGrid/threeCardGrid.css +6 -0
  348. package/src/modules/tm/threeCardGrid/threeCardGrid.html +5 -0
  349. package/src/modules/tm/threeCardGrid/threeCardGrid.ts +3 -0
  350. package/src/modules/tm/trailblazersA/trailblazersA.css +70 -0
  351. package/src/modules/tm/trailblazersA/trailblazersA.html +42 -0
  352. package/src/modules/tm/trailblazersA/trailblazersA.stories.js +52 -0
  353. package/src/modules/tm/trailblazersA/trailblazersA.ts +43 -0
  354. package/src/modules/tm/utils/utils.ts +18 -0
  355. package/src/modules/tm/youtube/youtube.css +7 -0
  356. package/src/modules/tm/youtube/youtube.html +10 -0
  357. package/src/modules/tm/youtube/youtube.stories.js +15 -0
  358. package/src/modules/tm/youtube/youtube.ts +27 -0
  359. package/src/modules/ui/focusTrap/focusTrap.html +5 -0
  360. package/src/modules/ui/focusTrap/focusTrap.ts +104 -0
  361. package/src/modules/ui/focusVisible/__tests__/focusVisible.test.ts +95 -0
  362. package/src/modules/ui/focusVisible/focusVisible.html +3 -0
  363. package/src/modules/ui/focusVisible/focusVisible.ts +46 -0
@@ -0,0 +1,269 @@
1
+ import { api, track, LightningElement } from 'lwc';
2
+
3
+ import { track as analyticsTrack } from 'tds/instrumentation';
4
+ import { sendInteractionEvent, InteractionEventTypes } from 'shared/helpers';
5
+
6
+ export type CardAttribute = string | null;
7
+
8
+ export type CardImageVariant =
9
+ | 'top--cover'
10
+ | 'top--small'
11
+ | 'left--small'
12
+ | 'left--cover'
13
+ | 'right--cover';
14
+
15
+ export type Card = {
16
+ assistiveText: CardAttribute;
17
+ ctaHref: CardAttribute;
18
+ ctaTarget: CardAttribute;
19
+ ctaTitle: CardAttribute;
20
+ description: CardAttribute;
21
+ imgSrc: CardAttribute;
22
+ pretitle: CardAttribute;
23
+ pretitleHref: CardAttribute;
24
+ pretitleHrefText: CardAttribute;
25
+ title: CardAttribute;
26
+ productArea: CardAttribute;
27
+ date: CardAttribute;
28
+ level: CardAttribute;
29
+ };
30
+
31
+ const widths = [820, 640, 320, 75];
32
+
33
+ const homepageCtaTitles = ['design', 'deliver', 'govern', 'roadmap'];
34
+
35
+ export default class extends LightningElement {
36
+ @api assistiveText: CardAttribute = null;
37
+ @api ctaHref: CardAttribute = null;
38
+ @api ctaTarget: CardAttribute = null;
39
+ @api ctaTitle: CardAttribute = null;
40
+ @api description: CardAttribute = null;
41
+ @api imgAspect: CardAttribute = null;
42
+ @api imgSrc: CardAttribute = null;
43
+ @api imgVariant: CardImageVariant = 'top--cover';
44
+ @api pretitle: CardAttribute = null;
45
+ @api pretitleHref: CardAttribute = null;
46
+ @api pretitleHrefText: CardAttribute = null;
47
+ @api title: string = '';
48
+ @api productArea: string = '';
49
+ @api date: string = '';
50
+ @api level: string = '';
51
+
52
+ @track private snapToTop = mediaQuerySnapToTop.matches;
53
+ private cardId: string = '';
54
+
55
+ private get imgStyle() {
56
+ if (!this.imgSrc) return '';
57
+ let style: string[] = [];
58
+ const { imgVariantResponsive: variant, imgSrc } = this;
59
+
60
+ if (variant.includes('cover')) {
61
+ let image = imgSrc;
62
+
63
+ // Use the original image if it's a remote image or WebP
64
+ /* if (!this.isRemoteImage && !imgSrc.includes('webp')) {
65
+ const imgType = imgSrc.split('.').pop();
66
+ image = imgSrc.replace(`.${imgType}`, '-820w.webp');
67
+ } */
68
+
69
+ style.push(`background-image: url(${image})`);
70
+ }
71
+ if (variant === 'top--cover') {
72
+ style.push(`padding-top: ${this.imgAspect || '40%'}`);
73
+ }
74
+ return style.join(';');
75
+ }
76
+
77
+ private get imgTag() {
78
+ return this.imgVariant.includes('small');
79
+ }
80
+
81
+ private get isRemoteImage() {
82
+ return /^(https?\:\/\/|\/\/)/i.test(this.imgSrc || '');
83
+ }
84
+
85
+ private get imgSrcSetWebP() {
86
+ if (this.isRemoteImage) {
87
+ return this.imgSrc;
88
+ } else {
89
+ const imgType = this.imgSrc?.split('.').pop();
90
+ const imgName = this.imgSrc?.replace(`.${imgType}`, '');
91
+ let srcSet: string[] = [];
92
+ widths.forEach((width) => {
93
+ srcSet.push(`${imgName}-${width}w.webp ${width}w`);
94
+ });
95
+ return srcSet.join(',');
96
+ }
97
+ }
98
+
99
+ private get imgSrcSetJpg() {
100
+ if (this.isRemoteImage) {
101
+ return this.imgSrc;
102
+ } else {
103
+ const imgType = this.imgSrc?.split('.').pop();
104
+ const imgName = this.imgSrc?.replace(`.${imgType}`, '');
105
+ let srcSet: string[] = [];
106
+ widths.forEach((width) => {
107
+ srcSet.push(`${imgName}-${width}w.jpg ${width}w`);
108
+ });
109
+ return srcSet.join(',');
110
+ }
111
+ }
112
+
113
+ private get imgTagNoSvg() {
114
+ return this.imgTag && !this.imgSrc?.toLowerCase().endsWith('svg');
115
+ }
116
+
117
+ private get imgTagSvg() {
118
+ return this.imgTag && this.imgSrc?.toLowerCase().endsWith('svg');
119
+ }
120
+
121
+ private get rel() {
122
+ return this.ctaTarget === '_blank' ? 'noopener' : '';
123
+ }
124
+
125
+ get isExternalHref() {
126
+ return this.ctaTarget === '_blank' && this.ctaTitle;
127
+ }
128
+
129
+ private get imgVariantResponsive() {
130
+ if (!this.snapToTop) return this.imgVariant;
131
+ return String(this.imgVariant).replace(/left|right/, 'top');
132
+ }
133
+
134
+ // Accessibility getters
135
+ get cardTitleId() {
136
+ return `${this.cardId}-title`;
137
+ }
138
+
139
+ get ctaTitleId() {
140
+ return `${this.cardId}-cta`;
141
+ }
142
+
143
+ get imageDivId() {
144
+ return `${this.cardId}-image-div`;
145
+ }
146
+
147
+ get imageImgId() {
148
+ return `${this.cardId}-image-img`;
149
+ }
150
+
151
+ get imageSvgId() {
152
+ return `${this.cardId}-image-svg`;
153
+ }
154
+
155
+ get imageAriaLabel() {
156
+ const title = this.title || 'Card';
157
+ const description = this.description || '';
158
+ return `View ${title}${description ? `: ${description}` : ''}`;
159
+ }
160
+
161
+ get imageAltText() {
162
+ return this.description || this.title || 'Card image';
163
+ }
164
+
165
+ connectedCallback() {
166
+ mediaQuerySnapToTop.addListener(this.onMediaQuerySnapToTop);
167
+ // Generate unique ID for this card instance
168
+ const title = this.title || 'Card';
169
+ this.cardId = `${title}-${Math.random().toString(36).substring(2, 11)}`;
170
+ }
171
+
172
+ disconnectedCallback() {
173
+ mediaQuerySnapToTop.removeListener(this.onMediaQuerySnapToTop);
174
+ }
175
+
176
+ private onImageClick(e: MouseEvent) {
177
+ const element = e.target as HTMLElement;
178
+ sendInteractionEvent(
179
+ 'Card Image Click',
180
+ InteractionEventTypes.IMAGE_CLICK,
181
+ e,
182
+ element
183
+ );
184
+
185
+ let { ctaHref, ctaTarget } = this;
186
+ if (ctaHref) {
187
+ if (ctaTarget) window.open(ctaHref, ctaTarget);
188
+ else window.location.href = ctaHref;
189
+ }
190
+ this.trackLinkClick(e, true);
191
+ }
192
+
193
+ private trackLinkClick(e: MouseEvent, imgClick: boolean) {
194
+ const element = e.currentTarget as HTMLAnchorElement;
195
+ const linkText = this.ctaTitle;
196
+ const title = typeof this.title === 'string' ? this.title : '';
197
+ let event: string = '';
198
+ let payload: Record<string, string> = {};
199
+ if (!imgClick) {
200
+ sendInteractionEvent(
201
+ 'Card Link Click',
202
+ InteractionEventTypes.CLICK,
203
+ e,
204
+ element
205
+ );
206
+ }
207
+
208
+ if (
209
+ window.location.pathname === '/' &&
210
+ homepageCtaTitles.includes(this.title.toLowerCase())
211
+ ) {
212
+ event = 'homepage_cta';
213
+ payload = {
214
+ linkText: `home: ${linkText}`,
215
+ headingText: title,
216
+ itemLocation: 'card'
217
+ };
218
+ } else {
219
+ event = 'select_content';
220
+ payload = {
221
+ contentType: 'card grid',
222
+ itemTitle: (!title || title === '') ? undefined : title,
223
+ itemLocation: 'card'
224
+ } as any;
225
+ }
226
+ if (element.target) {
227
+ const parsedLink = new URL(element.href);
228
+ analyticsTrack(this.template.host, 'custEv_outboundClick', {
229
+ clickText: title,
230
+ clickUrl: parsedLink.href
231
+ });
232
+ }
233
+ analyticsTrack(this.template.host, event, payload);
234
+ }
235
+
236
+ private onMediaQuerySnapToTop = (e: MediaQueryListEvent) => {
237
+ this.snapToTop = e.matches;
238
+ };
239
+
240
+ // Accessibility keyboard handlers
241
+ handleCardKeydown(e: KeyboardEvent) {
242
+ if (e.key === 'Enter' || e.key === ' ') {
243
+ this.trackLinkClick(e as unknown as MouseEvent, false);
244
+ e.preventDefault();
245
+ if (this.ctaHref) {
246
+ if (this.ctaTarget) window.open(this.ctaHref, this.ctaTarget);
247
+ else window.location.href = this.ctaHref;
248
+ }
249
+ }
250
+ }
251
+ }
252
+
253
+ export function extractCardAttributes(element: Element) {
254
+ return {
255
+ ctaHref: element.getAttribute('cta-href')!,
256
+ ctaTarget: element.getAttribute('cta-target')!,
257
+ ctaTitle: element.getAttribute('cta-title')!,
258
+ description: element.getAttribute('description'),
259
+ imgSrc: element.getAttribute('img-src'),
260
+ pretitle: element.getAttribute('pretitle'),
261
+ pretitleHref: element.getAttribute('pretitle-href'),
262
+ pretitleHrefText: element.getAttribute('pretitle-href-text'),
263
+ title: element.getAttribute('title')
264
+ } as Card;
265
+ }
266
+
267
+ // tm-card-grid taks care of adjusting the grid to the correct number
268
+ // of columns at smaller view ports
269
+ export const mediaQuerySnapToTop = window.matchMedia(`(max-width: 500px)`);
@@ -0,0 +1,11 @@
1
+ .card-base {
2
+ background-color: var(--tds-color-white);
3
+ border-radius: var(--tds-radius-lg);
4
+ box-shadow: var(--tds-shadow-xs);
5
+ height: 100%;
6
+ transition: all 250ms ease-in-out;
7
+ }
8
+
9
+ .card-base:hover {
10
+ box-shadow: var(--tds-shadow-md);
11
+ }
@@ -0,0 +1,11 @@
1
+ @import 'tds/reset';
2
+
3
+ ul {
4
+ --spacing: var(--tds-spacing-6);
5
+ justify-content: center;
6
+ display: grid;
7
+ grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
8
+ grid-column-gap: var(--spacing);
9
+ grid-row-gap: var(--spacing);
10
+ max-width: 1280px;
11
+ }
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <ul>
3
+ <template for:each={items} for:item="item">
4
+ <li key={item.ctaHref}>
5
+ <tm-card
6
+ cta-href={item.ctaHref}
7
+ cta-target={item.ctaTarget}
8
+ cta-title={item.ctaTitle}
9
+ img-aspect={imgAspect}
10
+ img-src={item.imgSrc}
11
+ img-variant={imgVariant}
12
+ description={item.description}
13
+ title={item.title}
14
+ pretitle={item.pretitle}
15
+ pretitle-href={item.pretitleHref}
16
+ pretitle-href-text={item.pretitleHrefText}
17
+ ></tm-card>
18
+ </li>
19
+ </template>
20
+ </ul>
21
+ </template>
@@ -0,0 +1,107 @@
1
+ import { html } from 'lit-html';
2
+
3
+ export default {
4
+ title: 'tm/tm-card-grid-a',
5
+ parameters: {
6
+ chromatic: {
7
+ viewports: [450, 800, 1199]
8
+ },
9
+ modules: ['/modules/tm-card-grid-a.js']
10
+ }
11
+ };
12
+
13
+ export const Base = () => html`
14
+ <tm-card-grid-a img-aspect="60%">
15
+ <tm-card
16
+ cta-href="/"
17
+ cta-title="Read More"
18
+ cta-target="_blank"
19
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
20
+ title="Hello A"
21
+ ></tm-card>
22
+ <tm-card
23
+ cta-href="/"
24
+ cta-title="Read More"
25
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
26
+ title="Hello B"
27
+ ></tm-card>
28
+ <tm-card
29
+ cta-href="/"
30
+ cta-title="Read More"
31
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
32
+ title="Hello C"
33
+ ></tm-card>
34
+ <tm-card
35
+ cta-href="/"
36
+ cta-title="Read More"
37
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
38
+ title="Hello D"
39
+ ></tm-card>
40
+ <tm-card
41
+ cta-href="/"
42
+ cta-title="Read More"
43
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
44
+ title="Hello E"
45
+ ></tm-card>
46
+ </tm-card-grid-a>
47
+ `;
48
+
49
+ export const ImageFull = () => html`
50
+ <tm-card-grid-a img-aspect="60%" img-type="full">
51
+ <tm-card
52
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
53
+ img-src="/images/card-a.png"
54
+ title="Hello A"
55
+ ></tm-card>
56
+ <tm-card
57
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
58
+ img-src="/images/card-a.png"
59
+ title="Hello B"
60
+ ></tm-card>
61
+ <tm-card
62
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
63
+ img-src="/images/card-a.png"
64
+ title="Hello C"
65
+ ></tm-card>
66
+ <tm-card
67
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
68
+ img-src="/images/card-a.png"
69
+ title="Hello D"
70
+ ></tm-card>
71
+ <tm-card
72
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
73
+ img-src="/images/card-a.png"
74
+ title="Hello E"
75
+ ></tm-card>
76
+ </tm-card-grid-a>
77
+ `;
78
+
79
+ export const ImageLeft = () => html`
80
+ <tm-card-grid-a img-aspect="60%" img-type="left">
81
+ <tm-card
82
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
83
+ img-src="/images/card-a.png"
84
+ title="Hello A"
85
+ ></tm-card>
86
+ <tm-card
87
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
88
+ img-src="/images/card-a.png"
89
+ title="Hello B"
90
+ ></tm-card>
91
+ <tm-card
92
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
93
+ img-src="/images/card-a.png"
94
+ title="Hello C"
95
+ ></tm-card>
96
+ <tm-card
97
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
98
+ img-src="/images/card-a.png"
99
+ title="Hello D"
100
+ ></tm-card>
101
+ <tm-card
102
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
103
+ img-src="/images/card-a.png"
104
+ title="Hello E"
105
+ ></tm-card>
106
+ </tm-card-grid-a>
107
+ `;
@@ -0,0 +1,24 @@
1
+ import { api } from 'lwc';
2
+
3
+ import { Card, extractCardAttributes } from 'tm/card';
4
+
5
+ import { ChildrenElement } from 'shared/children';
6
+
7
+ export default class extends ChildrenElement<Card> {
8
+ @api items: Card[] = [];
9
+ @api imgAspect: string | null = null;
10
+ @api imgType: 'full' | 'left' | null = null;
11
+
12
+ private get imgVariant() {
13
+ switch (this.imgType) {
14
+ case 'full':
15
+ return 'top--cover';
16
+ case 'left':
17
+ return 'top--small';
18
+ default:
19
+ return '';
20
+ }
21
+ }
22
+
23
+ extractor = extractCardAttributes;
24
+ }
@@ -0,0 +1,88 @@
1
+ @import 'tds/reset';
2
+
3
+ div {
4
+ --spacing: var(--tds-spacing-6);
5
+ display: grid;
6
+ grid-column-gap: var(--spacing);
7
+ grid-row-gap: var(--spacing);
8
+ grid-template-columns: repeat(6, 1fr);
9
+ grid-template-rows: repeat(3, auto);
10
+ max-width: 1280px;
11
+ }
12
+
13
+ .card:nth-child(1) {
14
+ grid-column: 1 / span 3;
15
+ grid-row: 1;
16
+ }
17
+
18
+ .card:nth-child(2) {
19
+ grid-column: 4 / span 3;
20
+ grid-row: 1;
21
+ }
22
+
23
+ .card:nth-child(3) {
24
+ grid-column: 1 / span 2;
25
+ grid-row: 2;
26
+ }
27
+
28
+ .card:nth-child(4) {
29
+ grid-column: 1 / span 2;
30
+ grid-row: 3;
31
+ }
32
+
33
+ .card:nth-child(5) {
34
+ grid-column: 3 / span 4;
35
+ grid-row: 2 / span 2;
36
+ }
37
+
38
+ @media screen and (max-width: 1100px) {
39
+ ul {
40
+ grid-template-rows: repeat(5, auto);
41
+ }
42
+
43
+ .card:nth-child(3) {
44
+ grid-column: 1 / span 3;
45
+ grid-row: 4;
46
+ }
47
+
48
+ .card:nth-child(4) {
49
+ grid-column: 4 / span 3;
50
+ grid-row: 4;
51
+ }
52
+
53
+ .card:nth-child(5) {
54
+ grid-column: 1 / span 6;
55
+ grid-row: 2 / span 2;
56
+ }
57
+ }
58
+
59
+ @media screen and (max-width: 850px) {
60
+ ul {
61
+ grid-template-rows: repeat(6, auto);
62
+ }
63
+
64
+ .card:nth-child(1) {
65
+ grid-column: 1 / span 6;
66
+ grid-row: 1;
67
+ }
68
+
69
+ .card:nth-child(2) {
70
+ grid-column: 1 / span 6;
71
+ grid-row: 2;
72
+ }
73
+
74
+ .card:nth-child(3) {
75
+ grid-column: 1 / span 6;
76
+ grid-row: 5;
77
+ }
78
+
79
+ .card:nth-child(4) {
80
+ grid-column: 1 / span 6;
81
+ grid-row: 6;
82
+ }
83
+
84
+ .card:nth-child(5) {
85
+ grid-column: 1 / span 6;
86
+ grid-row: 3 / span 2;
87
+ }
88
+ }
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div>
3
+ <template for:each={grid} for:item="item">
4
+ <tm-card
5
+ class="card"
6
+ cta-href={item.ctaHref}
7
+ cta-target={item.ctaTarget}
8
+ cta-title={item.ctaTitle}
9
+ description={item.description}
10
+ img-src={item.imgSrc}
11
+ img-variant={item.imgVariant}
12
+ key={item.title}
13
+ pretitle={item.pretitle}
14
+ pretitle-href={item.pretitleHref}
15
+ pretitle-href-text={item.pretitleHrefText}
16
+ title={item.title}
17
+ ></tm-card>
18
+ </template>
19
+ </div>
20
+ </template>
@@ -0,0 +1,58 @@
1
+ import { html } from 'lit-html';
2
+
3
+ export default {
4
+ title: 'tm/tm-card-grid-b',
5
+ parameters: {
6
+ chromatic: {
7
+ viewports: [450, 800, 1000, 1199]
8
+ },
9
+ modules: ['/modules/tm-card-grid-b.js']
10
+ }
11
+ };
12
+
13
+ export const Base = () => html`
14
+ <tm-card-grid-b>
15
+ <tm-card
16
+ cta-href="/"
17
+ cta-title="Read More"
18
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
19
+ img-src="/images/card-a.png"
20
+ title="Hello A"
21
+ pretitle="Type of Content"
22
+ ></tm-card>
23
+ <tm-card
24
+ cta-href="/"
25
+ cta-title="Read More"
26
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
27
+ img-src="/images/card-a.png"
28
+ title="Hello B"
29
+ pretitle="Blog by"
30
+ pretitle-href="/user/sharon"
31
+ pretitle-href-text="Sharon Tate"
32
+ ></tm-card>
33
+ <tm-card
34
+ cta-href="/"
35
+ cta-title="Read More"
36
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
37
+ img-src="/images/card-a.png"
38
+ title="Hello C"
39
+ pretitle="Type of Content"
40
+ ></tm-card>
41
+ <tm-card
42
+ cta-href="/"
43
+ cta-title="Read More"
44
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
45
+ img-src="/images/card-a.png"
46
+ title="Hello D"
47
+ pretitle="Type of Content"
48
+ ></tm-card>
49
+ <tm-card
50
+ cta-href="/"
51
+ cta-title="Read More"
52
+ description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget velit placerat, scelerisque libero sed, mattis orci."
53
+ img-src="/images/card-a.png"
54
+ title="Hello E"
55
+ pretitle="Type of Content"
56
+ ></tm-card>
57
+ </tm-card-grid-b>
58
+ `;
@@ -0,0 +1,19 @@
1
+ import { Card, CardImageVariant, extractCardAttributes } from 'tm/card';
2
+
3
+ import { ChildrenElement } from 'shared/children';
4
+
5
+ type GridCard = Card & { imgVariant: CardImageVariant };
6
+
7
+ export default class extends ChildrenElement<Card> {
8
+ extractor = extractCardAttributes;
9
+
10
+ get grid(): GridCard[] {
11
+ return [
12
+ { ...this.items[0], imgVariant: 'right--cover' },
13
+ { ...this.items[1], imgVariant: 'right--cover' },
14
+ { ...this.items[2], imgVariant: 'left--small' },
15
+ { ...this.items[3], imgVariant: 'left--small' },
16
+ { ...this.items[4], imgVariant: 'left--cover' }
17
+ ];
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ @import 'tds/reset';
2
+
3
+ ul {
4
+ --spacing: var(--tds-spacing-6);
5
+ justify-content: center;
6
+ display: grid;
7
+ grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
8
+ grid-column-gap: var(--spacing);
9
+ grid-row-gap: var(--spacing);
10
+ max-width: 1280px;
11
+ margin: auto;
12
+ }
13
+
14
+ @media screen and (max-width: 800px) {
15
+ ul {
16
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
17
+ }
18
+ }
19
+
20
+ @media screen and (max-width: 400px) {
21
+ ul {
22
+ grid-template-columns: 1fr;
23
+ }
24
+ }
@@ -0,0 +1,22 @@
1
+ <template>
2
+ <ul>
3
+ <template for:each={items} for:item="item">
4
+ <li key={item.title}>
5
+ <tm-card
6
+ class="card"
7
+ cta-href={item.ctaHref}
8
+ cta-target={item.ctaTarget}
9
+ cta-title={item.ctaTitle}
10
+ img-aspect={imgAspect}
11
+ img-src={item.imgSrc}
12
+ img-variant="top--cover"
13
+ description={item.description}
14
+ pretitle={item.pretitle}
15
+ pretitle-href={item.pretitleHref}
16
+ pretitle-href-text={item.pretitleHrefText}
17
+ title={item.title}
18
+ ></tm-card>
19
+ </li>
20
+ </template>
21
+ </ul>
22
+ </template>