@salesforcedevs/dx-components 0.26.2 → 0.26.3-alpha.1

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 (261) hide show
  1. package/lwc.config.json +2 -1
  2. package/package.json +2 -7
  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/newsletterForm/newsletterForm.html +3 -3
  28. package/src/modules/dx/popover/popover.ts +1 -1
  29. package/src/modules/dx/section/section.ts +1 -1
  30. package/src/modules/dx/sidebar/sidebar.ts +1 -1
  31. package/src/modules/dx/sidebarOld/sidebarOld.html +1 -1
  32. package/src/modules/dx/sidebarOld/sidebarOld.ts +22 -7
  33. package/src/modules/dx/sidebarSearch/sidebarSearch.ts +41 -25
  34. package/src/modules/dx/slackCta/slackCta.css +1 -1
  35. package/src/modules/dx/tooltip/microtip.css +1 -0
  36. package/src/modules/dx/tooltip/tooltip.css +1 -0
  37. package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
  38. package/src/modules/{utils-internal → utils}/coveo/coveo.ts +0 -0
  39. package/src/modules/{utils-internal → utils}/css/css.ts +0 -0
  40. package/src/modules/{utils-internal → utils}/devices/devices.ts +0 -0
  41. package/src/modules/utils/highlight/highlight.ts +28 -15
  42. package/src/modules/{utils-internal → utils}/options/options.ts +0 -0
  43. package/src/modules/{utils-internal → utils}/prismjs/prismjs.html +0 -0
  44. package/src/modules/{utils-internal → utils}/prismjs/prismjs.ts +0 -0
  45. package/src/modules/{utils-internal → utils}/recentSearches/recentSearches.ts +0 -0
  46. package/src/modules/utils/regexps/regexps.ts +12 -0
  47. package/src/modules/{utils-internal → utils}/seo/seo.ts +0 -0
  48. package/src/modules/{utils-internal → utils}/slot/slot.ts +0 -0
  49. package/src/modules/{utils-internal → utils}/wordpress/wordpress.ts +0 -0
  50. package/LICENSE +0 -12
  51. package/src/modules/dx/banner/__tests__/banner.test.ts +0 -33
  52. package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
  53. package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
  54. package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -140
  55. package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
  56. package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
  57. package/src/modules/dx/button/__tests__/button.test.ts +0 -107
  58. package/src/modules/dx/button/button.stories.ts +0 -150
  59. package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -26
  60. package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
  61. package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
  62. package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
  63. package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
  64. package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -20
  65. package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
  66. package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
  67. package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -100
  68. package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
  69. package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
  70. package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
  71. package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
  72. package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
  73. package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
  74. package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -95
  75. package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
  76. package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -153
  77. package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +0 -193
  78. package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +0 -21
  79. package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +0 -59
  80. package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
  81. package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
  82. package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
  83. package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +0 -87
  84. package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +0 -10
  85. package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +0 -32
  86. package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -58
  87. package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
  88. package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
  89. package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -68
  90. package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
  91. package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
  92. package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
  93. package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -66
  94. package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
  95. package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
  96. package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
  97. package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
  98. package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
  99. package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
  100. package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
  101. package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
  102. package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
  103. package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -85
  104. package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
  105. package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
  106. package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
  107. package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
  108. package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
  109. package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -238
  110. package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
  111. package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
  112. package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -165
  113. package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
  114. package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
  115. package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
  116. package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
  117. package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
  118. package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
  119. package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
  120. package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
  121. package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
  122. package/src/modules/dx/feature/__tests__/feature.test.ts +0 -51
  123. package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
  124. package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
  125. package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
  126. package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -178
  127. package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
  128. package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
  129. package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -43
  130. package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
  131. package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
  132. package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
  133. package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
  134. package/src/modules/dx/footer/footer.stories.ts +0 -88
  135. package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
  136. package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
  137. package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
  138. package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
  139. package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
  140. package/src/modules/dx/grid/__tests__/grid.test.ts +0 -32
  141. package/src/modules/dx/grid/grid.stories.ts +0 -134
  142. package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
  143. package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
  144. package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
  145. package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -69
  146. package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
  147. package/src/modules/dx/groupText/groupText.stories.ts +0 -81
  148. package/src/modules/dx/header/__tests__/header.test.ts +0 -236
  149. package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
  150. package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
  151. package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
  152. package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
  153. package/src/modules/dx/header/header.stories.ts +0 -172
  154. package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
  155. package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
  156. package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
  157. package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -182
  158. package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
  159. package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -6
  160. package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -52
  161. package/src/modules/dx/helmet/helmet.stories.ts +0 -53
  162. package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
  163. package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
  164. package/src/modules/dx/hr/hr.stories.ts +0 -50
  165. package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
  166. package/src/modules/dx/icon/icon.stories.ts +0 -100
  167. package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
  168. package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
  169. package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
  170. package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
  171. package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
  172. package/src/modules/dx/input/__tests__/input.test.ts +0 -357
  173. package/src/modules/dx/input/input.stories.ts +0 -102
  174. package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
  175. package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -83
  176. package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
  177. package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
  178. package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
  179. package/src/modules/dx/lazy/lazy.stories.ts +0 -132
  180. package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
  181. package/src/modules/dx/pagination/pagination.stories.ts +0 -88
  182. package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
  183. package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
  184. package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
  185. package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
  186. package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
  187. package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
  188. package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
  189. package/src/modules/dx/popover/__tests__/mockProps.ts +0 -8
  190. package/src/modules/dx/popover/__tests__/popover.test.ts +0 -313
  191. package/src/modules/dx/popover/popover.stories.ts +0 -82
  192. package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
  193. package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
  194. package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
  195. package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
  196. package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
  197. package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
  198. package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
  199. package/src/modules/dx/section/__tests__/section.test.ts +0 -17
  200. package/src/modules/dx/section/section.stories.ts +0 -381
  201. package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
  202. package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
  203. package/src/modules/dx/select/select.stories.ts +0 -59
  204. package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
  205. package/src/modules/dx/sidebar/__tests__/mockSearchChangeEmptyEvent.ts +0 -6
  206. package/src/modules/dx/sidebar/__tests__/mockSearchChangeEvent.ts +0 -527
  207. package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -568
  208. package/src/modules/dx/sidebar/sidebar.stories.ts +0 -188
  209. package/src/modules/dx/sidebarOld/__tests__/mockProps.ts +0 -178
  210. package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -570
  211. package/src/modules/dx/sidebarOld/sidebarOld.stories.ts +0 -139
  212. package/src/modules/dx/sidebarSearch/__tests__/mockPreloadedState.ts +0 -1686
  213. package/src/modules/dx/sidebarSearch/__tests__/sidebarSearch.test.ts +0 -175
  214. package/src/modules/dx/sidebarSearchResult/__tests__/sidebarSearchResult.test.ts +0 -96
  215. package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +0 -36
  216. package/src/modules/dx/slackCta/slackCta.stories.ts +0 -25
  217. package/src/modules/dx/socials/__tests__/socials.test.ts +0 -114
  218. package/src/modules/dx/socials/socials.stories.ts +0 -24
  219. package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
  220. package/src/modules/dx/spinner/spinner.stories.ts +0 -69
  221. package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
  222. package/src/modules/dx/tab/tab.stories.ts +0 -57
  223. package/src/modules/dx/toc/__tests__/mockProps.ts +0 -28
  224. package/src/modules/dx/toc/__tests__/toc.test.ts +0 -109
  225. package/src/modules/dx/toc/toc.stories.ts +0 -26
  226. package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -22
  227. package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
  228. package/src/modules/dx/topics/__tests__/mockProps.ts +0 -3
  229. package/src/modules/dx/topics/__tests__/topics.test.ts +0 -31
  230. package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
  231. package/src/modules/dx/tree/__tests__/tree.test.ts +0 -346
  232. package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
  233. package/src/modules/dx/tree/tree.stories.ts +0 -65
  234. package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
  235. package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -377
  236. package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
  237. package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -168
  238. package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -77
  239. package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -114
  240. package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
  241. package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -72
  242. package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
  243. package/src/modules/test-components/buttonTest/buttonTest.html +0 -3
  244. package/src/modules/test-components/buttonTest/buttonTest.ts +0 -3
  245. package/src/modules/test-components/codeBlockTest/codeBlockTest.js +0 -4
  246. package/src/modules/test-components/featureGridTest/featureGridTest.html +0 -7
  247. package/src/modules/test-components/featureGridTest/featureGridTest.ts +0 -5
  248. package/src/modules/test-components/instrumentationTest/instrumentationTest.html +0 -4
  249. package/src/modules/test-components/instrumentationTest/instrumentationTest.ts +0 -8
  250. package/src/modules/test-components/popoverTest/popoverTest.html +0 -6
  251. package/src/modules/test-components/popoverTest/popoverTest.ts +0 -5
  252. package/src/modules/test-components/slackCtaTest/slackCtaTest.html +0 -3
  253. package/src/modules/test-components/slackCtaTest/slackCtaTest.ts +0 -3
  254. package/src/modules/utils/highlight/__tests__/highlight.test.ts +0 -108
  255. package/src/modules/utils/highlight/__tests__/mockProps.ts +0 -45
  256. package/src/modules/utils-internal/jest/jest.ts +0 -58
  257. package/src/modules/utils-internal/recentSearches/__tests__/recentSearches.test.ts +0 -83
  258. package/src/modules/utils-internal/regexps/regexps.ts +0 -5
  259. package/src/modules/utils-internal/storybook/storybook.ts +0 -32
  260. package/src/modules/utils-internal/tests/tests.ts +0 -38
  261. package/src/modules/utils-internal/wordpress/__tests__/wordpress.test.ts +0 -15
