@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,107 +0,0 @@
1
- import Button from "dx/button";
2
- import ButtonTest from "test-components/buttonTest";
3
- import { createRenderComponent } from "utils-internal/tests";
4
-
5
- const TAG = "dx-button";
6
- const render = createRenderComponent(TAG, Button);
7
- const renderSlotted = createRenderComponent("dx-button-test", ButtonTest);
8
-
9
- describe(TAG, () => {
10
- it("renders an empty button element with no icon", () => {
11
- const element = render({ ariaLabel: "Default" });
12
- const buttonEl = element.shadowRoot.querySelector("button");
13
- const iconEl = element.shadowRoot.querySelector("dx-icon");
14
- expect(buttonEl).not.toBeNull();
15
- expect(iconEl).toBeNull();
16
- return expect(element).toBeAccessible();
17
- });
18
-
19
- it("renders button defaults if no overrides are specified", () => {
20
- const element = render({ ariaLabel: "Default" });
21
-
22
- const buttonEl = element.shadowRoot.querySelector("button");
23
- const buttonElClasses = buttonEl.getAttribute("class");
24
- expect(buttonEl.getAttribute("disabled")).toBeFalsy();
25
- expect(buttonEl.getAttribute("type")).toBe("button");
26
- expect(buttonElClasses).toContain("variant_primary");
27
- expect(buttonElClasses).toContain("size-small");
28
- expect(buttonElClasses).not.toContain("style-full");
29
- expect(buttonElClasses).not.toContain("style-icon");
30
-
31
- return expect(element).toBeAccessible();
32
- });
33
-
34
- it("is accessible when the slot is used", () => {
35
- const element = renderSlotted();
36
-
37
- return expect(element).toBeAccessible();
38
- });
39
-
40
- it("can focus itself", () => {
41
- const element = render({ ariaLabel: "Default" });
42
-
43
- const buttonEl = element.shadowRoot.querySelector("button");
44
-
45
- element.focus();
46
-
47
- expect(element.shadowRoot.activeElement.isSameNode(buttonEl)).toEqual(
48
- true
49
- );
50
- });
51
-
52
- it("only shows a loading message when the component is in `loading` state", () => {
53
- const element = render({ loading: true, iconSymbol: "search" });
54
- const loadingEl = element.shadowRoot.querySelector(
55
- ".temp-loading-message"
56
- );
57
- expect(loadingEl).not.toBeNull();
58
- const spans = element.shadowRoot.querySelectorAll("span");
59
- expect(spans.length).toEqual(1);
60
- const icon = element.shadowRoot.querySelector("dx-icon");
61
- expect(icon).toBeNull();
62
- return expect(element).toBeAccessible();
63
- });
64
-
65
- it("can display an icon with the expected settings", () => {
66
- const iconSize = "large";
67
- const iconSymbol = "automate";
68
- const ariaLabel = "Automate";
69
- const element = render({
70
- ariaLabel,
71
- iconSize,
72
- iconSymbol,
73
- loading: false
74
- });
75
- const iconEl = element.shadowRoot.querySelector("dx-icon");
76
- expect(iconEl).not.toBeNull();
77
- expect(iconEl.sprite).toBe("utility");
78
- expect(iconEl.size).toBe(iconSize);
79
- expect(iconEl.symbol).toBe(iconSymbol);
80
- return expect(element).toBeAccessible();
81
- });
82
-
83
- it("displays a link when given an href", () => {
84
- const element = render({
85
- ariaLabel: "Google",
86
- href: "https://www.google.com"
87
- });
88
- expect(element.shadowRoot.querySelector("a")).toBeDefined();
89
- expect(element.shadowRoot.querySelector("button")).toBeFalsy();
90
-
91
- return expect(element).toBeAccessible();
92
- });
93
-
94
- it("applies correct font family class", () => {
95
- const element = render({ ariaLabel: "Default" });
96
- const buttonEl = element.shadowRoot.querySelector(".button");
97
- const className = buttonEl.getAttribute("class");
98
- expect(className.includes("font-display")).toBeTruthy();
99
-
100
- const elementOther = render({ font: "sans" });
101
- const buttonElOther = elementOther.shadowRoot.querySelector(".button");
102
- const classNameOther = buttonElOther.getAttribute("class");
103
- expect(classNameOther.includes("font-sans")).toBeTruthy();
104
-
105
- return expect(element).toBeAccessible();
106
- });
107
- });
@@ -1,150 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-button",
5
- component: "dx-button"
6
- };
7
-
8
- // prettier-ignore
9
- const createStyles = () => html `
10
- <style>
11
- dx-button {
12
- display: block;
13
- }
14
- </style>`;
15
-
16
- // prettier-ignore
17
- export const Inline = () => html ` ${createStyles()}
18
-
19
- <dx-button variant="inline"> Inline Button </dx-button>
20
-
21
- <dx-button
22
- href="http://tweetflight.wearebrightly.com/"
23
- target="_blank"
24
- variant="inline"
25
- icon-symbol="link"
26
- >
27
- Inline Link
28
- </dx-button>`;
29
-
30
- // prettier-ignore
31
- export const Primary = () => html ` ${createStyles()}
32
-
33
- <dx-button icon-symbol="magicwand"> Primary Button </dx-button>
34
-
35
- <dx-button icon-symbol="chevronright"></dx-button>
36
-
37
- <dx-button icon-symbol="magicwand" size="large">
38
- Large Primary Button
39
- </dx-button>
40
-
41
- <dx-button icon-symbol="chevronright" size="large"></dx-button>
42
-
43
- <dx-button icon-symbol="chevronright" icon-position="left">
44
- Primary Button
45
- </dx-button>
46
-
47
- <dx-button
48
- href="http://tweetflight.wearebrightly.com/"
49
- target="_blank"
50
- icon-symbol="link"
51
- >
52
- Primary Link
53
- </dx-button>
54
-
55
- <dx-button
56
- href="http://tweetflight.wearebrightly.com/"
57
- target="_blank"
58
- icon-symbol="link"
59
- size="large"
60
- >
61
- Large Primary Link
62
- </dx-button>
63
-
64
- <dx-button
65
- href="/assets/svg/salesforce-logo.svg"
66
- download="salesforce-logo"
67
- icon-symbol="download"
68
- size="large"
69
- >
70
- Download Link
71
- </dx-button>
72
- `;
73
-
74
- // prettier-ignore
75
- export const Secondary = () => html ` ${createStyles()}
76
-
77
- <dx-button variant="secondary" icon-symbol="magicwand">
78
- Secondary Button
79
- </dx-button>
80
-
81
- <dx-button variant="secondary" icon-symbol="chevronright"> </dx-button>
82
-
83
- <dx-button
84
- variant="secondary"
85
- icon-symbol="magicwand"
86
- size="large"
87
- >
88
- Large Secondary Button
89
- </dx-button>
90
-
91
- <dx-button
92
- variant="secondary"
93
- icon-symbol="chevronright"
94
- size="large"
95
- ></dx-button>
96
-
97
- <dx-button
98
- href="http://tweetflight.wearebrightly.com/"
99
- target="_blank"
100
- variant="secondary"
101
- icon-symbol="link"
102
- >
103
- Secondary Link
104
- </dx-button>
105
-
106
- <dx-button
107
- href="http://tweetflight.wearebrightly.com/"
108
- target="_blank"
109
- variant="secondary"
110
- icon-symbol="link"
111
- size="large"
112
- >
113
- Large Secondary Link
114
- </dx-button>
115
- `;
116
-
117
- // prettier-ignore
118
- export const Tertiary = () => html ` ${createStyles()}
119
-
120
- <dx-button variant="tertiary" icon-symbol="chevronright">
121
- Tertiary Button
122
- </dx-button>
123
-
124
- <dx-button
125
- variant="tertiary"
126
- icon-symbol="chevronright"
127
- size="large"
128
- >
129
- Large Tertiary Button
130
- </dx-button>
131
-
132
- <dx-button
133
- href="http://tweetflight.wearebrightly.com/"
134
- target="_blank"
135
- variant="tertiary"
136
- icon-symbol="link"
137
- >
138
- Tertiary Link
139
- </dx-button>
140
-
141
- <dx-button
142
- href="http://tweetflight.wearebrightly.com/"
143
- target="_blank"
144
- variant="tertiary"
145
- icon-symbol="link"
146
- size="large"
147
- >
148
- Large Tertiary Link
149
- </dx-button>
150
- `;
@@ -1,26 +0,0 @@
1
- import CardBlogPost from "dx/cardBlogPost";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-card-blog-post";
6
- const render = createRenderComponent(TAG, CardBlogPost);
7
- const date = new Date().toISOString();
8
-
9
- describe(TAG, () => {
10
- it("renders without datetime", () => {
11
- const element = render(mockProps);
12
-
13
- const cardContent: HTMLElement =
14
- element.shadowRoot.querySelector("dx-card-content");
15
- expect(cardContent).not.toBeNull();
16
- return expect(element).toBeAccessible();
17
- });
18
-
19
- it("renders with Datetime", () => {
20
- const element = render({ ...mockProps, datetime: date });
21
- const formatedDate = element.shadowRoot.querySelector(
22
- "dx-formatted-date-time"
23
- );
24
- expect(formatedDate.value).not.toBeNull();
25
- });
26
- });
@@ -1,12 +0,0 @@
1
- export default {
2
- authorHref: "https://developer.salesforce.com/blogs/author/josh-birk",
3
- authorImgSrc: "https://placekitten.com/300/300",
4
- authorLabel: "Mr. Mistoffelees",
5
- body:
6
- "Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned.",
7
- href: "https://developer.salesforce.com/",
8
- imgAlt: "Scenic view of a mountain.",
9
- imgSrc: "https://i.imgur.com/FUsyxR5.jpg",
10
- label: "Blog Post",
11
- title: "Performance Testing on the Lightning Platform"
12
- };
@@ -1,164 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-blog-post",
5
- component: "dx-card-blog-post"
6
- };
7
-
8
- const date = new Date().toISOString();
9
-
10
- const createStyles = () => html`
11
- <style>
12
- dx-card-blog-post {
13
- margin-top: 25px;
14
- margin-bottom: 25px;
15
- width: 400px;
16
- }
17
- </style>
18
- `;
19
-
20
- export const Base = () => html`
21
- ${createStyles()}
22
- <dx-card-blog-post
23
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
24
- author-img-src="https://placekitten.com/300/300"
25
- author-label="Mr. Mistoffelees"
26
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
27
- datetime="${date}"
28
- href="https://developer.salesforce.com/"
29
- img-alt="Scenic view of a mountain."
30
- img-src="https://i.imgur.com/FUsyxR5.jpg"
31
- label="Blog Post"
32
- title="Performance Testing on the Lightning Platform"
33
- >
34
- </dx-card-blog-post>
35
- <dx-card-blog-post
36
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
37
- author-img-src="https://placekitten.com/300/300"
38
- author-label="Mr. Mistoffelees"
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
- title="Performance Testing on the Lightning Platform"
43
- >
44
- </dx-card-blog-post>
45
- <dx-card-blog-post
46
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
47
- author-img-src="https://placekitten.com/300/300"
48
- author-label="Mr. Mistoffelees"
49
- body="Every year the Ecma International Technical Committee 39 (TC39), which Salesforce is a member of, releases a new edition of ECMA-262, the ECMAScript Language Specification standards, which JavaScript is based on. The next edition is ES2021 (ES12), which is currently in draft and planned to be released in June."
50
- href="https://developer.salesforce.com/"
51
- img-alt="Scenic view of a mountain."
52
- img-src="https://i.imgur.com/FUsyxR5.jpg"
53
- title="Performance Testing on the Lightning Platform"
54
- >
55
- </dx-card-blog-post>
56
- `;
57
-
58
- // prettier-ignore
59
- export const Grid = () => html`
60
- <dx-grid columns="three">
61
- <dx-card-blog-post
62
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
63
- author-img-src="https://placekitten.com/300/300"
64
- author-label="Mr. Mistoffelees"
65
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
66
- datetime="${date}"
67
- href="https://developer.salesforce.com/"
68
- img-alt="Scenic view of a mountain."
69
- img-src="https://i.imgur.com/FUsyxR5.jpg"
70
- title="Performance Testing on the Lightning Platform"
71
- >
72
- </dx-card-blog-post>
73
- <dx-card-blog-post
74
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
75
- author-img-src="https://placekitten.com/300/300"
76
- author-label="Mr. Mistoffelees"
77
- body="This is a totally random sentence to make this longer. Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
78
- datetime="${date}"
79
- href="https://developer.salesforce.com/"
80
- img-alt="Scenic view of a mountain."
81
- img-src="https://i.imgur.com/FUsyxR5.jpg"
82
- title="Performance Testing on the Lightning Platform"
83
- >
84
- </dx-card-blog-post>
85
- <dx-card-blog-post
86
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
87
- author-img-src="https://placekitten.com/300/300"
88
- author-label="Mr. Mistoffelees"
89
- body="This is a totally random sentence to make this longer. Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
90
- datetime="${date}"
91
- href="https://developer.salesforce.com/"
92
- img-alt="Scenic view of a mountain."
93
- img-src="https://i.imgur.com/FUsyxR5.jpg"
94
- title="Performance Testing on the Lightning Platform"
95
- >
96
- </dx-card-blog-post>
97
- <dx-card-blog-post
98
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
99
- author-img-src="https://placekitten.com/300/300"
100
- author-label="Mr. Mistoffelees"
101
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
102
- datetime="${date}"
103
- href="https://developer.salesforce.com/"
104
- img-alt="Scenic view of a mountain."
105
- img-src="https://i.imgur.com/FUsyxR5.jpg"
106
- title="Performance Testing on the Lightning Platform"
107
- >
108
- </dx-card-blog-post>
109
- <dx-card-blog-post
110
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
111
- author-img-src="https://placekitten.com/300/300"
112
- author-label="Mr. Mistoffelees"
113
- body="This is a totally random sentence to make this longer. Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
114
- datetime="${date}"
115
- href="https://developer.salesforce.com/"
116
- img-alt="Scenic view of a mountain."
117
- img-src="https://i.imgur.com/FUsyxR5.jpg"
118
- title="Performance Testing on the Lightning Platform"
119
- >
120
- </dx-card-blog-post>
121
- <dx-card-blog-post
122
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
123
- author-img-src="https://placekitten.com/300/300"
124
- author-label="Mr. Mistoffelees"
125
- body="This is a totally random sentence to make this longer. Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
126
- datetime="${date}"
127
- href="https://developer.salesforce.com/"
128
- img-alt="Scenic view of a mountain."
129
- img-src="https://i.imgur.com/FUsyxR5.jpg"
130
- title="Performance Testing on the Lightning Platform"
131
- >
132
- </dx-card-blog-post>
133
- <dx-card-blog-post
134
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
135
- author-img-src="https://placekitten.com/300/300"
136
- author-label="Mr. Mistoffelees"
137
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
138
- datetime="${date}"
139
- href="https://developer.salesforce.com/"
140
- img-alt="Scenic view of a mountain."
141
- img-src="https://i.imgur.com/FUsyxR5.jpg"
142
- title="Performance Testing on the Lightning Platform"
143
- >
144
- </dx-card-blog-post>
145
- <dx-card-blog-post
146
- author-href="https://developer.salesforce.com/blogs/author/josh-birk"
147
- author-img-src="https://placekitten.com/300/300"
148
- author-label="Mr. Mistoffelees"
149
- body="Do you know how your customizations will perform when the crowds show up? Confidence is hard-earned."
150
- datetime="${date}"
151
- href="https://developer.salesforce.com/"
152
- img-alt="Scenic view of a mountain."
153
- img-src="https://i.imgur.com/FUsyxR5.jpg"
154
- title="Performance Testing on the Lightning Platform"
155
- >
156
- </dx-card-blog-post>
157
- <dx-card-callout
158
- background-color="indigo-vibrant-30"
159
- href="/build-stuff"
160
- title="Find an upcoming event"
161
- label="Calendar"
162
- ></dx-card-callout>
163
- </dx-grid>
164
- `;
@@ -1,34 +0,0 @@
1
- import CardBlogPostProvider from "dx/cardBlogPostProvider";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockWordpressPosts from "./mockWordpressPosts";
4
-
5
- const delay = () => new Promise((res) => setTimeout(res, 0));
6
-
7
- const TAG = "dx-card-blog-post-provider";
8
- const render = createRenderComponent(TAG, CardBlogPostProvider);
9
-
10
- beforeEach(() => {
11
- const mockFetchPromise = Promise.resolve({
12
- json: () => Promise.resolve(mockWordpressPosts),
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 (and doesnt blow up with a payload missing deeply nested items)", async () => {
21
- const element = render();
22
-
23
- expect(global.fetch).toHaveBeenCalledTimes(1);
24
- expect(global.fetch).toHaveBeenCalledWith("/blogs/api?maxResults=6");
25
-
26
- await delay();
27
-
28
- const els = element.shadowRoot.querySelectorAll("dx-card-blog-post");
29
-
30
- expect(els.length).toEqual(mockWordpressPosts.posts.length);
31
-
32
- return expect(element).toBeAccessible();
33
- });
34
- });
@@ -1,44 +0,0 @@
1
- export default {
2
- posts: [
3
- {
4
- date: "2021-03-04T17:00:05",
5
- description:
6
- "In Winter ‘20 we introduced the ability to schedule a flow, which allows you to run a certain flow on a daily basis, for example. With Spring ’21, we take it a step further by introducing scheduled paths inside of a flow.",
7
- id: 19554,
8
- originalUrl:
9
- "https://developer.salesforce.com/blogs/2021/03/schedule-your-path-in-salesforce-flow.html",
10
- title: "Schedule Your Path in Salesforce Flow",
11
- url: "/blogs/2021/03/schedule-your-path-in-salesforce-flow.html"
12
- },
13
- {
14
- date: "2021-03-04T17:00:05",
15
- description:
16
- "In Winter ‘20 we introduced the ability to schedule a flow, which allows you to run a certain flow on a daily basis, for example. With Spring ’21, we take it a step further by introducing scheduled paths inside of a flow.",
17
- id: 1954,
18
- originalUrl:
19
- "https://developer.salesforce.com/blogs/2021/03/schedule-your-path-in-salesforce-flow.html",
20
- title: "Schedule Your Path in Salesforce Flow",
21
- url: "/blogs/2021/03/schedule-your-path-in-salesforce-flow.html"
22
- },
23
- {
24
- date: "2021-03-04T17:00:05",
25
- description:
26
- "In Winter ‘20 we introduced the ability to schedule a flow, which allows you to run a certain flow on a daily basis, for example. With Spring ’21, we take it a step further by introducing scheduled paths inside of a flow.",
27
- id: 14,
28
- originalUrl:
29
- "https://developer.salesforce.com/blogs/2021/03/schedule-your-path-in-salesforce-flow.html",
30
- title: "Schedule Your Path in Salesforce Flow",
31
- url: "/blogs/2021/03/schedule-your-path-in-salesforce-flow.html"
32
- },
33
- {
34
- date: "2021-03-04T17:00:05",
35
- description:
36
- "In Winter ‘20 we introduced the ability to schedule a flow, which allows you to run a certain flow on a daily basis, for example. With Spring ’21, we take it a step further by introducing scheduled paths inside of a flow.",
37
- id: 4,
38
- originalUrl:
39
- "https://developer.salesforce.com/blogs/2021/03/schedule-your-path-in-salesforce-flow.html",
40
- title: "Schedule Your Path in Salesforce Flow",
41
- url: "/blogs/2021/03/schedule-your-path-in-salesforce-flow.html"
42
- }
43
- ]
44
- };
@@ -1,20 +0,0 @@
1
- import CardCallout from "dx/cardCallout";
2
- import { createRenderComponent } from "utils-internal/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-card-callout";
6
- const render = createRenderComponent(TAG, CardCallout);
7
-
8
- describe(TAG, () => {
9
- it("renders the link, arrow icon, title, & label", () => {
10
- const element = render(mockProps);
11
-
12
- const els = ["a", "dx-icon", "h3", ".dx-text-button-light"].map(
13
- (query) => element.shadowRoot.querySelector(query)
14
- );
15
-
16
- expect(els).not.toContain(null);
17
-
18
- return expect(element).toBeAccessible();
19
- });
20
- });
@@ -1,7 +0,0 @@
1
- export default {
2
- backgroundColor: "indigo-vibrant-30",
3
- color: "blue-vibrant-20",
4
- href: "/build-stuff",
5
- label: "Browse all build guides",
6
- title: "Build exactly what you need."
7
- };
@@ -1,33 +0,0 @@
1
- import { html } from "lit-html";
2
-
3
- export default {
4
- title: "dx/dx-card-callout",
5
- component: "dx-card-callout"
6
- };
7
-
8
- const createStyles = () => html`
9
- <style>
10
- dx-card-callout {
11
- width: 400px;
12
- max-width: 100%;
13
- min-width: 240px;
14
- }
15
- </style>
16
- `;
17
-
18
- export const Base = () => html`
19
- ${createStyles()}
20
- <dx-card-callout
21
- href="/build-stuff"
22
- title="Find an upcoming event"
23
- label="Calendar"
24
- ></dx-card-callout>
25
- <br />
26
- <dx-card-callout
27
- background-color="cloud-blue-vibrant-80"
28
- color="blue-vibrant-20"
29
- href="/build-stuff"
30
- title="Find an upcoming event"
31
- label="Calendar"
32
- ></dx-card-callout>
33
- `;