@salesforcedevs/dx-components 0.26.2 → 0.28.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 (255) hide show
  1. package/lwc.config.json +2 -1
  2. package/package.json +2 -6
  3. package/src/modules/{utils-internal → base-elements}/archiveCard/archiveCard.ts +0 -0
  4. package/src/modules/{utils-internal → base-elements}/headerBase/headerBase.ts +0 -0
  5. package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +1 -1
  6. package/src/modules/dx/cardCallout/cardCallout.ts +1 -1
  7. package/src/modules/dx/cardContent/cardContent.ts +2 -2
  8. package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
  9. package/src/modules/dx/cardExpanded/cardExpanded.ts +1 -1
  10. package/src/modules/dx/cardMinimal/cardMinimal.ts +1 -1
  11. package/src/modules/dx/cardNews/cardNews.ts +1 -1
  12. package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +1 -1
  13. package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
  14. package/src/modules/dx/codeBlock/codeBlock.ts +1 -1
  15. package/src/modules/dx/dropdown/dropdown.ts +1 -1
  16. package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +1 -1
  17. package/src/modules/dx/groupText/groupText.ts +1 -1
  18. package/src/modules/dx/header/header.ts +1 -1
  19. package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +1 -1
  20. package/src/modules/dx/headerSearch/headerSearch.ts +1 -1
  21. package/src/modules/dx/icon/icon.ts +1 -1
  22. package/src/modules/dx/iconBadge/iconBadge.ts +1 -1
  23. package/src/modules/dx/input/input.ts +1 -1
  24. package/src/modules/dx/modalDrawer/modalDrawer.css +40 -0
  25. package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
  26. package/src/modules/dx/modalDrawer/modalDrawer.ts +27 -0
  27. package/src/modules/dx/popover/popover.ts +1 -1
  28. package/src/modules/dx/section/section.ts +1 -1
  29. package/src/modules/dx/sidebar/sidebar.ts +1 -1
  30. package/src/modules/dx/sidebarSearch/sidebarSearch.ts +2 -5
  31. package/src/modules/dx/slackCta/slackCta.css +1 -1
  32. package/src/modules/dx/tooltip/tooltip.css +1 -0
  33. package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
  34. package/src/modules/{utils-internal → utils}/coveo/coveo.ts +0 -0
  35. package/src/modules/{utils-internal → utils}/css/css.ts +0 -0
  36. package/src/modules/{utils-internal → utils}/devices/devices.ts +0 -0
  37. package/src/modules/utils/highlight/highlight.ts +1 -1
  38. package/src/modules/{utils-internal → utils}/options/options.ts +0 -0
  39. package/src/modules/{utils-internal → utils}/prismjs/prismjs.html +0 -0
  40. package/src/modules/{utils-internal → utils}/prismjs/prismjs.ts +0 -0
  41. package/src/modules/{utils-internal → utils}/recentSearches/recentSearches.ts +0 -0
  42. package/src/modules/{utils-internal → utils}/regexps/regexps.ts +0 -0
  43. package/src/modules/{utils-internal → utils}/seo/seo.ts +0 -0
  44. package/src/modules/{utils-internal → utils}/slot/slot.ts +0 -0
  45. package/src/modules/{utils-internal → utils}/wordpress/wordpress.ts +0 -0
  46. package/src/modules/dx/banner/__tests__/banner.test.ts +0 -33
  47. package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
  48. package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
  49. package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -140
  50. package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
  51. package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
  52. package/src/modules/dx/button/__tests__/button.test.ts +0 -107
  53. package/src/modules/dx/button/button.stories.ts +0 -150
  54. package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -26
  55. package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
  56. package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
  57. package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
  58. package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
  59. package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -20
  60. package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
  61. package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
  62. package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -100
  63. package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
  64. package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
  65. package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
  66. package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
  67. package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
  68. package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
  69. package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -95
  70. package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
  71. package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -153
  72. package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +0 -193
  73. package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +0 -21
  74. package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +0 -59
  75. package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
  76. package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
  77. package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
  78. package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +0 -87
  79. package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +0 -10
  80. package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +0 -32
  81. package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -58
  82. package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
  83. package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
  84. package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -68
  85. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
  86. package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
  87. package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
  88. package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -66
  89. package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
  90. package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
  91. package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
  92. package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
  93. package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
  94. package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
  95. package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
  96. package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
  97. package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
  98. package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -85
  99. package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
  100. package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
  101. package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
  102. package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
  103. package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
  104. package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -238
  105. package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
  106. package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
  107. package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -165
  108. package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
  109. package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
  110. package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
  111. package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
  112. package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
  113. package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
  114. package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
  115. package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
  116. package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
  117. package/src/modules/dx/feature/__tests__/feature.test.ts +0 -51
  118. package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
  119. package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
  120. package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
  121. package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -178
  122. package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
  123. package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
  124. package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -43
  125. package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
  126. package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
  127. package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
  128. package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
  129. package/src/modules/dx/footer/footer.stories.ts +0 -88
  130. package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
  131. package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
  132. package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
  133. package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
  134. package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
  135. package/src/modules/dx/grid/__tests__/grid.test.ts +0 -32
  136. package/src/modules/dx/grid/grid.stories.ts +0 -134
  137. package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
  138. package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
  139. package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
  140. package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -69
  141. package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
  142. package/src/modules/dx/groupText/groupText.stories.ts +0 -81
  143. package/src/modules/dx/header/__tests__/header.test.ts +0 -236
  144. package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
  145. package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
  146. package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
  147. package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
  148. package/src/modules/dx/header/header.stories.ts +0 -172
  149. package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
  150. package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
  151. package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
  152. package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -182
  153. package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
  154. package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -6
  155. package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -52
  156. package/src/modules/dx/helmet/helmet.stories.ts +0 -53
  157. package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
  158. package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
  159. package/src/modules/dx/hr/hr.stories.ts +0 -50
  160. package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
  161. package/src/modules/dx/icon/icon.stories.ts +0 -100
  162. package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
  163. package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
  164. package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
  165. package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
  166. package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
  167. package/src/modules/dx/input/__tests__/input.test.ts +0 -357
  168. package/src/modules/dx/input/input.stories.ts +0 -102
  169. package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
  170. package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -83
  171. package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
  172. package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
  173. package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
  174. package/src/modules/dx/lazy/lazy.stories.ts +0 -132
  175. package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
  176. package/src/modules/dx/pagination/pagination.stories.ts +0 -88
  177. package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
  178. package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
  179. package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
  180. package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
  181. package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
  182. package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
  183. package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
  184. package/src/modules/dx/popover/__tests__/mockProps.ts +0 -8
  185. package/src/modules/dx/popover/__tests__/popover.test.ts +0 -313
  186. package/src/modules/dx/popover/popover.stories.ts +0 -82
  187. package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
  188. package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
  189. package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
  190. package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
  191. package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
  192. package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
  193. package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
  194. package/src/modules/dx/section/__tests__/section.test.ts +0 -17
  195. package/src/modules/dx/section/section.stories.ts +0 -381
  196. package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
  197. package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
  198. package/src/modules/dx/select/select.stories.ts +0 -59
  199. package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
  200. package/src/modules/dx/sidebar/__tests__/mockSearchChangeEmptyEvent.ts +0 -6
  201. package/src/modules/dx/sidebar/__tests__/mockSearchChangeEvent.ts +0 -527
  202. package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -568
  203. package/src/modules/dx/sidebar/sidebar.stories.ts +0 -188
  204. package/src/modules/dx/sidebarOld/__tests__/mockProps.ts +0 -178
  205. package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -570
  206. package/src/modules/dx/sidebarOld/sidebarOld.stories.ts +0 -139
  207. package/src/modules/dx/sidebarSearch/__tests__/mockPreloadedState.ts +0 -1686
  208. package/src/modules/dx/sidebarSearch/__tests__/sidebarSearch.test.ts +0 -175
  209. package/src/modules/dx/sidebarSearchResult/__tests__/sidebarSearchResult.test.ts +0 -96
  210. package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +0 -36
  211. package/src/modules/dx/slackCta/slackCta.stories.ts +0 -25
  212. package/src/modules/dx/socials/__tests__/socials.test.ts +0 -114
  213. package/src/modules/dx/socials/socials.stories.ts +0 -24
  214. package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
  215. package/src/modules/dx/spinner/spinner.stories.ts +0 -69
  216. package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
  217. package/src/modules/dx/tab/tab.stories.ts +0 -57
  218. package/src/modules/dx/toc/__tests__/mockProps.ts +0 -28
  219. package/src/modules/dx/toc/__tests__/toc.test.ts +0 -109
  220. package/src/modules/dx/toc/toc.stories.ts +0 -26
  221. package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -22
  222. package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
  223. package/src/modules/dx/topics/__tests__/mockProps.ts +0 -3
  224. package/src/modules/dx/topics/__tests__/topics.test.ts +0 -31
  225. package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
  226. package/src/modules/dx/tree/__tests__/tree.test.ts +0 -346
  227. package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
  228. package/src/modules/dx/tree/tree.stories.ts +0 -65
  229. package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
  230. package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -377
  231. package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
  232. package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -168
  233. package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -77
  234. package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -114
  235. package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
  236. package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -72
  237. package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
  238. package/src/modules/test-components/buttonTest/buttonTest.html +0 -3
  239. package/src/modules/test-components/buttonTest/buttonTest.ts +0 -3
  240. package/src/modules/test-components/codeBlockTest/codeBlockTest.js +0 -4
  241. package/src/modules/test-components/featureGridTest/featureGridTest.html +0 -7
  242. package/src/modules/test-components/featureGridTest/featureGridTest.ts +0 -5
  243. package/src/modules/test-components/instrumentationTest/instrumentationTest.html +0 -4
  244. package/src/modules/test-components/instrumentationTest/instrumentationTest.ts +0 -8
  245. package/src/modules/test-components/popoverTest/popoverTest.html +0 -6
  246. package/src/modules/test-components/popoverTest/popoverTest.ts +0 -5
  247. package/src/modules/test-components/slackCtaTest/slackCtaTest.html +0 -3
  248. package/src/modules/test-components/slackCtaTest/slackCtaTest.ts +0 -3
  249. package/src/modules/utils/highlight/__tests__/highlight.test.ts +0 -108
  250. package/src/modules/utils/highlight/__tests__/mockProps.ts +0 -45
  251. package/src/modules/utils-internal/jest/jest.ts +0 -58
  252. package/src/modules/utils-internal/recentSearches/__tests__/recentSearches.test.ts +0 -83
  253. package/src/modules/utils-internal/storybook/storybook.ts +0 -32
  254. package/src/modules/utils-internal/tests/tests.ts +0 -38
  255. package/src/modules/utils-internal/wordpress/__tests__/wordpress.test.ts +0 -15
