@salesforcedevs/dx-components 0.26.1-alpha0.5 → 0.26.3
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/LICENSE +12 -0
- package/lwc.config.json +1 -1
- package/package.json +3 -8
- package/src/assets/icons/action-sprite/svg/symbols.svg +1 -0
- package/src/assets/icons/brand-sprite/svg/symbols.svg +1381 -0
- package/src/assets/icons/custom-sprite/svg/symbols.svg +1 -0
- package/src/assets/icons/doctype-sprite/svg/symbols.svg +1 -0
- package/src/assets/icons/general-sprite/svg/symbols.svg +3013 -0
- package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +257 -0
- package/src/assets/icons/standard-sprite/svg/symbols.svg +1 -0
- package/src/assets/icons/utility-sprite/svg/symbols.svg +1 -0
- package/src/assets/svg/card-news-learn-moar.svg +415 -0
- package/src/assets/svg/cloud-1.svg +24 -0
- package/src/assets/svg/cloud-2.svg +18 -0
- package/src/assets/svg/codey.svg +93 -0
- package/src/assets/svg/command.svg +9 -0
- package/src/assets/svg/control.svg +10 -0
- package/src/assets/svg/docs-empty-state-small.svg +72 -0
- package/src/assets/svg/docs-empty-state.svg +86 -0
- package/src/assets/svg/dsc-home-news-bear.svg +3 -0
- package/src/assets/svg/dsc-home-news-community.png +0 -0
- package/src/assets/svg/dsc-home-news-goatbear.svg +257 -0
- package/src/assets/svg/dsc-home-news-samplegallery.svg +76 -0
- package/src/assets/svg/empty-state-assistant.svg +1 -0
- package/src/assets/svg/fch-blog-cloud-1.png +0 -0
- package/src/assets/svg/fch-blog-cloud-2.png +0 -0
- package/src/assets/svg/fch-blog-planet.png +0 -0
- package/src/assets/svg/feature-backdrop1.svg +10 -0
- package/src/assets/svg/feature-backdrop2.svg +10 -0
- package/src/assets/svg/featured-demo-art-blank.svg +76 -0
- package/src/assets/svg/featured-demo-art-eBikes.svg +77 -0
- package/src/assets/svg/footer-graphic-large.svg +207 -0
- package/src/assets/svg/footer-graphic-mountains-small.svg +17 -0
- package/src/assets/svg/footer-graphic-mountains.svg +21 -0
- package/src/assets/svg/footer-graphic-trees-small.svg +33 -0
- package/src/assets/svg/footer-graphic-trees.svg +62 -0
- package/src/assets/svg/lake-mountain.svg +79 -0
- package/src/assets/svg/podcast-subscription-clouds-small.svg +49 -0
- package/src/assets/svg/podcast-subscription-clouds.svg +57 -0
- package/src/assets/svg/podcasts-subscription-apple.svg +164 -0
- package/src/assets/svg/podcasts-subscription-google.svg +29 -0
- package/src/assets/svg/podcasts-subscription-spotify.svg +11 -0
- package/src/assets/svg/salesforce-cloud.svg +7 -0
- package/src/assets/svg/salesforce-logo-corporate.svg +21 -0
- package/src/assets/svg/salesforce-logo.svg +14 -0
- package/src/assets/svg/sidebar-loading.svg +34 -0
- package/src/assets/svg/slack-cta-podcast-background-left.svg +28 -0
- package/src/assets/svg/slack-cta-podcast-background-right.svg +38 -0
- package/src/assets/svg/trees.svg +42 -0
- package/src/modules/base-elements/archiveCard/archiveCard.ts +35 -0
- package/src/modules/base-elements/headerBase/headerBase.ts +204 -0
- package/src/modules/dx/banner/banner.css +46 -0
- package/src/modules/dx/banner/banner.html +13 -0
- package/src/modules/dx/banner/banner.ts +14 -0
- package/src/modules/dx/brandThemeProvider/brandCssVars.ts +10 -0
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.html +3 -0
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.ts +46 -0
- package/src/modules/dx/breadcrumbs/breadcrumbs.css +111 -0
- package/src/modules/dx/breadcrumbs/breadcrumbs.html +44 -0
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +122 -0
- package/src/modules/dx/button/button.css +175 -0
- package/src/modules/dx/button/button.html +43 -0
- package/src/modules/dx/button/button.ts +63 -0
- package/src/modules/dx/cardBlogPost/cardBlogPost.css +13 -0
- package/src/modules/dx/cardBlogPost/cardBlogPost.html +24 -0
- package/src/modules/dx/cardBlogPost/cardBlogPost.ts +23 -0
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.css +3 -0
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.html +16 -0
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +29 -0
- package/src/modules/dx/cardCallout/cardCallout.css +57 -0
- package/src/modules/dx/cardCallout/cardCallout.html +15 -0
- package/src/modules/dx/cardCallout/cardCallout.ts +37 -0
- package/src/modules/dx/cardContent/cardContent.css +52 -0
- package/src/modules/dx/cardContent/cardContent.html +59 -0
- package/src/modules/dx/cardContent/cardContent.ts +68 -0
- package/src/modules/dx/cardDemo/cardDemo.css +1 -0
- package/src/modules/dx/cardDemo/cardDemo.html +12 -0
- package/src/modules/dx/cardDemo/cardDemo.ts +11 -0
- package/src/modules/dx/cardDocs/cardDocs.css +50 -0
- package/src/modules/dx/cardDocs/cardDocs.html +20 -0
- package/src/modules/dx/cardDocs/cardDocs.ts +30 -0
- package/src/modules/dx/cardEvent/cardEvent.css +107 -0
- package/src/modules/dx/cardEvent/cardEvent.html +94 -0
- package/src/modules/dx/cardEvent/cardEvent.ts +42 -0
- package/src/modules/dx/cardExpanded/cardExpanded.css +49 -0
- package/src/modules/dx/cardExpanded/cardExpanded.html +37 -0
- package/src/modules/dx/cardExpanded/cardExpanded.ts +45 -0
- package/src/modules/dx/cardGrid/cardGrid.css +89 -0
- package/src/modules/dx/cardGrid/cardGrid.html +46 -0
- package/src/modules/dx/cardGrid/cardGrid.ts +140 -0
- package/src/modules/dx/cardMinimal/cardMinimal.css +31 -0
- package/src/modules/dx/cardMinimal/cardMinimal.html +13 -0
- package/src/modules/dx/cardMinimal/cardMinimal.ts +3 -0
- package/src/modules/dx/cardNews/cardNews.css +159 -0
- package/src/modules/dx/cardNews/cardNews.html +37 -0
- package/src/modules/dx/cardNews/cardNews.ts +62 -0
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +19 -0
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.html +36 -0
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.ts +36 -0
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +3 -0
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +12 -0
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +29 -0
- package/src/modules/dx/cardSmall/cardSmall.css +32 -0
- package/src/modules/dx/cardSmall/cardSmall.html +42 -0
- package/src/modules/dx/cardSmall/cardSmall.ts +38 -0
- package/src/modules/dx/cardTitle/cardTitle.css +41 -0
- package/src/modules/dx/cardTitle/cardTitle.html +20 -0
- package/src/modules/dx/cardTitle/cardTitle.ts +27 -0
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.css +24 -0
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.html +20 -0
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.ts +18 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +14 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +26 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +13 -0
- package/src/modules/dx/checkbox/checkbox.css +168 -0
- package/src/modules/dx/checkbox/checkbox.html +26 -0
- package/src/modules/dx/checkbox/checkbox.ts +55 -0
- package/src/modules/dx/checkboxGroup/checkboxGroup.css +12 -0
- package/src/modules/dx/checkboxGroup/checkboxGroup.html +15 -0
- package/src/modules/dx/checkboxGroup/checkboxGroup.ts +77 -0
- package/src/modules/dx/codeBlock/codeBlock.css +128 -0
- package/src/modules/dx/codeBlock/codeBlock.html +79 -0
- package/src/modules/dx/codeBlock/codeBlock.ts +215 -0
- package/src/modules/dx/codeBlock/darkTheme.css +88 -0
- package/src/modules/dx/codeBlock/lightTheme.css +72 -0
- package/src/modules/dx/dropdown/dropdown.css +93 -0
- package/src/modules/dx/dropdown/dropdown.html +67 -0
- package/src/modules/dx/dropdown/dropdown.ts +182 -0
- package/src/modules/dx/dropdownOption/dropdownOption.css +61 -0
- package/src/modules/dx/dropdownOption/dropdownOption.html +53 -0
- package/src/modules/dx/dropdownOption/dropdownOption.ts +39 -0
- package/src/modules/dx/emptyState/emptyState.css +64 -0
- package/src/modules/dx/emptyState/emptyState.html +9 -0
- package/src/modules/dx/emptyState/emptyState.ts +20 -0
- package/src/modules/dx/feature/feature.css +135 -0
- package/src/modules/dx/feature/feature.html +33 -0
- package/src/modules/dx/feature/feature.ts +34 -0
- package/src/modules/dx/featureGrid/featureGrid.html +3 -0
- package/src/modules/dx/featureGrid/featureGrid.ts +15 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +469 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +96 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +113 -0
- package/src/modules/dx/featuredContentHeader/svgs.ts +35 -0
- package/src/modules/dx/featuresList/featuresList.css +24 -0
- package/src/modules/dx/featuresList/featuresList.html +20 -0
- package/src/modules/dx/featuresList/featuresList.ts +21 -0
- package/src/modules/dx/footer/footer.css +405 -0
- package/src/modules/dx/footer/footer.html +145 -0
- package/src/modules/dx/footer/footer.ts +124 -0
- package/src/modules/dx/footer/links.ts +140 -0
- package/src/modules/dx/footerOption/footerOption.css +4 -0
- package/src/modules/dx/footerOption/footerOption.html +12 -0
- package/src/modules/dx/footerOption/footerOption.ts +19 -0
- package/src/modules/dx/formattedDateTime/formattedDateTime.html +1 -0
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +72 -0
- package/src/modules/dx/grid/grid.css +48 -0
- package/src/modules/dx/grid/grid.html +3 -0
- package/src/modules/dx/grid/grid.md +14 -0
- package/src/modules/dx/grid/grid.ts +72 -0
- package/src/modules/dx/groupBio/groupBio.css +49 -0
- package/src/modules/dx/groupBio/groupBio.html +29 -0
- package/src/modules/dx/groupBio/groupBio.ts +41 -0
- package/src/modules/dx/groupText/groupText.css +119 -0
- package/src/modules/dx/groupText/groupText.html +65 -0
- package/src/modules/dx/groupText/groupText.ts +93 -0
- package/src/modules/dx/headTags/headTags.html +3 -0
- package/src/modules/dx/headTags/headTags.ts +39 -0
- package/src/modules/dx/header/__benchmarks__/header.benchmark.js +45 -0
- package/src/modules/dx/header/header.css +109 -0
- package/src/modules/dx/header/header.html +129 -0
- package/src/modules/dx/header/header.ts +27 -0
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +160 -0
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.html +73 -0
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +102 -0
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.css +5 -0
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.html +14 -0
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +20 -0
- package/src/modules/dx/headerNav/headerNav.css +31 -0
- package/src/modules/dx/headerNav/headerNav.html +48 -0
- package/src/modules/dx/headerNav/headerNav.ts +56 -0
- package/src/modules/dx/headerSearch/headerSearch.css +62 -0
- package/src/modules/dx/headerSearch/headerSearch.html +64 -0
- package/src/modules/dx/headerSearch/headerSearch.ts +159 -0
- package/src/modules/dx/helmet/helmet.css +83 -0
- package/src/modules/dx/helmet/helmet.html +39 -0
- package/src/modules/dx/helmet/helmet.ts +27 -0
- package/src/modules/dx/hr/hr.css +55 -0
- package/src/modules/dx/hr/hr.html +23 -0
- package/src/modules/dx/hr/hr.ts +45 -0
- package/src/modules/dx/icon/icon.css +14 -0
- package/src/modules/dx/icon/icon.html +11 -0
- package/src/modules/dx/icon/icon.ts +85 -0
- package/src/modules/dx/iconBadge/iconBadge.css +40 -0
- package/src/modules/dx/iconBadge/iconBadge.html +10 -0
- package/src/modules/dx/iconBadge/iconBadge.ts +42 -0
- package/src/modules/dx/imageAndLabel/imageAndLabel.css +54 -0
- package/src/modules/dx/imageAndLabel/imageAndLabel.html +22 -0
- package/src/modules/dx/imageAndLabel/imageAndLabel.ts +16 -0
- package/src/modules/dx/input/input.css +165 -0
- package/src/modules/dx/input/input.html +58 -0
- package/src/modules/dx/input/input.ts +238 -0
- package/src/modules/dx/input/validators.ts +5 -0
- package/src/modules/dx/instrumentation/instrumentation.html +1 -0
- package/src/modules/dx/instrumentation/instrumentation.ts +116 -0
- package/src/modules/dx/interactiveImage/interactiveImage.css +59 -0
- package/src/modules/dx/interactiveImage/interactiveImage.html +32 -0
- package/src/modules/dx/interactiveImage/interactiveImage.ts +71 -0
- package/src/modules/dx/lazy/lazy.html +5 -0
- package/src/modules/dx/lazy/lazy.ts +163 -0
- package/src/modules/dx/logo/logo.css +33 -0
- package/src/modules/dx/logo/logo.html +6 -0
- package/src/modules/dx/logo/logo.ts +8 -0
- package/src/modules/dx/newsletterForm/newsletterForm.css +73 -0
- package/src/modules/dx/newsletterForm/newsletterForm.html +73 -0
- package/src/modules/dx/newsletterForm/newsletterForm.ts +238 -0
- package/src/modules/dx/pagination/pagination.css +51 -0
- package/src/modules/dx/pagination/pagination.html +45 -0
- package/src/modules/dx/pagination/pagination.ts +93 -0
- package/src/modules/dx/podcastHost/podcastHost.css +62 -0
- package/src/modules/dx/podcastHost/podcastHost.html +28 -0
- package/src/modules/dx/podcastHost/podcastHost.ts +13 -0
- package/src/modules/dx/podcastPlayer/podcastPlayer.css +10 -0
- package/src/modules/dx/podcastPlayer/podcastPlayer.html +3 -0
- package/src/modules/dx/podcastPlayer/podcastPlayer.ts +5 -0
- package/src/modules/dx/podcastSubscription/podcastSubscription.css +91 -0
- package/src/modules/dx/podcastSubscription/podcastSubscription.html +24 -0
- package/src/modules/dx/podcastSubscription/podcastSubscription.ts +58 -0
- package/src/modules/dx/popover/popover.css +63 -0
- package/src/modules/dx/popover/popover.html +16 -0
- package/src/modules/dx/popover/popover.ts +313 -0
- package/src/modules/dx/radioGroup/radioGroup.css +12 -0
- package/src/modules/dx/radioGroup/radioGroup.html +16 -0
- package/src/modules/dx/radioGroup/radioGroup.ts +65 -0
- package/src/modules/dx/relativeDateTime/relativeDateTime.html +3 -0
- package/src/modules/dx/relativeDateTime/relativeDateTime.ts +113 -0
- package/src/modules/dx/searchResults/coveo.css +18989 -0
- package/src/modules/dx/searchResults/searchResults.css +387 -0
- package/src/modules/dx/searchResults/searchResults.html +104 -0
- package/src/modules/dx/searchResults/searchResults.ts +186 -0
- package/src/modules/dx/section/section.css +130 -0
- package/src/modules/dx/section/section.html +66 -0
- package/src/modules/dx/section/section.ts +41 -0
- package/src/modules/dx/sectionSignup/sectionSignup.css +43 -0
- package/src/modules/dx/sectionSignup/sectionSignup.html +23 -0
- package/src/modules/dx/sectionSignup/sectionSignup.ts +44 -0
- package/src/modules/dx/select/select.css +44 -0
- package/src/modules/dx/select/select.html +60 -0
- package/src/modules/dx/select/select.ts +23 -0
- package/src/modules/dx/sidebar/sidebar.css +192 -0
- package/src/modules/dx/sidebar/sidebar.html +94 -0
- package/src/modules/dx/sidebar/sidebar.ts +255 -0
- package/src/modules/dx/sidebarOld/sidebarOld.css +160 -0
- package/src/modules/dx/sidebarOld/sidebarOld.html +70 -0
- package/src/modules/dx/sidebarOld/sidebarOld.ts +187 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.css +3 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.html +26 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +437 -0
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +36 -0
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.html +14 -0
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.ts +70 -0
- package/src/modules/dx/skipNavLink/skipNavLink.css +21 -0
- package/src/modules/dx/skipNavLink/skipNavLink.html +3 -0
- package/src/modules/dx/skipNavLink/skipNavLink.ts +3 -0
- package/src/modules/dx/slackCta/slackCta.css +47 -0
- package/src/modules/dx/slackCta/slackCta.html +17 -0
- package/src/modules/dx/slackCta/slackCta.ts +12 -0
- package/src/modules/dx/socials/socials.css +35 -0
- package/src/modules/dx/socials/socials.html +22 -0
- package/src/modules/dx/socials/socials.ts +81 -0
- package/src/modules/dx/spinner/spinner.css +750 -0
- package/src/modules/dx/spinner/spinner.html +6 -0
- package/src/modules/dx/spinner/spinner.ts +20 -0
- package/src/modules/dx/tab/tab.css +106 -0
- package/src/modules/dx/tab/tab.html +13 -0
- package/src/modules/dx/tab/tab.ts +52 -0
- package/src/modules/dx/toc/toc.css +94 -0
- package/src/modules/dx/toc/toc.html +28 -0
- package/src/modules/dx/toc/toc.ts +77 -0
- package/src/modules/dx/tooltip/microtip.css +269 -0
- package/src/modules/dx/tooltip/tooltip.css +36 -0
- package/src/modules/dx/tooltip/tooltip.html +5 -0
- package/src/modules/dx/tooltip/tooltip.ts +6 -0
- package/src/modules/dx/topics/topics.css +25 -0
- package/src/modules/dx/topics/topics.html +12 -0
- package/src/modules/dx/topics/topics.ts +25 -0
- package/src/modules/dx/tree/tree.css +5 -0
- package/src/modules/dx/tree/tree.html +11 -0
- package/src/modules/dx/tree/tree.ts +72 -0
- package/src/modules/dx/tree/treeHandler.ts +100 -0
- package/src/modules/dx/treeItem/treeItem.css +14 -0
- package/src/modules/dx/treeItem/treeItem.html +22 -0
- package/src/modules/dx/treeItem/treeItem.ts +110 -0
- package/src/modules/dx/treeTile/treeTile.css +190 -0
- package/src/modules/dx/treeTile/treeTile.html +27 -0
- package/src/modules/dx/treeTile/treeTile.ts +59 -0
- package/src/modules/dx/typeBadge/typeBadge.css +74 -0
- package/src/modules/dx/typeBadge/typeBadge.html +5 -0
- package/src/modules/dx/typeBadge/typeBadge.ts +65 -0
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.css +12 -0
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.html +11 -0
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +18 -0
- package/src/modules/helpers/animations/animations.css +15 -0
- package/src/modules/helpers/button/button.css +4 -0
- package/src/modules/helpers/card/card.css +258 -0
- package/src/modules/helpers/code/code.css +296 -0
- package/src/modules/helpers/commonHeader/commonHeader.css +130 -0
- package/src/modules/helpers/reset/reset.css +559 -0
- package/src/modules/helpers/sidebar/sidebar.css +21 -0
- package/src/modules/helpers/slds/slds.css +191 -0
- package/src/modules/helpers/table/table.css +110 -0
- package/src/modules/helpers/text/text.css +163 -0
- package/src/modules/utils/coveo/coveo.ts +70 -0
- package/src/modules/utils/css/css.ts +43 -0
- package/src/modules/utils/devices/devices.ts +1 -0
- package/src/modules/utils/highlight/highlight.ts +32 -0
- package/src/modules/utils/normalizers/normalizers.ts +91 -0
- package/src/modules/utils/options/options.ts +39 -0
- package/src/modules/utils/prismjs/prismjs.html +3 -0
- package/src/modules/utils/prismjs/prismjs.ts +3321 -0
- package/src/modules/utils/recentSearches/recentSearches.ts +57 -0
- package/src/modules/utils/regexps/regexps.ts +5 -0
- package/src/modules/utils/seo/seo.ts +4 -0
- package/src/modules/utils/slot/slot.ts +17 -0
- package/src/modules/utils/wordpress/wordpress.ts +13 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { Breadcrumb, Option } from "typings/custom";
|
|
4
|
+
import { toJson } from "utils/normalizers";
|
|
5
|
+
|
|
6
|
+
type LabelMap = { [href: string]: string };
|
|
7
|
+
type NormalizedBreadcrumb = Breadcrumb & { last: boolean; asLink: boolean };
|
|
8
|
+
|
|
9
|
+
const toLabel = (val: string) => {
|
|
10
|
+
const noFileExt = val.replace(/\..+$/, "");
|
|
11
|
+
const spaces = noFileExt.replace(/-/g, " ");
|
|
12
|
+
const titlecase = spaces.replace(
|
|
13
|
+
/\w\S*/g,
|
|
14
|
+
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
|
15
|
+
);
|
|
16
|
+
return titlecase;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default class Breadcrumbs extends LightningElement {
|
|
20
|
+
@api ariaLabel: string = "Navigation Breadcrumbs";
|
|
21
|
+
@api baseHref: string = "/";
|
|
22
|
+
@api navItems: Option[] = [];
|
|
23
|
+
@api pathname: string = window.location.pathname;
|
|
24
|
+
@api title: string = "Salesforce";
|
|
25
|
+
@api logo: boolean = false;
|
|
26
|
+
@api truncate = false;
|
|
27
|
+
@api hideCurrentLocation = false;
|
|
28
|
+
|
|
29
|
+
@api
|
|
30
|
+
get breadcrumbs(): NormalizedBreadcrumb[] {
|
|
31
|
+
const breadcrumbs = this._breadcrumbs || this.autoBreadcrumbs;
|
|
32
|
+
return this.normalizeBreadcrumbs(
|
|
33
|
+
this.hideCurrentLocation && breadcrumbs.length > 1
|
|
34
|
+
? breadcrumbs.slice(0, breadcrumbs.length - 1)
|
|
35
|
+
: breadcrumbs
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
set breadcrumbs(value) {
|
|
39
|
+
this._breadcrumbs = toJson(value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private _breadcrumbs!: Breadcrumb[];
|
|
43
|
+
|
|
44
|
+
private get labelMap(): LabelMap {
|
|
45
|
+
const deepReducer = (options: Option[]) =>
|
|
46
|
+
options.reduce((acc: LabelMap, item: Option): LabelMap => {
|
|
47
|
+
if (item.options) {
|
|
48
|
+
return { ...acc, ...deepReducer(item.options) };
|
|
49
|
+
}
|
|
50
|
+
if (!item.link) {
|
|
51
|
+
return acc;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
...acc,
|
|
55
|
+
[item.link.href]: item.label
|
|
56
|
+
};
|
|
57
|
+
}, {});
|
|
58
|
+
return this.navItems ? deepReducer(this.navItems) : {};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private get autoBreadcrumbs() {
|
|
62
|
+
if (!this.pathname || this.pathname === "/") {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
// assumes url starts with "/", which it always should
|
|
66
|
+
const pieces = this.pathname.slice(1).split("/");
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
return pieces.reduce((acc, val, i) => {
|
|
69
|
+
const href = `/${pieces.slice(0, i + 1).join("/")}`;
|
|
70
|
+
const label = this.labelMap[href] || toLabel(val);
|
|
71
|
+
return [
|
|
72
|
+
...acc,
|
|
73
|
+
{
|
|
74
|
+
href,
|
|
75
|
+
label
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
}, []) as { href: string; label: string }[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private normalizeBreadcrumbs(
|
|
82
|
+
breadcrumbs: Breadcrumb[]
|
|
83
|
+
): NormalizedBreadcrumb[] {
|
|
84
|
+
const { length } = breadcrumbs;
|
|
85
|
+
return breadcrumbs.map(
|
|
86
|
+
(breadcrumb, i): NormalizedBreadcrumb => {
|
|
87
|
+
const last = i === length - 1;
|
|
88
|
+
return {
|
|
89
|
+
...breadcrumb,
|
|
90
|
+
asLink: this.hideCurrentLocation || !last,
|
|
91
|
+
last
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private get breadcrumbDropdownOptions() {
|
|
98
|
+
if (this.breadcrumbs.length < 2) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return this.breadcrumbs
|
|
102
|
+
.slice(0, this.breadcrumbs.length - 1)
|
|
103
|
+
.map((link) => ({
|
|
104
|
+
id: link.href,
|
|
105
|
+
label: link.label,
|
|
106
|
+
link: {
|
|
107
|
+
href: link.href
|
|
108
|
+
}
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private get breadcrumbsEmpty(): boolean {
|
|
113
|
+
return this.breadcrumbs.length === 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private get className(): string {
|
|
117
|
+
return cx(
|
|
118
|
+
this.truncate && this.breadcrumbs.length > 3 && "state-long",
|
|
119
|
+
this.hideCurrentLocation && "hide-current-location"
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
@import "helpers/reset";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
width: min-content;
|
|
5
|
+
font-size: inherit;
|
|
6
|
+
|
|
7
|
+
--dx-c-button-primary-color: var(--dx-g-blue-vibrant-50);
|
|
8
|
+
--dx-c-button-primary-color-hover: var(--dx-g-blue-vibrant-40);
|
|
9
|
+
--dx-c-button-secondary-color-hover: var(--dx-g-cloud-blue-vibrant-90);
|
|
10
|
+
--dx-c-button-inline-color-hover: var(--dx-g-blue-vibrant-30);
|
|
11
|
+
--dx-c-button-justify-content: center;
|
|
12
|
+
--dx-c-button-opacity: 1;
|
|
13
|
+
--dx-c-button-font-size: var(--dx-g-text-sm);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.button {
|
|
17
|
+
opacity: var(--dx-c-button-opacity);
|
|
18
|
+
width: inherit;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: var(--dx-c-button-justify-content);
|
|
22
|
+
user-select: none;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
font-size: var(--dx-c-button-font-size);
|
|
25
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
26
|
+
padding: 0 var(--dx-c-button-horizontal-spacing, var(--dx-g-spacing-md));
|
|
27
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.button:focus {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.button.variant_inline-inherit {
|
|
35
|
+
font-size: inherit;
|
|
36
|
+
text-transform: inherit;
|
|
37
|
+
user-select: inherit;
|
|
38
|
+
white-space: normal;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.button dx-icon {
|
|
42
|
+
display: inline;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.button.variant_inline dx-icon,
|
|
46
|
+
.button.variant_inline-inherit dx-icon {
|
|
47
|
+
display: inline-block;
|
|
48
|
+
transform: translate(0, -2px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.button > span {
|
|
52
|
+
font-family: inherit;
|
|
53
|
+
font-size: inherit;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button:not(.variant_inline-inherit).font-display {
|
|
57
|
+
font-family: var(--dx-g-font-display);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.button.font-display:not(.variant_inline):not(.variant_inline-inherit) > span {
|
|
61
|
+
/* offset accounts for display font's ghost padding */
|
|
62
|
+
margin-top: 5px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.button.font-sans {
|
|
66
|
+
font-family: var(--dx-g-font-sans);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.button.icon-right:not(.slot-empty) > *:nth-child(2) {
|
|
70
|
+
margin-left: var(--dx-g-spacing-sm);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.button.icon-left:not(.slot-empty) > *:nth-child(2) {
|
|
74
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.button.style-icon.slot-empty {
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.icon-right {
|
|
82
|
+
flex-direction: row;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.icon-left {
|
|
86
|
+
flex-direction: row-reverse;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* sizes */
|
|
90
|
+
|
|
91
|
+
.button.size-large {
|
|
92
|
+
height: var(--dx-g-spacing-3xl);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.button.size-large.style-icon.slot-empty {
|
|
96
|
+
width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-3xl));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.button.size-small {
|
|
100
|
+
height: var(--dx-g-spacing-xl);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.button.size-small.style-icon.slot-empty {
|
|
104
|
+
width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-xl));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* primary */
|
|
108
|
+
|
|
109
|
+
.button.variant_primary {
|
|
110
|
+
color: white;
|
|
111
|
+
background: var(--dx-c-button-primary-color);
|
|
112
|
+
border: 1px solid var(--dx-c-button-primary-color);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.button.variant_primary:hover {
|
|
116
|
+
background: var(--dx-c-button-primary-color-hover);
|
|
117
|
+
border-color: var(--dx-c-button-primary-color-hover);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* secondary */
|
|
121
|
+
|
|
122
|
+
.button.variant_secondary {
|
|
123
|
+
color: var(--dx-c-button-primary-color);
|
|
124
|
+
background: transparent;
|
|
125
|
+
border: 1px solid var(--dx-c-button-primary-color);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.button.variant_secondary:hover {
|
|
129
|
+
background: var(--dx-c-button-secondary-color-hover);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* text primary */
|
|
133
|
+
|
|
134
|
+
.button.variant_tertiary,
|
|
135
|
+
.button.variant_inline,
|
|
136
|
+
.button.variant_inline-inherit {
|
|
137
|
+
color: var(--dx-c-button-primary-color);
|
|
138
|
+
border: 1px solid transparent;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.button.variant_tertiary:hover {
|
|
142
|
+
background: var(--dx-c-button-secondary-color-hover);
|
|
143
|
+
border-color: var(--dx-c-button-secondary-color-hover);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* inline */
|
|
147
|
+
.button.variant_inline,
|
|
148
|
+
.button.variant_inline-inherit {
|
|
149
|
+
display: inline;
|
|
150
|
+
padding: 0;
|
|
151
|
+
height: unset; /* please leave this here, actually is having an effect */
|
|
152
|
+
width: unset; /* please leave this here, actually is having an effect */
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.button.variant_inline:hover,
|
|
156
|
+
.button.variant_inline-inherit:hover {
|
|
157
|
+
color: var(--dx-c-button-inline-color-hover);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.button.state-disabled {
|
|
161
|
+
pointer-events: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* custom */
|
|
165
|
+
.button.variant_custom {
|
|
166
|
+
color: var(--dx-c-button-custom-color);
|
|
167
|
+
background: var(--dx-c-button-custom-background);
|
|
168
|
+
border: 1px solid var(--dx-c-button-custom-border);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.button.variant_custom:hover {
|
|
172
|
+
color: var(--dx-c-button-custom-color-hover);
|
|
173
|
+
background: var(--dx-c-button-custom-background-hover);
|
|
174
|
+
border-color: var(--dx-c-button-custom-border-hover);
|
|
175
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
if:false={href}
|
|
4
|
+
class={className}
|
|
5
|
+
disabled={disabled}
|
|
6
|
+
type={type}
|
|
7
|
+
aria-label={ariaLabel}
|
|
8
|
+
part="container"
|
|
9
|
+
>
|
|
10
|
+
<span if:false={loading}>
|
|
11
|
+
<slot onslotchange={onSlotChange}></slot>
|
|
12
|
+
</span>
|
|
13
|
+
<dx-icon
|
|
14
|
+
if:true={showIcon}
|
|
15
|
+
sprite={iconSprite}
|
|
16
|
+
size={iconSize}
|
|
17
|
+
symbol={iconSymbol}
|
|
18
|
+
></dx-icon>
|
|
19
|
+
<span class="temp-loading-message" if:true={loading}>Loading...</span>
|
|
20
|
+
</button>
|
|
21
|
+
<a
|
|
22
|
+
if:true={href}
|
|
23
|
+
href={href}
|
|
24
|
+
target={target}
|
|
25
|
+
rel={rel}
|
|
26
|
+
class={className}
|
|
27
|
+
disabled={disabled}
|
|
28
|
+
download={download}
|
|
29
|
+
aria-label={ariaLabel}
|
|
30
|
+
part="container"
|
|
31
|
+
>
|
|
32
|
+
<span if:false={loading}>
|
|
33
|
+
<slot onslotchange={onSlotChange}></slot>
|
|
34
|
+
</span>
|
|
35
|
+
<dx-icon
|
|
36
|
+
if:true={showIcon}
|
|
37
|
+
sprite={iconSprite}
|
|
38
|
+
size={iconSize}
|
|
39
|
+
symbol={iconSymbol}
|
|
40
|
+
></dx-icon>
|
|
41
|
+
<span class="temp-loading-message" if:true={loading}>Loading...</span>
|
|
42
|
+
</a>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import {
|
|
4
|
+
ButtonVariant,
|
|
5
|
+
IconSprite,
|
|
6
|
+
IconSize,
|
|
7
|
+
IconSymbol,
|
|
8
|
+
LightningSlotElement
|
|
9
|
+
} from "typings/custom";
|
|
10
|
+
|
|
11
|
+
export default class Button extends LightningElement {
|
|
12
|
+
@api ariaLabel: string = "";
|
|
13
|
+
@api disabled: boolean | null = null;
|
|
14
|
+
@api iconSize?: IconSize = "small";
|
|
15
|
+
@api iconSprite?: IconSprite = "utility";
|
|
16
|
+
@api iconSymbol?: IconSymbol;
|
|
17
|
+
@api iconPosition?: "right" | "left" = "right";
|
|
18
|
+
@api loading: boolean = false;
|
|
19
|
+
@api size: "large" | "small" = "small";
|
|
20
|
+
@api variant: ButtonVariant = "primary";
|
|
21
|
+
@api font: "display" | "sans" = "display";
|
|
22
|
+
|
|
23
|
+
// button props
|
|
24
|
+
@api type: "submit" | "reset" | "button" = "button";
|
|
25
|
+
|
|
26
|
+
// link props
|
|
27
|
+
@api href: string | null = null;
|
|
28
|
+
@api download: string | null = null;
|
|
29
|
+
@api target: "_self" | "_blank" | "_parent" | "_top" | null = null;
|
|
30
|
+
@api rel: string | null = null;
|
|
31
|
+
|
|
32
|
+
@api focus() {
|
|
33
|
+
const button = this.template.querySelector(".button");
|
|
34
|
+
if (button) {
|
|
35
|
+
button.focus();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private isSlotEmpty: boolean = true;
|
|
40
|
+
|
|
41
|
+
private get showIcon(): boolean {
|
|
42
|
+
return !!this.iconSymbol && !this.loading;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private get className(): string {
|
|
46
|
+
return cx(
|
|
47
|
+
"button",
|
|
48
|
+
this.disabled && "state-disabled",
|
|
49
|
+
`variant_${this.variant}`,
|
|
50
|
+
this.loading && "state-loading",
|
|
51
|
+
`size-${this.size}`,
|
|
52
|
+
!!this.iconSymbol && "style-icon",
|
|
53
|
+
this.isSlotEmpty && "slot-empty",
|
|
54
|
+
`font-${this.font}`,
|
|
55
|
+
this.iconPosition === "right" ? "icon-right" : "icon-left"
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private onSlotChange(e: LightningSlotElement) {
|
|
60
|
+
const slot = e.target;
|
|
61
|
+
this.isSlotEmpty = slot.assignedElements().length !== 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dx-card-content
|
|
3
|
+
author-href={authorHref}
|
|
4
|
+
author-img-src={authorImgSrc}
|
|
5
|
+
author-label={authorLabel}
|
|
6
|
+
body={body}
|
|
7
|
+
featured={featured}
|
|
8
|
+
href={href}
|
|
9
|
+
img-alt={imgAlt}
|
|
10
|
+
img-src={imgSrc}
|
|
11
|
+
label={label}
|
|
12
|
+
target={target}
|
|
13
|
+
title={title}
|
|
14
|
+
>
|
|
15
|
+
<dx-formatted-date-time
|
|
16
|
+
if:true={_datetime}
|
|
17
|
+
slot="datetime"
|
|
18
|
+
day="2-digit"
|
|
19
|
+
month="long"
|
|
20
|
+
year="numeric"
|
|
21
|
+
value={_datetime}
|
|
22
|
+
></dx-formatted-date-time>
|
|
23
|
+
</dx-card-content>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class CardBlogPost extends LightningElement {
|
|
4
|
+
@api authorHref?: string | null = null;
|
|
5
|
+
@api authorImgSrc!: string | null;
|
|
6
|
+
@api authorLabel!: string | null;
|
|
7
|
+
@api body!: string;
|
|
8
|
+
@api datetime!: string;
|
|
9
|
+
@api dateTime?: string | null = null;
|
|
10
|
+
@api featured?: boolean = false;
|
|
11
|
+
@api href!: string;
|
|
12
|
+
@api imgAlt?: string;
|
|
13
|
+
@api imgSrc?: string | null;
|
|
14
|
+
@api label?: string;
|
|
15
|
+
@api target?: string | null = null;
|
|
16
|
+
@api title!: string;
|
|
17
|
+
|
|
18
|
+
// LWC is being compiled so that datetime is being interpreted as date-time
|
|
19
|
+
// ONLY from from the implementation in dx-card-blog-post-provider
|
|
20
|
+
private get _datetime() {
|
|
21
|
+
return this.datetime || this.dateTime;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template for:each={posts} for:item="post">
|
|
3
|
+
<dx-card-blog-post
|
|
4
|
+
label="BLOG POST"
|
|
5
|
+
author-img-src={post.authorImgSrc}
|
|
6
|
+
author-label={post.authorName}
|
|
7
|
+
body={post.body}
|
|
8
|
+
datetime={post.datetime}
|
|
9
|
+
href={post.href}
|
|
10
|
+
img-alt={post.imgAlt}
|
|
11
|
+
img-src={post.imgSrc}
|
|
12
|
+
key={post.id}
|
|
13
|
+
title={post.title}
|
|
14
|
+
></dx-card-blog-post>
|
|
15
|
+
</template>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LightningElement, api, track } from "lwc";
|
|
2
|
+
import { fetchWordpressPosts } from "utils/wordpress";
|
|
3
|
+
import { normalizePost } from "utils/normalizers";
|
|
4
|
+
|
|
5
|
+
type BlogPost = {
|
|
6
|
+
body: string;
|
|
7
|
+
datetime: string;
|
|
8
|
+
href: string;
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default class CardBlogPostProvider extends LightningElement {
|
|
14
|
+
@api count?: string;
|
|
15
|
+
|
|
16
|
+
@track posts: BlogPost[] = [];
|
|
17
|
+
|
|
18
|
+
private fetchPosts = async () => {
|
|
19
|
+
this.posts = await fetchWordpressPosts(
|
|
20
|
+
"/blogs/api",
|
|
21
|
+
normalizePost,
|
|
22
|
+
this.count
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
this.fetchPosts();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@import "helpers/reset";
|
|
2
|
+
@import "helpers/text";
|
|
3
|
+
@import "helpers/card";
|
|
4
|
+
|
|
5
|
+
.card-callout {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* in the callout card's case it needs to be subservient to the other items in the grid */
|
|
12
|
+
.dx-card-base_override-width {
|
|
13
|
+
height: 100% !important;
|
|
14
|
+
min-height: unset !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* title */
|
|
18
|
+
|
|
19
|
+
.dx-text-heading-3 {
|
|
20
|
+
color: inherit;
|
|
21
|
+
margin-bottom: var(--dx-g-spacing-3xl);
|
|
22
|
+
overflow-wrap: hyphenate-word;
|
|
23
|
+
hyphens: overflow;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* label */
|
|
27
|
+
|
|
28
|
+
.dx-text-button-light {
|
|
29
|
+
color: inherit;
|
|
30
|
+
margin-top: auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* callout arrow */
|
|
34
|
+
|
|
35
|
+
dx-icon {
|
|
36
|
+
display: inline;
|
|
37
|
+
color: inherit;
|
|
38
|
+
margin-left: var(--dx-g-spacing-sm);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
dx-icon::part(svg) {
|
|
42
|
+
transition: var(--dx-g-transition-transform-2x);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.card-callout:hover dx-icon::part(svg) {
|
|
46
|
+
transform: translate(var(--dx-g-spacing-xs));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.card-callout:active dx-icon::part(svg) {
|
|
50
|
+
transform: translate(var(--dx-g-spacing-2xs));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media screen and (max-width: 1024px) {
|
|
54
|
+
.dx-text-heading-3 {
|
|
55
|
+
margin-bottom: var(--dx-g-spacing-xl);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
class={className}
|
|
4
|
+
href={href}
|
|
5
|
+
target={target}
|
|
6
|
+
style={style}
|
|
7
|
+
onclick={sendGtm}
|
|
8
|
+
>
|
|
9
|
+
<h3 class="dx-text-heading-3">{title}</h3>
|
|
10
|
+
<span class="dx-text-button-light">
|
|
11
|
+
{label}
|
|
12
|
+
<dx-icon symbol="forward"></dx-icon>
|
|
13
|
+
</span>
|
|
14
|
+
</a>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { toDxColor } from "utils/css";
|
|
4
|
+
import { track } from "dx/instrumentation";
|
|
5
|
+
|
|
6
|
+
export default class CardCallout extends LightningElement {
|
|
7
|
+
@api backgroundColor?: string = "indigo-vibrant-40";
|
|
8
|
+
@api color?: string = "white";
|
|
9
|
+
@api href!: string;
|
|
10
|
+
@api label: string = "";
|
|
11
|
+
@api target?: string | null = null;
|
|
12
|
+
@api title!: string;
|
|
13
|
+
|
|
14
|
+
private get style(): string {
|
|
15
|
+
const background = `background-color: ${toDxColor(
|
|
16
|
+
this.backgroundColor
|
|
17
|
+
)};`;
|
|
18
|
+
const color = `color: ${toDxColor(this.color)};`;
|
|
19
|
+
return [background, color].join(" ");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private get className(): string {
|
|
23
|
+
return cx(
|
|
24
|
+
"card-callout",
|
|
25
|
+
"dx-card-base",
|
|
26
|
+
"dx-card-base_section-vertical"
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private sendGtm(e: PointerEvent) {
|
|
31
|
+
track(e.currentTarget, "select_content", {
|
|
32
|
+
content_type: "callout",
|
|
33
|
+
item_title: this.title,
|
|
34
|
+
item_location: this.href
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import "helpers/reset";
|
|
2
|
+
@import "helpers/text";
|
|
3
|
+
@import "helpers/card";
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
/* because this is used within other cards */
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.card-content {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.card-content:not(.dx-card-base_layout-horizontal) {
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.hide-datetime .datetime {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.hide-datetime .body {
|
|
24
|
+
margin-bottom: 0 !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* mobile responsiveness */
|
|
28
|
+
|
|
29
|
+
@media screen and (max-width: 1024px) {
|
|
30
|
+
.card-content:not(.dx-card-base_featured) {
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.card-content:not(.dx-card-base_featured) .image-link {
|
|
35
|
+
margin-right: var(--dx-g-card-img-spacing);
|
|
36
|
+
margin-bottom: unset;
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
height: 80px;
|
|
39
|
+
width: 80px;
|
|
40
|
+
padding-top: unset;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.card-content.has-image:not(.dx-card-base_featured)
|
|
44
|
+
dx-image-and-label::part(image) {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.card-content:not(.dx-card-base_featured) .label,
|
|
49
|
+
.card-content:not(.dx-card-base_featured) .datetime {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
}
|