@salesforcedevs/dx-components 0.3.12 → 0.3.14-banner-alpha1
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 +56 -19
- package/package.json +20 -12
- package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +528 -79
- package/src/assets/svg/big-moon.svg +1 -0
- package/src/assets/svg/blue-circle.svg +3 -0
- package/src/assets/svg/docs-empty-state-small.svg +72 -0
- package/src/assets/svg/featured-demo-art-blank.svg +76 -0
- package/src/assets/svg/login-widget-bg.png +0 -0
- package/src/assets/svg/no-results-combined.svg +80 -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/trial-left.svg +6 -0
- package/src/assets/svg/trial-right.svg +26 -0
- package/src/modules/dx/banner/banner.css +31 -457
- package/src/modules/dx/banner/banner.html +9 -37
- package/src/modules/dx/banner/banner.ts +7 -125
- package/src/modules/dx/breadcrumbs/breadcrumbs.css +18 -22
- package/src/modules/dx/breadcrumbs/breadcrumbs.html +7 -9
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +47 -32
- package/src/modules/dx/button/button.css +46 -19
- package/src/modules/dx/button/button.ts +6 -1
- package/src/modules/dx/buttonToggle/buttonToggle.css +50 -0
- package/src/modules/dx/buttonToggle/buttonToggle.html +17 -0
- package/src/modules/dx/buttonToggle/buttonToggle.ts +75 -0
- package/src/modules/dx/cardBlogPost/cardBlogPost.css +2 -2
- package/src/modules/dx/cardCallout/cardCallout.css +10 -4
- package/src/modules/dx/cardCallout/cardCallout.ts +13 -9
- package/src/modules/dx/cardContent/cardContent.css +8 -5
- package/src/modules/dx/cardContent/cardContent.html +4 -1
- package/src/modules/dx/cardContent/cardContent.ts +4 -2
- package/src/modules/dx/cardDemo/cardDemo.css +1 -1
- package/src/modules/dx/cardDocs/cardDocs.css +4 -3
- package/src/modules/dx/cardDocs/cardDocs.html +4 -1
- package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
- package/src/modules/dx/cardEvent/cardEvent.css +21 -3
- package/src/modules/dx/cardEvent/cardEvent.html +18 -4
- package/src/modules/dx/cardEvent/cardEvent.ts +8 -0
- package/src/modules/dx/cardExpanded/cardExpanded.css +50 -0
- package/src/modules/dx/cardExpanded/cardExpanded.html +31 -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 +8 -0
- package/src/modules/dx/cardMinimal/cardMinimal.ts +3 -0
- package/src/modules/dx/cardNews/cardNews.css +5 -5
- package/src/modules/dx/cardNews/cardNews.html +2 -0
- package/src/modules/dx/cardNews/cardNews.ts +16 -1
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +3 -3
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.html +1 -1
- package/src/modules/dx/cardSmall/cardSmall.css +7 -3
- package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
- package/src/modules/dx/cardTitle/cardTitle.css +5 -3
- package/src/modules/dx/cardTitle/cardTitle.html +18 -16
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.css +2 -2
- package/src/modules/dx/cardTrial/cardTrial.css +130 -0
- package/src/modules/dx/cardTrial/cardTrial.html +115 -0
- package/src/modules/dx/cardTrial/cardTrial.ts +102 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.css +149 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.html +85 -0
- package/src/modules/dx/cardTrialExpanded/cardTrialExpanded.ts +67 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +2 -2
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +2 -0
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +2 -1
- package/src/modules/dx/checkbox/checkbox.css +39 -9
- package/src/modules/dx/checkbox/checkbox.html +24 -11
- package/src/modules/dx/checkbox/checkbox.ts +38 -5
- package/src/modules/dx/checkboxGroup/checkboxGroup.css +1 -1
- package/src/modules/dx/checkboxGroup/checkboxGroup.ts +1 -1
- 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 +2 -2
- package/src/modules/dx/codeBlock/codeBlock.html +6 -4
- package/src/modules/dx/codeBlock/codeBlock.ts +91 -53
- package/src/modules/dx/codeBlock/darkTheme.css +0 -1
- package/src/modules/dx/codeBlock/lightTheme.css +0 -1
- package/src/modules/dx/dropdown/dropdown.css +7 -2
- package/src/modules/dx/dropdown/dropdown.html +20 -13
- package/src/modules/dx/dropdown/dropdown.ts +51 -24
- package/src/modules/dx/dropdownOption/dropdownOption.css +121 -3
- package/src/modules/dx/dropdownOption/dropdownOption.html +4 -0
- package/src/modules/dx/dropdownOption/dropdownOption.ts +43 -10
- package/src/modules/dx/emptyState/emptyState.css +48 -15
- package/src/modules/dx/emptyState/emptyState.html +6 -4
- package/src/modules/dx/emptyState/emptyState.ts +11 -20
- package/src/modules/dx/feature/feature.css +31 -2
- package/src/modules/dx/feature/feature.html +19 -3
- package/src/modules/dx/feature/feature.ts +8 -3
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +105 -41
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +107 -71
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +41 -18
- package/src/modules/dx/featuredContentHeader/svgs.ts +10 -497
- package/src/modules/dx/featuresList/featuresList.css +3 -3
- package/src/modules/dx/featuresList/featuresList.html +15 -10
- package/src/modules/dx/featuresList/featuresList.ts +1 -1
- 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 +6 -10
- package/src/modules/dx/footer/footer.html +38 -29
- package/src/modules/dx/footer/footer.ts +67 -24
- package/src/modules/dx/footer/links.ts +110 -42
- package/src/modules/dx/footerOption/footerOption.css +4 -0
- package/src/modules/dx/footerOption/footerOption.ts +5 -4
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +5 -0
- package/src/modules/dx/grid/grid.css +7 -10
- package/src/modules/dx/grid/grid.md +14 -0
- package/src/modules/dx/grid/grid.ts +7 -9
- package/src/modules/dx/groupText/groupText.css +2 -2
- package/src/modules/dx/groupText/groupText.html +6 -1
- package/src/modules/dx/groupText/groupText.ts +21 -2
- package/src/modules/dx/header/header.css +25 -166
- package/src/modules/dx/header/header.html +37 -26
- package/src/modules/dx/header/header.ts +10 -180
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +29 -12
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +6 -6
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +5 -4
- package/src/modules/dx/headerNav/headerNav.css +1 -45
- package/src/modules/dx/headerNav/headerNav.html +23 -20
- package/src/modules/dx/headerNav/headerNav.ts +32 -9
- package/src/modules/dx/headerSearch/headerSearch.css +1 -37
- package/src/modules/dx/headerSearch/headerSearch.html +6 -25
- package/src/modules/dx/headerSearch/headerSearch.ts +47 -50
- package/src/modules/dx/helmet/helmet.css +2 -2
- package/src/modules/dx/hr/hr.css +11 -9
- package/src/modules/dx/hr/hr.html +6 -12
- package/src/modules/dx/hr/hr.ts +11 -12
- package/src/modules/dx/icon/icon.css +1 -1
- package/src/modules/dx/icon/icon.ts +1 -1
- package/src/modules/dx/iconBadge/iconBadge.css +13 -1
- package/src/modules/dx/iconBadge/iconBadge.html +2 -7
- package/src/modules/dx/iconBadge/iconBadge.ts +16 -6
- package/src/modules/dx/imageAndLabel/imageAndLabel.css +3 -4
- package/src/modules/dx/imageAndLabel/imageAndLabel.html +14 -2
- package/src/modules/dx/input/input.css +68 -4
- package/src/modules/dx/input/input.html +27 -2
- package/src/modules/dx/input/input.ts +108 -32
- package/src/modules/dx/interactiveImage/interactiveImage.css +2 -2
- package/src/modules/dx/logo/logo.css +32 -0
- package/src/modules/dx/logo/logo.html +6 -0
- package/src/modules/dx/logo/logo.ts +8 -0
- package/src/modules/dx/metadataBadge/metadataBadge.css +41 -0
- package/src/modules/dx/metadataBadge/metadataBadge.html +5 -0
- package/src/modules/dx/metadataBadge/metadataBadge.ts +24 -0
- package/src/modules/dx/modal/modal.css +40 -0
- package/src/modules/dx/modal/modal.html +10 -0
- package/src/modules/dx/modal/modal.ts +50 -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 +33 -0
- package/src/modules/dx/pagination/pagination.css +2 -3
- package/src/modules/dx/pagination/pagination.ts +50 -8
- package/src/modules/dx/podcastHost/podcastHost.css +2 -2
- package/src/modules/dx/podcastHost/podcastHost.html +2 -2
- package/src/modules/dx/popover/popover.css +29 -4
- package/src/modules/dx/popover/popover.html +2 -2
- package/src/modules/dx/popover/popover.ts +121 -86
- package/src/modules/dx/radioGroup/radioGroup.css +1 -1
- package/src/modules/dx/radioGroup/radioGroup.ts +1 -1
- package/src/modules/dx/searchResults/coveo.css +314 -111
- package/src/modules/dx/searchResults/searchResults.css +2 -2
- package/src/modules/dx/searchResults/searchResults.html +10 -11
- package/src/modules/dx/searchResults/searchResults.ts +41 -20
- package/src/modules/dx/section/section.css +15 -12
- package/src/modules/dx/section/section.html +1 -1
- package/src/modules/dx/section/section.ts +11 -11
- package/src/modules/dx/sectionSignup/sectionSignup.html +0 -1
- 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 +27 -144
- package/src/modules/dx/sidebar/sidebar.html +63 -40
- package/src/modules/dx/sidebar/sidebar.ts +156 -69
- 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.ts +1 -1
- 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 +88 -17
- package/src/modules/dx/tab/tab.html +10 -12
- package/src/modules/dx/tab/tab.ts +35 -28
- package/src/modules/dx/tabPanel/tabPanel.css +12 -1
- package/src/modules/dx/tabPanelItem/tabPanelItem.css +39 -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 +35 -0
- package/src/modules/dx/tabPanelList/tabPanelList.html +47 -0
- package/src/modules/dx/{tabs/tabs.ts → tabPanelList/tabPanelList.ts} +56 -4
- package/src/modules/dx/{tabs → tabPanelList}/uniqueId.ts +0 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.css +33 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.html +53 -0
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.ts +440 -0
- package/src/modules/dx/toc/toc.css +16 -3
- package/src/modules/dx/toc/toc.html +1 -0
- package/src/modules/dx/toc/toc.ts +1 -1
- package/src/modules/dx/tooltip/microtip.css +269 -0
- package/src/modules/dx/tooltip/tooltip.css +23 -10
- package/src/modules/dx/tooltip/tooltip.html +1 -1
- package/src/modules/dx/tooltip/tooltip.ts +3 -39
- 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 +1 -1
- package/src/modules/dx/tree/tree.ts +9 -1
- package/src/modules/dx/tree/treeHandler.ts +1 -0
- package/src/modules/dx/treeItem/treeItem.css +12 -1
- package/src/modules/dx/treeItem/treeItem.html +10 -11
- package/src/modules/dx/treeItem/treeItem.ts +64 -9
- package/src/modules/dx/treeTile/treeTile.css +63 -54
- package/src/modules/dx/treeTile/treeTile.html +13 -9
- package/src/modules/dx/treeTile/treeTile.ts +25 -5
- package/src/modules/dx/typeBadge/typeBadge.css +20 -43
- package/src/modules/dx/typeBadge/typeBadge.html +7 -1
- package/src/modules/dx/typeBadge/typeBadge.ts +155 -8
- 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 +31 -0
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +215 -0
- package/src/modules/dxBaseElements/matchMediaElement/matchMediaElement.ts +59 -0
- package/src/modules/dxBaseElements/sidebarBase/sidebarBase.ts +65 -0
- package/src/modules/dxConstants/brands/brands.ts +14 -0
- package/src/modules/dxConstants/colors/colors.ts +14 -0
- package/src/modules/dxConstants/contentTypes/contentTypes.ts +10 -0
- package/src/modules/{helpers → dxHelpers}/animations/animations.css +0 -0
- package/src/modules/{helpers → dxHelpers}/button/button.css +0 -0
- package/src/modules/{helpers → dxHelpers}/card/card.css +36 -13
- package/src/modules/{helpers → dxHelpers}/code/code.css +0 -0
- package/src/modules/dxHelpers/commonHeader/commonHeader.css +131 -0
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +145 -0
- package/src/modules/dxHelpers/commonTreeItem/commonTreeItem.css +21 -0
- package/src/modules/{helpers → dxHelpers}/reset/reset.css +0 -0
- package/src/modules/dxHelpers/scrollbar/scrollbar.css +31 -0
- package/src/modules/{helpers → dxHelpers}/table/table.css +24 -8
- package/src/modules/{helpers → dxHelpers}/text/text.css +48 -0
- package/src/modules/dxUtils/analytics/analytics.ts +24 -0
- package/src/modules/dxUtils/async/async.ts +45 -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 +53 -0
- package/src/modules/dxUtils/dates/dates.ts +60 -0
- package/src/modules/{utils → dxUtils}/devices/devices.ts +0 -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/{utils → dxUtils}/normalizers/normalizers.ts +15 -23
- package/src/modules/{utils → dxUtils}/options/options.ts +13 -9
- package/src/modules/{utils → dxUtils}/prismjs/prismjs.html +0 -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/{utils → dxUtils}/slot/slot.ts +0 -0
- package/src/modules/{utils → dxUtils}/wordpress/wordpress.ts +0 -0
- package/LICENSE +0 -12
- package/src/modules/dx/banner/__tests__/banner.test.ts +0 -80
- package/src/modules/dx/banner/banner.stories.ts +0 -121
- package/src/modules/dx/banner/svgs.ts +0 -1107
- package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
- package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -82
- package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -13
- package/src/modules/dx/button/__tests__/button.test.ts +0 -107
- package/src/modules/dx/button/button.stories.ts +0 -150
- package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -27
- package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
- package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
- package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.css +0 -3
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.html +0 -16
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +0 -29
- package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -23
- package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
- package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -112
- package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/cardContent/cardContent.stories.ts +0 -109
- package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
- package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
- package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
- package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
- package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -70
- package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -9
- package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -143
- package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -59
- package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
- package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -70
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +0 -3
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +0 -12
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +0 -29
- package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -70
- package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
- package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
- package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
- package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
- package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
- package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -132
- package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -56
- package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
- package/src/modules/dx/checkbox/checkbox.stories.ts +0 -12
- package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
- package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
- package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -96
- package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -157
- package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -216
- package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -194
- package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
- package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
- package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/dropdown/dropdown.stories.ts +0 -75
- package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -82
- package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
- package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -33
- package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/emptyState/emptyState.stories.ts +0 -65
- package/src/modules/dx/feature/__tests__/feature.test.ts +0 -30
- package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
- package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -81
- package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -113
- package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -43
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
- package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -47
- package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
- package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
- package/src/modules/dx/footer/__tests__/footer.test.ts +0 -136
- package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
- package/src/modules/dx/footer/footer.stories.ts +0 -70
- package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
- package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
- package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
- package/src/modules/dx/grid/__tests__/grid.test.ts +0 -45
- package/src/modules/dx/grid/grid.stories.ts +0 -128
- package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
- package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/groupBio/groupBio.css +0 -49
- package/src/modules/dx/groupBio/groupBio.html +0 -29
- package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
- package/src/modules/dx/groupBio/groupBio.ts +0 -41
- package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -57
- package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
- package/src/modules/dx/groupText/groupText.stories.ts +0 -81
- package/src/modules/dx/headTags/headTags.html +0 -1
- package/src/modules/dx/headTags/headTags.ts +0 -13
- package/src/modules/dx/header/__tests__/header.test.ts +0 -194
- package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
- package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
- package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/dx/header/__tests__/mockProps.ts +0 -173
- package/src/modules/dx/header/header.stories.ts +0 -136
- package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
- package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
- package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -50
- package/src/modules/dx/headerNavOption/__tests__/headerNavOption.test.ts +0 -47
- package/src/modules/dx/headerNavOption/headerNavOption.css +0 -38
- package/src/modules/dx/headerNavOption/headerNavOption.html +0 -5
- package/src/modules/dx/headerNavOption/headerNavOption.ts +0 -15
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -273
- package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
- package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/headerSearch/scopes.ts +0 -10
- package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -53
- package/src/modules/dx/helmet/helmet.stories.ts +0 -53
- package/src/modules/dx/hr/__tests__/hr.test.ts +0 -77
- package/src/modules/dx/hr/__tests__/mockProps.ts +0 -18
- package/src/modules/dx/hr/hr.stories.ts +0 -55
- package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
- package/src/modules/dx/icon/icon.stories.ts +0 -98
- package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
- package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
- package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
- package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
- package/src/modules/dx/input/__tests__/input.test.ts +0 -162
- package/src/modules/dx/input/input.stories.ts +0 -48
- package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
- package/src/modules/dx/instrumentation/instrumentation.html +0 -1
- package/src/modules/dx/instrumentation/instrumentation.ts +0 -116
- package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -76
- package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -42
- package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
- package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
- package/src/modules/dx/lazy/lazy.html +0 -5
- package/src/modules/dx/lazy/lazy.stories.ts +0 -132
- package/src/modules/dx/lazy/lazy.ts +0 -170
- package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
- package/src/modules/dx/pagination/pagination.stories.ts +0 -88
- package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
- package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
- package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
- package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
- package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
- package/src/modules/dx/podcastSubscription/podcastSubscription.css +0 -92
- package/src/modules/dx/podcastSubscription/podcastSubscription.html +0 -24
- package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
- package/src/modules/dx/podcastSubscription/podcastSubscription.ts +0 -58
- package/src/modules/dx/popover/__tests__/popover.test.ts +0 -207
- package/src/modules/dx/popover/popover.stories.ts +0 -82
- package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
- package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
- package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
- package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
- package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
- package/src/modules/dx/searchResults/searchResults.stories.ts +0 -38
- package/src/modules/dx/section/__tests__/section.test.ts +0 -17
- package/src/modules/dx/section/section.stories.ts +0 -381
- package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
- package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
- package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -569
- package/src/modules/dx/sidebar/sidebar.stories.ts +0 -139
- package/src/modules/dx/socials/__tests__/socials.test.ts +0 -124
- package/src/modules/dx/socials/socials.stories.ts +0 -24
- package/src/modules/dx/tab/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/tab/__tests__/tab.test.ts +0 -71
- package/src/modules/dx/tabPanel/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/tabPanel/__tests__/tabPanel.test.ts +0 -46
- package/src/modules/dx/tabs/__tests__/mockProps.ts +0 -3
- package/src/modules/dx/tabs/__tests__/tabs.test.ts +0 -47
- package/src/modules/dx/tabs/tabs.css +0 -7
- package/src/modules/dx/tabs/tabs.html +0 -21
- package/src/modules/dx/tabs/tabs.stories.ts +0 -74
- package/src/modules/dx/toc/__tests__/mockProps.ts +0 -22
- package/src/modules/dx/toc/__tests__/toc.test.ts +0 -116
- package/src/modules/dx/toc/toc.stories.ts +0 -26
- package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -66
- package/src/modules/dx/tooltip/tippy.css +0 -1
- package/src/modules/dx/tooltip/tooltip.stories.ts +0 -65
- package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
- package/src/modules/dx/tree/__tests__/tree.test.ts +0 -357
- package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
- package/src/modules/dx/tree/tree.stories.ts +0 -65
- package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -370
- package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -178
- package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -63
- package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -79
- package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -76
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.css +0 -12
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.html +0 -11
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +0 -18
- package/src/modules/tests/buttonTest/buttonTest.html +0 -3
- package/src/modules/tests/buttonTest/buttonTest.ts +0 -3
- package/src/modules/tests/codeBlockTest/codeBlockTest.js +0 -4
- package/src/modules/tests/dropdownTest/dropdownTest.html +0 -5
- package/src/modules/tests/dropdownTest/dropdownTest.ts +0 -17
- package/src/modules/tests/featureGridTest/featureGridTest.html +0 -7
- package/src/modules/tests/featureGridTest/featureGridTest.ts +0 -5
- package/src/modules/tests/instrumentationTest/instrumentationTest.html +0 -4
- package/src/modules/tests/instrumentationTest/instrumentationTest.ts +0 -8
- package/src/modules/tests/popoverTest/popoverTest.html +0 -6
- package/src/modules/tests/popoverTest/popoverTest.ts +0 -5
- package/src/modules/utils/css/css.ts +0 -2
- package/src/modules/utils/jest/jest.ts +0 -13
- package/src/modules/utils/prismjs/prismjs.ts +0 -3225
- package/src/modules/utils/storybook/storybook.ts +0 -33
- package/src/modules/utils/tests/tests.ts +0 -14
- package/src/modules/utils/wordpress/__tests__/wordpress.test.ts +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
4
|
display: block;
|
|
@@ -38,3 +38,15 @@ dx-icon {
|
|
|
38
38
|
.shape-square {
|
|
39
39
|
border-radius: var(--dx-g-spacing-sm);
|
|
40
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
|
+
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class={className} style={style}>
|
|
3
|
-
<dx-icon
|
|
4
|
-
color={color}
|
|
5
|
-
symbol={symbol}
|
|
6
|
-
sprite={sprite}
|
|
7
|
-
size="override"
|
|
8
|
-
></dx-icon>
|
|
2
|
+
<div class={className} style={style} part="badge">
|
|
3
|
+
<dx-icon symbol={symbol} sprite={sprite} size={iconSize}></dx-icon>
|
|
9
4
|
</div>
|
|
10
5
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { IconSprite, IconSymbol, IconBadgeShape } from "typings/custom";
|
|
4
|
-
import { toDxColor } from "
|
|
4
|
+
import { toDxColor } from "dxUtils/css";
|
|
5
5
|
|
|
6
6
|
const validShapes = ["square", "circle"];
|
|
7
7
|
|
|
@@ -10,6 +10,8 @@ export default class IconBadge extends LightningElement {
|
|
|
10
10
|
@api symbol!: IconSymbol;
|
|
11
11
|
@api color?: string | null = null;
|
|
12
12
|
@api backgroundColor?: string;
|
|
13
|
+
@api backgroundSize?: string;
|
|
14
|
+
@api iconSize?: string = "override";
|
|
13
15
|
|
|
14
16
|
_shape: IconBadgeShape = "circle";
|
|
15
17
|
@api
|
|
@@ -30,13 +32,21 @@ export default class IconBadge extends LightningElement {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
get className() {
|
|
33
|
-
return cx(
|
|
35
|
+
return cx(
|
|
36
|
+
"icon-badge",
|
|
37
|
+
`shape-${this.shape}`,
|
|
38
|
+
this.backgroundSize && `background-${this.backgroundSize}`
|
|
39
|
+
);
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
get style() {
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
|
|
40
|
-
|
|
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}`;
|
|
41
51
|
}
|
|
42
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import "
|
|
2
|
-
@import "
|
|
3
|
-
@import "
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
@import "dxHelpers/button";
|
|
4
4
|
|
|
5
5
|
:host {
|
|
6
6
|
--dx-c-image-and-label-text-color: var(--dx-g-text-label-color);
|
|
@@ -17,7 +17,6 @@ img {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
span {
|
|
20
|
-
margin-top: 3px;
|
|
21
20
|
white-space: nowrap;
|
|
22
21
|
}
|
|
23
22
|
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div if:false={href} class="container">
|
|
3
|
-
<img
|
|
3
|
+
<img
|
|
4
|
+
if:true={imgSrc}
|
|
5
|
+
class={imgClass}
|
|
6
|
+
src={imgSrc}
|
|
7
|
+
alt={imgAlt}
|
|
8
|
+
part="image"
|
|
9
|
+
/>
|
|
4
10
|
<span class="dx-text-label-1-dark" part="label">{label}</span>
|
|
5
11
|
</div>
|
|
6
12
|
<a if:true={href} href={href} class="container">
|
|
7
|
-
<img
|
|
13
|
+
<img
|
|
14
|
+
if:true={imgSrc}
|
|
15
|
+
class={imgClass}
|
|
16
|
+
src={imgSrc}
|
|
17
|
+
alt={imgAlt}
|
|
18
|
+
part="image"
|
|
19
|
+
/>
|
|
8
20
|
<span class="dx-text-label-1-dark" part="label">{label}</span>
|
|
9
21
|
</a>
|
|
10
22
|
</template>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
2
3
|
|
|
3
4
|
:host {
|
|
4
5
|
--dx-c-input-background-active: white;
|
|
5
6
|
--dx-c-input-background: white;
|
|
6
|
-
--dx-c-input-border-active:
|
|
7
|
+
--dx-c-input-border-active: 2px solid var(--dx-g-blue-vibrant-50);
|
|
7
8
|
--dx-c-input-border-radius: var(--dx-g-spacing-xs);
|
|
8
9
|
--dx-c-input-border: 1px solid var(--dx-g-gray-90);
|
|
9
10
|
--dx-c-input-boxshadow-active: none;
|
|
@@ -20,6 +21,8 @@
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
.input-group {
|
|
24
|
+
--error-color: var(--dx-g-red-vibrant-50);
|
|
25
|
+
|
|
23
26
|
height: var(--dx-c-input-height);
|
|
24
27
|
width: var(--dx-c-input-width);
|
|
25
28
|
max-width: inherit;
|
|
@@ -48,16 +51,19 @@
|
|
|
48
51
|
flex-grow: 1;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
.input-container.has-
|
|
54
|
+
.input-container.has-floating-item {
|
|
52
55
|
padding-right: var(--dx-g-spacing-sm);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
.input-container.state-focused {
|
|
56
59
|
background: var(--dx-c-input-background-active);
|
|
57
|
-
border: var(--dx-c-input-border-active);
|
|
58
60
|
box-shadow: var(--dx-c-input-boxshadow-active);
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
.input-container.state-focused:not(.has-error) {
|
|
64
|
+
border: var(--dx-c-input-border-active);
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
.input-container > dx-icon {
|
|
62
68
|
color: var(--dx-c-input-icon-color);
|
|
63
69
|
margin-left: var(--dx-g-spacing-sm);
|
|
@@ -84,6 +90,20 @@ input {
|
|
|
84
90
|
background: none;
|
|
85
91
|
}
|
|
86
92
|
|
|
93
|
+
label {
|
|
94
|
+
color: var(--sds-g-gray-11);
|
|
95
|
+
display: inline-block;
|
|
96
|
+
font-size: var(--dx-g-text-xs);
|
|
97
|
+
hyphens: auto;
|
|
98
|
+
margin-bottom: var(--dx-g-spacing-2xs);
|
|
99
|
+
padding-right: var(--dx-g-spacing-sm);
|
|
100
|
+
padding-top: var(--dx-g-spacing-xs);
|
|
101
|
+
overflow-wrap: break-word;
|
|
102
|
+
word-wrap: break-word;
|
|
103
|
+
-ms-hyphens: auto;
|
|
104
|
+
-webkit-hyphens: auto;
|
|
105
|
+
}
|
|
106
|
+
|
|
87
107
|
.input-group.size-small input {
|
|
88
108
|
padding: 0 var(--dx-g-spacing-sm);
|
|
89
109
|
}
|
|
@@ -102,6 +122,7 @@ input::placeholder {
|
|
|
102
122
|
}
|
|
103
123
|
|
|
104
124
|
.shortcut {
|
|
125
|
+
align-items: center;
|
|
105
126
|
display: flex;
|
|
106
127
|
flex-shrink: 0;
|
|
107
128
|
flex-direction: row;
|
|
@@ -112,6 +133,49 @@ input::placeholder {
|
|
|
112
133
|
text-transform: uppercase;
|
|
113
134
|
}
|
|
114
135
|
|
|
136
|
+
.description {
|
|
137
|
+
margin-top: var(--dx-g-spacing-xs);
|
|
138
|
+
font-family: var(--dx-g-font-sans);
|
|
139
|
+
font-size: var(--dx-g-text-xs);
|
|
140
|
+
line-height: 18px;
|
|
141
|
+
color: var(--dx-g-gray-50);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.description.hide {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.description a {
|
|
149
|
+
color: var(--dx-g-blue-vibrant-50);
|
|
150
|
+
}
|
|
151
|
+
|
|
115
152
|
.shortcut > img {
|
|
116
153
|
margin-right: var(--dx-g-spacing-2xs);
|
|
117
154
|
}
|
|
155
|
+
|
|
156
|
+
.has-error {
|
|
157
|
+
background-clip: padding-box;
|
|
158
|
+
border: 2px solid var(--error-color);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.has-error.state-focused {
|
|
162
|
+
box-shadow: 0 0 3px var(--dx-g-blue-vibrant-50);
|
|
163
|
+
-webkit-box-shadow: 0 0 3px var(--dx-g-blue-vibrant-50);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.error-message-box {
|
|
167
|
+
margin-top: var(--dx-g-spacing-xs);
|
|
168
|
+
display: block;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.clear-button > dx-icon {
|
|
172
|
+
--dx-c-icon-color: var(--sds-g-gray-9);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.clear-button > dx-icon::part(svg) {
|
|
176
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.clear-button:hover > dx-icon {
|
|
180
|
+
--dx-c-icon-color: var(--dx-g-blue-vibrant-30);
|
|
181
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<label if:true={label} id="label" for="input" tabindex="-1">
|
|
3
|
+
{label}
|
|
4
|
+
<abbr if:true={required}>*</abbr>
|
|
5
|
+
</label>
|
|
2
6
|
<div class={className}>
|
|
3
7
|
<div class={inputContainerClassName} onclick={onClick} role={role}>
|
|
4
8
|
<dx-icon
|
|
@@ -10,16 +14,27 @@
|
|
|
10
14
|
aria-label={ariaLabel}
|
|
11
15
|
aria-keyshortcuts={ariaKeyShortcuts}
|
|
12
16
|
autocomplete={autocomplete}
|
|
17
|
+
name={name}
|
|
13
18
|
disabled={inputDisabled}
|
|
19
|
+
id="input"
|
|
14
20
|
onblur={onInputBlur}
|
|
15
21
|
onfocus={onInputFocus}
|
|
16
22
|
oninput={onInputChange}
|
|
17
23
|
onkeydown={onKeyDown}
|
|
18
24
|
placeholder={placeholder}
|
|
19
25
|
type={type}
|
|
20
|
-
value={
|
|
26
|
+
value={value}
|
|
27
|
+
aria-labelledby="label description"
|
|
21
28
|
/>
|
|
22
|
-
<
|
|
29
|
+
<button
|
|
30
|
+
class="clear-button"
|
|
31
|
+
aria-label="Clear"
|
|
32
|
+
if:true={showClearButton}
|
|
33
|
+
onclick={clear}
|
|
34
|
+
>
|
|
35
|
+
<dx-icon symbol="clear" size="medium"></dx-icon>
|
|
36
|
+
</button>
|
|
37
|
+
<div class="shortcut" if:true={showShortcutKey}>
|
|
23
38
|
<img src={shortcutImgSrc} alt={shortcutImgAlt} />
|
|
24
39
|
<span>{shortcutKey}</span>
|
|
25
40
|
</div>
|
|
@@ -34,4 +49,14 @@
|
|
|
34
49
|
{submitLabel}
|
|
35
50
|
</dx-button>
|
|
36
51
|
</div>
|
|
52
|
+
<div id="description" class={descriptionClassName} tabindex="-1">
|
|
53
|
+
{description}
|
|
54
|
+
</div>
|
|
55
|
+
<div
|
|
56
|
+
if:true={errorMessage}
|
|
57
|
+
aria-live="assertive"
|
|
58
|
+
class="error-message-box dx-text-form-error-message"
|
|
59
|
+
>
|
|
60
|
+
{errorMessage}
|
|
61
|
+
</div>
|
|
37
62
|
</template>
|
|
@@ -1,44 +1,102 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { IconSize, IconSymbol } from "typings/custom";
|
|
4
|
-
import { isMac } from "
|
|
4
|
+
import { isMac } from "dxUtils/devices";
|
|
5
|
+
import { setContainerInnerHtml } from "dxUtils/lwc";
|
|
5
6
|
import { isValidEmail } from "./validators";
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
type ValidatorMap = {
|
|
9
|
+
[key: string]: {
|
|
10
|
+
validator: (value: string | null) => boolean;
|
|
11
|
+
errorMessage: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const typeValidatorMap: ValidatorMap = {
|
|
16
|
+
email: {
|
|
17
|
+
validator: isValidEmail,
|
|
18
|
+
errorMessage: "Enter valid email"
|
|
19
|
+
}
|
|
9
20
|
};
|
|
10
21
|
export default class Input extends LightningElement {
|
|
11
22
|
@api ariaLabel!: string;
|
|
12
23
|
@api autocomplete: string | null = null;
|
|
24
|
+
@api clearable: boolean = false;
|
|
13
25
|
@api disabled: boolean = false;
|
|
14
26
|
@api iconSize: IconSize = "medium";
|
|
15
27
|
@api iconSymbol: IconSymbol | null = null;
|
|
28
|
+
@api label?: string;
|
|
29
|
+
@api descriptionMarkup?: string;
|
|
16
30
|
@api loading: boolean = false;
|
|
31
|
+
@api missingErrorMessage: string = "Complete this field";
|
|
32
|
+
@api formatErrorMessage?: string;
|
|
33
|
+
@api name?: string;
|
|
17
34
|
@api placeholder!: string;
|
|
35
|
+
@api required = false;
|
|
18
36
|
@api role: string | null = null;
|
|
19
37
|
@api shortcutKey: string | null = null;
|
|
20
38
|
@api size: "small" | "large" | "override" = "small";
|
|
21
39
|
@api submitLabel?: string | null = null;
|
|
22
40
|
@api type: string = "text";
|
|
23
|
-
@api
|
|
41
|
+
@api validityOnBlur = false;
|
|
42
|
+
|
|
43
|
+
@api
|
|
44
|
+
get value() {
|
|
45
|
+
return this._value;
|
|
46
|
+
}
|
|
47
|
+
set value(value: string | null) {
|
|
48
|
+
this._value = value || "";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@api
|
|
52
|
+
get errorMessage() {
|
|
53
|
+
return this._errorMessage;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
set errorMessage(value) {
|
|
57
|
+
this._errorMessage = value;
|
|
58
|
+
}
|
|
59
|
+
|
|
24
60
|
@api focus() {
|
|
25
61
|
if (this.input) {
|
|
26
62
|
this.input.focus();
|
|
27
63
|
}
|
|
28
64
|
}
|
|
29
65
|
|
|
30
|
-
|
|
66
|
+
@api
|
|
67
|
+
reportValidity(): boolean {
|
|
68
|
+
if (this.isRequiredAndFilled) {
|
|
69
|
+
this._errorMessage = this.missingErrorMessage;
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const typeValidator = typeValidatorMap[this.type];
|
|
74
|
+
if (typeValidator && !typeValidator.validator(this.value)) {
|
|
75
|
+
this._errorMessage =
|
|
76
|
+
this.formatErrorMessage || typeValidator.errorMessage;
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
this._errorMessage = "";
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private _errorMessage: string = "";
|
|
31
85
|
private focused: boolean = false;
|
|
32
86
|
private input: HTMLInputElement | null = null;
|
|
33
87
|
private _value: string | null = null;
|
|
34
88
|
private _loading: boolean = false;
|
|
35
89
|
|
|
36
|
-
private get
|
|
37
|
-
return this.
|
|
90
|
+
private get showClearButton(): boolean {
|
|
91
|
+
return this.clearable && !!this.value;
|
|
38
92
|
}
|
|
39
93
|
|
|
40
|
-
private get
|
|
41
|
-
return this.
|
|
94
|
+
private get showShortcutKey(): boolean {
|
|
95
|
+
return !this.showClearButton && !!this.shortcutKey;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private get ariaKeyShortcuts() {
|
|
99
|
+
return this.shortcutKey ? `meta+${this.shortcutKey}` : null;
|
|
42
100
|
}
|
|
43
101
|
|
|
44
102
|
private get inputLoading() {
|
|
@@ -46,8 +104,12 @@ export default class Input extends LightningElement {
|
|
|
46
104
|
}
|
|
47
105
|
|
|
48
106
|
private get inputInvalid() {
|
|
49
|
-
const
|
|
50
|
-
return
|
|
107
|
+
const typeValidator = typeValidatorMap[this.type];
|
|
108
|
+
return (
|
|
109
|
+
this.isRequiredAndFilled &&
|
|
110
|
+
typeValidator &&
|
|
111
|
+
!typeValidator.validator(this.value)
|
|
112
|
+
);
|
|
51
113
|
}
|
|
52
114
|
|
|
53
115
|
private get inputDisabled() {
|
|
@@ -58,11 +120,17 @@ export default class Input extends LightningElement {
|
|
|
58
120
|
return cx("input-group", `size-${this.size}`);
|
|
59
121
|
}
|
|
60
122
|
|
|
123
|
+
private get descriptionClassName() {
|
|
124
|
+
return cx("description", !this.descriptionMarkup && "hide");
|
|
125
|
+
}
|
|
126
|
+
|
|
61
127
|
private get inputContainerClassName() {
|
|
62
128
|
return cx(
|
|
63
129
|
"input-container",
|
|
64
130
|
this.focused && "state-focused",
|
|
65
|
-
this.
|
|
131
|
+
(this.showClearButton || this.showShortcutKey) &&
|
|
132
|
+
"has-floating-item",
|
|
133
|
+
!!this.errorMessage && "has-error"
|
|
66
134
|
);
|
|
67
135
|
}
|
|
68
136
|
|
|
@@ -82,6 +150,10 @@ export default class Input extends LightningElement {
|
|
|
82
150
|
return `${this.commandKey}-${this.shortcutKey} is the search shortcut`;
|
|
83
151
|
}
|
|
84
152
|
|
|
153
|
+
private get isRequiredAndFilled() {
|
|
154
|
+
return this.required && (!this.value || !this.value.trim());
|
|
155
|
+
}
|
|
156
|
+
|
|
85
157
|
connectedCallback() {
|
|
86
158
|
window.addEventListener("keydown", this.onWindowKeydown);
|
|
87
159
|
}
|
|
@@ -94,9 +166,8 @@ export default class Input extends LightningElement {
|
|
|
94
166
|
if (!this.input) {
|
|
95
167
|
this.input = <HTMLInputElement>this.template.querySelector("input");
|
|
96
168
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
169
|
+
const container = this.template.querySelector(".description");
|
|
170
|
+
setContainerInnerHtml(container, this.descriptionMarkup);
|
|
100
171
|
}
|
|
101
172
|
|
|
102
173
|
onClick() {
|
|
@@ -111,51 +182,56 @@ export default class Input extends LightningElement {
|
|
|
111
182
|
|
|
112
183
|
onInputBlur() {
|
|
113
184
|
this.focused = false;
|
|
185
|
+
|
|
186
|
+
if (this.validityOnBlur) {
|
|
187
|
+
this.reportValidity();
|
|
188
|
+
}
|
|
114
189
|
}
|
|
115
190
|
|
|
116
191
|
onInputChange(e: InputEvent) {
|
|
117
192
|
if (!e || !e.target) {
|
|
118
193
|
return;
|
|
119
194
|
}
|
|
120
|
-
this.
|
|
121
|
-
this.dispatchChange();
|
|
195
|
+
this.dispatchChange((<HTMLInputElement>e.target).value || "");
|
|
122
196
|
}
|
|
123
197
|
|
|
124
198
|
onButtonClick(e: Event) {
|
|
125
199
|
if (!this.buttonDisabled) {
|
|
126
200
|
e.stopPropagation();
|
|
127
201
|
}
|
|
128
|
-
this.
|
|
202
|
+
this.submit();
|
|
129
203
|
}
|
|
130
204
|
|
|
131
|
-
dispatchChange() {
|
|
132
|
-
this.
|
|
205
|
+
dispatchChange(value: string) {
|
|
206
|
+
this._value = value;
|
|
207
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
|
|
133
208
|
}
|
|
134
209
|
|
|
135
|
-
|
|
136
|
-
|
|
210
|
+
clear(e?: Event) {
|
|
211
|
+
if (e) {
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
}
|
|
214
|
+
this.dispatchChange("");
|
|
215
|
+
this.dispatchEvent(new CustomEvent("clear"));
|
|
216
|
+
if (this.input) {
|
|
217
|
+
this.input.blur();
|
|
218
|
+
}
|
|
137
219
|
}
|
|
138
220
|
|
|
139
|
-
|
|
221
|
+
submit = async () => {
|
|
140
222
|
if (this.inputInvalid) {
|
|
141
223
|
return;
|
|
142
224
|
}
|
|
143
|
-
this.
|
|
225
|
+
this.dispatchEvent(new CustomEvent("submit", { detail: this.value }));
|
|
144
226
|
};
|
|
145
227
|
|
|
146
228
|
private onKeyDown(e: KeyboardEvent) {
|
|
147
229
|
switch (e.key) {
|
|
148
230
|
case "Escape":
|
|
149
|
-
this.
|
|
150
|
-
if (this.input) {
|
|
151
|
-
this.input.blur();
|
|
152
|
-
this._value = "";
|
|
153
|
-
this.dispatchChange();
|
|
154
|
-
}
|
|
231
|
+
this.clear();
|
|
155
232
|
break;
|
|
156
233
|
case "Enter":
|
|
157
|
-
this.
|
|
158
|
-
this.dispatchEvent(new CustomEvent("enter"));
|
|
234
|
+
this.submit();
|
|
159
235
|
break;
|
|
160
236
|
default:
|
|
161
237
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
--dx-c-logo-label-color: var(--dx-g-blue-vibrant-20);
|
|
6
|
+
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
a {
|
|
11
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
a:hover {
|
|
17
|
+
color: var(--dx-g-blue-vibrant-40);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.logo-link {
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
margin-right: var(--dx-g-spacing-xs);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.logo-link > span {
|
|
26
|
+
color: var(--dx-c-logo-label-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.logo-link > img {
|
|
30
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
31
|
+
width: 28px;
|
|
32
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
|
|
3
|
+
.badge {
|
|
4
|
+
--background: var(--dx-g-cloud-blue-natural-90);
|
|
5
|
+
--border-radius: var(--dx-g-spacing-xs);
|
|
6
|
+
--color: var(--dx-g-blue-vibrant-20);
|
|
7
|
+
--height: var(--dx-g-spacing-lg);
|
|
8
|
+
--horizontal-spacing: var(--dx-g-spacing-sm);
|
|
9
|
+
|
|
10
|
+
color: var(--dx-c-metadata-badge-color, var(--color));
|
|
11
|
+
background: var(--dx-c-metadata-badge-background, var(--background));
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
height: var(--height);
|
|
16
|
+
width: min-content;
|
|
17
|
+
padding: 0 var(--horizontal-spacing);
|
|
18
|
+
border-radius: var(--border-radius);
|
|
19
|
+
font-family: var(--dx-g-font-display);
|
|
20
|
+
font-size: 10px;
|
|
21
|
+
text-align: center;
|
|
22
|
+
letter-spacing: 0.6px;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badge.size-small {
|
|
28
|
+
--height: var(--dx-g-spacing-md);
|
|
29
|
+
--horizontal-spacing: var(--dx-g-spacing-xs);
|
|
30
|
+
|
|
31
|
+
font-size: 8px;
|
|
32
|
+
letter-spacing: 0.5px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media screen and (max-width: 768px) {
|
|
36
|
+
.badge:not(.size-small) {
|
|
37
|
+
height: var(--dx-g-spacing-lg);
|
|
38
|
+
padding: 0 var(--dx-g-spacing-sm);
|
|
39
|
+
font-size: var(--dx-g-text-2xs);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
import { Color, TypeBadgeSize } from "typings/custom";
|
|
4
|
+
import { colorToDxColors, buildStyleColorVariables } from "dxUtils/css";
|
|
5
|
+
|
|
6
|
+
export default class MetadataBadge extends LightningElement {
|
|
7
|
+
@api size: TypeBadgeSize = "default";
|
|
8
|
+
@api color?: Color;
|
|
9
|
+
@api value!: string;
|
|
10
|
+
|
|
11
|
+
private get className(): string {
|
|
12
|
+
return cx("badge", `size-${this.size}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
private get style(): string {
|
|
16
|
+
if (this.color) {
|
|
17
|
+
const variables = colorToDxColors(this.color as Color);
|
|
18
|
+
if (variables) {
|
|
19
|
+
return buildStyleColorVariables(variables);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
}
|