@@ -1,32 +0,0 @@
1
- import { html } from "lit-html";
2
- import { blogPostMock, podcastEpisodeMock } from "./__tests__/mockProps";
3
-
4
- export default {
5
- title: "dx/dx-card-minimal",
6
- component: "dx-card-minimal"
7
- };
8
-
9
- export const BlogPost = (args: { title: string; href: string }) => html`
10
- <dx-card-minimal
11
- title="${args.title}"
12
- href="${args.href}"
13
- ></dx-card-minimal>
14
- `;
15
-
16
- BlogPost.args = {
17
- title: blogPostMock.title,
18
- href: blogPostMock.href
19
- };
20
-
21
- export const PodcastEpisode = (args: { title: string; href: string }) => html`
22
- <dx-card-minimal
23
- title="${args.title}"
24
- href="${args.href}"
25
- content-type="${podcastEpisodeMock.contentType}"
26
- ></dx-card-minimal>
27
- `;
28
-
29
- PodcastEpisode.args = {
30
- title: podcastEpisodeMock.title,
31
- href: podcastEpisodeMock.href
32
- };
@@ -1,58 +0,0 @@
1
- import CardNews from "dx/cardNews";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-card-news";
6
- const render = createRenderComponent(TAG, CardNews);
7
-
8
- describe(TAG, () => {
9
- it("renders the link, title, body and button", () => {
10
- const element = render(mockProps);
11
-
12
- const els = ["a", "h3", "p", "dx-button"].map((query) =>
13
- element.shadowRoot.querySelector(query)
14
- );
15
-
16
- expect(els).not.toContain(null);
17
-
18
- return expect(element).toBeAccessible();
19
- });
20
-
21
- it("renders the image when present", () => {
22
- const props = mockProps;
23
- props.imgAlt = "Vector image of a lake and a mountain.";
24
- props.imgSrc = "/assets/svg/dsc-home-news-bear.svg";
25
-
26
- const element = render(props);
27
-
28
- const els = ["img"].map((query) =>
29
- element.shadowRoot.querySelector(query)
30
- );
31
-
32
- expect(els).not.toContain(null);
33
-
34
- return expect(element).toBeAccessible();
35
- });
36
-
37
- it("renders with vertical align and container width large", () => {
38
- const element = render({
39
- ...mockProps,
40
- dark: true,
41
- imgAlt: "Vector image of a lake and a mountain.",
42
- imgSrc: "/assets/svg/dsc-home-news-bear.svg",
43
- textContainerWidth: "large",
44
- imgVerticalAlign: "bottom"
45
- });
46
-
47
- const link: HTMLElement =
48
- element.shadowRoot.querySelector(".dx-card-news");
49
- const image: HTMLElement = element.shadowRoot.querySelector("img");
50
- expect(link.classList).toContain("is-dark");
51
- expect(image.classList).toContain(
52
- "dx-card-news-img-vertical-align-bottom"
53
- );
54
- expect(image.classList).toContain("dx-card-news-img-small");
55
-
56
- return expect(element).toBeAccessible();
57
- });
58
- });
@@ -1,7 +0,0 @@
1
- export default {
2
- href: "https://salesforce.com",
3
- title: "Salesforce Developer Survey",
4
- body: "Share your insights to help us improve your developer experience",
5
- backgroundColor: "indigo-vibrant-20",
6
- buttonText: "Take the Survey"
7
- };
@@ -1,115 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-news",
5
- component: "dx-card-news"
6
- };
7
-
8
- const createStyles = () => html`
9
- <style>
10
- #large {
11
- width: 700px;
12
- }
13
- dx-card-news {
14
- width: 400px;
15
- max-width: 100%;
16
- min-width: 240px;
17
- margin-bottom: 16px;
18
- }
19
- @media screen and (min-width: 1024px) {
20
- dx-card-news {
21
- margin-bottom: 24px;
22
- }
23
- }
24
- .title {
25
- margin: 1rem 0;
26
- }
27
- </style>
28
- `;
29
-
30
- const title = (value: string) => html`<div class="title">${value}</div>`;
31
-
32
- export const Base = () => html`
33
- ${createStyles()} ${title("Large size, image in right side")}
34
-
35
- <dx-card-news
36
- id="large"
37
- href="https://salesforce.com"
38
- img-alt="Vector image of a lake and a mountain."
39
- img-src="/assets/svg/dsc-home-news-bear.svg"
40
- title="Salesforce Developer Survey"
41
- body="Share your insights to help us improve your developer experience"
42
- background-color="indigo-vibrant-20"
43
- size="large"
44
- button-text="Take the Survey"
45
- button-type="large"
46
- img-placement="right"
47
- ></dx-card-news>
48
-
49
- ${title("Regular size, no image")}
50
- <dx-card-news
51
- href="https://salesforce.com"
52
- title="Sample Gallery"
53
- body="Get hands-on with code by exploring our Sample Gallery, updated for Spring'21"
54
- background-color="indigo-vibrant-90"
55
- color="cloud-blue-vibrant-20"
56
- button-text="Check It Out"
57
- button-type="inline"
58
- ></dx-card-news>
59
-
60
- ${title("Regular size, with image at the bottom")}
61
- <dx-card-news
62
- href="https://salesforce.com"
63
- img-alt="Vector image of a lake and a mountain."
64
- img-src="/assets/svg/lake-mountain.svg"
65
- title="LEARN MOAR"
66
- body="Discover what's new for Admins and Developers in the Spring'21 Release"
67
- background-color="cloud-blue-vibrant-90"
68
- color="cloud-blue-vibrant-20"
69
- button-text="Learn moar"
70
- button-type="inline"
71
- img-placement="bottom"
72
- ></dx-card-news>
73
-
74
- ${title("Regular size, with image at the top")}
75
- <dx-card-news
76
- href="https://salesforce.com"
77
- img-alt="Vector image of a lake and a mountain."
78
- img-src="/assets/svg/lake-mountain.svg"
79
- title="LEARN MOAR"
80
- body="Discover what's new for Admins and Developers in the Spring'21 Release"
81
- background-color="cloud-blue-vibrant-90"
82
- color="cloud-blue-vibrant-20"
83
- button-text="Learn moar"
84
- button-type="inline"
85
- img-placement="top"
86
- ></dx-card-news>
87
-
88
- ${title("Regular size, with image at the top and longer text")}
89
-
90
- <dx-card-news
91
- img-alt="Vector image of a lake and a mountain."
92
- img-src="/assets/svg/lake-mountain.svg"
93
- title="Support the Black Community"
94
- body="This is a longer text than usual. The image should scale down. Global President of BOLDForce, our employee resource group, shares 8 things you can do to act against racial injustice."
95
- background-color="gray-10"
96
- dark="true"
97
- img-placement="top"
98
- button-text="Learn more"
99
- button-type="inline"
100
- ></dx-card-news>
101
-
102
- ${title("Regular size, with image at the bottom and longer text")}
103
-
104
- <dx-card-news
105
- img-alt="Vector image of a lake and a mountain."
106
- img-src="/assets/svg/lake-mountain.svg"
107
- title="Support the Black Community"
108
- body="This is a longer text than usual. The image should scale down. Global President of BOLDForce, our employee resource group, shares 8 things you can do to act against racial injustice."
109
- background-color="gray-10"
110
- dark="true"
111
- img-placement="bottom"
112
- button-text="Learn more"
113
- button-type="inline"
114
- ></dx-card-news>
115
- `;
@@ -1,68 +0,0 @@
1
- import CardPodcastEpisode from "dx/cardPodcastEpisode";
2
- import { createRenderComponent } from "utils-internal/tests";
3
-
4
- const TAG = "dx-card-content";
5
- const render = createRenderComponent(TAG, CardPodcastEpisode);
6
- const fourHours = new Date(Date.now() - 1.44e7).toISOString();
7
- const mockProps = {
8
- body: "Test Body",
9
- href: "https://developer.salesforce.com/",
10
- length: "32 min",
11
- number: "6",
12
- title: "Becoming a Developer"
13
- };
14
-
15
- describe(TAG, () => {
16
- it("renders", () => {
17
- const element = render({ ...mockProps, datetime: fourHours });
18
-
19
- const title: HTMLElement =
20
- element.shadowRoot.querySelector("dx-card-title");
21
- const body: HTMLElement = element.shadowRoot.querySelector(".body");
22
- const dateTime: HTMLElement = element.shadowRoot.querySelector(
23
- "dx-relative-date-time"
24
- );
25
- const length: HTMLElement = element.shadowRoot.querySelector(".length");
26
-
27
- expect(title).not.toBeNull();
28
- expect(body).not.toBeNull();
29
- expect(dateTime).not.toBeNull();
30
- expect(length).not.toBeNull();
31
-
32
- expect(title.title).toEqual("Becoming a Developer");
33
- expect(body.textContent).toEqual("Test Body");
34
- expect(length.textContent).toEqual("32 min");
35
-
36
- return expect(element).toBeAccessible();
37
- });
38
-
39
- it("fires events", () => {
40
- const element = render(mockProps);
41
-
42
- const link: HTMLElement = element.shadowRoot.querySelector("a");
43
- const containerDiv: HTMLElement =
44
- element.shadowRoot.querySelector("div");
45
- link.dispatchEvent(new CustomEvent("mouseenter"));
46
-
47
- return Promise.resolve()
48
- .then(() => {
49
- expect(containerDiv.classList).toContain(
50
- "dx-card-base_link-hovered"
51
- );
52
- link.dispatchEvent(new CustomEvent("mouseleave"));
53
- })
54
- .then(() => {
55
- expect(containerDiv.classList).not.toContain(
56
- "dx-card-base_link-hovered"
57
- );
58
- });
59
- });
60
-
61
- it("renders with Datetime", () => {
62
- const element = render({ ...mockProps, dateTime: fourHours });
63
- const formatedDate = element.shadowRoot.querySelector(
64
- "dx-relative-date-time"
65
- );
66
- expect(formatedDate.value).not.toBeNull();
67
- });
68
- });
@@ -1,31 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-podcast-episode",
5
- component: "dx-card-podcast-episode"
6
- };
7
-
8
- const fourHours = new Date(Date.now() - 1.44e7).toISOString();
9
-
10
- const createStyles = () => html`
11
- <style>
12
- dx-card-podcast-episode {
13
- width: 440px;
14
- max-width: 100%;
15
- min-width: 240px;
16
- }
17
- </style>
18
- `;
19
-
20
- export const Base = () => html`
21
- ${createStyles()}
22
- <dx-card-podcast-episode
23
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
24
- datetime="${fourHours}"
25
- href="https://developer.salesforce.com/"
26
- length="32 min"
27
- number="6"
28
- title="Becoming a Developer with Lexis Hanson"
29
- >
30
- </dx-card-podcast-episode>
31
- `;
@@ -1,36 +0,0 @@
1
- import CardPodcastEpisodeProvider from "dx/cardPodcastEpisodeProvider";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockWordpressEpisodes from "./mockWordpressEpisodes";
4
-
5
- const delay = () => new Promise((res) => setTimeout(res, 0));
6
-
7
- const TAG = "dx-card-podcast-episode-provider";
8
- const render = createRenderComponent(TAG, CardPodcastEpisodeProvider);
9
-
10
- beforeEach(() => {
11
- const mockFetchPromise = Promise.resolve({
12
- json: () => Promise.resolve(mockWordpressEpisodes),
13
- status: 200
14
- });
15
- // @ts-ignore
16
- jest.spyOn(global, "fetch").mockImplementation(() => mockFetchPromise);
17
- });
18
-
19
- describe(TAG, () => {
20
- it("renders the correct number of posts", async () => {
21
- const element = render();
22
-
23
- expect(global.fetch).toHaveBeenCalledTimes(1);
24
- expect(global.fetch).toHaveBeenCalledWith("/podcast/api?maxResults=6");
25
-
26
- await delay();
27
-
28
- const els = element.shadowRoot.querySelectorAll(
29
- "dx-card-podcast-episode"
30
- );
31
-
32
- expect(els.length).toEqual(mockWordpressEpisodes.posts.length);
33
-
34
- return expect(element).toBeAccessible();
35
- });
36
- });
@@ -1,50 +0,0 @@
1
- export default {
2
- posts: [
3
- {
4
- date: "2021-02-22T08:45:10",
5
- description:
6
- " Marisa Hambleton is a Managing Partner at MH2X. In this episode, we are discussing the Cactusforce conference. We talk about its origins and the recent virtual version of it. Marisa was introduced to Salesforce after both she and her husband lost their jobs at IBM.",
7
- id: 233,
8
- originalUrl:
9
- "https://developer.salesforce.com/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html",
10
- title: "Episode 70: Cactusforce with Marisa Hambleton",
11
- url:
12
- "/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html",
13
- podcastDuration: "00:00:00"
14
- },
15
- {
16
- date: "2021-02-22T08:45:10",
17
- description:
18
- " Marisa Hambleton is a Managing Partner at MH2X. In this episode, we are discussing the Cactusforce conference. We talk about its origins and the recent virtual version of it. Marisa was introduced to Salesforce after both she and her husband lost their jobs at IBM.",
19
- id: 234,
20
- originalUrl:
21
- "https://developer.salesforce.com/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html",
22
- title: "Episode 70: Cactusforce with Marisa Hambleton",
23
- url:
24
- "/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html",
25
- podcastDuration: "00:00:00"
26
- },
27
- {
28
- date: "2021-02-22T08:45:10",
29
- description:
30
- " Marisa Hambleton is a Managing Partner at MH2X. In this episode, we are discussing the Cactusforce conference. We talk about its origins and the recent virtual version of it. Marisa was introduced to Salesforce after both she and her husband lost their jobs at IBM.",
31
- id: 235,
32
- originalUrl:
33
- "https://developer.salesforce.com/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html",
34
- title: "Episode 70: Cactusforce with Marisa Hambleton",
35
- url:
36
- "/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html"
37
- },
38
- {
39
- date: "2021-02-22T08:45:10",
40
- description:
41
- " Marisa Hambleton is a Managing Partner at MH2X. In this episode, we are discussing the Cactusforce conference. We talk about its origins and the recent virtual version of it. Marisa was introduced to Salesforce after both she and her husband lost their jobs at IBM.",
42
- id: 236,
43
- originalUrl:
44
- "https://developer.salesforce.com/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html",
45
- title: "Episode 70: Cactusforce with Marisa Hambleton",
46
- url:
47
- "/podcast/2021/02/episode-70-cactusforce-with-marisa-hambleton.html"
48
- }
49
- ]
50
- };
@@ -1,66 +0,0 @@
1
- import CardSmall from "dx/cardSmall";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
- import { isSlotEmpty, stopPropagationOnSlotted } from "utils-internal/slot";
5
-
6
- const TAG = "dx-card-small";
7
- const render = createRenderComponent(TAG, CardSmall);
8
-
9
- jest.mock("utils-internal/slot", () => {
10
- return {
11
- isSlotEmpty: jest.fn(),
12
- stopPropagationOnSlotted: jest.fn()
13
- };
14
- });
15
-
16
- describe(TAG, () => {
17
- it("renders the link, title & body; also renders card as a link by default", () => {
18
- const element = render(mockProps);
19
-
20
- const els = ["dx-card-title", ".dx-text-body-2", "dx-icon-badge"].map(
21
- (query) => element.shadowRoot.querySelector(query)
22
- );
23
- const card = element.shadowRoot.querySelector(".dx-card-base");
24
-
25
- expect(els).not.toContain(null);
26
- expect(card.tagName).toEqual("A");
27
-
28
- return expect(element).toBeAccessible();
29
- });
30
-
31
- it("sets proper styles", () => {
32
- const element = render({
33
- ...mockProps,
34
- badgeSymbol: "circle",
35
- borderless: true
36
- });
37
-
38
- const containerDiv: HTMLElement =
39
- element.shadowRoot.querySelector("div");
40
-
41
- expect(containerDiv.classList).toContain("has-icon");
42
- expect(containerDiv.classList).toContain("dx-card-base_borderless");
43
- });
44
-
45
- it("renders slot", () => {
46
- (isSlotEmpty as jest.Mock).mockReturnValue(false);
47
- const element = render(mockProps);
48
- const slot: HTMLSlotElement = element.shadowRoot.querySelector("slot");
49
- const containerDiv: HTMLElement =
50
- element.shadowRoot.querySelector(".dx-card-base_ctas");
51
- slot.dispatchEvent(new Event("slotchange"));
52
- expect(isSlotEmpty).toBeCalledTimes(1);
53
- expect(stopPropagationOnSlotted).toBeCalledTimes(1);
54
-
55
- return Promise.resolve().then(() => {
56
- expect(containerDiv).not.toBeNull();
57
- });
58
- });
59
-
60
- it("doesn't render whole card as a link when borderless", () => {
61
- const element = render({ ...mockProps, borderless: true });
62
- const card = element.shadowRoot.querySelector(".dx-card-base");
63
-
64
- expect(card.tagName).toEqual("DIV");
65
- });
66
- });
@@ -1,8 +0,0 @@
1
- export default {
2
- body:
3
- "This is a pretty long card body. It could say just about anything regarding the content of this card.",
4
- title: "This Is A Test Title",
5
- href: "/test-href",
6
- badgeSymbol: "bucket",
7
- target: "_blank"
8
- };
@@ -1,166 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-small",
5
- component: "dx-card-small"
6
- };
7
-
8
- const createStyles = () => html`
9
- <style>
10
- dx-card-small {
11
- margin-top: 25px;
12
- margin-bottom: 25px;
13
- width: 400px;
14
- max-width: 100%;
15
- min-width: 240px;
16
- }
17
- </style>
18
- `;
19
-
20
- export const Base = () => html`
21
- ${createStyles()}
22
-
23
- <dx-card-small
24
- href="/test-href"
25
- target="_blank"
26
- title="Marketplaces"
27
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
28
- badge-symbol="bucket"
29
- >
30
- <dx-button
31
- href="http://tweetflight.wearebrightly.com/"
32
- target="_blank"
33
- variant="inline"
34
- icon-symbol="forward"
35
- >
36
- Visit AppExchange
37
- </dx-button>
38
- </dx-card-small>
39
-
40
- <dx-card-small
41
- href="/test-href"
42
- target="_blank"
43
- title="Marketplaces"
44
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
45
- >
46
- <dx-button
47
- href="http://tweetflight.wearebrightly.com/"
48
- target="_blank"
49
- variant="inline"
50
- icon-symbol="forward"
51
- >
52
- Visit AppExchange
53
- </dx-button>
54
- </dx-card-small>
55
-
56
- <dx-card-small
57
- href="/test-href"
58
- target="_blank"
59
- title="Marketplaces"
60
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
61
- >
62
- </dx-card-small>
63
-
64
- <dx-card-small
65
- borderless="${true}"
66
- href="/test-href"
67
- target="_blank"
68
- title="Marketplaces"
69
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
70
- badge-symbol="bucket"
71
- >
72
- <dx-button
73
- href="http://tweetflight.wearebrightly.com/"
74
- target="_blank"
75
- variant="inline"
76
- icon-symbol="forward"
77
- >
78
- Visit AppExchange
79
- </dx-button>
80
- </dx-card-small>
81
-
82
- <dx-card-small
83
- borderless="${true}"
84
- href="/test-href"
85
- target="_blank"
86
- title="Marketplaces"
87
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
88
- >
89
- </dx-card-small>
90
- `;
91
-
92
- // prettier-ignore
93
- export const Grid = () => html`
94
- <dx-grid columns="three">
95
- <dx-card-small
96
- href="/test-href"
97
- target="_blank"
98
- title="Marketplaces"
99
- body="This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card."
100
- badge-symbol="bucket"
101
- >
102
- </dx-card-small>
103
- <dx-card-small
104
- href="/test-href"
105
- target="_blank"
106
- title="Marketplaces"
107
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
108
- badge-symbol="bucket"
109
- >
110
- </dx-card-small>
111
- <dx-card-small
112
- href="/test-href"
113
- target="_blank"
114
- title="Marketplaces"
115
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
116
- badge-symbol="bucket"
117
- >
118
- </dx-card-small>
119
- <dx-card-small
120
- href="/test-href"
121
- target="_blank"
122
- title="Marketplaces"
123
- body="This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card."
124
- badge-symbol="bucket"
125
- >
126
- </dx-card-small>
127
- <dx-card-small
128
- href="/test-href"
129
- target="_blank"
130
- title="Marketplaces"
131
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
132
- badge-symbol="bucket"
133
- >
134
- </dx-card-small>
135
- <dx-card-small
136
- href="/test-href"
137
- target="_blank"
138
- title="Marketplaces"
139
- body="This is a pretty long card body. It could say just about anything regarding the content of this card."
140
- badge-symbol="bucket"
141
- >
142
- </dx-card-small>
143
- <dx-card-small
144
- href="/test-href"
145
- target="_blank"
146
- title="Marketplaces"
147
- body="This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card."
148
- badge-symbol="bucket"
149
- >
150
- </dx-card-small>
151
- <dx-card-small
152
- href="/test-href"
153
- target="_blank"
154
- title="Marketplaces"
155
- body="This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card. This is a pretty long card body. It could say just about anything regarding the content of this card."
156
- badge-symbol="bucket"
157
- >
158
- </dx-card-small>
159
- <dx-card-callout
160
- background-color="indigo-vibrant-30"
161
- href="/build-stuff"
162
- title="Find an upcoming event"
163
- label="Calendar"
164
- ></dx-card-callout>
165
- </dx-grid>
166
- `;