@salesforcedevs/dx-components 0.25.5 → 0.26.1-alpha0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lwc.config.json +1 -0
- package/package.json +5 -4
- package/LICENSE +0 -12
- package/src/assets/icons/action-sprite/svg/symbols.svg +0 -1
- package/src/assets/icons/brand-sprite/svg/symbols.svg +0 -1381
- package/src/assets/icons/custom-sprite/svg/symbols.svg +0 -1
- package/src/assets/icons/doctype-sprite/svg/symbols.svg +0 -1
- package/src/assets/icons/general-sprite/svg/symbols.svg +0 -3013
- package/src/assets/icons/salesforcebrand-sprite/svg/symbols.svg +0 -257
- package/src/assets/icons/standard-sprite/svg/symbols.svg +0 -1
- package/src/assets/icons/utility-sprite/svg/symbols.svg +0 -1
- package/src/assets/svg/card-news-learn-moar.svg +0 -415
- package/src/assets/svg/cloud-1.svg +0 -24
- package/src/assets/svg/cloud-2.svg +0 -18
- package/src/assets/svg/codey.svg +0 -93
- package/src/assets/svg/command.svg +0 -9
- package/src/assets/svg/control.svg +0 -10
- package/src/assets/svg/docs-empty-state-small.svg +0 -72
- package/src/assets/svg/docs-empty-state.svg +0 -86
- package/src/assets/svg/dsc-home-news-bear.svg +0 -3
- package/src/assets/svg/dsc-home-news-community.png +0 -0
- package/src/assets/svg/dsc-home-news-goatbear.svg +0 -257
- package/src/assets/svg/dsc-home-news-samplegallery.svg +0 -76
- package/src/assets/svg/empty-state-assistant.svg +0 -1
- 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 +0 -10
- package/src/assets/svg/feature-backdrop2.svg +0 -10
- package/src/assets/svg/featured-demo-art-blank.svg +0 -76
- package/src/assets/svg/featured-demo-art-eBikes.svg +0 -77
- package/src/assets/svg/footer-graphic-large.svg +0 -207
- package/src/assets/svg/footer-graphic-mountains-small.svg +0 -17
- package/src/assets/svg/footer-graphic-mountains.svg +0 -21
- package/src/assets/svg/footer-graphic-trees-small.svg +0 -33
- package/src/assets/svg/footer-graphic-trees.svg +0 -62
- package/src/assets/svg/lake-mountain.svg +0 -79
- package/src/assets/svg/podcast-subscription-clouds-small.svg +0 -49
- package/src/assets/svg/podcast-subscription-clouds.svg +0 -57
- package/src/assets/svg/podcasts-subscription-apple.svg +0 -164
- package/src/assets/svg/podcasts-subscription-google.svg +0 -29
- package/src/assets/svg/podcasts-subscription-spotify.svg +0 -11
- package/src/assets/svg/salesforce-cloud.svg +0 -7
- package/src/assets/svg/salesforce-logo-corporate.svg +0 -21
- package/src/assets/svg/salesforce-logo.svg +0 -14
- package/src/assets/svg/sidebar-loading.svg +0 -34
- package/src/assets/svg/slack-cta-podcast-background-left.svg +0 -28
- package/src/assets/svg/slack-cta-podcast-background-right.svg +0 -38
- package/src/assets/svg/trees.svg +0 -42
- package/src/modules/dx/banner/__tests__/banner.test.ts +0 -33
- package/src/modules/dx/banner/banner.css +0 -46
- package/src/modules/dx/banner/banner.html +0 -13
- package/src/modules/dx/banner/banner.ts +0 -14
- package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
- package/src/modules/dx/brandThemeProvider/brandCssVars.ts +0 -10
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.html +0 -3
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.ts +0 -46
- package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -140
- package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/breadcrumbs/breadcrumbs.css +0 -111
- package/src/modules/dx/breadcrumbs/breadcrumbs.html +0 -44
- package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +0 -122
- package/src/modules/dx/button/__tests__/button.test.ts +0 -107
- package/src/modules/dx/button/button.css +0 -175
- package/src/modules/dx/button/button.html +0 -43
- package/src/modules/dx/button/button.stories.ts +0 -150
- package/src/modules/dx/button/button.ts +0 -63
- package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -26
- package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/cardBlogPost/cardBlogPost.css +0 -13
- package/src/modules/dx/cardBlogPost/cardBlogPost.html +0 -24
- package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
- package/src/modules/dx/cardBlogPost/cardBlogPost.ts +0 -23
- 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 -20
- package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardCallout/cardCallout.css +0 -57
- package/src/modules/dx/cardCallout/cardCallout.html +0 -15
- package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
- package/src/modules/dx/cardCallout/cardCallout.ts +0 -37
- package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -100
- package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/cardContent/cardContent.css +0 -52
- package/src/modules/dx/cardContent/cardContent.html +0 -59
- package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
- package/src/modules/dx/cardContent/cardContent.ts +0 -68
- package/src/modules/dx/cardDemo/cardDemo.css +0 -1
- package/src/modules/dx/cardDemo/cardDemo.html +0 -12
- package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
- package/src/modules/dx/cardDemo/cardDemo.ts +0 -11
- 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.css +0 -50
- package/src/modules/dx/cardDocs/cardDocs.html +0 -20
- package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
- package/src/modules/dx/cardDocs/cardDocs.ts +0 -30
- package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -95
- package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardEvent/cardEvent.css +0 -107
- package/src/modules/dx/cardEvent/cardEvent.html +0 -94
- package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -153
- package/src/modules/dx/cardEvent/cardEvent.ts +0 -42
- package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +0 -193
- package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +0 -21
- package/src/modules/dx/cardExpanded/cardExpanded.css +0 -49
- package/src/modules/dx/cardExpanded/cardExpanded.html +0 -37
- package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +0 -59
- package/src/modules/dx/cardExpanded/cardExpanded.ts +0 -45
- package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
- package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/cardGrid/cardGrid.css +0 -89
- package/src/modules/dx/cardGrid/cardGrid.html +0 -46
- package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
- package/src/modules/dx/cardGrid/cardGrid.ts +0 -140
- package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +0 -87
- package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardMinimal/cardMinimal.css +0 -31
- package/src/modules/dx/cardMinimal/cardMinimal.html +0 -13
- package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +0 -32
- package/src/modules/dx/cardMinimal/cardMinimal.ts +0 -3
- package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -58
- package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardNews/cardNews.css +0 -159
- package/src/modules/dx/cardNews/cardNews.html +0 -37
- package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
- package/src/modules/dx/cardNews/cardNews.ts +0 -62
- package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -68
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +0 -19
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.html +0 -36
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.ts +0 -36
- 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 -66
- package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/cardSmall/cardSmall.css +0 -32
- package/src/modules/dx/cardSmall/cardSmall.html +0 -42
- package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
- package/src/modules/dx/cardSmall/cardSmall.ts +0 -38
- package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
- package/src/modules/dx/cardTitle/cardTitle.css +0 -41
- package/src/modules/dx/cardTitle/cardTitle.html +0 -20
- package/src/modules/dx/cardTitle/cardTitle.ts +0 -27
- 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.css +0 -24
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.html +0 -20
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.ts +0 -18
- 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.css +0 -14
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.html +0 -26
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.ts +0 -13
- package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -85
- package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
- package/src/modules/dx/checkbox/checkbox.css +0 -168
- package/src/modules/dx/checkbox/checkbox.html +0 -26
- package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
- package/src/modules/dx/checkbox/checkbox.ts +0 -55
- 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.css +0 -12
- package/src/modules/dx/checkboxGroup/checkboxGroup.html +0 -15
- package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
- package/src/modules/dx/checkboxGroup/checkboxGroup.ts +0 -77
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -238
- package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
- package/src/modules/dx/codeBlock/codeBlock.css +0 -128
- package/src/modules/dx/codeBlock/codeBlock.html +0 -79
- package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
- package/src/modules/dx/codeBlock/codeBlock.ts +0 -215
- package/src/modules/dx/codeBlock/darkTheme.css +0 -88
- package/src/modules/dx/codeBlock/lightTheme.css +0 -72
- package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -165
- package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
- package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
- package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/dropdown/dropdown.css +0 -93
- package/src/modules/dx/dropdown/dropdown.html +0 -67
- package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
- package/src/modules/dx/dropdown/dropdown.ts +0 -182
- package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
- package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
- package/src/modules/dx/dropdownOption/dropdownOption.css +0 -61
- package/src/modules/dx/dropdownOption/dropdownOption.html +0 -53
- package/src/modules/dx/dropdownOption/dropdownOption.ts +0 -39
- package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
- package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/emptyState/emptyState.css +0 -64
- package/src/modules/dx/emptyState/emptyState.html +0 -9
- package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
- package/src/modules/dx/emptyState/emptyState.ts +0 -20
- package/src/modules/dx/feature/__tests__/feature.test.ts +0 -51
- package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/feature/feature.css +0 -135
- package/src/modules/dx/feature/feature.html +0 -33
- package/src/modules/dx/feature/feature.ts +0 -34
- package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
- package/src/modules/dx/featureGrid/featureGrid.html +0 -3
- package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
- package/src/modules/dx/featureGrid/featureGrid.ts +0 -15
- package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -178
- package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +0 -469
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +0 -96
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +0 -113
- package/src/modules/dx/featuredContentHeader/svgs.ts +0 -35
- package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -43
- package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
- package/src/modules/dx/featuresList/featuresList.css +0 -24
- package/src/modules/dx/featuresList/featuresList.html +0 -20
- package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
- package/src/modules/dx/featuresList/featuresList.ts +0 -21
- package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
- package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
- package/src/modules/dx/footer/footer.css +0 -405
- package/src/modules/dx/footer/footer.html +0 -145
- package/src/modules/dx/footer/footer.stories.ts +0 -88
- package/src/modules/dx/footer/footer.ts +0 -124
- package/src/modules/dx/footer/links.ts +0 -140
- 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/footerOption/footerOption.css +0 -4
- package/src/modules/dx/footerOption/footerOption.html +0 -12
- package/src/modules/dx/footerOption/footerOption.ts +0 -19
- 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.html +0 -1
- package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +0 -72
- package/src/modules/dx/grid/__tests__/grid.test.ts +0 -32
- package/src/modules/dx/grid/grid.css +0 -48
- package/src/modules/dx/grid/grid.html +0 -3
- package/src/modules/dx/grid/grid.md +0 -14
- package/src/modules/dx/grid/grid.stories.ts +0 -134
- package/src/modules/dx/grid/grid.ts +0 -72
- 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 -69
- package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
- package/src/modules/dx/groupText/groupText.css +0 -119
- package/src/modules/dx/groupText/groupText.html +0 -65
- package/src/modules/dx/groupText/groupText.stories.ts +0 -81
- package/src/modules/dx/groupText/groupText.ts +0 -93
- package/src/modules/dx/headTags/headTags.html +0 -3
- package/src/modules/dx/headTags/headTags.ts +0 -39
- package/src/modules/dx/header/__benchmarks__/header.benchmark.js +0 -45
- package/src/modules/dx/header/__tests__/header.test.ts +0 -236
- package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
- package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
- package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
- package/src/modules/dx/header/header.css +0 -109
- package/src/modules/dx/header/header.html +0 -128
- package/src/modules/dx/header/header.stories.ts +0 -172
- package/src/modules/dx/header/header.ts +0 -27
- package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +0 -160
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.html +0 -73
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +0 -102
- package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.css +0 -5
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.html +0 -14
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +0 -20
- package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
- package/src/modules/dx/headerNav/headerNav.css +0 -31
- package/src/modules/dx/headerNav/headerNav.html +0 -48
- package/src/modules/dx/headerNav/headerNav.ts +0 -56
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -182
- package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
- package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/headerSearch/headerSearch.css +0 -62
- package/src/modules/dx/headerSearch/headerSearch.html +0 -64
- package/src/modules/dx/headerSearch/headerSearch.ts +0 -159
- package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -52
- package/src/modules/dx/helmet/helmet.css +0 -83
- package/src/modules/dx/helmet/helmet.html +0 -39
- package/src/modules/dx/helmet/helmet.stories.ts +0 -53
- package/src/modules/dx/helmet/helmet.ts +0 -27
- package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
- package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/hr/hr.css +0 -55
- package/src/modules/dx/hr/hr.html +0 -23
- package/src/modules/dx/hr/hr.stories.ts +0 -50
- package/src/modules/dx/hr/hr.ts +0 -45
- package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
- package/src/modules/dx/icon/icon.css +0 -14
- package/src/modules/dx/icon/icon.html +0 -11
- package/src/modules/dx/icon/icon.stories.ts +0 -100
- package/src/modules/dx/icon/icon.ts +0 -85
- package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
- package/src/modules/dx/iconBadge/iconBadge.css +0 -40
- package/src/modules/dx/iconBadge/iconBadge.html +0 -10
- package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
- package/src/modules/dx/iconBadge/iconBadge.ts +0 -42
- 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.css +0 -54
- package/src/modules/dx/imageAndLabel/imageAndLabel.html +0 -22
- package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
- package/src/modules/dx/imageAndLabel/imageAndLabel.ts +0 -16
- package/src/modules/dx/input/__tests__/input.test.ts +0 -357
- package/src/modules/dx/input/input.css +0 -165
- package/src/modules/dx/input/input.html +0 -58
- package/src/modules/dx/input/input.stories.ts +0 -102
- package/src/modules/dx/input/input.ts +0 -238
- package/src/modules/dx/input/validators.ts +0 -5
- 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 -83
- package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
- package/src/modules/dx/interactiveImage/interactiveImage.css +0 -59
- package/src/modules/dx/interactiveImage/interactiveImage.html +0 -32
- package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
- package/src/modules/dx/interactiveImage/interactiveImage.ts +0 -71
- 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 -163
- package/src/modules/dx/logo/logo.css +0 -33
- package/src/modules/dx/logo/logo.html +0 -6
- package/src/modules/dx/logo/logo.ts +0 -8
- package/src/modules/dx/newsletterForm/newsletterForm.css +0 -73
- package/src/modules/dx/newsletterForm/newsletterForm.html +0 -73
- package/src/modules/dx/newsletterForm/newsletterForm.ts +0 -238
- package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
- package/src/modules/dx/pagination/pagination.css +0 -51
- package/src/modules/dx/pagination/pagination.html +0 -45
- package/src/modules/dx/pagination/pagination.stories.ts +0 -88
- package/src/modules/dx/pagination/pagination.ts +0 -93
- 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.css +0 -62
- package/src/modules/dx/podcastHost/podcastHost.html +0 -28
- package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
- package/src/modules/dx/podcastHost/podcastHost.ts +0 -13
- package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
- package/src/modules/dx/podcastPlayer/podcastPlayer.css +0 -10
- package/src/modules/dx/podcastPlayer/podcastPlayer.html +0 -3
- package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
- package/src/modules/dx/podcastPlayer/podcastPlayer.ts +0 -5
- 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__/mockProps.ts +0 -8
- package/src/modules/dx/popover/__tests__/popover.test.ts +0 -313
- package/src/modules/dx/popover/popover.css +0 -63
- package/src/modules/dx/popover/popover.html +0 -16
- package/src/modules/dx/popover/popover.stories.ts +0 -82
- package/src/modules/dx/popover/popover.ts +0 -313
- 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.css +0 -12
- package/src/modules/dx/radioGroup/radioGroup.html +0 -16
- package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
- package/src/modules/dx/radioGroup/radioGroup.ts +0 -65
- 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.html +0 -3
- package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
- package/src/modules/dx/relativeDateTime/relativeDateTime.ts +0 -113
- package/src/modules/dx/searchResults/coveo.css +0 -18989
- package/src/modules/dx/searchResults/searchResults.css +0 -387
- package/src/modules/dx/searchResults/searchResults.html +0 -104
- package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
- package/src/modules/dx/searchResults/searchResults.ts +0 -186
- package/src/modules/dx/section/__tests__/section.test.ts +0 -17
- package/src/modules/dx/section/section.css +0 -130
- package/src/modules/dx/section/section.html +0 -66
- package/src/modules/dx/section/section.stories.ts +0 -381
- package/src/modules/dx/section/section.ts +0 -41
- package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
- package/src/modules/dx/sectionSignup/sectionSignup.css +0 -43
- package/src/modules/dx/sectionSignup/sectionSignup.html +0 -23
- package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
- package/src/modules/dx/sectionSignup/sectionSignup.ts +0 -44
- package/src/modules/dx/select/select.css +0 -44
- package/src/modules/dx/select/select.html +0 -60
- package/src/modules/dx/select/select.stories.ts +0 -59
- package/src/modules/dx/select/select.ts +0 -23
- package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEmptyEvent.ts +0 -6
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEvent.ts +0 -527
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -568
- package/src/modules/dx/sidebar/sidebar.css +0 -192
- package/src/modules/dx/sidebar/sidebar.html +0 -94
- package/src/modules/dx/sidebar/sidebar.stories.ts +0 -188
- package/src/modules/dx/sidebar/sidebar.ts +0 -255
- package/src/modules/dx/sidebarOld/__tests__/mockProps.ts +0 -178
- package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -570
- package/src/modules/dx/sidebarOld/sidebarOld.css +0 -160
- package/src/modules/dx/sidebarOld/sidebarOld.html +0 -70
- package/src/modules/dx/sidebarOld/sidebarOld.stories.ts +0 -139
- package/src/modules/dx/sidebarOld/sidebarOld.ts +0 -187
- package/src/modules/dx/sidebarSearch/__tests__/mockPreloadedState.ts +0 -1686
- package/src/modules/dx/sidebarSearch/__tests__/sidebarSearch.test.ts +0 -175
- package/src/modules/dx/sidebarSearch/sidebarSearch.css +0 -3
- package/src/modules/dx/sidebarSearch/sidebarSearch.html +0 -26
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +0 -440
- package/src/modules/dx/sidebarSearchResult/__tests__/sidebarSearchResult.test.ts +0 -96
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +0 -36
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.html +0 -14
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.ts +0 -70
- package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +0 -48
- package/src/modules/dx/slackCta/slackCta.css +0 -41
- package/src/modules/dx/slackCta/slackCta.html +0 -17
- package/src/modules/dx/slackCta/slackCta.stories.ts +0 -25
- package/src/modules/dx/slackCta/slackCta.ts +0 -13
- package/src/modules/dx/socials/__tests__/socials.test.ts +0 -114
- package/src/modules/dx/socials/socials.css +0 -35
- package/src/modules/dx/socials/socials.html +0 -22
- package/src/modules/dx/socials/socials.stories.ts +0 -24
- package/src/modules/dx/socials/socials.ts +0 -81
- package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
- package/src/modules/dx/spinner/spinner.css +0 -750
- package/src/modules/dx/spinner/spinner.html +0 -6
- package/src/modules/dx/spinner/spinner.stories.ts +0 -69
- package/src/modules/dx/spinner/spinner.ts +0 -20
- package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
- package/src/modules/dx/tab/tab.css +0 -106
- package/src/modules/dx/tab/tab.html +0 -13
- package/src/modules/dx/tab/tab.stories.ts +0 -57
- package/src/modules/dx/tab/tab.ts +0 -52
- package/src/modules/dx/toc/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/toc/__tests__/toc.test.ts +0 -109
- package/src/modules/dx/toc/toc.css +0 -94
- package/src/modules/dx/toc/toc.html +0 -28
- package/src/modules/dx/toc/toc.stories.ts +0 -26
- package/src/modules/dx/toc/toc.ts +0 -77
- package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -22
- package/src/modules/dx/tooltip/microtip.css +0 -269
- package/src/modules/dx/tooltip/tooltip.css +0 -36
- package/src/modules/dx/tooltip/tooltip.html +0 -5
- package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
- package/src/modules/dx/tooltip/tooltip.ts +0 -6
- package/src/modules/dx/topics/__tests__/mockProps.ts +0 -3
- package/src/modules/dx/topics/__tests__/topics.test.ts +0 -31
- package/src/modules/dx/topics/topics.css +0 -25
- package/src/modules/dx/topics/topics.html +0 -12
- package/src/modules/dx/topics/topics.ts +0 -25
- package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
- package/src/modules/dx/tree/__tests__/tree.test.ts +0 -346
- package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
- package/src/modules/dx/tree/tree.css +0 -5
- package/src/modules/dx/tree/tree.html +0 -11
- package/src/modules/dx/tree/tree.stories.ts +0 -65
- package/src/modules/dx/tree/tree.ts +0 -72
- package/src/modules/dx/tree/treeHandler.ts +0 -100
- package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -377
- package/src/modules/dx/treeItem/treeItem.css +0 -14
- package/src/modules/dx/treeItem/treeItem.html +0 -22
- package/src/modules/dx/treeItem/treeItem.ts +0 -110
- package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -168
- package/src/modules/dx/treeTile/treeTile.css +0 -190
- package/src/modules/dx/treeTile/treeTile.html +0 -27
- package/src/modules/dx/treeTile/treeTile.ts +0 -59
- package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -77
- package/src/modules/dx/typeBadge/typeBadge.css +0 -74
- package/src/modules/dx/typeBadge/typeBadge.html +0 -5
- package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -114
- package/src/modules/dx/typeBadge/typeBadge.ts +0 -65
- package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -72
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.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/helpers/animations/animations.css +0 -15
- package/src/modules/helpers/button/button.css +0 -4
- package/src/modules/helpers/card/card.css +0 -258
- package/src/modules/helpers/code/code.css +0 -296
- package/src/modules/helpers/commonHeader/commonHeader.css +0 -130
- package/src/modules/helpers/reset/reset.css +0 -559
- package/src/modules/helpers/sidebar/sidebar.css +0 -21
- package/src/modules/helpers/slds/slds.css +0 -191
- package/src/modules/helpers/table/table.css +0 -110
- package/src/modules/helpers/text/text.css +0 -163
- package/src/modules/test-components/buttonTest/buttonTest.html +0 -3
- package/src/modules/test-components/buttonTest/buttonTest.ts +0 -3
- package/src/modules/test-components/codeBlockTest/codeBlockTest.js +0 -4
- package/src/modules/test-components/featureGridTest/featureGridTest.html +0 -7
- package/src/modules/test-components/featureGridTest/featureGridTest.ts +0 -5
- package/src/modules/test-components/instrumentationTest/instrumentationTest.html +0 -4
- package/src/modules/test-components/instrumentationTest/instrumentationTest.ts +0 -8
- package/src/modules/test-components/popoverTest/popoverTest.html +0 -6
- package/src/modules/test-components/popoverTest/popoverTest.ts +0 -5
- package/src/modules/utils/highlight/__tests__/highlight.test.ts +0 -108
- package/src/modules/utils/highlight/__tests__/mockProps.ts +0 -45
- package/src/modules/utils/highlight/highlight.ts +0 -32
- package/src/modules/utils/normalizers/normalizers.ts +0 -91
- package/src/modules/utils-internal/archiveCard/archiveCard.ts +0 -35
- package/src/modules/utils-internal/coveo/coveo.ts +0 -70
- package/src/modules/utils-internal/css/css.ts +0 -43
- package/src/modules/utils-internal/devices/devices.ts +0 -1
- package/src/modules/utils-internal/headerBase/headerBase.ts +0 -204
- package/src/modules/utils-internal/jest/jest.ts +0 -58
- package/src/modules/utils-internal/options/options.ts +0 -39
- package/src/modules/utils-internal/prismjs/prismjs.html +0 -3
- package/src/modules/utils-internal/prismjs/prismjs.ts +0 -3321
- package/src/modules/utils-internal/recentSearches/__tests__/recentSearches.test.ts +0 -83
- package/src/modules/utils-internal/recentSearches/recentSearches.ts +0 -57
- package/src/modules/utils-internal/regexps/regexps.ts +0 -5
- package/src/modules/utils-internal/seo/seo.ts +0 -4
- package/src/modules/utils-internal/slot/slot.ts +0 -17
- package/src/modules/utils-internal/storybook/storybook.ts +0 -32
- package/src/modules/utils-internal/tests/tests.ts +0 -38
- package/src/modules/utils-internal/wordpress/__tests__/wordpress.test.ts +0 -15
- package/src/modules/utils-internal/wordpress/wordpress.ts +0 -13
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { Option, PopperPlacement } from "typings/custom";
|
|
2
|
-
import { LightningElement, api, track } from "lwc";
|
|
3
|
-
import cx from "classnames";
|
|
4
|
-
import get from "lodash.get";
|
|
5
|
-
import { deepmapOptions } from "utils-internal/options";
|
|
6
|
-
import { toJson } from "utils/normalizers";
|
|
7
|
-
|
|
8
|
-
interface DropdownOption extends Option {
|
|
9
|
-
// link that gets shown as a highlighted link at end of option group
|
|
10
|
-
calloutLink?: {
|
|
11
|
-
href: string;
|
|
12
|
-
target?: string;
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default class Dropdown extends LightningElement {
|
|
18
|
-
@api value: string | null = null; // "active option" id
|
|
19
|
-
@api valuePath: string = "id"; // path to match for the active value (useful for url matching)
|
|
20
|
-
@api stayOpenAfterChange?: boolean = false;
|
|
21
|
-
|
|
22
|
-
// props forwarded to popover:
|
|
23
|
-
@api ariaLabel: string | null = null;
|
|
24
|
-
@api tempId: string | null = null;
|
|
25
|
-
@api offset?: "small" | "medium";
|
|
26
|
-
@api open: boolean | null = null;
|
|
27
|
-
@api pagePadding?: number = 16; // padding between dropdown and the edge of the page
|
|
28
|
-
@api placement?: PopperPlacement = "bottom-start";
|
|
29
|
-
@api small?: boolean = false;
|
|
30
|
-
@api openOnHover?: boolean = false; // dropdown opens/closes with hover
|
|
31
|
-
@api width?: string | null = null;
|
|
32
|
-
@api fullWidth?: boolean | null;
|
|
33
|
-
@api navItemLabel: string | null = null;
|
|
34
|
-
|
|
35
|
-
// props forwarded to dropdown option
|
|
36
|
-
@api analyticsEvent: string | null = null;
|
|
37
|
-
|
|
38
|
-
@api
|
|
39
|
-
get options() {
|
|
40
|
-
return deepmapOptions(this._options, (option: DropdownOption) => ({
|
|
41
|
-
...option,
|
|
42
|
-
active: this.value === get(option, this.valuePath),
|
|
43
|
-
keyValue: get(option, this.valuePath)
|
|
44
|
-
}));
|
|
45
|
-
}
|
|
46
|
-
set options(value: DropdownOption[]) {
|
|
47
|
-
this._options = toJson(value);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@api
|
|
51
|
-
get focusedValue() {
|
|
52
|
-
return this._focusedValue;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@track
|
|
56
|
-
private _options!: DropdownOption[];
|
|
57
|
-
|
|
58
|
-
// PRIVATE VARS
|
|
59
|
-
|
|
60
|
-
private _focusedValue: string | null = null;
|
|
61
|
-
private popoverEl: HTMLElement | null = null;
|
|
62
|
-
|
|
63
|
-
constructor() {
|
|
64
|
-
super();
|
|
65
|
-
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
this.addEventListener("keydown", this.onKeyDown);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// GETTERS
|
|
71
|
-
|
|
72
|
-
private get role() {
|
|
73
|
-
return this.areOptionsEmpty ? null : "menu";
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
private get className() {
|
|
77
|
-
return cx(
|
|
78
|
-
this.isNested && "menu-nested",
|
|
79
|
-
this.isNested && this.options.length >= 2 && "menu-nested-2-col",
|
|
80
|
-
this.offset && `menu-offset-${this.offset}`,
|
|
81
|
-
this.areOptionsEmpty && "menu-hidden"
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
private get isNested() {
|
|
86
|
-
return this.options.some((option) => !!option.options);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
private get optionsElements() {
|
|
90
|
-
return this.template.querySelectorAll("dx-dropdown-option");
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
private get areOptionsEmpty() {
|
|
94
|
-
return this.options.length === 0;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// CLASS FNS
|
|
98
|
-
|
|
99
|
-
private onKeyDown = (e: KeyboardEvent) => {
|
|
100
|
-
switch (e.key) {
|
|
101
|
-
case "ArrowDown":
|
|
102
|
-
e.preventDefault();
|
|
103
|
-
this.incrementOptionFocus(1);
|
|
104
|
-
break;
|
|
105
|
-
case "ArrowUp":
|
|
106
|
-
e.preventDefault();
|
|
107
|
-
this.incrementOptionFocus(-1);
|
|
108
|
-
break;
|
|
109
|
-
default:
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
private onOptionClick(e: CustomEvent) {
|
|
114
|
-
if (e.detail !== this.value) {
|
|
115
|
-
this.dispatchEvent(new CustomEvent("change", { detail: e.detail }));
|
|
116
|
-
}
|
|
117
|
-
if (!this.stayOpenAfterChange && this.popoverEl) {
|
|
118
|
-
this.popoverEl.closePopover();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
private onOptionFocus(e: PointerEvent) {
|
|
123
|
-
if (e.target) {
|
|
124
|
-
// @ts-ignore
|
|
125
|
-
this._focusedValue = e.target.option.id;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
private findOptionElementIndex(value: string) {
|
|
130
|
-
return Array.from(this.optionsElements).findIndex(
|
|
131
|
-
// @ts-ignore
|
|
132
|
-
(el) => el.option.id === value
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
private incrementOptionFocus(indexChange: number) {
|
|
137
|
-
if (!this._focusedValue) {
|
|
138
|
-
this.focusDefaultOption();
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const focusedOptionIndex = this.findOptionElementIndex(
|
|
143
|
-
this._focusedValue
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
let nextIndex = focusedOptionIndex + indexChange;
|
|
147
|
-
if (nextIndex < 0) {
|
|
148
|
-
nextIndex = this.optionsElements.length - 1;
|
|
149
|
-
}
|
|
150
|
-
if (nextIndex >= this.optionsElements.length) {
|
|
151
|
-
nextIndex = 0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const element = this.optionsElements[nextIndex];
|
|
155
|
-
if (element) {
|
|
156
|
-
element.focus();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
private onClose(): void {
|
|
161
|
-
this._focusedValue = null;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
private focusDefaultOption() {
|
|
165
|
-
const defaultIndex = this.value
|
|
166
|
-
? this.findOptionElementIndex(this.value)
|
|
167
|
-
: 0;
|
|
168
|
-
|
|
169
|
-
const optionToFocus: any =
|
|
170
|
-
this.optionsElements[defaultIndex < 0 ? 0 : defaultIndex];
|
|
171
|
-
if (optionToFocus) {
|
|
172
|
-
optionToFocus.focus();
|
|
173
|
-
this._focusedValue = optionToFocus.option.id;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
renderedCallback() {
|
|
178
|
-
if (!this.popoverEl) {
|
|
179
|
-
this.popoverEl = this.template.querySelector("dx-popover");
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import DropdownOption from "dx/dropdownOption";
|
|
2
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
3
|
-
import { MOCK_BUTTON_PROPS, MOCK_LINK_PROPS } from "./mockProps";
|
|
4
|
-
import * as instrumentation from "dx/instrumentation";
|
|
5
|
-
|
|
6
|
-
const TAG = "dx-dropdown-option";
|
|
7
|
-
const render = createRenderComponent(TAG, DropdownOption);
|
|
8
|
-
|
|
9
|
-
const appendToMenu = (element: HTMLElement) => {
|
|
10
|
-
const menu = document.createElement("DIV");
|
|
11
|
-
document.body.appendChild(menu);
|
|
12
|
-
menu.setAttribute("role", "menu");
|
|
13
|
-
menu.appendChild(element);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
describe(TAG, () => {
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
jest.clearAllMocks();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("renders a button by default", () => {
|
|
22
|
-
const component = render(MOCK_BUTTON_PROPS);
|
|
23
|
-
expect(component.shadowRoot.querySelector("button")).not.toBeNull();
|
|
24
|
-
|
|
25
|
-
appendToMenu(component);
|
|
26
|
-
return expect(component).toBeAccessible();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("renders the correct label, description, and img", () => {
|
|
30
|
-
const component = render(MOCK_BUTTON_PROPS);
|
|
31
|
-
const label =
|
|
32
|
-
component.shadowRoot.querySelector(".option_label").textContent;
|
|
33
|
-
expect(label).toEqual(MOCK_BUTTON_PROPS.option.label);
|
|
34
|
-
|
|
35
|
-
const description = component.shadowRoot.querySelector(
|
|
36
|
-
".option_description"
|
|
37
|
-
).textContent;
|
|
38
|
-
expect(description).toEqual(MOCK_BUTTON_PROPS.option.description);
|
|
39
|
-
|
|
40
|
-
const img = component.shadowRoot.querySelector(".option_icon");
|
|
41
|
-
expect(img).not.toBeNull();
|
|
42
|
-
|
|
43
|
-
appendToMenu(component);
|
|
44
|
-
return expect(component).toBeAccessible();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("renders a link with the correct href when given link props", () => {
|
|
48
|
-
const component = render(MOCK_LINK_PROPS);
|
|
49
|
-
|
|
50
|
-
const href = component.shadowRoot
|
|
51
|
-
.querySelector("a")
|
|
52
|
-
.getAttribute("href");
|
|
53
|
-
expect(href).toEqual(MOCK_LINK_PROPS.option.link.href);
|
|
54
|
-
|
|
55
|
-
appendToMenu(component);
|
|
56
|
-
return expect(component).toBeAccessible();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("applies the active class correctly", () => {
|
|
60
|
-
const component = render({ ...MOCK_BUTTON_PROPS, active: true });
|
|
61
|
-
const optionEl = component.shadowRoot.querySelector(".option-active");
|
|
62
|
-
expect(optionEl).not.toBeNull();
|
|
63
|
-
|
|
64
|
-
appendToMenu(component);
|
|
65
|
-
return expect(component).toBeAccessible();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("can focus itself", () => {
|
|
69
|
-
const component = render(MOCK_BUTTON_PROPS);
|
|
70
|
-
component.focus();
|
|
71
|
-
|
|
72
|
-
expect(document.activeElement).toEqual(component);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it("onClick function is fired when button is clicked", () => {
|
|
76
|
-
const onClickMock = jest.fn();
|
|
77
|
-
const component = render({
|
|
78
|
-
...MOCK_BUTTON_PROPS,
|
|
79
|
-
onclick: onClickMock
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
const option = component.shadowRoot.querySelector(".option");
|
|
83
|
-
option.click();
|
|
84
|
-
|
|
85
|
-
expect(onClickMock).toBeCalled();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("fires analytics when given an analytics event", () => {
|
|
89
|
-
const track = jest.spyOn(instrumentation, "track");
|
|
90
|
-
|
|
91
|
-
const component = render({
|
|
92
|
-
...MOCK_BUTTON_PROPS,
|
|
93
|
-
analyticsEvent: "mock"
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const option = component.shadowRoot.querySelector(".option");
|
|
97
|
-
option.click();
|
|
98
|
-
|
|
99
|
-
expect(track).toHaveBeenCalledTimes(1);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it("doesn't fire analytics when not given an analytics event", () => {
|
|
103
|
-
const track = jest.spyOn(instrumentation, "track");
|
|
104
|
-
|
|
105
|
-
const component = render(MOCK_BUTTON_PROPS);
|
|
106
|
-
|
|
107
|
-
const option = component.shadowRoot.querySelector(".option");
|
|
108
|
-
option.click();
|
|
109
|
-
|
|
110
|
-
expect(track).not.toHaveBeenCalled();
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const MOCK_BUTTON_PROPS = {
|
|
2
|
-
option: {
|
|
3
|
-
id: "documentation",
|
|
4
|
-
label: "Documentation",
|
|
5
|
-
description: "Documentation is kewl",
|
|
6
|
-
iconSymbol: "heroku",
|
|
7
|
-
iconSprite: "salesforcebrand"
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const MOCK_LINK_PROPS = {
|
|
12
|
-
option: {
|
|
13
|
-
id: "documentation",
|
|
14
|
-
label: "Documentation",
|
|
15
|
-
link: {
|
|
16
|
-
href: "/documentation",
|
|
17
|
-
target: null
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
@import "helpers/reset";
|
|
2
|
-
|
|
3
|
-
.option {
|
|
4
|
-
display: flex;
|
|
5
|
-
font-family: var(--dx-g-font-sans);
|
|
6
|
-
width: 100%;
|
|
7
|
-
padding: var(--dx-g-spacing-sm);
|
|
8
|
-
font-size: var(--dx-g-text-sm);
|
|
9
|
-
border-radius: var(--dx-g-spacing-xs);
|
|
10
|
-
transition: var(--dx-g-transition-hue-1x);
|
|
11
|
-
align-items: center;
|
|
12
|
-
outline: none !important;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.option:focus {
|
|
16
|
-
box-shadow: inset 0 0 0 1px var(--dx-g-blue-vibrant-50);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.option:active {
|
|
20
|
-
background: var(--dx-g-blue-vibrant-95) !important;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.option:not(.option-active):hover {
|
|
24
|
-
background: var(--dx-g-gray-95);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.option-active {
|
|
28
|
-
background: var(--dx-g-blue-vibrant-95);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.option_details {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
font-family: var(--dx-g-font-sans);
|
|
36
|
-
font-size: var(--dx-g-text-sm);
|
|
37
|
-
text-align: left;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.option_label {
|
|
41
|
-
color: var(--dx-g-blue-vibrant-50);
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
font-weight: var(--dx-g-font-bold);
|
|
45
|
-
font-size: var(--dx-c-dropdown-option-font-size, var(--dx-g-text-base));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.option_label > *:last-child {
|
|
49
|
-
margin-left: var(--dx-g-spacing-sm);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.option_description {
|
|
53
|
-
color: var(--dx-g-gray-30);
|
|
54
|
-
margin-top: var(--dx-g-spacing-xs);
|
|
55
|
-
line-height: 18px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.option_icon {
|
|
59
|
-
margin-right: var(--dx-g-spacing-md);
|
|
60
|
-
flex-shrink: 0;
|
|
61
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a
|
|
3
|
-
if:true={option.link}
|
|
4
|
-
class={className}
|
|
5
|
-
href={option.link.href}
|
|
6
|
-
target={option.link.target}
|
|
7
|
-
key={option.id}
|
|
8
|
-
role="menuitem"
|
|
9
|
-
tabindex="-1"
|
|
10
|
-
onclick={onClick}
|
|
11
|
-
>
|
|
12
|
-
<dx-icon
|
|
13
|
-
class="option_icon"
|
|
14
|
-
symbol={option.iconSymbol}
|
|
15
|
-
sprite={option.iconSprite}
|
|
16
|
-
if:true={option.iconSymbol}
|
|
17
|
-
size="large"
|
|
18
|
-
></dx-icon>
|
|
19
|
-
<div class="option_details">
|
|
20
|
-
<div class="option_label">
|
|
21
|
-
{option.label}
|
|
22
|
-
<dx-icon
|
|
23
|
-
symbol="new_window"
|
|
24
|
-
if:true={option.link.target}
|
|
25
|
-
></dx-icon>
|
|
26
|
-
</div>
|
|
27
|
-
<div if:true={option.description} class="option_description">
|
|
28
|
-
{option.description}
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</a>
|
|
32
|
-
<button
|
|
33
|
-
if:false={option.link}
|
|
34
|
-
class={className}
|
|
35
|
-
role="menuitem"
|
|
36
|
-
tabindex="-1"
|
|
37
|
-
onclick={onClick}
|
|
38
|
-
>
|
|
39
|
-
<dx-icon
|
|
40
|
-
class="option_icon"
|
|
41
|
-
symbol={option.iconSymbol}
|
|
42
|
-
sprite={option.iconSprite}
|
|
43
|
-
if:true={option.iconSymbol}
|
|
44
|
-
size="large"
|
|
45
|
-
></dx-icon>
|
|
46
|
-
<div class="option_details">
|
|
47
|
-
<div class="option_label">{option.label}</div>
|
|
48
|
-
<div if:true={option.description} class="option_description">
|
|
49
|
-
{option.description}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</button>
|
|
53
|
-
</template>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LightningElement, api } from "lwc";
|
|
2
|
-
import cx from "classnames";
|
|
3
|
-
import { Option } from "typings/custom";
|
|
4
|
-
import { track } from "dx/instrumentation";
|
|
5
|
-
|
|
6
|
-
export default class DropdownOption extends LightningElement {
|
|
7
|
-
@api option!: Option;
|
|
8
|
-
@api keyValue!: string;
|
|
9
|
-
@api active: boolean = false;
|
|
10
|
-
@api navItemLabel: String | null = null;
|
|
11
|
-
@api analyticsEvent: string | null = null;
|
|
12
|
-
|
|
13
|
-
@api focus() {
|
|
14
|
-
const option = this.template.querySelector(".option");
|
|
15
|
-
if (!option) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
option.focus();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
private get className(): string {
|
|
22
|
-
return cx("option", this.active && "option-active");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
private onClick(e: PointerEvent) {
|
|
26
|
-
this.dispatchEvent(
|
|
27
|
-
new CustomEvent("select", { detail: this.keyValue })
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
if (this.analyticsEvent && e.currentTarget) {
|
|
31
|
-
track(e.currentTarget, this.analyticsEvent, {
|
|
32
|
-
navHeading: this.navItemLabel || undefined,
|
|
33
|
-
navSubHeading: this.option.label || undefined,
|
|
34
|
-
clickText: this.keyValue || undefined,
|
|
35
|
-
pageLocation: window.location.pathname || undefined
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import EmptyState from "dx/emptyState";
|
|
2
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
3
|
-
import mockProps from "./mockProps";
|
|
4
|
-
|
|
5
|
-
const TAG = "dx-empty-state";
|
|
6
|
-
const render = createRenderComponent(TAG, EmptyState);
|
|
7
|
-
|
|
8
|
-
describe(TAG, () => {
|
|
9
|
-
it("renders", () => {
|
|
10
|
-
const element = render(mockProps);
|
|
11
|
-
const container: HTMLElement =
|
|
12
|
-
element.shadowRoot.querySelector(".container");
|
|
13
|
-
const renderedTitle: HTMLElement =
|
|
14
|
-
element.shadowRoot.querySelector("h3");
|
|
15
|
-
const renderedSubTitle: HTMLElement =
|
|
16
|
-
element.shadowRoot.querySelector("p");
|
|
17
|
-
const image: HTMLImageElement = element.shadowRoot.querySelector("img");
|
|
18
|
-
|
|
19
|
-
expect(renderedTitle).not.toBeNull();
|
|
20
|
-
expect(renderedSubTitle).not.toBeNull();
|
|
21
|
-
expect(container).not.toBeNull();
|
|
22
|
-
expect(image).not.toBeNull();
|
|
23
|
-
|
|
24
|
-
expect(renderedSubTitle.textContent).toEqual(mockProps.subtitle);
|
|
25
|
-
expect(renderedTitle.textContent).toEqual(mockProps.title);
|
|
26
|
-
|
|
27
|
-
return expect(element).toBeAccessible();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("renders as the large variant by default", () => {
|
|
31
|
-
const element = render(mockProps);
|
|
32
|
-
const container: HTMLElement =
|
|
33
|
-
element.shadowRoot.querySelector(".container");
|
|
34
|
-
const image: HTMLImageElement = element.shadowRoot.querySelector("img");
|
|
35
|
-
expect(container.classList).toContain("size-large");
|
|
36
|
-
expect(container.classList).toHaveLength(2);
|
|
37
|
-
expect(image.src).not.toContain("-small.svg");
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("renders as the small variant when specified", () => {
|
|
41
|
-
const element = render({
|
|
42
|
-
...mockProps,
|
|
43
|
-
size: "small"
|
|
44
|
-
});
|
|
45
|
-
const container: HTMLElement =
|
|
46
|
-
element.shadowRoot.querySelector(".container");
|
|
47
|
-
const image: HTMLImageElement = element.shadowRoot.querySelector("img");
|
|
48
|
-
expect(container.classList).toContain("size-small");
|
|
49
|
-
expect(container.classList).toHaveLength(2);
|
|
50
|
-
expect(image.src).toContain("-small.svg");
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
@import "helpers/reset";
|
|
2
|
-
@import "helpers/text";
|
|
3
|
-
|
|
4
|
-
:host {
|
|
5
|
-
--dx-c-empty-state-background: var(--dx-g-gray-95);
|
|
6
|
-
--dx-c-empty-state-image-width: 600px;
|
|
7
|
-
|
|
8
|
-
width: 100%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.container {
|
|
12
|
-
position: relative;
|
|
13
|
-
background: var(--dx-c-empty-state-background);
|
|
14
|
-
border-radius: var(--dx-g-spacing-md);
|
|
15
|
-
padding: var(--dx-g-spacing-2xl) 0;
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
img {
|
|
23
|
-
width: var(--dx-c-empty-state-image-width);
|
|
24
|
-
min-width: var(--dx-c-empty-state-image-width);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.size-small img {
|
|
28
|
-
max-width: 250px;
|
|
29
|
-
min-width: unset;
|
|
30
|
-
width: calc(100% - 40px);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.text {
|
|
34
|
-
position: absolute;
|
|
35
|
-
top: 35%;
|
|
36
|
-
min-height: 15%;
|
|
37
|
-
left: 0;
|
|
38
|
-
width: 100%;
|
|
39
|
-
display: flex;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
align-items: center;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
text-align: center;
|
|
44
|
-
padding: 0 var(--dx-g-spacing-xl);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.size-small .text {
|
|
48
|
-
top: 40%;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.title {
|
|
52
|
-
font-size: var(--dx-g-text-2xl);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.size-small .title {
|
|
56
|
-
font-size: var(--dx-g-text-base);
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.subtitle {
|
|
61
|
-
padding-top: var(--dx-g-spacing-sm);
|
|
62
|
-
color: var(--dx-g-text-heading-color);
|
|
63
|
-
font-weight: bold;
|
|
64
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class={containerClassName} part="container">
|
|
3
|
-
<img src={imageAssetPath} alt="Mountains" />
|
|
4
|
-
<div class="text">
|
|
5
|
-
<h3 class="title dx-text-heading-3">{title}</h3>
|
|
6
|
-
<p class="subtitle dx-text-body-2" if:true={subtitle}>{subtitle}</p>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "dx/dx-empty-state",
|
|
5
|
-
component: "dx-empty-state"
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const createStyles = () => html`
|
|
9
|
-
<style>
|
|
10
|
-
body {
|
|
11
|
-
padding: 12px !important;
|
|
12
|
-
}
|
|
13
|
-
.title {
|
|
14
|
-
font-weight: bold;
|
|
15
|
-
margin: 24px;
|
|
16
|
-
}
|
|
17
|
-
#styled {
|
|
18
|
-
--dx-c-empty-state-background: var(--sds-g-gray-2);
|
|
19
|
-
--dx-c-empty-state-image-width: 400px;
|
|
20
|
-
width: 300px;
|
|
21
|
-
display: block;
|
|
22
|
-
}
|
|
23
|
-
.small-container {
|
|
24
|
-
width: 250px;
|
|
25
|
-
}
|
|
26
|
-
</style>
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
const title = (value: string) => html`<p class="title">${value}</p>`;
|
|
30
|
-
|
|
31
|
-
export const Base = () => html`
|
|
32
|
-
${createStyles()} ${title("Default")}
|
|
33
|
-
<dx-empty-state
|
|
34
|
-
title="Beep boop. That did not compute."
|
|
35
|
-
subtitle="No results"
|
|
36
|
-
></dx-empty-state>
|
|
37
|
-
|
|
38
|
-
${title("No subtitle and customized with style hooks")}
|
|
39
|
-
<dx-empty-state id="styled" title="No Results"></dx-empty-state>
|
|
40
|
-
|
|
41
|
-
${title("Small variant")}
|
|
42
|
-
<div class="small-container">
|
|
43
|
-
<dx-empty-state title="No Results" size="small"></dx-empty-state>
|
|
44
|
-
</div>
|
|
45
|
-
`;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { EmptyStateSize } from "typings/custom";
|
|
3
|
-
|
|
4
|
-
export default class EmptyState extends LightningElement {
|
|
5
|
-
@api title: string = "";
|
|
6
|
-
@api subtitle?: string | null = null;
|
|
7
|
-
@api size?: EmptyStateSize = "large";
|
|
8
|
-
|
|
9
|
-
get containerClassName() {
|
|
10
|
-
return `container ${
|
|
11
|
-
!this.size || this.size === "large" ? "size-large" : "size-small"
|
|
12
|
-
}`;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
get imageAssetPath() {
|
|
16
|
-
return `/assets/svg/docs-empty-state${
|
|
17
|
-
this.size === "small" ? "-small" : ""
|
|
18
|
-
}.svg`;
|
|
19
|
-
}
|
|
20
|
-
}
|