@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.
- package/lwc.config.json +2 -1
- package/package.json +2 -6
- package/src/modules/{utils-internal → base-elements}/archiveCard/archiveCard.ts +0 -0
- package/src/modules/{utils-internal → base-elements}/headerBase/headerBase.ts +0 -0
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +1 -1
- package/src/modules/dx/cardCallout/cardCallout.ts +1 -1
- package/src/modules/dx/cardContent/cardContent.ts +2 -2
- package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
- package/src/modules/dx/cardExpanded/cardExpanded.ts +1 -1
- package/src/modules/dx/cardMinimal/cardMinimal.ts +1 -1
- package/src/modules/dx/cardNews/cardNews.ts +1 -1
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +1 -1
- package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
- package/src/modules/dx/codeBlock/codeBlock.ts +1 -1
- package/src/modules/dx/dropdown/dropdown.ts +1 -1
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +1 -1
- package/src/modules/dx/groupText/groupText.ts +1 -1
- package/src/modules/dx/header/header.ts +1 -1
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +1 -1
- package/src/modules/dx/headerSearch/headerSearch.ts +1 -1
- package/src/modules/dx/icon/icon.ts +1 -1
- package/src/modules/dx/iconBadge/iconBadge.ts +1 -1
- package/src/modules/dx/input/input.ts +1 -1
- package/src/modules/dx/modalDrawer/modalDrawer.css +40 -0
- package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
- package/src/modules/dx/modalDrawer/modalDrawer.ts +27 -0
- package/src/modules/dx/popover/popover.ts +1 -1
- package/src/modules/dx/section/section.ts +1 -1
- package/src/modules/dx/sidebar/sidebar.ts +1 -1
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +2 -5
- package/src/modules/dx/slackCta/slackCta.css +1 -1
- package/src/modules/dx/tooltip/tooltip.css +1 -0
- package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
- package/src/modules/{utils-internal → utils}/coveo/coveo.ts +0 -0
- package/src/modules/{utils-internal → utils}/css/css.ts +0 -0
- package/src/modules/{utils-internal → utils}/devices/devices.ts +0 -0
- package/src/modules/utils/highlight/highlight.ts +1 -1
- package/src/modules/{utils-internal → utils}/options/options.ts +0 -0
- package/src/modules/{utils-internal → utils}/prismjs/prismjs.html +0 -0
- package/src/modules/{utils-internal → utils}/prismjs/prismjs.ts +0 -0
- package/src/modules/{utils-internal → utils}/recentSearches/recentSearches.ts +0 -0
- package/src/modules/{utils-internal → utils}/regexps/regexps.ts +0 -0
- package/src/modules/{utils-internal → utils}/seo/seo.ts +0 -0
- package/src/modules/{utils-internal → utils}/slot/slot.ts +0 -0
- package/src/modules/{utils-internal → utils}/wordpress/wordpress.ts +0 -0
- package/src/modules/dx/banner/__tests__/banner.test.ts +0 -33
- package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
- package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -140
- package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
- package/src/modules/dx/button/__tests__/button.test.ts +0 -107
- package/src/modules/dx/button/button.stories.ts +0 -150
- package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -26
- package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
- package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
- package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
- package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -20
- package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
- package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -100
- package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
- package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
- package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
- package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
- package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
- package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -95
- package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -153
- package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +0 -193
- package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +0 -21
- package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +0 -59
- package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
- package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
- package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +0 -87
- package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +0 -32
- package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -58
- package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
- package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -68
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
- package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -66
- package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
- package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
- package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
- package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
- package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
- package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
- package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -85
- package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
- package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
- package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
- package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
- package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -238
- package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
- package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
- package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -165
- package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
- package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
- package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
- package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
- package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
- package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
- package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
- package/src/modules/dx/feature/__tests__/feature.test.ts +0 -51
- package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
- package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
- package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -178
- package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
- package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -43
- package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
- package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
- package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
- package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
- package/src/modules/dx/footer/footer.stories.ts +0 -88
- package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
- package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
- package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
- package/src/modules/dx/grid/__tests__/grid.test.ts +0 -32
- package/src/modules/dx/grid/grid.stories.ts +0 -134
- package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
- package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
- package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -69
- package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
- package/src/modules/dx/groupText/groupText.stories.ts +0 -81
- package/src/modules/dx/header/__tests__/header.test.ts +0 -236
- package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
- package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
- package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
- package/src/modules/dx/header/header.stories.ts +0 -172
- package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
- package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
- package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -182
- package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
- package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -52
- package/src/modules/dx/helmet/helmet.stories.ts +0 -53
- package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
- package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/hr/hr.stories.ts +0 -50
- package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
- package/src/modules/dx/icon/icon.stories.ts +0 -100
- package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
- package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
- package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
- package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
- package/src/modules/dx/input/__tests__/input.test.ts +0 -357
- package/src/modules/dx/input/input.stories.ts +0 -102
- package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
- package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -83
- package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
- package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
- package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
- package/src/modules/dx/lazy/lazy.stories.ts +0 -132
- package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
- package/src/modules/dx/pagination/pagination.stories.ts +0 -88
- package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
- package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
- package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
- package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
- package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
- package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
- package/src/modules/dx/popover/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/popover/__tests__/popover.test.ts +0 -313
- package/src/modules/dx/popover/popover.stories.ts +0 -82
- package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
- package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
- package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
- package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
- package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
- package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
- package/src/modules/dx/section/__tests__/section.test.ts +0 -17
- package/src/modules/dx/section/section.stories.ts +0 -381
- package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
- package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
- package/src/modules/dx/select/select.stories.ts +0 -59
- package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEmptyEvent.ts +0 -6
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEvent.ts +0 -527
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -568
- package/src/modules/dx/sidebar/sidebar.stories.ts +0 -188
- package/src/modules/dx/sidebarOld/__tests__/mockProps.ts +0 -178
- package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -570
- package/src/modules/dx/sidebarOld/sidebarOld.stories.ts +0 -139
- package/src/modules/dx/sidebarSearch/__tests__/mockPreloadedState.ts +0 -1686
- package/src/modules/dx/sidebarSearch/__tests__/sidebarSearch.test.ts +0 -175
- package/src/modules/dx/sidebarSearchResult/__tests__/sidebarSearchResult.test.ts +0 -96
- package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +0 -36
- package/src/modules/dx/slackCta/slackCta.stories.ts +0 -25
- package/src/modules/dx/socials/__tests__/socials.test.ts +0 -114
- package/src/modules/dx/socials/socials.stories.ts +0 -24
- package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
- package/src/modules/dx/spinner/spinner.stories.ts +0 -69
- package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
- package/src/modules/dx/tab/tab.stories.ts +0 -57
- package/src/modules/dx/toc/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/toc/__tests__/toc.test.ts +0 -109
- package/src/modules/dx/toc/toc.stories.ts +0 -26
- package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -22
- package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
- package/src/modules/dx/topics/__tests__/mockProps.ts +0 -3
- package/src/modules/dx/topics/__tests__/topics.test.ts +0 -31
- package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
- package/src/modules/dx/tree/__tests__/tree.test.ts +0 -346
- package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
- package/src/modules/dx/tree/tree.stories.ts +0 -65
- package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -377
- package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -168
- package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -77
- package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -114
- package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -72
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
- package/src/modules/test-components/buttonTest/buttonTest.html +0 -3
- package/src/modules/test-components/buttonTest/buttonTest.ts +0 -3
- package/src/modules/test-components/codeBlockTest/codeBlockTest.js +0 -4
- package/src/modules/test-components/featureGridTest/featureGridTest.html +0 -7
- package/src/modules/test-components/featureGridTest/featureGridTest.ts +0 -5
- package/src/modules/test-components/instrumentationTest/instrumentationTest.html +0 -4
- package/src/modules/test-components/instrumentationTest/instrumentationTest.ts +0 -8
- package/src/modules/test-components/popoverTest/popoverTest.html +0 -6
- package/src/modules/test-components/popoverTest/popoverTest.ts +0 -5
- package/src/modules/test-components/slackCtaTest/slackCtaTest.html +0 -3
- package/src/modules/test-components/slackCtaTest/slackCtaTest.ts +0 -3
- package/src/modules/utils/highlight/__tests__/highlight.test.ts +0 -108
- package/src/modules/utils/highlight/__tests__/mockProps.ts +0 -45
- package/src/modules/utils-internal/jest/jest.ts +0 -58
- package/src/modules/utils-internal/recentSearches/__tests__/recentSearches.test.ts +0 -83
- package/src/modules/utils-internal/storybook/storybook.ts +0 -32
- package/src/modules/utils-internal/tests/tests.ts +0 -38
- package/src/modules/utils-internal/wordpress/__tests__/wordpress.test.ts +0 -15
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* eslint-disable jest/no-mocks-import */
|
|
2
|
-
import CardEvent from "dx/cardEvent";
|
|
3
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
4
|
-
import mockProps from "./mockProps";
|
|
5
|
-
|
|
6
|
-
const TAG = "dx-card-event";
|
|
7
|
-
const render = createRenderComponent(TAG, CardEvent);
|
|
8
|
-
|
|
9
|
-
describe(TAG, () => {
|
|
10
|
-
it("renders the date", () => {
|
|
11
|
-
const component = render(mockProps);
|
|
12
|
-
const dateEl = component.shadowRoot.querySelector(".card-event");
|
|
13
|
-
expect(dateEl).not.toBeNull();
|
|
14
|
-
return expect(component).toBeAccessible();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("doesn't render end datetime ui if property not provided", () => {
|
|
18
|
-
const component = render({
|
|
19
|
-
title: mockProps.title,
|
|
20
|
-
startDatetime: mockProps.startDatetime,
|
|
21
|
-
hre: mockProps.href
|
|
22
|
-
});
|
|
23
|
-
const endtimeEls =
|
|
24
|
-
component.shadowRoot.querySelectorAll(".end-date-time");
|
|
25
|
-
expect(endtimeEls.length).toEqual(0);
|
|
26
|
-
return expect(component).toBeAccessible();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("renders the correct number of date time components", () => {
|
|
30
|
-
const component = render(mockProps);
|
|
31
|
-
const datetimeEl = component.shadowRoot.querySelectorAll(
|
|
32
|
-
"dx-formatted-date-time"
|
|
33
|
-
);
|
|
34
|
-
expect(datetimeEl.length).toEqual(5);
|
|
35
|
-
return expect(component).toBeAccessible();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("fires events", () => {
|
|
39
|
-
const element = render({
|
|
40
|
-
...mockProps,
|
|
41
|
-
imgSrc: "https://i.imgur.com/FUsyxR5.jpg",
|
|
42
|
-
featured: true
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const imagelink: HTMLElement =
|
|
46
|
-
element.shadowRoot.querySelector(".image-link");
|
|
47
|
-
const containerDiv: HTMLElement =
|
|
48
|
-
element.shadowRoot.querySelector("div");
|
|
49
|
-
|
|
50
|
-
expect(containerDiv.classList).toContain("dx-card-base_featured");
|
|
51
|
-
|
|
52
|
-
imagelink.dispatchEvent(new CustomEvent("mouseenter"));
|
|
53
|
-
|
|
54
|
-
return Promise.resolve()
|
|
55
|
-
.then(() => {
|
|
56
|
-
expect(containerDiv.classList).toContain(
|
|
57
|
-
"dx-card-base_link-hovered"
|
|
58
|
-
);
|
|
59
|
-
imagelink.dispatchEvent(new CustomEvent("mouseleave"));
|
|
60
|
-
})
|
|
61
|
-
.then(() => {
|
|
62
|
-
expect(containerDiv.classList).not.toContain(
|
|
63
|
-
"dx-card-base_link-hovered"
|
|
64
|
-
);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("renders the short description", () => {
|
|
69
|
-
const component = render(mockProps);
|
|
70
|
-
const shortDescEl =
|
|
71
|
-
component.shadowRoot.querySelector(".dx-text-body-2");
|
|
72
|
-
expect(shortDescEl).not.toBeNull();
|
|
73
|
-
return expect(component).toBeAccessible();
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("renders a badge when type is set", () => {
|
|
77
|
-
const component = render({
|
|
78
|
-
...mockProps,
|
|
79
|
-
type: "Webinar"
|
|
80
|
-
});
|
|
81
|
-
const badgeEl = component.shadowRoot.querySelector("dx-type-badge");
|
|
82
|
-
expect(badgeEl).not.toBeNull();
|
|
83
|
-
return expect(component).toBeAccessible();
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it("renders a subtitle when location is set", () => {
|
|
87
|
-
const component = render({
|
|
88
|
-
...mockProps,
|
|
89
|
-
location: "YOUTUBE LIVE"
|
|
90
|
-
});
|
|
91
|
-
const subtitleEl = component.shadowRoot.querySelector(".subtitle");
|
|
92
|
-
expect(subtitleEl).not.toBeNull();
|
|
93
|
-
return expect(component).toBeAccessible();
|
|
94
|
-
});
|
|
95
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const startDatetime = new Date(0, 0, 1, 9, 0, 0).toISOString();
|
|
2
|
-
const endDatetime = new Date(0, 0, 1, 12, 0, 0).toISOString();
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "Virtual Event: Salesforce Life for Financial Services",
|
|
6
|
-
startDatetime: startDatetime,
|
|
7
|
-
endDatetime: endDatetime,
|
|
8
|
-
href: "www.salesforce.com",
|
|
9
|
-
shortDescription: "Virtual Event: Salesforce Life for Financial Services"
|
|
10
|
-
};
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "dx/dx-card-event",
|
|
5
|
-
component: "dx-card-event"
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const startDatetime = new Date(0, 0, 1, 9, 0, 0).toISOString();
|
|
9
|
-
const endDatetime = new Date(0, 0, 1, 12, 0, 0).toISOString();
|
|
10
|
-
|
|
11
|
-
const createStyles = () => html`
|
|
12
|
-
<style>
|
|
13
|
-
dx-card-event {
|
|
14
|
-
width: 400px;
|
|
15
|
-
max-width: 100%;
|
|
16
|
-
min-width: 240px;
|
|
17
|
-
margin-bottom: 48px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
#horiz {
|
|
21
|
-
width: unset;
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
export const Base = () => html`
|
|
27
|
-
${createStyles()}
|
|
28
|
-
|
|
29
|
-
<dx-card-event
|
|
30
|
-
href="www.google.com"
|
|
31
|
-
location="San Francisco"
|
|
32
|
-
start-datetime="${startDatetime}"
|
|
33
|
-
end-datetime="${endDatetime}"
|
|
34
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
35
|
-
img-alt="Scenic view of a mountain."
|
|
36
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
37
|
-
short-description="Dev Talkies is back in June! Kris Lande, SVP Trailhead Marketing and Trailblazer Relations at Salesforce, is joining us to inspire you and give you an exclusive peek into TrailheaDX."
|
|
38
|
-
type="Webinar"
|
|
39
|
-
></dx-card-event>
|
|
40
|
-
|
|
41
|
-
<dx-card-event
|
|
42
|
-
href="www.google.com"
|
|
43
|
-
location="San Francisco"
|
|
44
|
-
start-datetime="${startDatetime}"
|
|
45
|
-
end-datetime="${endDatetime}"
|
|
46
|
-
id="horiz"
|
|
47
|
-
layout="horizontal"
|
|
48
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
49
|
-
img-alt="Scenic view of a mountain."
|
|
50
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
51
|
-
short-description="Dev Talkies is back in June! Kris Lande, SVP Trailhead Marketing and Trailblazer Relations at Salesforce, is joining us to inspire you and give you an exclusive peek into TrailheaDX."
|
|
52
|
-
type="Live Event"
|
|
53
|
-
></dx-card-event>
|
|
54
|
-
|
|
55
|
-
<dx-card-event
|
|
56
|
-
href="www.google.com"
|
|
57
|
-
location="San Francisco"
|
|
58
|
-
start-datetime="${startDatetime}"
|
|
59
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
60
|
-
img-alt="Scenic view of a mountain."
|
|
61
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
62
|
-
featured="true"
|
|
63
|
-
short-description="Dev Talkies is back in June! Kris Lande, SVP Trailhead Marketing and Trailblazer Relations at Salesforce, is joining us to inspire you and give you an exclusive peek into TrailheaDX."
|
|
64
|
-
></dx-card-event>
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
// prettier-ignore
|
|
68
|
-
export const Grid = () => html`
|
|
69
|
-
<dx-grid columns="three">
|
|
70
|
-
<dx-card-event
|
|
71
|
-
href="www.google.com"
|
|
72
|
-
end-datetime="${endDatetime}"
|
|
73
|
-
location="San Francisco"
|
|
74
|
-
start-datetime="${startDatetime}"
|
|
75
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
76
|
-
img-alt="Scenic view of a mountain."
|
|
77
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
78
|
-
></dx-card-event>
|
|
79
|
-
<dx-card-event
|
|
80
|
-
href="www.google.com"
|
|
81
|
-
end-datetime="${endDatetime}"
|
|
82
|
-
location="San Francisco"
|
|
83
|
-
start-datetime="${startDatetime}"
|
|
84
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
85
|
-
img-alt="Scenic view of a mountain."
|
|
86
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
87
|
-
></dx-card-event>
|
|
88
|
-
</dx-card-small>
|
|
89
|
-
<dx-card-event
|
|
90
|
-
href="www.google.com"
|
|
91
|
-
end-datetime="${endDatetime}"
|
|
92
|
-
location="San Francisco"
|
|
93
|
-
start-datetime="${startDatetime}"
|
|
94
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
95
|
-
img-alt="Scenic view of a mountain."
|
|
96
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
97
|
-
></dx-card-event>
|
|
98
|
-
</dx-card-small>
|
|
99
|
-
<dx-card-event
|
|
100
|
-
href="www.google.com"
|
|
101
|
-
end-datetime="${endDatetime}"
|
|
102
|
-
location="San Francisco"
|
|
103
|
-
start-datetime="${startDatetime}"
|
|
104
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
105
|
-
img-alt="Scenic view of a mountain."
|
|
106
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
107
|
-
></dx-card-event>
|
|
108
|
-
<dx-card-event
|
|
109
|
-
href="www.google.com"
|
|
110
|
-
end-datetime="${endDatetime}"
|
|
111
|
-
location="San Francisco"
|
|
112
|
-
start-datetime="${startDatetime}"
|
|
113
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
114
|
-
img-alt="Scenic view of a mountain."
|
|
115
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
116
|
-
></dx-card-event>
|
|
117
|
-
</dx-card-small>
|
|
118
|
-
<dx-card-event
|
|
119
|
-
href="www.google.com"
|
|
120
|
-
end-datetime="${endDatetime}"
|
|
121
|
-
location="San Francisco"
|
|
122
|
-
start-datetime="${startDatetime}"
|
|
123
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
124
|
-
img-alt="Scenic view of a mountain."
|
|
125
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
126
|
-
></dx-card-event>
|
|
127
|
-
</dx-card-small>
|
|
128
|
-
<dx-card-event
|
|
129
|
-
href="www.google.com"
|
|
130
|
-
end-datetime="${endDatetime}"
|
|
131
|
-
location="San Francisco"
|
|
132
|
-
start-datetime="${startDatetime}"
|
|
133
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
134
|
-
img-alt="Scenic view of a mountain."
|
|
135
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
136
|
-
></dx-card-event>
|
|
137
|
-
<dx-card-event
|
|
138
|
-
href="www.google.com"
|
|
139
|
-
end-datetime="${endDatetime}"
|
|
140
|
-
location="San Francisco"
|
|
141
|
-
start-datetime="${startDatetime}"
|
|
142
|
-
title="Virtual Event: Salesforce Life for Financial Services"
|
|
143
|
-
img-alt="Scenic view of a mountain."
|
|
144
|
-
img-src="https://i.imgur.com/FUsyxR5.jpg"
|
|
145
|
-
></dx-card-event>
|
|
146
|
-
<dx-card-callout
|
|
147
|
-
background-color="indigo-vibrant-30"
|
|
148
|
-
href="/build-stuff"
|
|
149
|
-
title="Find an upcoming event"
|
|
150
|
-
label="Calendar"
|
|
151
|
-
></dx-card-callout>
|
|
152
|
-
</dx-grid>
|
|
153
|
-
`;
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import CardTitle from "dx/cardTitle";
|
|
2
|
-
import CardExpanded from "dx/cardExpanded";
|
|
3
|
-
import FormattedDateTime from "dx/formattedDateTime";
|
|
4
|
-
import ImageAndLabel from "dx/imageAndLabel";
|
|
5
|
-
import Topics from "dx/topics";
|
|
6
|
-
import TypeBadge from "dx/typeBadge";
|
|
7
|
-
import { createMediaMock } from "utils-internal/jest";
|
|
8
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
9
|
-
import mockProps, { podcastMock } from "./mockProps";
|
|
10
|
-
|
|
11
|
-
const MOBILE_QUERY = "(max-width: 640px)";
|
|
12
|
-
const TAG = "dx-card-expanded";
|
|
13
|
-
const render = createRenderComponent(TAG, CardExpanded);
|
|
14
|
-
|
|
15
|
-
describe(TAG, () => {
|
|
16
|
-
describe("render", () => {
|
|
17
|
-
it("renders blog content type", () => {
|
|
18
|
-
const component = render(mockProps);
|
|
19
|
-
|
|
20
|
-
const container: HTMLElement =
|
|
21
|
-
component.shadowRoot.querySelector(".card-container");
|
|
22
|
-
expect(container).not.toBeNull();
|
|
23
|
-
expect(container.classList).toHaveLength(1);
|
|
24
|
-
|
|
25
|
-
const typeBadge: TypeBadge =
|
|
26
|
-
component.shadowRoot.querySelector("dx-type-badge");
|
|
27
|
-
expect(typeBadge).not.toBeNull();
|
|
28
|
-
expect(typeBadge.color).toBe("teal");
|
|
29
|
-
expect(typeBadge.value).toBe("Blog");
|
|
30
|
-
expect(typeBadge.size).toBe("default");
|
|
31
|
-
|
|
32
|
-
const title: CardTitle =
|
|
33
|
-
component.shadowRoot.querySelector("dx-card-title");
|
|
34
|
-
expect(title).not.toBeNull();
|
|
35
|
-
expect(title.href).toBe(mockProps.href);
|
|
36
|
-
expect(title.target).toBe("_self");
|
|
37
|
-
|
|
38
|
-
const imageAndLabel: ImageAndLabel =
|
|
39
|
-
component.shadowRoot.querySelector("dx-image-and-label");
|
|
40
|
-
expect(imageAndLabel).not.toBeNull();
|
|
41
|
-
expect(imageAndLabel.href).toBe(mockProps.authorHref);
|
|
42
|
-
expect(imageAndLabel.imgSrc).toBe(mockProps.authorImgSrc);
|
|
43
|
-
expect(imageAndLabel.label).toBe(mockProps.authorLabel);
|
|
44
|
-
|
|
45
|
-
expect(
|
|
46
|
-
component.shadowRoot.querySelector(".card-dot-separator")
|
|
47
|
-
).not.toBeNull();
|
|
48
|
-
|
|
49
|
-
const formatedDate: FormattedDateTime =
|
|
50
|
-
component.shadowRoot.querySelector("dx-formatted-date-time");
|
|
51
|
-
expect(formatedDate).not.toBeNull();
|
|
52
|
-
expect(formatedDate.value).toBe("February 20, 2021");
|
|
53
|
-
|
|
54
|
-
const body: HTMLSpanElement = component.shadowRoot.querySelector(
|
|
55
|
-
".card-container > span"
|
|
56
|
-
);
|
|
57
|
-
expect(body).not.toBeNull();
|
|
58
|
-
expect(body.textContent).toBe(mockProps.body);
|
|
59
|
-
|
|
60
|
-
const topics: Topics =
|
|
61
|
-
component.shadowRoot.querySelector("dx-topics");
|
|
62
|
-
expect(topics).not.toBeNull();
|
|
63
|
-
expect(topics.topics).toEqual(mockProps.topics);
|
|
64
|
-
|
|
65
|
-
expect(window.matchMedia).toBeCalledTimes(1);
|
|
66
|
-
expect(window.matchMedia).toBeCalledWith(MOBILE_QUERY);
|
|
67
|
-
|
|
68
|
-
return expect(component).toBeAccessible();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it("renders with no props", () => {
|
|
72
|
-
const component = render();
|
|
73
|
-
|
|
74
|
-
const container: HTMLElement =
|
|
75
|
-
component.shadowRoot.querySelector(".card-container");
|
|
76
|
-
expect(container).not.toBeNull();
|
|
77
|
-
expect(container.classList).toHaveLength(1);
|
|
78
|
-
|
|
79
|
-
const typeBadge: TypeBadge =
|
|
80
|
-
component.shadowRoot.querySelector("dx-type-badge");
|
|
81
|
-
expect(typeBadge).not.toBeNull();
|
|
82
|
-
expect(typeBadge.color).toBe("teal");
|
|
83
|
-
expect(typeBadge.value).toBe("Blog");
|
|
84
|
-
expect(typeBadge.size).toBe("default");
|
|
85
|
-
|
|
86
|
-
expect(
|
|
87
|
-
component.shadowRoot.querySelector("dx-card-title")
|
|
88
|
-
).toBeNull();
|
|
89
|
-
expect(
|
|
90
|
-
component.shadowRoot.querySelector("dx-image-and-label")
|
|
91
|
-
).toBeNull();
|
|
92
|
-
expect(
|
|
93
|
-
component.shadowRoot.querySelector(".card-dot-separator")
|
|
94
|
-
).toBeNull();
|
|
95
|
-
expect(
|
|
96
|
-
component.shadowRoot.querySelector("dx-formatted-date-time")
|
|
97
|
-
).toBeNull();
|
|
98
|
-
expect(
|
|
99
|
-
component.shadowRoot.querySelector("span:last-of-type")
|
|
100
|
-
).toBeNull();
|
|
101
|
-
expect(component.shadowRoot.querySelector("dx-topics")).toBeNull();
|
|
102
|
-
|
|
103
|
-
expect(window.matchMedia).toBeCalledTimes(1);
|
|
104
|
-
expect(window.matchMedia).toBeCalledWith(MOBILE_QUERY);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("renders Podcast content type", () => {
|
|
108
|
-
const component = render(podcastMock);
|
|
109
|
-
|
|
110
|
-
const container: HTMLElement =
|
|
111
|
-
component.shadowRoot.querySelector(".card-container");
|
|
112
|
-
expect(container).not.toBeNull();
|
|
113
|
-
expect(container.classList).toHaveLength(1);
|
|
114
|
-
|
|
115
|
-
const typeBadge: TypeBadge =
|
|
116
|
-
component.shadowRoot.querySelector("dx-type-badge");
|
|
117
|
-
expect(typeBadge).not.toBeNull();
|
|
118
|
-
expect(typeBadge.color).toBe("blue");
|
|
119
|
-
expect(typeBadge.value).toBe("Podcast");
|
|
120
|
-
expect(typeBadge.size).toBe("default");
|
|
121
|
-
|
|
122
|
-
const title: CardTitle =
|
|
123
|
-
component.shadowRoot.querySelector("dx-card-title");
|
|
124
|
-
expect(title).not.toBeNull();
|
|
125
|
-
expect(title.href).toBe(podcastMock.href);
|
|
126
|
-
expect(title.target).toBe("_self");
|
|
127
|
-
|
|
128
|
-
expect(
|
|
129
|
-
component.shadowRoot.querySelector("dx-image-and-label")
|
|
130
|
-
).toBeNull();
|
|
131
|
-
|
|
132
|
-
const lengthSpan: HTMLSpanElement =
|
|
133
|
-
component.shadowRoot.querySelector(".card-extra-info > span");
|
|
134
|
-
expect(lengthSpan).not.toBeNull();
|
|
135
|
-
expect(lengthSpan.textContent).toBe(podcastMock.length);
|
|
136
|
-
|
|
137
|
-
expect(
|
|
138
|
-
component.shadowRoot.querySelector(".card-dot-separator")
|
|
139
|
-
).not.toBeNull();
|
|
140
|
-
|
|
141
|
-
const formatedDate: FormattedDateTime =
|
|
142
|
-
component.shadowRoot.querySelector("dx-formatted-date-time");
|
|
143
|
-
expect(formatedDate).not.toBeNull();
|
|
144
|
-
expect(formatedDate.value).toBe("February 20, 2021");
|
|
145
|
-
|
|
146
|
-
const body: HTMLSpanElement = component.shadowRoot.querySelector(
|
|
147
|
-
".card-container > span"
|
|
148
|
-
);
|
|
149
|
-
expect(body).not.toBeNull();
|
|
150
|
-
expect(body.textContent).toBe(podcastMock.body);
|
|
151
|
-
|
|
152
|
-
const topics: Topics =
|
|
153
|
-
component.shadowRoot.querySelector("dx-topics");
|
|
154
|
-
expect(topics).not.toBeNull();
|
|
155
|
-
expect(topics.topics).toEqual(podcastMock.topics);
|
|
156
|
-
|
|
157
|
-
expect(window.matchMedia).toBeCalledTimes(1);
|
|
158
|
-
expect(window.matchMedia).toBeCalledWith(MOBILE_QUERY);
|
|
159
|
-
|
|
160
|
-
return expect(component).toBeAccessible();
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
describe("mobile render", () => {
|
|
165
|
-
beforeAll(() => {
|
|
166
|
-
window.matchMedia = createMediaMock(true);
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it("renders blog content type as mobile", () => {
|
|
170
|
-
const component = render(mockProps);
|
|
171
|
-
|
|
172
|
-
const container: HTMLElement =
|
|
173
|
-
component.shadowRoot.querySelector(".card-container");
|
|
174
|
-
expect(container).not.toBeNull();
|
|
175
|
-
expect(container.classList).toHaveLength(2);
|
|
176
|
-
expect(container.classList).toContain("card-mobile");
|
|
177
|
-
|
|
178
|
-
const typeBadge: TypeBadge =
|
|
179
|
-
component.shadowRoot.querySelector("dx-type-badge");
|
|
180
|
-
expect(typeBadge).not.toBeNull();
|
|
181
|
-
expect(typeBadge.size).toBe("small");
|
|
182
|
-
|
|
183
|
-
const imageAndLabel: ImageAndLabel =
|
|
184
|
-
component.shadowRoot.querySelector("dx-image-and-label");
|
|
185
|
-
expect(imageAndLabel).not.toBeNull();
|
|
186
|
-
expect(imageAndLabel.href).toBe(mockProps.authorHref);
|
|
187
|
-
expect(imageAndLabel.imgSrc).toBe("");
|
|
188
|
-
expect(imageAndLabel.label).toBe(mockProps.authorLabel);
|
|
189
|
-
|
|
190
|
-
return expect(component).toBeAccessible();
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
authorHref: "/",
|
|
3
|
-
authorImgSrc: "https://placekitten.com/300/300",
|
|
4
|
-
authorLabel: "Author Name",
|
|
5
|
-
contentType: "Blog",
|
|
6
|
-
href: "/awesome-blog-post",
|
|
7
|
-
date: "02/20/2021",
|
|
8
|
-
title: "Lightning Web Components for your Inbox",
|
|
9
|
-
body: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptate nulla inventore, quis enim dignissimos culpa assumenda non sed corporis similique praesentium ex quasi, cumque quia sequi rerum ab asperiores fugiat!",
|
|
10
|
-
topics: ["mobile", "performance"]
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const podcastMock = {
|
|
14
|
-
body: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptate nulla inventore, quis enim dignissimos culpa assumenda non sed corporis similique praesentium ex quasi, cumque quia sequi rerum ab asperiores fugiat!",
|
|
15
|
-
contentType: "Podcast",
|
|
16
|
-
date: "02/20/2021",
|
|
17
|
-
href: "/awesome-blog-post",
|
|
18
|
-
length: "40 min",
|
|
19
|
-
title: "Lightning Web Components for your Inbox",
|
|
20
|
-
topics: ["mobile", "performance"]
|
|
21
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
import mockProps, { podcastMock } from "./__tests__/mockProps";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "dx/dx-card-expanded",
|
|
6
|
-
component: "dx-card-expanded",
|
|
7
|
-
argTypes: {
|
|
8
|
-
contentType: {
|
|
9
|
-
control: {
|
|
10
|
-
options: ["Blog", "Podcast"],
|
|
11
|
-
type: "select"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const style = html`
|
|
18
|
-
<style>
|
|
19
|
-
dx-card-expanded {
|
|
20
|
-
width: clamp(400px, 80%, 800px);
|
|
21
|
-
}
|
|
22
|
-
</style>
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
type CardExpandedProps = {
|
|
26
|
-
authorHref?: string;
|
|
27
|
-
authorImgSrc?: string;
|
|
28
|
-
authorLabel?: string;
|
|
29
|
-
body: string;
|
|
30
|
-
contentType: "Blog" | "Podcast";
|
|
31
|
-
date: string;
|
|
32
|
-
href: string;
|
|
33
|
-
title: string;
|
|
34
|
-
length?: string;
|
|
35
|
-
topics: Array<string>;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const Template = (args: CardExpandedProps) => html`
|
|
39
|
-
${style}
|
|
40
|
-
<dx-card-expanded
|
|
41
|
-
author-href="${args.authorHref || ""}"
|
|
42
|
-
author-img-src="${args.authorImgSrc || ""}"
|
|
43
|
-
author-label="${args.authorLabel || ""}"
|
|
44
|
-
body="${args.body}"
|
|
45
|
-
content-type=${args.contentType || "Blog"}
|
|
46
|
-
date="${args.date}"
|
|
47
|
-
href="${args.href}"
|
|
48
|
-
length="${args.length || ""}"
|
|
49
|
-
title="${args.title}"
|
|
50
|
-
topics=${JSON.stringify(args.topics)}
|
|
51
|
-
></dx-card>-expanded
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
export const BlogPost = (args: CardExpandedProps) => Template(args);
|
|
55
|
-
|
|
56
|
-
BlogPost.args = mockProps;
|
|
57
|
-
|
|
58
|
-
export const PodcastPost = (args: CardExpandedProps) => Template(args);
|
|
59
|
-
PodcastPost.args = podcastMock;
|