@salesforcedevs/dx-components 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/LICENSE +12 -0
  2. package/lwc.config.json +96 -0
  3. package/package.json +32 -0
  4. package/src/assets/icons/action-sprite/svg/symbols.svg +1 -0
  5. package/src/assets/icons/brand-sprite/svg/symbols.svg +1381 -0
  6. package/src/assets/icons/custom-sprite/svg/symbols.svg +1 -0
  7. package/src/assets/icons/doctype-sprite/svg/symbols.svg +1 -0
  8. package/src/assets/icons/general-sprite/svg/symbols.svg +3013 -0
  9. package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +608 -0
  10. package/src/assets/icons/standard-sprite/svg/symbols.svg +1 -0
  11. package/src/assets/icons/utility-sprite/svg/symbols.svg +1 -0
  12. package/src/assets/svg/card-news-learn-moar.svg +415 -0
  13. package/src/assets/svg/cloud-1.svg +24 -0
  14. package/src/assets/svg/cloud-2.svg +18 -0
  15. package/src/assets/svg/codey.svg +93 -0
  16. package/src/assets/svg/command.svg +9 -0
  17. package/src/assets/svg/control.svg +10 -0
  18. package/src/assets/svg/docs-empty-state-small.svg +72 -0
  19. package/src/assets/svg/docs-empty-state.svg +86 -0
  20. package/src/assets/svg/dsc-home-news-bear.svg +3 -0
  21. package/src/assets/svg/dsc-home-news-community.png +0 -0
  22. package/src/assets/svg/dsc-home-news-goatbear.svg +257 -0
  23. package/src/assets/svg/dsc-home-news-samplegallery.svg +76 -0
  24. package/src/assets/svg/empty-state-assistant.svg +1 -0
  25. package/src/assets/svg/fch-blog-cloud-1.png +0 -0
  26. package/src/assets/svg/fch-blog-cloud-2.png +0 -0
  27. package/src/assets/svg/fch-blog-planet.png +0 -0
  28. package/src/assets/svg/feature-backdrop1.svg +10 -0
  29. package/src/assets/svg/feature-backdrop2.svg +10 -0
  30. package/src/assets/svg/featured-demo-art-blank.svg +76 -0
  31. package/src/assets/svg/featured-demo-art-eBikes.svg +77 -0
  32. package/src/assets/svg/footer-graphic-large.svg +207 -0
  33. package/src/assets/svg/footer-graphic-mountains-small.svg +17 -0
  34. package/src/assets/svg/footer-graphic-mountains.svg +21 -0
  35. package/src/assets/svg/footer-graphic-trees-small.svg +33 -0
  36. package/src/assets/svg/footer-graphic-trees.svg +62 -0
  37. package/src/assets/svg/lake-mountain.svg +79 -0
  38. package/src/assets/svg/no-results-combined.svg +80 -0
  39. package/src/assets/svg/podcast-subscription-clouds-small.svg +49 -0
  40. package/src/assets/svg/podcast-subscription-clouds.svg +57 -0
  41. package/src/assets/svg/podcasts-subscription-apple.svg +164 -0
  42. package/src/assets/svg/podcasts-subscription-google.svg +29 -0
  43. package/src/assets/svg/podcasts-subscription-spotify.svg +11 -0
  44. package/src/assets/svg/salesforce-cloud.svg +7 -0
  45. package/src/assets/svg/salesforce-logo-corporate.svg +21 -0
  46. package/src/assets/svg/salesforce-logo.svg +14 -0
  47. package/src/assets/svg/sidebar-item-loading.svg +3 -0
  48. package/src/assets/svg/sidebar-loading.svg +34 -0
  49. package/src/assets/svg/slack-cta-podcast-background-left.svg +28 -0
  50. package/src/assets/svg/slack-cta-podcast-background-right.svg +38 -0
  51. package/src/assets/svg/subscribe-background-left.svg +14 -0
  52. package/src/assets/svg/subscribe-background-right.svg +11 -0
  53. package/src/assets/svg/trees.svg +42 -0
  54. package/src/modules/dx/banner/banner.css +46 -0
  55. package/src/modules/dx/banner/banner.html +13 -0
  56. package/src/modules/dx/banner/banner.ts +12 -0
  57. package/src/modules/dx/brandThemeProvider/brandCssVars.ts +10 -0
  58. package/src/modules/dx/brandThemeProvider/brandThemeProvider.html +3 -0
  59. package/src/modules/dx/brandThemeProvider/brandThemeProvider.ts +46 -0
  60. package/src/modules/dx/breadcrumbs/breadcrumbs.css +111 -0
  61. package/src/modules/dx/breadcrumbs/breadcrumbs.html +44 -0
  62. package/src/modules/dx/breadcrumbs/breadcrumbs.ts +123 -0
  63. package/src/modules/dx/button/button.css +198 -0
  64. package/src/modules/dx/button/button.html +43 -0
  65. package/src/modules/dx/button/button.ts +68 -0
  66. package/src/modules/dx/cardBlogPost/cardBlogPost.css +13 -0
  67. package/src/modules/dx/cardBlogPost/cardBlogPost.html +24 -0
  68. package/src/modules/dx/cardBlogPost/cardBlogPost.ts +23 -0
  69. package/src/modules/dx/cardCallout/cardCallout.css +57 -0
  70. package/src/modules/dx/cardCallout/cardCallout.html +15 -0
  71. package/src/modules/dx/cardCallout/cardCallout.ts +41 -0
  72. package/src/modules/dx/cardContent/cardContent.css +52 -0
  73. package/src/modules/dx/cardContent/cardContent.html +62 -0
  74. package/src/modules/dx/cardContent/cardContent.ts +68 -0
  75. package/src/modules/dx/cardDemo/cardDemo.css +1 -0
  76. package/src/modules/dx/cardDemo/cardDemo.html +12 -0
  77. package/src/modules/dx/cardDemo/cardDemo.ts +11 -0
  78. package/src/modules/dx/cardDocs/cardDocs.css +50 -0
  79. package/src/modules/dx/cardDocs/cardDocs.html +23 -0
  80. package/src/modules/dx/cardDocs/cardDocs.ts +30 -0
  81. package/src/modules/dx/cardEvent/cardEvent.css +107 -0
  82. package/src/modules/dx/cardEvent/cardEvent.html +94 -0
  83. package/src/modules/dx/cardEvent/cardEvent.ts +42 -0
  84. package/src/modules/dx/cardExpanded/cardExpanded.css +50 -0
  85. package/src/modules/dx/cardExpanded/cardExpanded.html +36 -0
  86. package/src/modules/dx/cardExpanded/cardExpanded.ts +44 -0
  87. package/src/modules/dx/cardGridDocs/cardGridDocs.css +74 -0
  88. package/src/modules/dx/cardGridDocs/cardGridDocs.html +67 -0
  89. package/src/modules/dx/cardGridDocs/cardGridDocs.ts +86 -0
  90. package/src/modules/dx/cardMinimal/cardMinimal.css +31 -0
  91. package/src/modules/dx/cardMinimal/cardMinimal.html +13 -0
  92. package/src/modules/dx/cardMinimal/cardMinimal.ts +3 -0
  93. package/src/modules/dx/cardNews/cardNews.css +159 -0
  94. package/src/modules/dx/cardNews/cardNews.html +39 -0
  95. package/src/modules/dx/cardNews/cardNews.ts +77 -0
  96. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +19 -0
  97. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.html +36 -0
  98. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.ts +36 -0
  99. package/src/modules/dx/cardSmall/cardSmall.css +32 -0
  100. package/src/modules/dx/cardSmall/cardSmall.html +42 -0
  101. package/src/modules/dx/cardSmall/cardSmall.ts +38 -0
  102. package/src/modules/dx/cardTitle/cardTitle.css +43 -0
  103. package/src/modules/dx/cardTitle/cardTitle.html +20 -0
  104. package/src/modules/dx/cardTitle/cardTitle.ts +27 -0
  105. package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.css +24 -0
  106. package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.html +20 -0
  107. package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.ts +18 -0
  108. package/src/modules/dx/cardTrial/cardTrial.css +71 -0
  109. package/src/modules/dx/cardTrial/cardTrial.html +31 -0
  110. package/src/modules/dx/cardTrial/cardTrial.ts +34 -0
  111. package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +14 -0
  112. package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +27 -0
  113. package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +13 -0
  114. package/src/modules/dx/checkbox/checkbox.css +172 -0
  115. package/src/modules/dx/checkbox/checkbox.html +26 -0
  116. package/src/modules/dx/checkbox/checkbox.ts +56 -0
  117. package/src/modules/dx/checkboxGroup/checkboxGroup.css +12 -0
  118. package/src/modules/dx/checkboxGroup/checkboxGroup.html +15 -0
  119. package/src/modules/dx/checkboxGroup/checkboxGroup.ts +77 -0
  120. package/src/modules/dx/checkboxNative/checkboxNative.css +21 -0
  121. package/src/modules/dx/checkboxNative/checkboxNative.html +14 -0
  122. package/src/modules/dx/checkboxNative/checkboxNative.ts +39 -0
  123. package/src/modules/dx/codeBlock/codeBlock.css +128 -0
  124. package/src/modules/dx/codeBlock/codeBlock.html +79 -0
  125. package/src/modules/dx/codeBlock/codeBlock.ts +222 -0
  126. package/src/modules/dx/codeBlock/darkTheme.css +88 -0
  127. package/src/modules/dx/codeBlock/lightTheme.css +72 -0
  128. package/src/modules/dx/dropdown/dropdown.css +93 -0
  129. package/src/modules/dx/dropdown/dropdown.html +73 -0
  130. package/src/modules/dx/dropdown/dropdown.ts +193 -0
  131. package/src/modules/dx/dropdownOption/dropdownOption.css +179 -0
  132. package/src/modules/dx/dropdownOption/dropdownOption.html +57 -0
  133. package/src/modules/dx/dropdownOption/dropdownOption.ts +67 -0
  134. package/src/modules/dx/emptyState/emptyState.css +64 -0
  135. package/src/modules/dx/emptyState/emptyState.html +9 -0
  136. package/src/modules/dx/emptyState/emptyState.ts +20 -0
  137. package/src/modules/dx/feature/feature.css +135 -0
  138. package/src/modules/dx/feature/feature.html +33 -0
  139. package/src/modules/dx/feature/feature.ts +34 -0
  140. package/src/modules/dx/featureGrid/featureGrid.html +3 -0
  141. package/src/modules/dx/featureGrid/featureGrid.ts +15 -0
  142. package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +468 -0
  143. package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +109 -0
  144. package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +102 -0
  145. package/src/modules/dx/featuredContentHeader/svgs.ts +35 -0
  146. package/src/modules/dx/featuresList/featuresList.css +24 -0
  147. package/src/modules/dx/featuresList/featuresList.html +20 -0
  148. package/src/modules/dx/featuresList/featuresList.ts +21 -0
  149. package/src/modules/dx/filterMenu/filterMenu.css +138 -0
  150. package/src/modules/dx/filterMenu/filterMenu.html +116 -0
  151. package/src/modules/dx/filterMenu/filterMenu.ts +119 -0
  152. package/src/modules/dx/footer/footer.css +405 -0
  153. package/src/modules/dx/footer/footer.html +150 -0
  154. package/src/modules/dx/footer/footer.ts +129 -0
  155. package/src/modules/dx/footer/links.ts +206 -0
  156. package/src/modules/dx/footerOption/footerOption.css +4 -0
  157. package/src/modules/dx/footerOption/footerOption.html +12 -0
  158. package/src/modules/dx/footerOption/footerOption.ts +19 -0
  159. package/src/modules/dx/formattedDateTime/formattedDateTime.html +1 -0
  160. package/src/modules/dx/formattedDateTime/formattedDateTime.ts +77 -0
  161. package/src/modules/dx/grid/grid.css +48 -0
  162. package/src/modules/dx/grid/grid.html +3 -0
  163. package/src/modules/dx/grid/grid.md +14 -0
  164. package/src/modules/dx/grid/grid.ts +74 -0
  165. package/src/modules/dx/groupText/groupText.css +119 -0
  166. package/src/modules/dx/groupText/groupText.html +68 -0
  167. package/src/modules/dx/groupText/groupText.ts +111 -0
  168. package/src/modules/dx/header/__benchmarks__/header.benchmark.js +45 -0
  169. package/src/modules/dx/header/header.css +99 -0
  170. package/src/modules/dx/header/header.html +122 -0
  171. package/src/modules/dx/header/header.ts +13 -0
  172. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +160 -0
  173. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.html +73 -0
  174. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +102 -0
  175. package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.css +5 -0
  176. package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.html +14 -0
  177. package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +20 -0
  178. package/src/modules/dx/headerNav/headerNav.css +31 -0
  179. package/src/modules/dx/headerNav/headerNav.html +48 -0
  180. package/src/modules/dx/headerNav/headerNav.ts +56 -0
  181. package/src/modules/dx/headerSearch/headerSearch.css +62 -0
  182. package/src/modules/dx/headerSearch/headerSearch.html +62 -0
  183. package/src/modules/dx/headerSearch/headerSearch.ts +159 -0
  184. package/src/modules/dx/helmet/helmet.css +83 -0
  185. package/src/modules/dx/helmet/helmet.html +39 -0
  186. package/src/modules/dx/helmet/helmet.ts +27 -0
  187. package/src/modules/dx/hr/hr.css +56 -0
  188. package/src/modules/dx/hr/hr.html +23 -0
  189. package/src/modules/dx/hr/hr.ts +45 -0
  190. package/src/modules/dx/icon/icon.css +14 -0
  191. package/src/modules/dx/icon/icon.html +11 -0
  192. package/src/modules/dx/icon/icon.ts +85 -0
  193. package/src/modules/dx/iconBadge/iconBadge.css +52 -0
  194. package/src/modules/dx/iconBadge/iconBadge.html +5 -0
  195. package/src/modules/dx/iconBadge/iconBadge.ts +52 -0
  196. package/src/modules/dx/imageAndLabel/imageAndLabel.css +54 -0
  197. package/src/modules/dx/imageAndLabel/imageAndLabel.html +22 -0
  198. package/src/modules/dx/imageAndLabel/imageAndLabel.ts +16 -0
  199. package/src/modules/dx/input/input.css +181 -0
  200. package/src/modules/dx/input/input.html +62 -0
  201. package/src/modules/dx/input/input.ts +246 -0
  202. package/src/modules/dx/input/validators.ts +5 -0
  203. package/src/modules/dx/logo/logo.css +33 -0
  204. package/src/modules/dx/logo/logo.html +6 -0
  205. package/src/modules/dx/logo/logo.ts +8 -0
  206. package/src/modules/dx/modalDrawer/modalDrawer.css +41 -0
  207. package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
  208. package/src/modules/dx/modalDrawer/modalDrawer.ts +27 -0
  209. package/src/modules/dx/pagination/pagination.css +51 -0
  210. package/src/modules/dx/pagination/pagination.html +45 -0
  211. package/src/modules/dx/pagination/pagination.ts +135 -0
  212. package/src/modules/dx/podcastHost/podcastHost.css +62 -0
  213. package/src/modules/dx/podcastHost/podcastHost.html +28 -0
  214. package/src/modules/dx/podcastHost/podcastHost.ts +13 -0
  215. package/src/modules/dx/podcastPlayer/podcastPlayer.css +10 -0
  216. package/src/modules/dx/podcastPlayer/podcastPlayer.html +3 -0
  217. package/src/modules/dx/podcastPlayer/podcastPlayer.ts +5 -0
  218. package/src/modules/dx/popover/popover.css +65 -0
  219. package/src/modules/dx/popover/popover.html +16 -0
  220. package/src/modules/dx/popover/popover.ts +306 -0
  221. package/src/modules/dx/radioGroup/radioGroup.css +12 -0
  222. package/src/modules/dx/radioGroup/radioGroup.html +16 -0
  223. package/src/modules/dx/radioGroup/radioGroup.ts +65 -0
  224. package/src/modules/dx/relativeDateTime/relativeDateTime.html +3 -0
  225. package/src/modules/dx/relativeDateTime/relativeDateTime.ts +113 -0
  226. package/src/modules/dx/searchResults/coveo.css +18989 -0
  227. package/src/modules/dx/searchResults/searchResults.css +387 -0
  228. package/src/modules/dx/searchResults/searchResults.html +104 -0
  229. package/src/modules/dx/searchResults/searchResults.ts +187 -0
  230. package/src/modules/dx/section/section.css +130 -0
  231. package/src/modules/dx/section/section.html +66 -0
  232. package/src/modules/dx/section/section.ts +41 -0
  233. package/src/modules/dx/sectionSignup/sectionSignup.css +43 -0
  234. package/src/modules/dx/sectionSignup/sectionSignup.html +23 -0
  235. package/src/modules/dx/sectionSignup/sectionSignup.ts +44 -0
  236. package/src/modules/dx/select/select.css +221 -0
  237. package/src/modules/dx/select/select.html +57 -0
  238. package/src/modules/dx/select/select.ts +141 -0
  239. package/src/modules/dx/sidebar/sidebar.css +48 -0
  240. package/src/modules/dx/sidebar/sidebar.html +95 -0
  241. package/src/modules/dx/sidebar/sidebar.ts +258 -0
  242. package/src/modules/dx/sidebarOld/sidebarOld.css +16 -0
  243. package/src/modules/dx/sidebarOld/sidebarOld.html +74 -0
  244. package/src/modules/dx/sidebarOld/sidebarOld.ts +194 -0
  245. package/src/modules/dx/sidebarSearch/sidebarSearch.css +3 -0
  246. package/src/modules/dx/sidebarSearch/sidebarSearch.html +26 -0
  247. package/src/modules/dx/sidebarSearch/sidebarSearch.ts +463 -0
  248. package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +36 -0
  249. package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.html +14 -0
  250. package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.ts +70 -0
  251. package/src/modules/dx/skipNavLink/skipNavLink.css +21 -0
  252. package/src/modules/dx/skipNavLink/skipNavLink.html +3 -0
  253. package/src/modules/dx/skipNavLink/skipNavLink.ts +3 -0
  254. package/src/modules/dx/socials/socials.css +35 -0
  255. package/src/modules/dx/socials/socials.html +22 -0
  256. package/src/modules/dx/socials/socials.ts +81 -0
  257. package/src/modules/dx/spinner/spinner.css +743 -0
  258. package/src/modules/dx/spinner/spinner.html +6 -0
  259. package/src/modules/dx/spinner/spinner.ts +20 -0
  260. package/src/modules/dx/tab/tab.css +106 -0
  261. package/src/modules/dx/tab/tab.html +13 -0
  262. package/src/modules/dx/tab/tab.ts +52 -0
  263. package/src/modules/dx/toc/toc.css +106 -0
  264. package/src/modules/dx/toc/toc.html +29 -0
  265. package/src/modules/dx/toc/toc.ts +77 -0
  266. package/src/modules/dx/tooltip/microtip.css +269 -0
  267. package/src/modules/dx/tooltip/tooltip.css +37 -0
  268. package/src/modules/dx/tooltip/tooltip.html +5 -0
  269. package/src/modules/dx/tooltip/tooltip.ts +6 -0
  270. package/src/modules/dx/topics/topics.css +26 -0
  271. package/src/modules/dx/topics/topics.html +12 -0
  272. package/src/modules/dx/topics/topics.ts +25 -0
  273. package/src/modules/dx/tree/tree.css +5 -0
  274. package/src/modules/dx/tree/tree.html +11 -0
  275. package/src/modules/dx/tree/tree.ts +80 -0
  276. package/src/modules/dx/tree/treeHandler.ts +101 -0
  277. package/src/modules/dx/treeItem/treeItem.css +25 -0
  278. package/src/modules/dx/treeItem/treeItem.html +29 -0
  279. package/src/modules/dx/treeItem/treeItem.ts +146 -0
  280. package/src/modules/dx/treeTile/treeTile.css +190 -0
  281. package/src/modules/dx/treeTile/treeTile.html +27 -0
  282. package/src/modules/dx/treeTile/treeTile.ts +60 -0
  283. package/src/modules/dx/typeBadge/typeBadge.css +74 -0
  284. package/src/modules/dx/typeBadge/typeBadge.html +5 -0
  285. package/src/modules/dx/typeBadge/typeBadge.ts +65 -0
  286. package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.css +12 -0
  287. package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.html +11 -0
  288. package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +18 -0
  289. package/src/modules/dx/vimeoPlayer/vimeoPlayer.css +1 -0
  290. package/src/modules/dx/vimeoPlayer/vimeoPlayer.html +3 -0
  291. package/src/modules/dx/vimeoPlayer/vimeoPlayer.ts +31 -0
  292. package/src/modules/dxBaseElements/archiveCard/archiveCard.ts +35 -0
  293. package/src/modules/dxBaseElements/headerBase/headerBase.ts +205 -0
  294. package/src/modules/dxBaseElements/matchMediaElement/matchMediaElement.ts +59 -0
  295. package/src/modules/dxBaseElements/sidebarBase/sidebarBase.ts +65 -0
  296. package/src/modules/dxHelpers/animations/animations.css +15 -0
  297. package/src/modules/dxHelpers/button/button.css +4 -0
  298. package/src/modules/dxHelpers/card/card.css +263 -0
  299. package/src/modules/dxHelpers/code/code.css +296 -0
  300. package/src/modules/dxHelpers/commonHeader/commonHeader.css +130 -0
  301. package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +145 -0
  302. package/src/modules/dxHelpers/commonTreeItem/commonTreeItem.css +21 -0
  303. package/src/modules/dxHelpers/reset/reset.css +559 -0
  304. package/src/modules/dxHelpers/scrollbar/scrollbar.css +31 -0
  305. package/src/modules/dxHelpers/table/table.css +110 -0
  306. package/src/modules/dxHelpers/text/text.css +197 -0
  307. package/src/modules/dxUtils/analytics/analytics.ts +24 -0
  308. package/src/modules/dxUtils/browser/browser.ts +17 -0
  309. package/src/modules/dxUtils/constants/breakpoints.ts +9 -0
  310. package/src/modules/dxUtils/constants/constants.ts +1 -0
  311. package/src/modules/dxUtils/coveo/coveo.ts +70 -0
  312. package/src/modules/dxUtils/css/css.ts +43 -0
  313. package/src/modules/dxUtils/dates/dates.ts +60 -0
  314. package/src/modules/dxUtils/devices/devices.ts +1 -0
  315. package/src/modules/dxUtils/highlight/highlight.ts +32 -0
  316. package/src/modules/dxUtils/language/language.ts +21 -0
  317. package/src/modules/dxUtils/lwc/lwc.ts +9 -0
  318. package/src/modules/dxUtils/normalizers/normalizers.ts +80 -0
  319. package/src/modules/dxUtils/options/options.ts +43 -0
  320. package/src/modules/dxUtils/prismjs/prismjs.html +3 -0
  321. package/src/modules/dxUtils/prismjs/prismjs.ts +3937 -0
  322. package/src/modules/dxUtils/queryCoordinator/queryCoordinator.ts +43 -0
  323. package/src/modules/dxUtils/recentSearches/recentSearches.ts +57 -0
  324. package/src/modules/dxUtils/regexps/regexps.ts +5 -0
  325. package/src/modules/dxUtils/seo/seo.ts +4 -0
  326. package/src/modules/dxUtils/slot/slot.ts +17 -0
  327. package/src/modules/dxUtils/wordpress/wordpress.ts +13 -0
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <label if:true={label} id="label" for="input" tabindex="-1">
3
+ {label}
4
+ <abbr if:true={required}>*</abbr>
5
+ </label>
6
+ <div class={className}>
7
+ <div class={inputContainerClassName} onclick={onClick} role={role}>
8
+ <dx-icon
9
+ if:true={iconSymbol}
10
+ symbol={iconSymbol}
11
+ size={iconSize}
12
+ ></dx-icon>
13
+ <input
14
+ aria-label={ariaLabel}
15
+ aria-keyshortcuts={ariaKeyShortcuts}
16
+ autocomplete={autocomplete}
17
+ name={name}
18
+ disabled={inputDisabled}
19
+ id="input"
20
+ onblur={onInputBlur}
21
+ onfocus={onInputFocus}
22
+ oninput={onInputChange}
23
+ onkeydown={onKeyDown}
24
+ placeholder={placeholder}
25
+ type={type}
26
+ value={value}
27
+ aria-labelledby="label description"
28
+ />
29
+ <button
30
+ class="clear-button"
31
+ aria-label="Clear"
32
+ if:true={showClearButton}
33
+ onclick={clear}
34
+ >
35
+ <dx-icon symbol="clear" size="medium"></dx-icon>
36
+ </button>
37
+ <div class="shortcut" if:true={showShortcutKey}>
38
+ <img src={shortcutImgSrc} alt={shortcutImgAlt} />
39
+ <span>{shortcutKey}</span>
40
+ </div>
41
+ </div>
42
+ <dx-button
43
+ if:true={submitLabel}
44
+ disabled={buttonDisabled}
45
+ onclick={onButtonClick}
46
+ type="submit"
47
+ size={size}
48
+ >
49
+ {submitLabel}
50
+ </dx-button>
51
+ </div>
52
+ <div id="description" class={descriptionClassName} tabindex="-1">
53
+ {description}
54
+ </div>
55
+ <div
56
+ if:true={errorMessage}
57
+ aria-live="assertive"
58
+ class="error-message-box dx-text-form-error-message"
59
+ >
60
+ {errorMessage}
61
+ </div>
62
+ </template>
@@ -0,0 +1,246 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import cx from "classnames";
3
+ import { IconSize, IconSymbol } from "typings/custom";
4
+ import { isMac } from "dxUtils/devices";
5
+ import { setContainerInnerHtml } from "dxUtils/lwc";
6
+ import { isValidEmail } from "./validators";
7
+
8
+ type ValidatorMap = {
9
+ [key: string]: {
10
+ validator: (value: string | null) => boolean;
11
+ errorMessage: string;
12
+ };
13
+ };
14
+
15
+ const typeValidatorMap: ValidatorMap = {
16
+ email: {
17
+ validator: isValidEmail,
18
+ errorMessage: "Enter valid email"
19
+ }
20
+ };
21
+ export default class Input extends LightningElement {
22
+ @api ariaLabel!: string;
23
+ @api autocomplete: string | null = null;
24
+ @api clearable: boolean = false;
25
+ @api disabled: boolean = false;
26
+ @api iconSize: IconSize = "medium";
27
+ @api iconSymbol: IconSymbol | null = null;
28
+ @api label?: string;
29
+ @api descriptionMarkup?: string;
30
+ @api loading: boolean = false;
31
+ @api missingErrorMessage: string = "Complete this field";
32
+ @api formatErrorMessage?: string;
33
+ @api name?: string;
34
+ @api placeholder!: string;
35
+ @api required = false;
36
+ @api role: string | null = null;
37
+ @api shortcutKey: string | null = null;
38
+ @api size: "small" | "large" | "override" = "small";
39
+ @api submitLabel?: string | null = null;
40
+ @api type: string = "text";
41
+ @api validityOnBlur = false;
42
+
43
+ @api
44
+ get value() {
45
+ return this._value;
46
+ }
47
+ set value(value: string | null) {
48
+ this._value = value || "";
49
+ }
50
+
51
+ @api
52
+ get errorMessage() {
53
+ return this._errorMessage;
54
+ }
55
+
56
+ set errorMessage(value) {
57
+ this._errorMessage = value;
58
+ }
59
+
60
+ @api focus() {
61
+ if (this.input) {
62
+ this.input.focus();
63
+ }
64
+ }
65
+
66
+ @api
67
+ reportValidity(): boolean {
68
+ if (this.isRequiredAndFilled) {
69
+ this._errorMessage = this.missingErrorMessage;
70
+ return false;
71
+ }
72
+
73
+ const typeValidator = typeValidatorMap[this.type];
74
+ if (typeValidator && !typeValidator.validator(this.value)) {
75
+ this._errorMessage =
76
+ this.formatErrorMessage || typeValidator.errorMessage;
77
+ return false;
78
+ }
79
+
80
+ this._errorMessage = "";
81
+ return true;
82
+ }
83
+
84
+ private _errorMessage: string = "";
85
+ private focused: boolean = false;
86
+ private input: HTMLInputElement | null = null;
87
+ private _value: string | null = null;
88
+ private _loading: boolean = false;
89
+
90
+ private get showClearButton(): boolean {
91
+ return this.clearable && !!this.value;
92
+ }
93
+
94
+ private get showShortcutKey(): boolean {
95
+ return !this.showClearButton && !!this.shortcutKey;
96
+ }
97
+
98
+ private get ariaKeyShortcuts() {
99
+ return this.shortcutKey ? `meta+${this.shortcutKey}` : null;
100
+ }
101
+
102
+ private get inputLoading() {
103
+ return this.loading || this._loading;
104
+ }
105
+
106
+ private get inputInvalid() {
107
+ const typeValidator = typeValidatorMap[this.type];
108
+ return (
109
+ this.isRequiredAndFilled &&
110
+ typeValidator &&
111
+ !typeValidator.validator(this.value)
112
+ );
113
+ }
114
+
115
+ private get inputDisabled() {
116
+ return this.inputLoading || this.disabled;
117
+ }
118
+
119
+ private get className() {
120
+ return cx("input-group", `size-${this.size}`);
121
+ }
122
+
123
+ private get descriptionClassName() {
124
+ return cx("description", !this.descriptionMarkup && "hide");
125
+ }
126
+
127
+ private get inputContainerClassName() {
128
+ return cx(
129
+ "input-container",
130
+ this.focused && "state-focused",
131
+ (this.showClearButton || this.showShortcutKey) &&
132
+ "has-floating-item",
133
+ !!this.errorMessage && "has-error"
134
+ );
135
+ }
136
+
137
+ private get buttonDisabled() {
138
+ return this.inputLoading || this.inputInvalid || this.disabled;
139
+ }
140
+
141
+ private get commandKey() {
142
+ return isMac() ? "command" : "control";
143
+ }
144
+
145
+ private get shortcutImgSrc() {
146
+ return `/assets/svg/${this.commandKey}.svg`;
147
+ }
148
+
149
+ private get shortcutImgAlt() {
150
+ return `${this.commandKey}-${this.shortcutKey} is the search shortcut`;
151
+ }
152
+
153
+ private get isRequiredAndFilled() {
154
+ return this.required && (!this.value || !this.value.trim());
155
+ }
156
+
157
+ connectedCallback() {
158
+ window.addEventListener("keydown", this.onWindowKeydown);
159
+ }
160
+
161
+ disconnectedCallback() {
162
+ window.removeEventListener("keydown", this.onWindowKeydown);
163
+ }
164
+
165
+ renderedCallback() {
166
+ if (!this.input) {
167
+ this.input = <HTMLInputElement>this.template.querySelector("input");
168
+ }
169
+ const container = this.template.querySelector(".description");
170
+ setContainerInnerHtml(container, this.descriptionMarkup);
171
+ }
172
+
173
+ onClick() {
174
+ if (this.input) {
175
+ this.input.focus();
176
+ }
177
+ }
178
+
179
+ onInputFocus() {
180
+ this.focused = true;
181
+ }
182
+
183
+ onInputBlur() {
184
+ this.focused = false;
185
+
186
+ if (this.validityOnBlur) {
187
+ this.reportValidity();
188
+ }
189
+ }
190
+
191
+ onInputChange(e: InputEvent) {
192
+ if (!e || !e.target) {
193
+ return;
194
+ }
195
+ this.dispatchChange((<HTMLInputElement>e.target).value || "");
196
+ }
197
+
198
+ onButtonClick(e: Event) {
199
+ if (!this.buttonDisabled) {
200
+ e.stopPropagation();
201
+ }
202
+ this.submit();
203
+ }
204
+
205
+ dispatchChange(value: string) {
206
+ this._value = value;
207
+ this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
208
+ }
209
+
210
+ clear(e?: Event) {
211
+ if (e) {
212
+ e.stopPropagation();
213
+ }
214
+ this.dispatchChange("");
215
+ this.dispatchEvent(new CustomEvent("clear"));
216
+ if (this.input) {
217
+ this.input.blur();
218
+ }
219
+ }
220
+
221
+ submit = async () => {
222
+ if (this.inputInvalid) {
223
+ return;
224
+ }
225
+ this.dispatchEvent(new CustomEvent("submit", { detail: this.value }));
226
+ };
227
+
228
+ private onKeyDown(e: KeyboardEvent) {
229
+ switch (e.key) {
230
+ case "Escape":
231
+ this.clear();
232
+ break;
233
+ case "Enter":
234
+ this.submit();
235
+ break;
236
+ default:
237
+ }
238
+ }
239
+
240
+ private onWindowKeydown = (e: KeyboardEvent) => {
241
+ if (this.shortcutKey && e.metaKey && e.key === this.shortcutKey) {
242
+ e.preventDefault();
243
+ this.focus();
244
+ }
245
+ };
246
+ }
@@ -0,0 +1,5 @@
1
+ export const isValidEmail = (value: string | null) =>
2
+ // eslint-disable-next-line
3
+ /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
4
+ value || ""
5
+ );
@@ -0,0 +1,33 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+
4
+ :host {
5
+ --dx-c-logo-label-color: var(--dx-g-blue-vibrant-20);
6
+
7
+ flex-shrink: 0;
8
+ }
9
+
10
+ a {
11
+ transition: var(--dx-g-transition-hue-1x);
12
+ display: flex;
13
+ align-items: center;
14
+ }
15
+
16
+ a:hover {
17
+ color: var(--dx-g-blue-vibrant-40);
18
+ }
19
+
20
+ .logo-link {
21
+ flex-shrink: 0;
22
+ margin-right: var(--dx-g-spacing-xs);
23
+ }
24
+
25
+ .logo-link > span {
26
+ margin-top: 3px;
27
+ color: var(--dx-c-logo-label-color);
28
+ }
29
+
30
+ .logo-link > img {
31
+ margin-right: var(--dx-g-spacing-sm);
32
+ width: 28px;
33
+ }
@@ -0,0 +1,6 @@
1
+ <template>
2
+ <a href={href} class="logo-link">
3
+ <img src={imgSrc} alt={imgAlt} />
4
+ <span class="dx-text-heading-7">{label}</span>
5
+ </a>
6
+ </template>
@@ -0,0 +1,8 @@
1
+ import { LightningElement, api } from "lwc";
2
+
3
+ export default class Logo extends LightningElement {
4
+ @api href: string = "/";
5
+ @api imgSrc: string = "/assets/svg/salesforce-cloud.svg";
6
+ @api imgAlt: string = "Salesforce log";
7
+ @api label!: string;
8
+ }
@@ -0,0 +1,41 @@
1
+ :host {
2
+ --dx-c-modal-drawer-z-index: 5000;
3
+ --dx-c-modal-padding-around: var(--dx-g-spacing-smd);
4
+ --dx-c-modal-height: calc(100vh - var(--dx-c-modal-padding-around) * 2);
5
+ }
6
+
7
+ dx-button {
8
+ display: block;
9
+ margin-left: auto;
10
+ }
11
+
12
+ .modal-drawer_container {
13
+ background-color: white;
14
+ height: var(--dx-c-modal-height);
15
+ left: 0;
16
+ padding: var(--dx-c-modal-padding-around);
17
+ position: fixed;
18
+ transform: translateX(-100%);
19
+ transition: transform 0.4s ease;
20
+ top: 0;
21
+ width: inherit;
22
+ z-index: var(--dx-c-modal-drawer-z-index);
23
+ overflow-y: auto;
24
+ }
25
+
26
+ .modal-drawer_container.modal-drawer_active {
27
+ transform: translateX(0);
28
+ }
29
+
30
+ .modal-drawer_overlay {
31
+ background-color: #195594;
32
+ bottom: 0;
33
+ height: 100%;
34
+ left: 0;
35
+ opacity: 0.62;
36
+ position: fixed;
37
+ right: 0;
38
+ top: 0;
39
+ width: 100%;
40
+ z-index: calc(var(--dx-c-modal-drawer-z-index) - 1);
41
+ }
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class={containerClass}>
3
+ <slot></slot>
4
+ <dx-button onclick={handleCloseModal}>Done</dx-button>
5
+ </div>
6
+ <div
7
+ if:true={open}
8
+ class="modal-drawer_overlay"
9
+ onclick={handleCloseModal}
10
+ ></div>
11
+ </template>
@@ -0,0 +1,27 @@
1
+ import cx from "classnames";
2
+ import { LightningElement, api } from "lwc";
3
+ import { normalizeBoolean } from "dxUtils/normalizers";
4
+
5
+ export default class ModalDrawer extends LightningElement {
6
+ private _open = false;
7
+
8
+ @api get open() {
9
+ return this._open;
10
+ }
11
+
12
+ set open(value) {
13
+ this._open = normalizeBoolean(value);
14
+ }
15
+
16
+ get containerClass(): string {
17
+ return cx(
18
+ "modal-drawer_container",
19
+ this._open && "modal-drawer_active"
20
+ );
21
+ }
22
+
23
+ handleCloseModal() {
24
+ this._open = !this._open;
25
+ this.dispatchEvent(new CustomEvent("clickclose"));
26
+ }
27
+ }
@@ -0,0 +1,51 @@
1
+ @import "dxHelpers/reset";
2
+
3
+ .dx-pagination {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: space-between;
7
+ padding: 0;
8
+ width: min-content;
9
+ }
10
+
11
+ .dx-pagination dx-button {
12
+ --dx-c-button-primary-color: transparent;
13
+ }
14
+
15
+ .dx-pagination.has-prev dx-button:first-of-type {
16
+ --dx-c-button-primary-color: var(--dx-g-blue-vibrant-50);
17
+ }
18
+
19
+ .dx-pagination.has-next dx-button:last-of-type {
20
+ --dx-c-button-primary-color: var(--dx-g-blue-vibrant-50);
21
+ }
22
+
23
+ .dx-pagination-pages {
24
+ flex: 1;
25
+ display: flex;
26
+ justify-content: space-between;
27
+ }
28
+
29
+ .dx-pagination-pages button {
30
+ padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-md)
31
+ var(--dx-g-spacing-2xs) var(--dx-g-spacing-md);
32
+ border-radius: var(--dx-g-spacing-lg);
33
+ font-family: var(--dx-g-font-display);
34
+ font-size: var(--dx-g-text-sm);
35
+ color: var(--dx-g-blue-vibrant-20);
36
+ transition: var(--dx-g-transition-hue-1x);
37
+ margin-left: var(--dx-g-spacing-sm);
38
+ }
39
+
40
+ .dx-pagination-pages button:last-child {
41
+ margin-right: var(--dx-g-spacing-sm);
42
+ }
43
+
44
+ .dx-pagination-pages button:hover {
45
+ background-color: var(--dx-g-cloud-blue-vibrant-95);
46
+ }
47
+
48
+ .dx-pagination-pages button.current-page {
49
+ background-color: var(--dx-g-blue-vibrant-50);
50
+ color: white;
51
+ }
@@ -0,0 +1,45 @@
1
+ <template>
2
+ <div class={rootClass}>
3
+ <dx-button
4
+ data-part-id="previous"
5
+ aria-label="Previous Page"
6
+ variant="tertiary"
7
+ size="large"
8
+ icon-symbol="back"
9
+ icon-position="left"
10
+ onclick={onPageChange}
11
+ disabled={previousIsDisabled}
12
+ ></dx-button>
13
+ <div class="dx-pagination-pages">
14
+ <template for:each={pages} for:item="item" for:index="i">
15
+ <button
16
+ if:true={item.isCurrentPage}
17
+ class="current-page"
18
+ onclick={onPageChange}
19
+ data-page-id={item.index}
20
+ key={item.index}
21
+ >
22
+ {item.label}
23
+ </button>
24
+ <button
25
+ if:false={item.isCurrentPage}
26
+ onclick={onPageChange}
27
+ data-page-id={item.index}
28
+ key={item.index}
29
+ >
30
+ {item.label}
31
+ </button>
32
+ </template>
33
+ </div>
34
+ <dx-button
35
+ data-part-id="next"
36
+ aria-label="Next Page"
37
+ variant="tertiary"
38
+ size="large"
39
+ icon-symbol="forward"
40
+ icon-position="right"
41
+ onclick={onPageChange}
42
+ disabled={nextIsDisabled}
43
+ ></dx-button>
44
+ </div>
45
+ </template>
@@ -0,0 +1,135 @@
1
+ import classNames from "classnames";
2
+ import { LightningElement, api } from "lwc";
3
+ import { track } from "dxUtils/analytics";
4
+
5
+ const ANALYTICS_INFO = {
6
+ clickUrl: window.location.href,
7
+ ctaClick: false,
8
+ elementType: "button",
9
+ destinationType: "internal"
10
+ };
11
+
12
+ enum PaginationClickType {
13
+ Number,
14
+ Next,
15
+ Previous
16
+ }
17
+
18
+ export default class Pagination extends LightningElement {
19
+ @api currentPage: string = "1";
20
+ @api totalPages: string = "1";
21
+ @api pagesToShow: string = "5";
22
+
23
+ private get _currentPage() {
24
+ return parseInt(this.currentPage, 10);
25
+ }
26
+
27
+ private get _totalPages() {
28
+ return parseInt(this.totalPages, 10);
29
+ }
30
+
31
+ private get _pagesToShow() {
32
+ return parseInt(this.pagesToShow, 10);
33
+ }
34
+
35
+ private get hasPrev(): boolean {
36
+ return this._currentPage > 1;
37
+ }
38
+
39
+ private get hasNext(): boolean {
40
+ return this._currentPage < this._totalPages;
41
+ }
42
+
43
+ private get previousIsDisabled(): boolean {
44
+ return !this.hasPrev;
45
+ }
46
+
47
+ private get nextIsDisabled(): boolean {
48
+ return !this.hasNext;
49
+ }
50
+
51
+ private get rootClass(): string {
52
+ return classNames(
53
+ "dx-pagination",
54
+ this.hasNext && "has-next",
55
+ this.hasPrev && "has-prev"
56
+ );
57
+ }
58
+
59
+ private get pages(): {
60
+ label: string;
61
+ index: number;
62
+ isCurrentPage: boolean;
63
+ }[] {
64
+ const offset =
65
+ this._pagesToShow === 2 ? 2 : Math.ceil(this._pagesToShow / 2);
66
+ let start = this._currentPage - offset + 1;
67
+ let end = this._currentPage + offset - 1;
68
+
69
+ if (this._totalPages < this._pagesToShow) {
70
+ start = 1;
71
+ end = this._totalPages;
72
+ } else if (this._currentPage < offset) {
73
+ start = 1;
74
+ end = this._pagesToShow;
75
+ } else if (this._currentPage + offset > this._totalPages) {
76
+ start = this._totalPages - this._pagesToShow + 1;
77
+ end = this._totalPages;
78
+ }
79
+
80
+ return [
81
+ ...Array.from(Array(end - start + 1).keys()).map((index) => {
82
+ const page = index + start;
83
+ return {
84
+ label: `${page}`,
85
+ index: page,
86
+ isCurrentPage: page === this._currentPage
87
+ };
88
+ })
89
+ ];
90
+ }
91
+
92
+ private onPageChange(e: Event) {
93
+ const page = this.calculatePage(e);
94
+ const clickType = this.getPaginationClickType(e);
95
+
96
+ const clickText =
97
+ clickType === PaginationClickType.Number
98
+ ? page
99
+ : (e.target as HTMLElement).dataset.partId;
100
+
101
+ track(e.currentTarget!, "custEv_pagination", {
102
+ ...ANALYTICS_INFO,
103
+ clickText,
104
+ itemTitle: clickText
105
+ });
106
+
107
+ this.dispatchEvent(new CustomEvent("pagechange", { detail: page }));
108
+ }
109
+
110
+ private getPaginationClickType(e: Event): PaginationClickType {
111
+ const button = (e.target as HTMLElement).dataset.partId;
112
+ if (button === "previous") {
113
+ return PaginationClickType.Previous;
114
+ } else if (button === "next") {
115
+ return PaginationClickType.Next;
116
+ }
117
+
118
+ return PaginationClickType.Number;
119
+ }
120
+
121
+ private calculatePage(e: Event) {
122
+ const clickType = this.getPaginationClickType(e);
123
+
124
+ let page = 0;
125
+ if (clickType === PaginationClickType.Previous) {
126
+ page = this._currentPage - 1;
127
+ } else if (clickType === PaginationClickType.Next) {
128
+ page = this._currentPage + 1;
129
+ } else {
130
+ page = +(e.target as HTMLElement).dataset.pageId!;
131
+ }
132
+
133
+ return page;
134
+ }
135
+ }