@salesforcedevs/dx-components 0.0.0-alpha.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 +97 -0
- package/package.json +31 -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 +203 -0
- package/src/modules/dx/button/button.html +43 -0
- package/src/modules/dx/button/button.ts +68 -0
- package/src/modules/dx/buttonToggle/buttonToggle.css +50 -0
- package/src/modules/dx/buttonToggle/buttonToggle.html +16 -0
- package/src/modules/dx/buttonToggle/buttonToggle.ts +66 -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 +178 -0
- package/src/modules/dx/cardTrial/cardTrial.html +124 -0
- package/src/modules/dx/cardTrial/cardTrial.ts +97 -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/modal/modal.css +65 -0
- package/src/modules/dx/modal/modal.html +21 -0
- package/src/modules/dx/modal/modal.ts +46 -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 +66 -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/tabPanel/tabPanel.css +23 -0
- package/src/modules/dx/tabPanel/tabPanel.html +13 -0
- package/src/modules/dx/tabPanel/tabPanel.ts +27 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.css +43 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.html +15 -0
- package/src/modules/dx/tabPanelItem/tabPanelItem.ts +39 -0
- package/src/modules/dx/tabPanelList/tabPanelList.css +37 -0
- package/src/modules/dx/tabPanelList/tabPanelList.html +47 -0
- package/src/modules/dx/tabPanelList/tabPanelList.ts +164 -0
- package/src/modules/dx/tabPanelList/uniqueId.ts +6 -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
- package/yarn-error.log +17934 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { PopoverRequestCloseType, OptionWithLink } from "typings/custom";
|
|
4
|
+
import { buildSearchEngine } from "dxUtils/coveo";
|
|
5
|
+
import {
|
|
6
|
+
StandaloneSearchBox as StandaloneSearchBoxType,
|
|
7
|
+
StandaloneSearchBoxState,
|
|
8
|
+
buildStandaloneSearchBox,
|
|
9
|
+
StandaloneSearchBoxOptions
|
|
10
|
+
} from "@coveo/headless";
|
|
11
|
+
|
|
12
|
+
const baseSearchHref = `/search`;
|
|
13
|
+
|
|
14
|
+
export default class HeaderSearch extends LightningElement {
|
|
15
|
+
@api mobile!: boolean;
|
|
16
|
+
@api coveoOrganizationId!: string;
|
|
17
|
+
@api coveoPublicAccessToken!: string;
|
|
18
|
+
@api coveoSearchPipeline!: string;
|
|
19
|
+
@api coveoSearchHub!: string;
|
|
20
|
+
|
|
21
|
+
private input: HTMLElement | null = null;
|
|
22
|
+
private isDropdownOpen: boolean = false;
|
|
23
|
+
private isMobileSearchOpen: boolean = false;
|
|
24
|
+
private searchBox: StandaloneSearchBoxType | null = null;
|
|
25
|
+
private searchState: StandaloneSearchBoxState | null = null;
|
|
26
|
+
|
|
27
|
+
private get className() {
|
|
28
|
+
return this.mobile ? null : "desktop_search-container";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private get suggestions(): OptionWithLink[] {
|
|
32
|
+
if (this.searchState) {
|
|
33
|
+
return this.searchState.suggestions.map(
|
|
34
|
+
({ highlightedValue }: { highlightedValue: string }) => ({
|
|
35
|
+
id: highlightedValue,
|
|
36
|
+
label: highlightedValue,
|
|
37
|
+
link: {
|
|
38
|
+
href: this.createSearchHref(highlightedValue),
|
|
39
|
+
target: null
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private get mobileSearchInputClassName() {
|
|
48
|
+
return cx(
|
|
49
|
+
"mobile_search-input",
|
|
50
|
+
this.isMobileSearchOpen && "state-open"
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private get mobileSearchButtonIcon() {
|
|
55
|
+
return this.isMobileSearchOpen ? "close" : "search";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private get mobileSearchButtonAriaLabel() {
|
|
59
|
+
return this.isMobileSearchOpen
|
|
60
|
+
? "Hide mobile search"
|
|
61
|
+
: "Show mobile search";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
connectedCallback() {
|
|
65
|
+
this.instantiateSearchbox();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private onDropdownRequestClose(e: CustomEvent) {
|
|
69
|
+
switch (e.detail as PopoverRequestCloseType) {
|
|
70
|
+
case "interact-outside":
|
|
71
|
+
case "keypress-escape":
|
|
72
|
+
this.closeDropdown();
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private instantiateSearchbox() {
|
|
80
|
+
try {
|
|
81
|
+
const options: StandaloneSearchBoxOptions = {
|
|
82
|
+
numberOfSuggestions: 3,
|
|
83
|
+
redirectionUrl: "https://developer.salesforce.com"
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const engine = buildSearchEngine({
|
|
87
|
+
organizationId: this.coveoOrganizationId,
|
|
88
|
+
publicAccessToken: this.coveoPublicAccessToken,
|
|
89
|
+
searchPipeline: this.coveoSearchPipeline,
|
|
90
|
+
searchHub: this.coveoSearchHub
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
this.searchBox = buildStandaloneSearchBox(engine, { options });
|
|
94
|
+
|
|
95
|
+
this.searchBox?.subscribe(() => {
|
|
96
|
+
if (this.searchBox) {
|
|
97
|
+
this.searchState = this.searchBox.state;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
} catch (e) {
|
|
101
|
+
console.error(`Coveo searchbox failed to initialize (${e})`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private createSearchHref = (value: string | null = "") => {
|
|
106
|
+
return `${baseSearchHref}#q=${value}`;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
private onInputChange(e: CustomEvent) {
|
|
110
|
+
if (this.searchBox) {
|
|
111
|
+
this.searchBox.updateText(e.detail);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private onInputSubmit(e: CustomEvent) {
|
|
116
|
+
const href = this.createSearchHref(e.detail || "");
|
|
117
|
+
window.location.assign(href);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
private onMobileSearchButtonClick() {
|
|
121
|
+
this.isMobileSearchOpen = !this.isMobileSearchOpen;
|
|
122
|
+
const input = this.template.querySelector("dx-input");
|
|
123
|
+
if (this.isMobileSearchOpen && input) {
|
|
124
|
+
input.focus();
|
|
125
|
+
this.openDropdown();
|
|
126
|
+
} else {
|
|
127
|
+
this.closeDropdown();
|
|
128
|
+
}
|
|
129
|
+
if (!this.isMobileSearchOpen && this.searchBox) {
|
|
130
|
+
this.searchBox.updateText("");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
private openDropdown() {
|
|
135
|
+
this.isDropdownOpen = true;
|
|
136
|
+
this.isMobileSearchOpen = true;
|
|
137
|
+
this.reportState<boolean>(true);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private closeDropdown() {
|
|
141
|
+
this.isDropdownOpen = false;
|
|
142
|
+
this.isMobileSearchOpen = false;
|
|
143
|
+
this.reportState<boolean>(false);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private onInputEscape() {
|
|
147
|
+
this.closeDropdown();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
private reportState<T>(state: T) {
|
|
151
|
+
this.dispatchEvent(
|
|
152
|
+
new CustomEvent("statechange", {
|
|
153
|
+
detail: state,
|
|
154
|
+
bubbles: true,
|
|
155
|
+
composed: true
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
span {
|
|
5
|
+
font-family: var(--dx-g-font-sans);
|
|
6
|
+
font-size: var(--dx-g-text-2xs);
|
|
7
|
+
color: var(--dx-c-breadcrumb-color);
|
|
8
|
+
margin-top: 0.5px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
nav {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
nav > *:not(:last-child) {
|
|
18
|
+
margin-right: 6px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
nav a,
|
|
22
|
+
nav span {
|
|
23
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
a:hover {
|
|
29
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
30
|
+
color: var(--dx-c-breadcrumb-hover-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.home-link {
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
margin-right: var(--dx-g-spacing-xs);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.home-link > .home-link-title {
|
|
39
|
+
color: var(--dx-c-home-link-color);
|
|
40
|
+
line-height: 18px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.home-link > svg {
|
|
44
|
+
margin-right: 12px;
|
|
45
|
+
width: 18px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.helmet {
|
|
49
|
+
height: var(--dx-g-spacing-xl);
|
|
50
|
+
position: relative;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.helmet.variant_clear {
|
|
54
|
+
background-color: white;
|
|
55
|
+
|
|
56
|
+
--dx-c-home-link-color: var(--dx-g-blue-natural-10);
|
|
57
|
+
--dx-c-breadcrumb-color: var(--dx-g-gray-50);
|
|
58
|
+
--dx-c-breadcrumb-hover-color: var(--dx-g-cloud-blue-vibrant-40);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.helmet.variant_dark {
|
|
62
|
+
background-color: var(--dx-g-blue-vibrant-40);
|
|
63
|
+
|
|
64
|
+
--dx-c-home-link-color: white;
|
|
65
|
+
--dx-c-breadcrumb-color: var(--dx-g-blue-vibrant-90);
|
|
66
|
+
--dx-c-breadcrumb-hover-color: var(--dx-g-cloud-blue-vibrant-80);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.helmet.variant_light {
|
|
70
|
+
background-color: var(--dx-g-cloud-blue-vibrant-95);
|
|
71
|
+
|
|
72
|
+
--dx-c-home-link-color: var(--dx-g-blue-vibrant-20);
|
|
73
|
+
--dx-c-breadcrumb-color: var(--dx-g-gray-30);
|
|
74
|
+
--dx-c-breadcrumb-hover-color: var(--dx-g-cloud-blue-vibrant-40);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.helmet.variant_neutral {
|
|
78
|
+
background-color: var(--dx-g-gray-95);
|
|
79
|
+
|
|
80
|
+
--dx-c-home-link-color: var(--dx-g-gray-30);
|
|
81
|
+
--dx-c-breadcrumb-color: var(--dx-g-gray-50);
|
|
82
|
+
--dx-c-breadcrumb-hover-color: var(--dx-g-cloud-blue-vibrant-40);
|
|
83
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class={className} style={style}>
|
|
3
|
+
<nav role="navigation" class="helmet-title">
|
|
4
|
+
<a
|
|
5
|
+
href="https://developer.salesforce.com"
|
|
6
|
+
class="home-link"
|
|
7
|
+
alt={titleAlt}
|
|
8
|
+
>
|
|
9
|
+
<svg
|
|
10
|
+
width="28px"
|
|
11
|
+
height="20px"
|
|
12
|
+
viewBox="0 0 28 20"
|
|
13
|
+
version="1.1"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<title>{title}</title>
|
|
17
|
+
<g
|
|
18
|
+
id="Section-/-Nav-/-Footer-/-Architects"
|
|
19
|
+
transform="translate(-148.000000, -447.000000)"
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
d="M163.003774,447.648649 C164.8,447.648649 166.384906,448.675676 167.230189,450.189189 C167.969811,449.864865 168.762264,449.648649 169.607547,449.648649 C172.883019,449.648649 175.524528,452.351351 175.524528,455.702703 C175.524528,459.054054 172.883019,461.756757 169.607547,461.756757 C169.184906,461.756757 168.815094,461.702703 168.445283,461.648649 C167.70566,463 166.279245,463.918919 164.641509,463.918919 C163.954717,463.918919 163.320755,463.756757 162.739623,463.486486 C162,465.27027 160.256604,466.513514 158.196226,466.513514 C156.083019,466.513514 154.233962,465.162162 153.54717,463.216216 C153.230189,463.27027 152.913208,463.324324 152.596226,463.324324 C150.060377,463.324324 148,461.216216 148,458.621622 C148,456.891892 148.898113,455.378378 150.271698,454.567568 C150.007547,453.918919 149.849057,453.162162 149.849057,452.405405 C149.849057,449.432432 152.226415,447 155.184906,447 C157.033962,447.054054 158.566038,447.864865 159.516981,449.162162 C160.415094,448.243243 161.630189,447.648649 163.003774,447.648649 Z"
|
|
23
|
+
id="Path"
|
|
24
|
+
fill="#00A1E0"
|
|
25
|
+
></path>
|
|
26
|
+
</g>
|
|
27
|
+
</svg>
|
|
28
|
+
<span class="home-link-title">{title}</span>
|
|
29
|
+
</a>
|
|
30
|
+
<span>/</span>
|
|
31
|
+
<span if:true={currentPropertyHref}>
|
|
32
|
+
<a href={currentPropertyHref} alt={currentPropertyAlt}>
|
|
33
|
+
{currentPropertyTitle}
|
|
34
|
+
</a>
|
|
35
|
+
</span>
|
|
36
|
+
<span if:false={currentPropertyHref}>{currentPropertyTitle}</span>
|
|
37
|
+
</nav>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { HelmetVariant } from "typings/custom";
|
|
4
|
+
|
|
5
|
+
export default class Helmet extends LightningElement {
|
|
6
|
+
@api title: string = "Salesforce";
|
|
7
|
+
@api currentPropertyTitle: string = "Heroku";
|
|
8
|
+
@api currentPropertyHref?: string;
|
|
9
|
+
@api variant: HelmetVariant = "neutral";
|
|
10
|
+
@api horizontalPadding: string = "20px";
|
|
11
|
+
|
|
12
|
+
private get style() {
|
|
13
|
+
return `padding: 0 ${this.horizontalPadding};`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
private get titleAlt() {
|
|
17
|
+
return `Link to ${this.title}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
private get currentPropertyAlt() {
|
|
21
|
+
return `Link to ${this.currentPropertyTitle}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private get className() {
|
|
25
|
+
return cx("helmet", `variant_${this.variant}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
--dx-c-hr-padding-horizontal: var(--dx-g-page-padding-horizontal);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
p,
|
|
9
|
+
h2 {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
padding: 0 var(--dx-c-hr-padding-horizontal);
|
|
13
|
+
font-family: var(--dx-g-font-display);
|
|
14
|
+
font-size: var(--dx-g-text-sm);
|
|
15
|
+
color: var(--dx-g-blue-vibrant-20);
|
|
16
|
+
text-transform: uppercase;
|
|
17
|
+
letter-spacing: 0;
|
|
18
|
+
line-height: 18px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
p::before,
|
|
22
|
+
h2::before,
|
|
23
|
+
p::after,
|
|
24
|
+
h2::after {
|
|
25
|
+
transform: translateY(-2px); /* offset for display font ghost padding */
|
|
26
|
+
content: "";
|
|
27
|
+
flex: 1 1;
|
|
28
|
+
border-bottom: 2px solid var(--dx-g-gray-95);
|
|
29
|
+
margin: auto;
|
|
30
|
+
margin-right: 0;
|
|
31
|
+
margin-left: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
h2::before {
|
|
35
|
+
margin-right: var(--dx-g-spacing-md);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
h2::after {
|
|
39
|
+
margin-left: var(--dx-g-spacing-md);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
dx-button {
|
|
43
|
+
display: flex;
|
|
44
|
+
width: 100%;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
padding: 0 var(--dx-c-hr-padding-horizontal);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
dx-button::before {
|
|
50
|
+
content: "";
|
|
51
|
+
border-bottom: 2px solid var(--dx-g-gray-95);
|
|
52
|
+
flex: 1 1;
|
|
53
|
+
transform: translateY(-2px); /* offset for display font ghost padding */
|
|
54
|
+
margin: auto;
|
|
55
|
+
margin-right: var(--dx-g-spacing-md);
|
|
56
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<p if:true={isSeparator} part="hr" role="separator" style={style}></p>
|
|
3
|
+
<h2 if:true={isHeading} part="hr" style={style}>{text}</h2>
|
|
4
|
+
<dx-button
|
|
5
|
+
if:true={isLink}
|
|
6
|
+
href={href}
|
|
7
|
+
icon-symbol="forward"
|
|
8
|
+
style={style}
|
|
9
|
+
target={target}
|
|
10
|
+
variant="inline"
|
|
11
|
+
>
|
|
12
|
+
{text}
|
|
13
|
+
</dx-button>
|
|
14
|
+
<dx-button
|
|
15
|
+
if:true={isLoadMore}
|
|
16
|
+
icon-symbol="arrowdown"
|
|
17
|
+
onclick={handleClick}
|
|
18
|
+
style={style}
|
|
19
|
+
variant="inline"
|
|
20
|
+
>
|
|
21
|
+
{text}
|
|
22
|
+
</dx-button>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
import { HrVariant } from "typings/custom";
|
|
4
|
+
|
|
5
|
+
export default class Hr extends LightningElement {
|
|
6
|
+
@api text: string | null = null;
|
|
7
|
+
@api href?: string | null;
|
|
8
|
+
@api target: string | null = "_top";
|
|
9
|
+
@api spacing: string | null = "2xl";
|
|
10
|
+
@api variant: HrVariant | null = null;
|
|
11
|
+
|
|
12
|
+
private get ariaRole() {
|
|
13
|
+
return this.isHeading ? "heading" : "separator";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
private get style() {
|
|
17
|
+
return this.spacing
|
|
18
|
+
? `margin: var(--dx-g-spacing-${this.spacing}) 0;`
|
|
19
|
+
: "";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private get isButtonVariant() {
|
|
23
|
+
return this.variant === "link" || this.variant === "load-more";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private get isLink() {
|
|
27
|
+
return this.variant === "link";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private get isLoadMore() {
|
|
31
|
+
return this.variant === "load-more";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private get isHeading() {
|
|
35
|
+
return !this.isButtonVariant && this.text;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private get isSeparator() {
|
|
39
|
+
return !this.isButtonVariant && !this.text;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
handleClick() {
|
|
43
|
+
this.dispatchEvent(new CustomEvent("loadmore"));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { IconSprite, IconSize, IconSymbol } from "typings/custom";
|
|
3
|
+
import { toDxColor } from "dxUtils/css";
|
|
4
|
+
|
|
5
|
+
const fetches = new Map<string, Promise<any>>();
|
|
6
|
+
|
|
7
|
+
const sizeMap = {
|
|
8
|
+
xsmall: "xs",
|
|
9
|
+
small: "sm",
|
|
10
|
+
medium: "md",
|
|
11
|
+
large: "lg",
|
|
12
|
+
xlarge: "xl",
|
|
13
|
+
"2xlarge": "2xl"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default class Icon extends LightningElement {
|
|
17
|
+
@api sprite: IconSprite = "utility";
|
|
18
|
+
@api size: IconSize = "small";
|
|
19
|
+
@api symbol!: IconSymbol;
|
|
20
|
+
@api color?: string;
|
|
21
|
+
|
|
22
|
+
private node: SVGSymbolElement | undefined;
|
|
23
|
+
|
|
24
|
+
private get style() {
|
|
25
|
+
let stylestr = "";
|
|
26
|
+
if (this.size !== "override" && this.size in sizeMap) {
|
|
27
|
+
stylestr = `--dx-c-icon-size: var(--dx-g-icon-size-${
|
|
28
|
+
sizeMap[this.size]
|
|
29
|
+
});`;
|
|
30
|
+
}
|
|
31
|
+
if (this.color) {
|
|
32
|
+
stylestr = `${stylestr} fill: ${toDxColor(this.color)};`;
|
|
33
|
+
}
|
|
34
|
+
return stylestr;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private get assetUrl() {
|
|
38
|
+
return `/assets/icons/${this.sprite}-sprite/svg/symbols.svg`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private get href() {
|
|
42
|
+
return `${this.assetUrl}#${this.symbol}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private get symbolId() {
|
|
46
|
+
return `dx__${this.sprite}__${this.symbol}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private async appendNodes() {
|
|
50
|
+
if (this.node && this.node.id === this.symbolId) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
await this.fetchSprite(this.sprite);
|
|
54
|
+
const svg = this.template.querySelector("svg")!;
|
|
55
|
+
// TODO: Validate a better way
|
|
56
|
+
// eslint-disable-next-line @lwc/lwc/no-document-query
|
|
57
|
+
const node = document
|
|
58
|
+
.getElementById(this.symbolId)!
|
|
59
|
+
.cloneNode(true) as SVGSymbolElement;
|
|
60
|
+
while (svg.firstChild) {
|
|
61
|
+
svg.removeChild(svg.firstChild);
|
|
62
|
+
}
|
|
63
|
+
for (const n of Array.from(node.childNodes)) {
|
|
64
|
+
svg.appendChild(n);
|
|
65
|
+
}
|
|
66
|
+
svg.setAttribute("viewBox", node.getAttribute("viewBox")!);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private async fetchSprite(sprite: IconSprite) {
|
|
70
|
+
if (fetches.has(sprite)) {
|
|
71
|
+
return fetches.get(sprite);
|
|
72
|
+
}
|
|
73
|
+
const promise = fetch(this.assetUrl)
|
|
74
|
+
.then((res) => res.text())
|
|
75
|
+
.then((svg) => svg.replace(/id="/g, `id="dx__${sprite}__`))
|
|
76
|
+
.then((svg) => {
|
|
77
|
+
const node = document.createElement("div");
|
|
78
|
+
// eslint-disable-next-line @lwc/lwc/no-inner-html
|
|
79
|
+
node.innerHTML = svg;
|
|
80
|
+
document.body.appendChild(node);
|
|
81
|
+
});
|
|
82
|
+
fetches.set(sprite, promise);
|
|
83
|
+
return promise;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
|
|
6
|
+
--dx-c-icon-badge-background-color: var(--dx-g-indigo-vibrant-50);
|
|
7
|
+
--dx-c-icon-badge-box-shadow: none;
|
|
8
|
+
--dx-c-icon-badge-color: white;
|
|
9
|
+
--dx-c-icon-badge-icon-size: var(--dx-g-spacing-lg);
|
|
10
|
+
--dx-c-icon-badge-icon-transform: none;
|
|
11
|
+
--dx-c-icon-badge-size: var(--dx-g-spacing-3xl);
|
|
12
|
+
--dx-c-icon-badge-transition: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.icon-badge {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
height: var(--dx-c-icon-badge-size);
|
|
20
|
+
width: var(--dx-c-icon-badge-size);
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
background-color: var(--dx-c-icon-badge-background-color);
|
|
23
|
+
box-shadow: var(--dx-c-icon-badge-box-shadow);
|
|
24
|
+
transition: var(--dx-c-icon-badge-transition);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
dx-icon {
|
|
28
|
+
--dx-c-icon-size: var(--dx-c-icon-badge-icon-size);
|
|
29
|
+
--dx-c-icon-color: var(--dx-c-icon-badge-color);
|
|
30
|
+
|
|
31
|
+
transform: var(--dx-c-icon-badge-icon-transform);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.shape-circle {
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.shape-square {
|
|
39
|
+
border-radius: var(--dx-g-spacing-sm);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.background-small {
|
|
43
|
+
--dx-c-icon-badge-size: var(--dx-g-spacing-lg);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.background-medium {
|
|
47
|
+
--dx-c-icon-badge-size: var(--dx-g-spacing-xl);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.background-large {
|
|
51
|
+
--dx-c-icon-badge-size: var(--dx-g-spacing-3xl);
|
|
52
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { IconSprite, IconSymbol, IconBadgeShape } from "typings/custom";
|
|
4
|
+
import { toDxColor } from "dxUtils/css";
|
|
5
|
+
|
|
6
|
+
const validShapes = ["square", "circle"];
|
|
7
|
+
|
|
8
|
+
export default class IconBadge extends LightningElement {
|
|
9
|
+
@api sprite: IconSprite = "utility";
|
|
10
|
+
@api symbol!: IconSymbol;
|
|
11
|
+
@api color?: string | null = null;
|
|
12
|
+
@api backgroundColor?: string;
|
|
13
|
+
@api backgroundSize?: string;
|
|
14
|
+
@api iconSize?: string = "override";
|
|
15
|
+
|
|
16
|
+
_shape: IconBadgeShape = "circle";
|
|
17
|
+
@api
|
|
18
|
+
get shape() {
|
|
19
|
+
return this._shape;
|
|
20
|
+
}
|
|
21
|
+
set shape(value) {
|
|
22
|
+
if (!validShapes.includes(value)) {
|
|
23
|
+
console.error(
|
|
24
|
+
`[dx-icon-badge] Invalid shape provided "${value}". Shape must be type of: ${validShapes.join(
|
|
25
|
+
", "
|
|
26
|
+
)}`
|
|
27
|
+
);
|
|
28
|
+
this._shape = "circle";
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this._shape = value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get className() {
|
|
35
|
+
return cx(
|
|
36
|
+
"icon-badge",
|
|
37
|
+
`shape-${this.shape}`,
|
|
38
|
+
this.backgroundSize && `background-${this.backgroundSize}`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get style() {
|
|
43
|
+
const color = this.color
|
|
44
|
+
? `--dx-c-icon-badge-color: ${toDxColor(this.color)};`
|
|
45
|
+
: "";
|
|
46
|
+
const backgroundColor = this.backgroundColor
|
|
47
|
+
? `background-color: ${toDxColor(this.backgroundColor)};`
|
|
48
|
+
: "";
|
|
49
|
+
|
|
50
|
+
return `${color}${backgroundColor}`;
|
|
51
|
+
}
|
|
52
|
+
}
|