@@ -1,46 +0,0 @@
1
- import CardTitle from "dx/cardTitle";
2
- import { createRenderComponent } from "utils-internal/tests";
3
-
4
- const TAG = "dx-card-title";
5
- const render = createRenderComponent(TAG, CardTitle);
6
-
7
- describe(TAG, () => {
8
- it("renders the link and title", () => {
9
- const title = "Title";
10
- const element = render({ href: "/test", title });
11
-
12
- const el = element.shadowRoot.querySelector("a");
13
- const nowrap = element.shadowRoot.querySelector(".nowrap");
14
-
15
- expect(el.textContent).toEqual(title);
16
- expect(nowrap).toBeNull();
17
-
18
- return expect(element).toBeAccessible();
19
- });
20
-
21
- it("renders a the last word grouped with a new window icon when target is blank", () => {
22
- const title = "Title with multiple words";
23
- const element = render({ href: "/test", title, target: "_blank" });
24
-
25
- const nowrap = element.shadowRoot.querySelector(".nowrap");
26
- const newWindowIcon = element.shadowRoot.querySelector("dx-icon");
27
-
28
- expect(nowrap.textContent).toContain("words");
29
- expect(newWindowIcon).not.toBeNull();
30
-
31
- return expect(element).toBeAccessible();
32
- });
33
-
34
- it("renders no link when no href", () => {
35
- const title = "Title with multiple words";
36
- const element = render({ title });
37
-
38
- const el = element.shadowRoot.querySelector("h3");
39
- const link = element.shadowRoot.querySelector("a");
40
-
41
- expect(el.textContent).toEqual(title);
42
- expect(link).toBeNull();
43
-
44
- return expect(element).toBeAccessible();
45
- });
46
- });
@@ -1,18 +0,0 @@
1
- import CardTrailheadModule from "dx/cardTrailheadModule";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-card-trailhead-module";
6
- const render = createRenderComponent(TAG, CardTrailheadModule);
7
-
8
- describe(TAG, () => {
9
- it("renders", () => {
10
- const element = render(mockProps);
11
-
12
- const cardContent = element.shadowRoot.querySelector("dx-card-content");
13
- expect(cardContent).not.toBeNull();
14
-
15
- expect(cardContent.subtitle).toEqual("1000 Points");
16
- return expect(element).toBeAccessible();
17
- });
18
- });
@@ -1,11 +0,0 @@
1
- export default {
2
- badgeImgAlt: "Scenic view of a mountain.",
3
- badgeImgSrc:
4
- "https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png",
5
- body:
6
- "Get to know the Salesforce Lightning Platform APIs and learn to integrate your data. Get to know the Salesforce Lightning Platform APIs and learn to integrate your data.",
7
- href: "https://developer.salesforce.com/",
8
- length: "1 hr",
9
- points: "1000",
10
- title: "Lightning Platform API Basics With Extra Title"
11
- };
@@ -1,122 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-trailhead-module",
5
- component: "dx-card-trailhead-module"
6
- };
7
-
8
- const createStyles = () => html`
9
- <style>
10
- dx-card-trailhead-module {
11
- width: 400px;
12
- max-width: 100%;
13
- min-width: 240px;
14
- }
15
- </style>
16
- `;
17
-
18
- export const Base = () => html`
19
- ${createStyles()}
20
-
21
- <dx-card-trailhead-module
22
- badge-img-alt="Scenic view of a mountain."
23
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
24
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
25
- href="https://developer.salesforce.com/"
26
- length="1 hr"
27
- points="1000"
28
- title="Lightning Platform API Basics"
29
- >
30
- </dx-card-trailhead-module>
31
- `;
32
-
33
- export const Grid = () => html`
34
- <dx-grid columns="three">
35
- <dx-card-trailhead-module
36
- badge-img-alt="Scenic view of a mountain."
37
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
38
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
39
- href="https://developer.salesforce.com/"
40
- length="1 hr"
41
- points="1000"
42
- title="Lightning Platform API Basics"
43
- >
44
- </dx-card-trailhead-module>
45
- <dx-card-trailhead-module
46
- badge-img-alt="Scenic view of a mountain."
47
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
48
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data. Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
49
- href="https://developer.salesforce.com/"
50
- length="1 hr"
51
- points="1000"
52
- title="Lightning Platform API Basics With Extra Title"
53
- >
54
- </dx-card-trailhead-module>
55
- <dx-card-trailhead-module
56
- badge-img-alt="Scenic view of a mountain."
57
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
58
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data. Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
59
- href="https://developer.salesforce.com/"
60
- length="1 hr"
61
- points="1000"
62
- title="Lightning Platform API Basics With Extra Title"
63
- >
64
- </dx-card-trailhead-module>
65
- <dx-card-trailhead-module
66
- badge-img-alt="Scenic view of a mountain."
67
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
68
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
69
- href="https://developer.salesforce.com/"
70
- length="1 hr"
71
- points="1000"
72
- title="Lightning Platform API Basics"
73
- >
74
- </dx-card-trailhead-module>
75
- <dx-card-trailhead-module
76
- badge-img-alt="Scenic view of a mountain."
77
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
78
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data. Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
79
- href="https://developer.salesforce.com/"
80
- length="1 hr"
81
- points="1000"
82
- title="Lightning Platform API Basics With Extra Title"
83
- >
84
- </dx-card-trailhead-module>
85
- <dx-card-trailhead-module
86
- badge-img-alt="Scenic view of a mountain."
87
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
88
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data. Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
89
- href="https://developer.salesforce.com/"
90
- length="1 hr"
91
- points="1000"
92
- title="Lightning Platform API Basics With Extra Title"
93
- >
94
- </dx-card-trailhead-module>
95
- <dx-card-trailhead-module
96
- badge-img-alt="Scenic view of a mountain."
97
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
98
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
99
- href="https://developer.salesforce.com/"
100
- length="1 hr"
101
- points="1000"
102
- title="Lightning Platform API Basics"
103
- >
104
- </dx-card-trailhead-module>
105
- <dx-card-trailhead-module
106
- badge-img-alt="Scenic view of a mountain."
107
- badge-img-src="https://res.cloudinary.com/hy4kyit2a/f_auto,fl_lossy,q_70/learn/modules/service_lex/b677a8a9a27fbc8a41414576453eb16f_badge.png"
108
- body="Get to know the Salesforce Lightning Platform APIs and learn to integrate your data."
109
- href="https://developer.salesforce.com/"
110
- length="1 hr"
111
- points="1000"
112
- title="Lightning Platform API Basics"
113
- >
114
- </dx-card-trailhead-module>
115
- <dx-card-callout
116
- background-color="indigo-vibrant-30"
117
- href="/build-stuff"
118
- title="Find an upcoming event"
119
- label="Calendar"
120
- ></dx-card-callout>
121
- </dx-grid>
122
- `;
@@ -1,22 +0,0 @@
1
- import CardVideoPreview from "dx/cardVideoPreview";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-card-video-preview";
6
- const render = createRenderComponent(TAG, CardVideoPreview);
7
-
8
- describe(TAG, () => {
9
- it("renders the content card, play button & date", () => {
10
- const element = render(mockProps);
11
-
12
- const els = [
13
- "dx-card-content",
14
- ".dx-play-button",
15
- "dx-formatted-date-time"
16
- ].map((query) => element.shadowRoot.querySelector(query));
17
-
18
- expect(els).not.toContain(null);
19
-
20
- return expect(element).toBeAccessible();
21
- });
22
- });
@@ -1,11 +0,0 @@
1
- const fourDaysAgo = new Date(Date.now() - 3.456e8).toISOString();
2
-
3
- export default {
4
- datetime: fourDaysAgo,
5
- title: "This is a cool video about driving up to estes park to go skiing",
6
- body: "This is a cool video about driving up to estes park to go skiing",
7
- href: "/test-href",
8
- imgSrc: "https://i.imgur.com/FUsyxR5.jpg",
9
- imgAlt: "Scenic view of a mountain",
10
- target: "_blank"
11
- };
@@ -1,147 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-video-preview",
5
- component: "dx-card-video-preview"
6
- };
7
-
8
- const date = new Date().toISOString();
9
-
10
- const createStyles = () => html`
11
- <style>
12
- dx-card-video-preview {
13
- width: 400px;
14
- max-width: 100%;
15
- min-width: 240px;
16
- margin-botom: 48px;
17
- }
18
- </style>
19
- `;
20
-
21
- export const Base = () => html`
22
- ${createStyles()}
23
-
24
- <dx-card-video-preview
25
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
26
- datetime="${date}"
27
- href="https://developer.salesforce.com/"
28
- img-alt="Scenic view of a mountain."
29
- img-src="https://i.imgur.com/FUsyxR5.jpg"
30
- title="How to Harness Einstein Vision and Language in Any App"
31
- target="_blank"
32
- >
33
- </dx-card-video-preview>
34
-
35
- <br />
36
- horizontal layout
37
- <br />
38
- <dx-card-video-preview
39
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
40
- datetime="${date}"
41
- href="https://developer.salesforce.com/"
42
- img-alt="Scenic view of a mountain."
43
- img-src="https://i.imgur.com/FUsyxR5.jpg"
44
- title="How to Harness Einstein Vision and Language in Any App"
45
- target="_blank"
46
- layout="horizontal"
47
- >
48
- </dx-card-video-preview>
49
-
50
- <br />
51
- featured
52
- <br />
53
- <dx-card-video-preview
54
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
55
- datetime="${date}"
56
- featured="true"
57
- href="https://developer.salesforce.com/"
58
- img-alt="Scenic view of a mountain."
59
- img-src="https://i.imgur.com/FUsyxR5.jpg"
60
- title="How to Harness Einstein Vision and Language in Any App"
61
- target="_blank"
62
- >
63
- </dx-card-video-preview>
64
- `;
65
-
66
- export const Grid = () => html`
67
- <dx-grid columns="three">
68
- <dx-card-video-preview
69
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned. Confidence is hard-earned. Confidence is hard-earned."
70
- datetime="${date}"
71
- href="https://developer.salesforce.com/"
72
- img-alt="Scenic view of a mountain."
73
- img-src="https://i.imgur.com/FUsyxR5.jpg"
74
- title="How to Harness Einstein Vision and Language in Any App"
75
- >
76
- </dx-card-video-preview>
77
- <dx-card-video-preview
78
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
79
- datetime="${date}"
80
- href="https://developer.salesforce.com/"
81
- img-alt="Scenic view of a mountain."
82
- img-src="https://i.imgur.com/FUsyxR5.jpg"
83
- title="How to Harness Einstein Vision and Language in Any App"
84
- >
85
- </dx-card-video-preview>
86
- <dx-card-video-preview
87
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
88
- datetime="${date}"
89
- href="https://developer.salesforce.com/"
90
- img-alt="Scenic view of a mountain."
91
- img-src="https://i.imgur.com/FUsyxR5.jpg"
92
- title="How to Harness Einstein Vision and Language in Any App"
93
- >
94
- </dx-card-video-preview>
95
- <dx-card-video-preview
96
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
97
- datetime="${date}"
98
- href="https://developer.salesforce.com/"
99
- img-alt="Scenic view of a mountain."
100
- img-src="https://i.imgur.com/FUsyxR5.jpg"
101
- title="How to Harness Einstein Vision and Language in Any App"
102
- >
103
- </dx-card-video-preview>
104
- <dx-card-video-preview
105
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned. Do you know how your customizations will perform when the crowds show up?"
106
- datetime="${date}"
107
- href="https://developer.salesforce.com/"
108
- img-alt="Scenic view of a banana."
109
- img-src="https://i.imgur.com/FUsyxR5.jpg"
110
- title="How to Harness Einstein Vision and Language in Any App Banana"
111
- >
112
- </dx-card-video-preview>
113
- <dx-card-video-preview
114
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
115
- datetime="${date}"
116
- href="https://developer.salesforce.com/"
117
- img-alt="Scenic view of a mountain."
118
- img-src="https://i.imgur.com/FUsyxR5.jpg"
119
- title="How to Harness Einstein Vision and Language in Any App"
120
- >
121
- </dx-card-video-preview>
122
- <dx-card-video-preview
123
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
124
- datetime="${date}"
125
- href="https://developer.salesforce.com/"
126
- img-alt="Scenic view of a mountain."
127
- img-src="https://i.imgur.com/FUsyxR5.jpg"
128
- title="How to Harness Einstein Vision and Language in Any App"
129
- >
130
- </dx-card-video-preview>
131
- <dx-card-video-preview
132
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
133
- datetime="${date}"
134
- href="https://developer.salesforce.com/"
135
- img-alt="Scenic view of a mountain."
136
- img-src="https://i.imgur.com/FUsyxR5.jpg"
137
- title="How to Harness Einstein Vision and Language in Any App"
138
- >
139
- </dx-card-video-preview>
140
- <dx-card-callout
141
- background-color="indigo-vibrant-30"
142
- href="/build-stuff"
143
- title="Find an upcoming event"
144
- label="Calendar"
145
- ></dx-card-callout>
146
- </dx-grid>
147
- `;
@@ -1,85 +0,0 @@
1
- import Checkbox from "dx/checkbox";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-checkbox";
6
- const render = createRenderComponent(TAG, Checkbox);
7
-
8
- describe(TAG, () => {
9
- it("renders with the correct defaults", () => {
10
- const element = render({ ...mockProps, type: "radio" });
11
-
12
- const input = element.shadowRoot.querySelector("input");
13
- const span = element.shadowRoot.querySelector("span");
14
-
15
- expect(input).not.toBeNull();
16
- expect(input.type).toBe("radio");
17
- expect(input.checked).toBe(true);
18
- expect(input.value).toBe(mockProps.value);
19
- expect(span.textContent).toBe(mockProps.label);
20
-
21
- return expect(element).toBeAccessible();
22
- });
23
-
24
- it("passes disabled through correctly", () => {
25
- const element = render({ ...mockProps, disabled: true });
26
-
27
- const input = element.shadowRoot.querySelector("input");
28
-
29
- expect(input.disabled).toBe(true);
30
-
31
- return expect(element).toBeAccessible();
32
- });
33
-
34
- it("shows error messaging when showValidity is called and is invalid", () => {
35
- const element = render({
36
- ...mockProps,
37
- required: true,
38
- checked: false
39
- });
40
-
41
- const valid = element.reportValidity();
42
- expect(valid).toBe(false);
43
-
44
- return Promise.resolve().then(() => {
45
- const err = element.shadowRoot.querySelector(".show-error");
46
- expect(err).not.toBeNull();
47
-
48
- return expect(element).toBeAccessible();
49
- });
50
- });
51
-
52
- it("doesn't show error messaging when showValidity called and not required", () => {
53
- const element = render({ ...mockProps, checked: false });
54
-
55
- const valid = element.reportValidity();
56
- expect(valid).toBe(true);
57
-
58
- return Promise.resolve().then(() => {
59
- expect(element.className).not.toContain("show-error");
60
- return expect(element).toBeAccessible();
61
- });
62
- });
63
-
64
- it("fires the correct event onclick", () => {
65
- const mockChange = jest.fn();
66
-
67
- const element = render(mockProps);
68
-
69
- element.addEventListener("change", mockChange);
70
-
71
- const input: HTMLInputElement =
72
- element.shadowRoot.querySelector("input");
73
- input.checked = false;
74
- input.dispatchEvent(new InputEvent("change"));
75
-
76
- expect(mockChange.mock.calls[0][0].detail).toEqual(
77
- expect.objectContaining({
78
- value: mockProps.value,
79
- checked: false
80
- })
81
- );
82
-
83
- return expect(element).toBeAccessible();
84
- });
85
- });
@@ -1,5 +0,0 @@
1
- export default {
2
- value: "industries",
3
- label: "Industries",
4
- checked: true
5
- };
@@ -1,38 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-checkbox",
5
- component: "dx-checkbox"
6
- };
7
-
8
- const styles = () => html`
9
- <style>
10
- .terms {
11
- --dx-c-checkbox-text-line-height: 20px;
12
- --dx-c-checkbox-font-size: 14px;
13
- }
14
- </style>
15
- `;
16
-
17
- export const Base = () => html`
18
- ${styles()}
19
- <dx-checkbox value="industries" label="Industries"> </dx-checkbox>
20
- <br />
21
- <dx-checkbox value="industries" label="Industries" type="radio">
22
- </dx-checkbox>
23
- <br />
24
- <dx-checkbox value="terms" required="true" class="terms">
25
- By registering, you confirm you have read and agree to the
26
- <dx-button variant="inline-inherit" href="https://www.google.com"
27
- >Terms of Use</dx-button
28
- >
29
- and the
30
- <dx-button variant="inline-inherit" href="https://www.google.com"
31
- >Master Subscription Agreement</dx-button
32
- >
33
- and agree that my data is subject to the
34
- <dx-button variant="inline-inherit" href="https://www.google.com"
35
- >Privacy Statement</dx-button
36
- >, including use for marketing purposes.
37
- </dx-checkbox>
38
- `;
@@ -1,80 +0,0 @@
1
- import CheckboxGroup from "dx/checkboxGroup";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-checkbox-group";
6
- const render = createRenderComponent(TAG, CheckboxGroup);
7
-
8
- describe(TAG, () => {
9
- it("renders the correct number of checkboxes and renders the legend", () => {
10
- const element = render(mockProps);
11
-
12
- const checkboxes = element.shadowRoot.querySelectorAll("dx-checkbox");
13
- const legend = element.shadowRoot.querySelector("legend");
14
-
15
- expect(checkboxes.length).toBe(mockProps.options.length);
16
- expect(legend.textContent).toBe(mockProps.legend);
17
-
18
- return expect(element).toBeAccessible();
19
- });
20
-
21
- it("accepts a value", () => {
22
- const element = render({
23
- options: mockProps.options,
24
- legend: mockProps.legend,
25
- value: mockProps.defaultValue
26
- });
27
-
28
- expect(element.value).toEqual(mockProps.defaultValue);
29
-
30
- return expect(element).toBeAccessible();
31
- });
32
-
33
- it("disables all checkboxes when disabled is true", () => {
34
- const element = render({ ...mockProps, disabled: true });
35
-
36
- const checkboxes = element.shadowRoot.querySelectorAll("dx-checkbox");
37
-
38
- const allChecked = Array.from(checkboxes).every(
39
- (checkbox: any) => checkbox.disabled
40
- );
41
-
42
- expect(allChecked).toBe(true);
43
-
44
- return expect(element).toBeAccessible();
45
- });
46
-
47
- it("adds and removes option value from the callback payload's value", async () => {
48
- const mockChange = jest.fn();
49
-
50
- const element = render(mockProps);
51
-
52
- element.addEventListener("change", mockChange);
53
-
54
- const checkbox = element.shadowRoot.querySelector("dx-checkbox");
55
-
56
- const dispatchOnChange = () =>
57
- checkbox.dispatchEvent(
58
- new CustomEvent("change", { detail: { value: checkbox.value } })
59
- );
60
-
61
- dispatchOnChange();
62
-
63
- await Promise.resolve();
64
-
65
- expect(mockChange.mock.calls[0][0].detail.value).toEqual([
66
- ...mockProps.defaultValue,
67
- checkbox.value
68
- ]);
69
-
70
- dispatchOnChange();
71
-
72
- await Promise.resolve();
73
-
74
- expect(mockChange.mock.calls[1][0].detail.value).toEqual(
75
- mockProps.defaultValue
76
- );
77
-
78
- return expect(element).toBeAccessible();
79
- });
80
- });
@@ -1,14 +0,0 @@
1
- export const options = [
2
- { value: "analytics", label: "Analytics" },
3
- { value: "collaboration", label: "Collaboration" },
4
- { value: "commerce", label: "Commerce", disabled: true },
5
- { value: "marketing", label: "Marketing", disabled: true },
6
- { value: "heroku", label: "Heroku" },
7
- { value: "sales", label: "Sales" }
8
- ];
9
-
10
- export default {
11
- defaultValue: ["sales", "heroku", "marketing"],
12
- legend: "products",
13
- options
14
- };
@@ -1,33 +0,0 @@
1
- import { html } from "lit-html";
2
- import mockProps from "./__tests__/mockProps";
3
-
4
- export default {
5
- title: "dx/dx-checkbox-group",
6
- component: "dx-checkbox-group"
7
- };
8
-
9
- export const Base = (args: any) => html`
10
- <dx-checkbox-group
11
- legend="${args.legend}"
12
- options="${args.options}"
13
- default-value="${args.defaultValue}"
14
- ></dx-checkbox-group>
15
- `;
16
-
17
- export const Controlled = (args: any) => html`
18
- <dx-checkbox-group
19
- legend="${args.legend}"
20
- options="${args.options}"
21
- value="${args.defaultValue}"
22
- ></dx-checkbox-group>
23
- `;
24
-
25
- const args = {
26
- ...mockProps,
27
- options: JSON.stringify(mockProps.options),
28
- defaultValue: JSON.stringify(mockProps.defaultValue)
29
- };
30
-
31
- Base.args = args;
32
-
33
- Controlled.args = args;