@salesforcedevs/dx-components 0.0.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/LICENSE +12 -0
- package/lwc.config.json +96 -0
- package/package.json +32 -0
- 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 +608 -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/no-results-combined.svg +80 -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-item-loading.svg +3 -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/subscribe-background-left.svg +14 -0
- package/src/assets/svg/subscribe-background-right.svg +11 -0
- package/src/assets/svg/trees.svg +42 -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 +12 -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 +123 -0
- package/src/modules/dx/button/button.css +198 -0
- package/src/modules/dx/button/button.html +43 -0
- package/src/modules/dx/button/button.ts +68 -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/cardCallout/cardCallout.css +57 -0
- package/src/modules/dx/cardCallout/cardCallout.html +15 -0
- package/src/modules/dx/cardCallout/cardCallout.ts +41 -0
- package/src/modules/dx/cardContent/cardContent.css +52 -0
- package/src/modules/dx/cardContent/cardContent.html +62 -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 +23 -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 +50 -0
- package/src/modules/dx/cardExpanded/cardExpanded.html +36 -0
- package/src/modules/dx/cardExpanded/cardExpanded.ts +44 -0
- package/src/modules/dx/cardGridDocs/cardGridDocs.css +74 -0
- package/src/modules/dx/cardGridDocs/cardGridDocs.html +67 -0
- package/src/modules/dx/cardGridDocs/cardGridDocs.ts +86 -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 +39 -0
- package/src/modules/dx/cardNews/cardNews.ts +77 -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/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 +43 -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/cardTrial/cardTrial.css +71 -0
- package/src/modules/dx/cardTrial/cardTrial.html +31 -0
- package/src/modules/dx/cardTrial/cardTrial.ts +34 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +14 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +27 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +13 -0
- package/src/modules/dx/checkbox/checkbox.css +172 -0
- package/src/modules/dx/checkbox/checkbox.html +26 -0
- package/src/modules/dx/checkbox/checkbox.ts +56 -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/checkboxNative/checkboxNative.css +21 -0
- package/src/modules/dx/checkboxNative/checkboxNative.html +14 -0
- package/src/modules/dx/checkboxNative/checkboxNative.ts +39 -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 +222 -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 +73 -0
- package/src/modules/dx/dropdown/dropdown.ts +193 -0
- package/src/modules/dx/dropdownOption/dropdownOption.css +179 -0
- package/src/modules/dx/dropdownOption/dropdownOption.html +57 -0
- package/src/modules/dx/dropdownOption/dropdownOption.ts +67 -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 +468 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +109 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +102 -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/filterMenu/filterMenu.css +138 -0
- package/src/modules/dx/filterMenu/filterMenu.html +116 -0
- package/src/modules/dx/filterMenu/filterMenu.ts +119 -0
- package/src/modules/dx/footer/footer.css +405 -0
- package/src/modules/dx/footer/footer.html +150 -0
- package/src/modules/dx/footer/footer.ts +129 -0
- package/src/modules/dx/footer/links.ts +206 -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 +77 -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 +74 -0
- package/src/modules/dx/groupText/groupText.css +119 -0
- package/src/modules/dx/groupText/groupText.html +68 -0
- package/src/modules/dx/groupText/groupText.ts +111 -0
- package/src/modules/dx/header/__benchmarks__/header.benchmark.js +45 -0
- package/src/modules/dx/header/header.css +99 -0
- package/src/modules/dx/header/header.html +122 -0
- package/src/modules/dx/header/header.ts +13 -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 +62 -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 +56 -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 +52 -0
- package/src/modules/dx/iconBadge/iconBadge.html +5 -0
- package/src/modules/dx/iconBadge/iconBadge.ts +52 -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 +181 -0
- package/src/modules/dx/input/input.html +62 -0
- package/src/modules/dx/input/input.ts +246 -0
- package/src/modules/dx/input/validators.ts +5 -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/modalDrawer/modalDrawer.css +41 -0
- package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
- package/src/modules/dx/modalDrawer/modalDrawer.ts +27 -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 +135 -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/popover/popover.css +65 -0
- package/src/modules/dx/popover/popover.html +16 -0
- package/src/modules/dx/popover/popover.ts +306 -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 +187 -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 +221 -0
- package/src/modules/dx/select/select.html +57 -0
- package/src/modules/dx/select/select.ts +141 -0
- package/src/modules/dx/sidebar/sidebar.css +48 -0
- package/src/modules/dx/sidebar/sidebar.html +95 -0
- package/src/modules/dx/sidebar/sidebar.ts +258 -0
- package/src/modules/dx/sidebarOld/sidebarOld.css +16 -0
- package/src/modules/dx/sidebarOld/sidebarOld.html +74 -0
- package/src/modules/dx/sidebarOld/sidebarOld.ts +194 -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 +463 -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/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 +743 -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 +106 -0
- package/src/modules/dx/toc/toc.html +29 -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 +37 -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 +26 -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 +80 -0
- package/src/modules/dx/tree/treeHandler.ts +101 -0
- package/src/modules/dx/treeItem/treeItem.css +25 -0
- package/src/modules/dx/treeItem/treeItem.html +29 -0
- package/src/modules/dx/treeItem/treeItem.ts +146 -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 +60 -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/dx/vimeoPlayer/vimeoPlayer.css +1 -0
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.html +3 -0
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.ts +31 -0
- package/src/modules/dxBaseElements/archiveCard/archiveCard.ts +35 -0
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +205 -0
- package/src/modules/dxBaseElements/matchMediaElement/matchMediaElement.ts +59 -0
- package/src/modules/dxBaseElements/sidebarBase/sidebarBase.ts +65 -0
- package/src/modules/dxHelpers/animations/animations.css +15 -0
- package/src/modules/dxHelpers/button/button.css +4 -0
- package/src/modules/dxHelpers/card/card.css +263 -0
- package/src/modules/dxHelpers/code/code.css +296 -0
- package/src/modules/dxHelpers/commonHeader/commonHeader.css +130 -0
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +145 -0
- package/src/modules/dxHelpers/commonTreeItem/commonTreeItem.css +21 -0
- package/src/modules/dxHelpers/reset/reset.css +559 -0
- package/src/modules/dxHelpers/scrollbar/scrollbar.css +31 -0
- package/src/modules/dxHelpers/table/table.css +110 -0
- package/src/modules/dxHelpers/text/text.css +197 -0
- package/src/modules/dxUtils/analytics/analytics.ts +24 -0
- package/src/modules/dxUtils/browser/browser.ts +17 -0
- package/src/modules/dxUtils/constants/breakpoints.ts +9 -0
- package/src/modules/dxUtils/constants/constants.ts +1 -0
- package/src/modules/dxUtils/coveo/coveo.ts +70 -0
- package/src/modules/dxUtils/css/css.ts +43 -0
- package/src/modules/dxUtils/dates/dates.ts +60 -0
- package/src/modules/dxUtils/devices/devices.ts +1 -0
- package/src/modules/dxUtils/highlight/highlight.ts +32 -0
- package/src/modules/dxUtils/language/language.ts +21 -0
- package/src/modules/dxUtils/lwc/lwc.ts +9 -0
- package/src/modules/dxUtils/normalizers/normalizers.ts +80 -0
- package/src/modules/dxUtils/options/options.ts +43 -0
- package/src/modules/dxUtils/prismjs/prismjs.html +3 -0
- package/src/modules/dxUtils/prismjs/prismjs.ts +3937 -0
- package/src/modules/dxUtils/queryCoordinator/queryCoordinator.ts +43 -0
- package/src/modules/dxUtils/recentSearches/recentSearches.ts +57 -0
- package/src/modules/dxUtils/regexps/regexps.ts +5 -0
- package/src/modules/dxUtils/seo/seo.ts +4 -0
- package/src/modules/dxUtils/slot/slot.ts +17 -0
- package/src/modules/dxUtils/wordpress/wordpress.ts +13 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { Breadcrumb, OptionWithNested } from "typings/custom";
|
|
4
|
+
import { toJson } from "dxUtils/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: OptionWithNested[] = [];
|
|
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: OptionWithNested[]) =>
|
|
46
|
+
options.reduce(
|
|
47
|
+
(acc: LabelMap, item: OptionWithNested): LabelMap => {
|
|
48
|
+
if (item.options) {
|
|
49
|
+
return { ...acc, ...deepReducer(item.options) };
|
|
50
|
+
}
|
|
51
|
+
if (!item.link) {
|
|
52
|
+
return acc;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
...acc,
|
|
56
|
+
[item.link.href]: item.label
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
{}
|
|
60
|
+
);
|
|
61
|
+
return this.navItems ? deepReducer(this.navItems) : {};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private get autoBreadcrumbs() {
|
|
65
|
+
if (!this.pathname || this.pathname === "/") {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
// assumes url starts with "/", which it always should
|
|
69
|
+
const pieces = this.pathname.slice(1).split("/");
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
return pieces.reduce((acc, val, i) => {
|
|
72
|
+
const href = `/${pieces.slice(0, i + 1).join("/")}`;
|
|
73
|
+
const label = this.labelMap[href] || toLabel(val);
|
|
74
|
+
return [
|
|
75
|
+
...acc,
|
|
76
|
+
{
|
|
77
|
+
href,
|
|
78
|
+
label
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
}, []) as { href: string; label: string }[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private normalizeBreadcrumbs(
|
|
85
|
+
breadcrumbs: Breadcrumb[]
|
|
86
|
+
): NormalizedBreadcrumb[] {
|
|
87
|
+
const { length } = breadcrumbs;
|
|
88
|
+
return breadcrumbs.map((breadcrumb, i): NormalizedBreadcrumb => {
|
|
89
|
+
const last = i === length - 1;
|
|
90
|
+
return {
|
|
91
|
+
...breadcrumb,
|
|
92
|
+
asLink: this.hideCurrentLocation || !last,
|
|
93
|
+
last
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private get breadcrumbDropdownOptions() {
|
|
99
|
+
if (this.breadcrumbs.length < 2) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return this.breadcrumbs
|
|
103
|
+
.slice(0, this.breadcrumbs.length - 1)
|
|
104
|
+
.map((link) => ({
|
|
105
|
+
id: link.href,
|
|
106
|
+
label: link.label,
|
|
107
|
+
link: {
|
|
108
|
+
href: link.href
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private get breadcrumbsEmpty(): boolean {
|
|
114
|
+
return this.breadcrumbs.length === 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
private get className(): string {
|
|
118
|
+
return cx(
|
|
119
|
+
this.truncate && this.breadcrumbs.length > 3 && "state-long",
|
|
120
|
+
this.hideCurrentLocation && "hide-current-location"
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@import "dxHelpers/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:focus:not(:focus-visible) {
|
|
35
|
+
outline: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.button.variant_inline-inherit {
|
|
39
|
+
font-size: inherit;
|
|
40
|
+
text-transform: inherit;
|
|
41
|
+
user-select: inherit;
|
|
42
|
+
white-space: normal;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.button dx-icon {
|
|
46
|
+
display: inline;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.button.variant_inline dx-icon,
|
|
50
|
+
.button.variant_inline-inherit dx-icon {
|
|
51
|
+
display: inline-block;
|
|
52
|
+
transform: translate(0, -2px);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.button > span {
|
|
56
|
+
font-family: inherit;
|
|
57
|
+
font-size: inherit;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.button:not(.variant_inline-inherit).font-display {
|
|
61
|
+
font-family: var(--dx-g-font-display);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.button.font-display:not(.variant_inline):not(.variant_inline-inherit) > span {
|
|
65
|
+
/* offset accounts for display font's ghost padding */
|
|
66
|
+
margin-top: 5px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.button.font-sans {
|
|
70
|
+
font-family: var(--dx-g-font-sans);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.button.icon-right:not(.slot-empty) > *:nth-child(2) {
|
|
74
|
+
margin-left: var(--dx-g-spacing-sm);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.button.icon-left:not(.slot-empty) > *:nth-child(2) {
|
|
78
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.button.style-icon.slot-empty {
|
|
82
|
+
padding: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.icon-right {
|
|
86
|
+
flex-direction: row;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.icon-left {
|
|
90
|
+
flex-direction: row-reverse;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* sizes */
|
|
94
|
+
|
|
95
|
+
.button.size-large {
|
|
96
|
+
height: var(--dx-g-spacing-3xl);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.button.size-large.style-icon.slot-empty {
|
|
100
|
+
width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-3xl));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.button.size-small {
|
|
104
|
+
height: var(--dx-g-spacing-xl);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.button.size-small.style-icon.slot-empty {
|
|
108
|
+
width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-xl));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.button.size-hero {
|
|
112
|
+
font-size: var(--dx-g-text-lg);
|
|
113
|
+
height: 52px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.button.size-hero.style-icon.slot-empty {
|
|
117
|
+
width: var(--dx-c-slot-empty-width, 52px);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* primary */
|
|
121
|
+
|
|
122
|
+
.button.variant_primary {
|
|
123
|
+
color: white;
|
|
124
|
+
background: var(--dx-c-button-primary-color);
|
|
125
|
+
border: 1px solid var(--dx-c-button-primary-color);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.button.variant_primary:hover,
|
|
129
|
+
:host([aria-expanded="true"]) .button.variant_primary {
|
|
130
|
+
background: var(--dx-c-button-primary-color-hover);
|
|
131
|
+
border-color: var(--dx-c-button-primary-color-hover);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* secondary */
|
|
135
|
+
|
|
136
|
+
.button.variant_secondary {
|
|
137
|
+
color: var(--dx-c-button-primary-color);
|
|
138
|
+
background: transparent;
|
|
139
|
+
border: 1px solid var(--dx-c-button-primary-color);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.button.variant_secondary:hover,
|
|
143
|
+
:host([aria-expanded="true"]) .button.variant_secondary {
|
|
144
|
+
background: var(--dx-c-button-secondary-color-hover);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* text primary */
|
|
148
|
+
|
|
149
|
+
.button.variant_tertiary,
|
|
150
|
+
.button.variant_inline,
|
|
151
|
+
.button.variant_inline-inherit {
|
|
152
|
+
color: var(--dx-c-button-primary-color);
|
|
153
|
+
border: 1px solid transparent;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.button.variant_inline.light-text {
|
|
157
|
+
color: white;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.button.variant_tertiary:hover,
|
|
161
|
+
:host([aria-expanded="true"]) .button.variant_tertiary {
|
|
162
|
+
background: var(--dx-c-button-secondary-color-hover);
|
|
163
|
+
border-color: var(--dx-c-button-secondary-color-hover);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* inline */
|
|
167
|
+
.button.variant_inline,
|
|
168
|
+
.button.variant_inline-inherit {
|
|
169
|
+
display: inline;
|
|
170
|
+
padding: 0;
|
|
171
|
+
height: unset; /* please leave this here, actually is having an effect */
|
|
172
|
+
width: unset; /* please leave this here, actually is having an effect */
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.button.variant_inline:hover,
|
|
176
|
+
.button.variant_inline-inherit:hover,
|
|
177
|
+
:host([aria-expanded="true"])
|
|
178
|
+
:is(.button.variant_inline, .button.variant_inline-inherit) {
|
|
179
|
+
color: var(--dx-c-button-inline-color-hover);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.button.state-disabled {
|
|
183
|
+
pointer-events: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* custom */
|
|
187
|
+
.button.variant_custom {
|
|
188
|
+
color: var(--dx-c-button-custom-color);
|
|
189
|
+
background: var(--dx-c-button-custom-background);
|
|
190
|
+
border: 1px solid var(--dx-c-button-custom-border);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.button.variant_custom:hover,
|
|
194
|
+
:host([aria-expanded="true"]) .button.variant_custom {
|
|
195
|
+
color: var(--dx-c-button-custom-color-hover);
|
|
196
|
+
background: var(--dx-c-button-custom-background-hover);
|
|
197
|
+
border-color: var(--dx-c-button-custom-border-hover);
|
|
198
|
+
}
|
|
@@ -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,68 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import {
|
|
4
|
+
ButtonTextColor,
|
|
5
|
+
ButtonVariant,
|
|
6
|
+
IconSprite,
|
|
7
|
+
IconSize,
|
|
8
|
+
IconSymbol,
|
|
9
|
+
LightningSlotElement
|
|
10
|
+
} from "typings/custom";
|
|
11
|
+
|
|
12
|
+
export default class Button extends LightningElement {
|
|
13
|
+
@api ariaLabel: string = "";
|
|
14
|
+
@api disabled: boolean | null = null;
|
|
15
|
+
@api iconSize?: IconSize = "small";
|
|
16
|
+
@api iconSprite?: IconSprite = "utility";
|
|
17
|
+
@api iconSymbol?: IconSymbol;
|
|
18
|
+
@api iconPosition?: "right" | "left" = "right";
|
|
19
|
+
@api loading: boolean = false;
|
|
20
|
+
@api size: "large" | "hero" | "small" = "small";
|
|
21
|
+
@api variant: ButtonVariant = "primary";
|
|
22
|
+
@api inlineTextColor: ButtonTextColor = "dark";
|
|
23
|
+
@api font: "display" | "sans" = "display";
|
|
24
|
+
@api name?: string;
|
|
25
|
+
@api value?: any;
|
|
26
|
+
|
|
27
|
+
// button props
|
|
28
|
+
@api type: "submit" | "reset" | "button" = "button";
|
|
29
|
+
|
|
30
|
+
// link props
|
|
31
|
+
@api href: string | null = null;
|
|
32
|
+
@api download: string | null = null;
|
|
33
|
+
@api target: "_self" | "_blank" | "_parent" | "_top" | null = null;
|
|
34
|
+
@api rel: string | null = null;
|
|
35
|
+
|
|
36
|
+
@api focus() {
|
|
37
|
+
const button = this.template.querySelector(".button");
|
|
38
|
+
if (button) {
|
|
39
|
+
button.focus();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private isSlotEmpty: boolean = true;
|
|
44
|
+
|
|
45
|
+
private get showIcon(): boolean {
|
|
46
|
+
return !!this.iconSymbol && !this.loading;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private get className(): string {
|
|
50
|
+
return cx(
|
|
51
|
+
"button",
|
|
52
|
+
this.variant === "inline" && `${this.inlineTextColor}-text`,
|
|
53
|
+
this.disabled && "state-disabled",
|
|
54
|
+
`variant_${this.variant}`,
|
|
55
|
+
this.loading && "state-loading",
|
|
56
|
+
`size-${this.size}`,
|
|
57
|
+
!!this.iconSymbol && "style-icon",
|
|
58
|
+
this.isSlotEmpty && "slot-empty",
|
|
59
|
+
`font-${this.font}`,
|
|
60
|
+
this.iconPosition === "right" ? "icon-right" : "icon-left"
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private onSlotChange(e: LightningSlotElement) {
|
|
65
|
+
const slot = e.target;
|
|
66
|
+
this.isSlotEmpty = slot.assignedElements().length !== 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -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,57 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
@import "dxHelpers/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,41 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { toDxColor } from "dxUtils/css";
|
|
4
|
+
import { track } from "dxUtils/analytics";
|
|
5
|
+
|
|
6
|
+
export const ANALYTICS_EVENT_NAME = "custEv_ctaLinkClick";
|
|
7
|
+
|
|
8
|
+
export default class CardCallout extends LightningElement {
|
|
9
|
+
@api backgroundColor: string = "indigo-vibrant-40";
|
|
10
|
+
@api color: string = "white";
|
|
11
|
+
@api href!: string;
|
|
12
|
+
@api label: string = "";
|
|
13
|
+
@api target?: string;
|
|
14
|
+
@api title!: string;
|
|
15
|
+
|
|
16
|
+
private get style(): string {
|
|
17
|
+
const background = `background-color: ${toDxColor(
|
|
18
|
+
this.backgroundColor
|
|
19
|
+
)};`;
|
|
20
|
+
const color = `color: ${toDxColor(this.color)};`;
|
|
21
|
+
return [background, color].join(" ");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private get className(): string {
|
|
25
|
+
return cx(
|
|
26
|
+
"card-callout",
|
|
27
|
+
"dx-card-base",
|
|
28
|
+
"dx-card-base_section-vertical"
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private sendGtm(e: PointerEvent) {
|
|
33
|
+
track(e.currentTarget, ANALYTICS_EVENT_NAME, {
|
|
34
|
+
clickURL: this.href,
|
|
35
|
+
itemTitle: this.title,
|
|
36
|
+
clickText: this.label,
|
|
37
|
+
elementType: "card callout",
|
|
38
|
+
destinationType: "internal"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
@import "dxHelpers/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: 768px) {
|
|
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
|
+
}
|