@salesforcedevs/arch-components 1.20.17-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 +7 -0
- package/package.json +19 -0
- package/src/modules/common/context/context.html +1 -0
- package/src/modules/common/context/context.ts +137 -0
- package/src/modules/common/effectAdapter/__tests__/effectAdapter.test.ts +12 -0
- package/src/modules/common/effectAdapter/effectAdapter.html +1 -0
- package/src/modules/common/effectAdapter/effectAdapter.ts +18 -0
- package/src/modules/common/reflectedElement/__tests__/modules/test/select/select.html +3 -0
- package/src/modules/common/reflectedElement/__tests__/modules/test/select/select.ts +7 -0
- package/src/modules/common/reflectedElement/__tests__/modules/test/selectTransform/selectTransform.html +3 -0
- package/src/modules/common/reflectedElement/__tests__/modules/test/selectTransform/selectTransform.ts +18 -0
- package/src/modules/common/reflectedElement/__tests__/reflectedElement.test.ts +75 -0
- package/src/modules/common/reflectedElement/reflectedElement.ts +50 -0
- package/src/modules/common/slot/__tests__/slot.test.ts +96 -0
- package/src/modules/common/slot/slot.ts +20 -0
- package/src/modules/sa/coverage/coverage.css +35 -0
- package/src/modules/sa/coverage/coverage.html +15 -0
- package/src/modules/sa/coverage/coverage.ts +406 -0
- package/src/modules/sa/coverage/types.d.ts +26 -0
- package/src/modules/sa/expandableSection/expandableSection.css +24 -0
- package/src/modules/sa/expandableSection/expandableSection.html +20 -0
- package/src/modules/sa/expandableSection/expandableSection.stories.ts +37 -0
- package/src/modules/sa/expandableSection/expandableSection.ts +24 -0
- package/src/modules/sa/explorer/explorer.css +303 -0
- package/src/modules/sa/explorer/explorer.html +403 -0
- package/src/modules/sa/explorer/explorer.ts +664 -0
- package/src/modules/sa/explorer/types.d.ts +60 -0
- package/src/modules/sa/gallery/gallery.css +358 -0
- package/src/modules/sa/gallery/gallery.html +65 -0
- package/src/modules/sa/gallery/gallery.ts +300 -0
- package/src/modules/sa/gallery/types.d.ts +35 -0
- package/src/modules/sa/socialShare/socialShare.css +49 -0
- package/src/modules/sa/socialShare/socialShare.html +56 -0
- package/src/modules/sa/socialShare/socialShare.ts +29 -0
- package/src/modules/shared/a11y/a11y.ts +25 -0
- package/src/modules/shared/children/children.ts +29 -0
- package/src/modules/shared/color/color.ts +52 -0
- package/src/modules/shared/debounce/debounce.ts +32 -0
- package/src/modules/shared/dialog/dialog.ts +154 -0
- package/src/modules/shared/elements/__tests__/overflow.test.ts +39 -0
- package/src/modules/shared/elements/overflow.ts +71 -0
- package/src/modules/shared/fetch/fetch.ts +52 -0
- package/src/modules/shared/helpers/helpers.ts +141 -0
- package/src/modules/shared/i18n/i18n.ts +74 -0
- package/src/modules/shared/labels/__tests__/helpers.test.ts +107 -0
- package/src/modules/shared/labels/__tests__/pointHelpers.test.ts +33 -0
- package/src/modules/shared/labels/__tests__/timeHelpers.test.ts +89 -0
- package/src/modules/shared/labels/helpers.ts +23 -0
- package/src/modules/shared/labels/pointHelpers.ts +47 -0
- package/src/modules/shared/labels/timeHelpers.ts +182 -0
- package/src/modules/shared/labels/types.d.ts +5 -0
- package/src/modules/shared/logger/logger.ts +33 -0
- package/src/modules/shared/menu/menu.ts +239 -0
- package/src/modules/shared/overflow/__tests__/overflow.test.ts +39 -0
- package/src/modules/shared/overflow/overflow.ts +71 -0
- package/src/modules/shared/polling-request.ts +97 -0
- package/src/modules/shared/testutils.ts +118 -0
- package/src/modules/shared/track/track.ts +23 -0
- package/src/modules/shared/trailhead.ts +123 -0
- package/src/modules/shared/types.d.ts +1 -0
- package/src/modules/shared/useEffectAttr.ts +16 -0
- package/src/modules/shared/withState.ts +21 -0
- package/src/modules/tds/appLauncher/__fixtures__/index.ts +34 -0
- package/src/modules/tds/appLauncher/__tests__/appLauncher.test.ts +119 -0
- package/src/modules/tds/appLauncher/appLauncher.css +65 -0
- package/src/modules/tds/appLauncher/appLauncher.html +38 -0
- package/src/modules/tds/appLauncher/appLauncher.stories.ts +39 -0
- package/src/modules/tds/appLauncher/appLauncher.ts +79 -0
- package/src/modules/tds/appLauncher/types.ts +8 -0
- package/src/modules/tds/avatar/__tests__/avatar.test.ts +11 -0
- package/src/modules/tds/avatar/avatar.css +77 -0
- package/src/modules/tds/avatar/avatar.html +36 -0
- package/src/modules/tds/avatar/avatar.stories.ts +64 -0
- package/src/modules/tds/avatar/avatar.ts +50 -0
- package/src/modules/tds/badge/__tests__/badge.test.js +11 -0
- package/src/modules/tds/badge/badge.css +22 -0
- package/src/modules/tds/badge/badge.html +5 -0
- package/src/modules/tds/badge/badge.stories.ts +10 -0
- package/src/modules/tds/badge/badge.ts +9 -0
- package/src/modules/tds/button/__tests__/button.test.ts +52 -0
- package/src/modules/tds/button/button.css +1 -0
- package/src/modules/tds/button/button.html +20 -0
- package/src/modules/tds/button/button.stories.js +54 -0
- package/src/modules/tds/button/button.ts +59 -0
- package/src/modules/tds/buttonIcon/__tests__/buttonIcon.test.ts +17 -0
- package/src/modules/tds/buttonIcon/buttonIcon.css +1 -0
- package/src/modules/tds/buttonIcon/buttonIcon.html +12 -0
- package/src/modules/tds/buttonIcon/buttonIcon.stories.js +38 -0
- package/src/modules/tds/buttonIcon/buttonIcon.ts +6 -0
- package/src/modules/tds/buttonIconLink/buttonIconLink.css +1 -0
- package/src/modules/tds/buttonIconLink/buttonIconLink.html +14 -0
- package/src/modules/tds/buttonIconLink/buttonIconLink.stories.ts +32 -0
- package/src/modules/tds/buttonIconLink/buttonIconLink.ts +9 -0
- package/src/modules/tds/buttonLink/__tests__/buttonLink.test.ts +17 -0
- package/src/modules/tds/buttonLink/buttonLink.css +1 -0
- package/src/modules/tds/buttonLink/buttonLink.html +19 -0
- package/src/modules/tds/buttonLink/buttonLink.stories.js +24 -0
- package/src/modules/tds/buttonLink/buttonLink.ts +8 -0
- package/src/modules/tds/buttonStyles/buttonStyles.css +232 -0
- package/src/modules/tds/childSummary/__tests__/childSummary.test.js +99 -0
- package/src/modules/tds/childSummary/childSummary.css +74 -0
- package/src/modules/tds/childSummary/childSummary.html +38 -0
- package/src/modules/tds/childSummary/childSummary.stories.ts +40 -0
- package/src/modules/tds/childSummary/childSummary.ts +63 -0
- package/src/modules/tds/childSummary/types.d.ts +10 -0
- package/src/modules/tds/contentChildListItem/__tests__/contentChildListItem.test.ts +32 -0
- package/src/modules/tds/contentChildListItem/contentChildListItem.css +1 -0
- package/src/modules/tds/contentChildListItem/contentChildListItem.html +10 -0
- package/src/modules/tds/contentChildListItem/contentChildListItem.stories.ts +46 -0
- package/src/modules/tds/contentChildListItem/contentChildListItem.ts +34 -0
- package/src/modules/tds/contentIcon/contentIcon.css +47 -0
- package/src/modules/tds/contentIcon/contentIcon.html +15 -0
- package/src/modules/tds/contentIcon/contentIcon.stories.js +110 -0
- package/src/modules/tds/contentIcon/contentIcon.ts +66 -0
- package/src/modules/tds/contextAdapter/__tests__/contextAdapter.test.ts +76 -0
- package/src/modules/tds/contextAdapter/constants.ts +1 -0
- package/src/modules/tds/contextAdapter/contextAdapter.html +1 -0
- package/src/modules/tds/contextAdapter/contextAdapter.ts +54 -0
- package/src/modules/tds/dialogStyles/dialogStyles.css +90 -0
- package/src/modules/tds/footerLinks/__tests__/__snapshots__/footerLinks.test.ts.snap +3 -0
- package/src/modules/tds/footerLinks/__tests__/footerLinks.test.ts +142 -0
- package/src/modules/tds/footerLinks/footerLinks.css +80 -0
- package/src/modules/tds/footerLinks/footerLinks.html +30 -0
- package/src/modules/tds/footerLinks/footerLinks.ts +48 -0
- package/src/modules/tds/footerLinks/types.ts +11 -0
- package/src/modules/tds/footerMfe/footerMfe.html +3 -0
- package/src/modules/tds/footerMfe/footerMfe.ts +19 -0
- package/src/modules/tds/headerAvatar/__tests__/headerAvatar.test.ts +43 -0
- package/src/modules/tds/headerAvatar/headerAvatar.css +45 -0
- package/src/modules/tds/headerAvatar/headerAvatar.html +25 -0
- package/src/modules/tds/headerAvatar/headerAvatar.ts +15 -0
- package/src/modules/tds/headerHelpButton/__tests__/headerHelpButton.test.ts +32 -0
- package/src/modules/tds/headerHelpButton/headerHelpButton.css +14 -0
- package/src/modules/tds/headerHelpButton/headerHelpButton.html +19 -0
- package/src/modules/tds/headerHelpButton/headerHelpButton.ts +12 -0
- package/src/modules/tds/heading/__tests__/heading.test.ts +50 -0
- package/src/modules/tds/heading/heading.css +1 -0
- package/src/modules/tds/heading/heading.html +9 -0
- package/src/modules/tds/heading/heading.stories.ts +36 -0
- package/src/modules/tds/heading/heading.ts +36 -0
- package/src/modules/tds/icon/icon.css +28 -0
- package/src/modules/tds/icon/icon.html +17 -0
- package/src/modules/tds/icon/icon.stories.js +18 -0
- package/src/modules/tds/icon/icon.ts +79 -0
- package/src/modules/tds/input/__tests__/input.test.ts +41 -0
- package/src/modules/tds/input/input.css +34 -0
- package/src/modules/tds/input/input.html +12 -0
- package/src/modules/tds/input/input.stories.ts +25 -0
- package/src/modules/tds/input/input.ts +41 -0
- package/src/modules/tds/instrumentation/instrumentation.css +0 -0
- package/src/modules/tds/instrumentation/instrumentation.html +1 -0
- package/src/modules/tds/instrumentation/instrumentation.ts +113 -0
- package/src/modules/tds/pbCard/pbCard.css +28 -0
- package/src/modules/tds/pbCard/pbCard.html +21 -0
- package/src/modules/tds/pbCard/pbCard.ts +18 -0
- package/src/modules/tds/pill/__tests__/pill.test.ts +56 -0
- package/src/modules/tds/pill/pill.css +70 -0
- package/src/modules/tds/pill/pill.html +17 -0
- package/src/modules/tds/pill/pill.stories.ts +41 -0
- package/src/modules/tds/pill/pill.ts +34 -0
- package/src/modules/tds/progressBar/__tests__/progressBar.test.js +11 -0
- package/src/modules/tds/progressBar/progressBar.css +42 -0
- package/src/modules/tds/progressBar/progressBar.html +14 -0
- package/src/modules/tds/progressBar/progressBar.stories.ts +24 -0
- package/src/modules/tds/progressBar/progressBar.ts +14 -0
- package/src/modules/tds/radio/__tests__/radio.test.ts +29 -0
- package/src/modules/tds/radio/radio.css +89 -0
- package/src/modules/tds/radio/radio.html +17 -0
- package/src/modules/tds/radio/radio.stories.ts +31 -0
- package/src/modules/tds/radio/radio.ts +32 -0
- package/src/modules/tds/reset/reset.css +39 -0
- package/src/modules/tds/search/__fixtures__/index.ts +32 -0
- package/src/modules/tds/search/__tests__/search.test.ts +235 -0
- package/src/modules/tds/search/lib/__tests__/__snapshots__/listbox.test.ts.snap +115 -0
- package/src/modules/tds/search/lib/__tests__/listbox.test.ts +192 -0
- package/src/modules/tds/search/lib/listbox.ts +209 -0
- package/src/modules/tds/search/search.css +122 -0
- package/src/modules/tds/search/search.html +21 -0
- package/src/modules/tds/search/search.stories.ts +20 -0
- package/src/modules/tds/search/search.ts +107 -0
- package/src/modules/tds/search/types.d.ts +22 -0
- package/src/modules/tds/searchList/searchList.css +120 -0
- package/src/modules/tds/searchList/searchList.html +43 -0
- package/src/modules/tds/searchList/searchList.stories.ts +10 -0
- package/src/modules/tds/searchList/searchList.ts +53 -0
- package/src/modules/tds/select/__tests__/select.test.ts +150 -0
- package/src/modules/tds/select/select.css +42 -0
- package/src/modules/tds/select/select.html +24 -0
- package/src/modules/tds/select/select.stories.ts +59 -0
- package/src/modules/tds/select/select.ts +60 -0
- package/src/modules/tds/spinner/__tests__/spinner.test.ts +11 -0
- package/src/modules/tds/spinner/spinner.css +194 -0
- package/src/modules/tds/spinner/spinner.html +9 -0
- package/src/modules/tds/spinner/spinner.stories.ts +20 -0
- package/src/modules/tds/spinner/spinner.ts +15 -0
- package/src/modules/tds/styles/styles.css +24 -0
- package/src/modules/tds/summary/__tests__/summary.test.ts +135 -0
- package/src/modules/tds/summary/summary.css +135 -0
- package/src/modules/tds/summary/summary.html +69 -0
- package/src/modules/tds/summary/summary.stories.js +148 -0
- package/src/modules/tds/summary/summary.ts +95 -0
- package/src/modules/tds/tab/__tests__/tab.test.ts +25 -0
- package/src/modules/tds/tab/tab.css +3 -0
- package/src/modules/tds/tab/tab.html +5 -0
- package/src/modules/tds/tab/tab.ts +46 -0
- package/src/modules/tds/tabset/__tests__/tabset.test.ts +108 -0
- package/src/modules/tds/tabset/tabset.css +112 -0
- package/src/modules/tds/tabset/tabset.html +63 -0
- package/src/modules/tds/tabset/tabset.stories.ts +32 -0
- package/src/modules/tds/tabset/tabset.ts +232 -0
- package/src/modules/tds/themeProvider/themeProvider.css +502 -0
- package/src/modules/tds/themeProvider/themeProvider.html +3 -0
- package/src/modules/tds/themeProvider/themeProvider.ts +37 -0
- package/src/modules/tds/tile/tile.css +23 -0
- package/src/modules/tds/tile/tile.html +5 -0
- package/src/modules/tds/tile/tile.stories.js +14 -0
- package/src/modules/tds/tile/tile.ts +12 -0
- package/src/modules/tds/xsfMfeEvents/xsfMfeEvents.html +1 -0
- package/src/modules/tds/xsfMfeEvents/xsfMfeEvents.ts +47 -0
- package/src/modules/th/contextAdapter/__tests__/contextAdapter.test.ts +104 -0
- package/src/modules/th/contextAdapter/contextAdapter.html +1 -0
- package/src/modules/th/contextAdapter/contextAdapter.ts +49 -0
- package/src/modules/th/favoriteButton/__tests__/favoriteButton.test.ts +56 -0
- package/src/modules/th/favoriteButton/favoriteButton.css +3 -0
- package/src/modules/th/favoriteButton/favoriteButton.html +15 -0
- package/src/modules/th/favoriteButton/favoriteButton.stories.js +30 -0
- package/src/modules/th/favoriteButton/favoriteButton.ts +84 -0
- package/src/modules/th/favoriteButton/mocks/index.ts +12 -0
- package/src/modules/th/search/__fixtures__/index.ts +14 -0
- package/src/modules/th/search/__tests__/search.test.ts +233 -0
- package/src/modules/th/search/constants.ts +2 -0
- package/src/modules/th/search/mocks/index.ts +30 -0
- package/src/modules/th/search/mocks/responses.ts +54 -0
- package/src/modules/th/search/search.css +4 -0
- package/src/modules/th/search/search.html +12 -0
- package/src/modules/th/search/search.ts +172 -0
- package/src/modules/th/search/types.d.ts +29 -0
- package/src/modules/th/tbid/__tests__/__snapshots__/tbid.test.ts.snap +3 -0
- package/src/modules/th/tbid/__tests__/tbid.test.ts +242 -0
- package/src/modules/th/tbid/tbid.html +1 -0
- package/src/modules/th/tbid/tbid.stories.mdx +25 -0
- package/src/modules/th/tbid/tbid.ts +215 -0
- package/src/modules/tm/card/__tests__/card.test.ts +65 -0
- package/src/modules/tm/card/card.css +131 -0
- package/src/modules/tm/card/card.html +81 -0
- package/src/modules/tm/card/card.ts +269 -0
- package/src/modules/tm/cardBase/cardBase.css +11 -0
- package/src/modules/tm/cardGridA/cardGridA.css +11 -0
- package/src/modules/tm/cardGridA/cardGridA.html +21 -0
- package/src/modules/tm/cardGridA/cardGridA.stories.js +107 -0
- package/src/modules/tm/cardGridA/cardGridA.ts +24 -0
- package/src/modules/tm/cardGridB/cardGridB.css +88 -0
- package/src/modules/tm/cardGridB/cardGridB.html +20 -0
- package/src/modules/tm/cardGridB/cardGridB.stories.js +58 -0
- package/src/modules/tm/cardGridB/cardGridB.ts +19 -0
- package/src/modules/tm/cardGridC/cardGridC.css +24 -0
- package/src/modules/tm/cardGridC/cardGridC.html +22 -0
- package/src/modules/tm/cardGridC/cardGridC.stories.js +42 -0
- package/src/modules/tm/cardGridC/cardGridC.ts +11 -0
- package/src/modules/tm/cardGridD/cardGridD.css +17 -0
- package/src/modules/tm/cardGridD/cardGridD.html +20 -0
- package/src/modules/tm/cardGridD/cardGridD.stories.js +34 -0
- package/src/modules/tm/cardGridD/cardGridD.ts +7 -0
- package/src/modules/tm/cardNew/cardNew.css +31 -0
- package/src/modules/tm/cardNew/cardNew.html +29 -0
- package/src/modules/tm/cardNew/cardNew.ts +66 -0
- package/src/modules/tm/content/__fixtures__/index.ts +884 -0
- package/src/modules/tm/content/__tests__/content.test.ts +95 -0
- package/src/modules/tm/content/content.css +641 -0
- package/src/modules/tm/content/content.html +53 -0
- package/src/modules/tm/content/content.stories.js +14 -0
- package/src/modules/tm/content/content.ts +171 -0
- package/src/modules/tm/endCapA/__tests__/endCapA.test.ts +52 -0
- package/src/modules/tm/endCapA/endCapA.css +64 -0
- package/src/modules/tm/endCapA/endCapA.html +21 -0
- package/src/modules/tm/endCapA/endCapA.stories.js +37 -0
- package/src/modules/tm/endCapA/endCapA.ts +23 -0
- package/src/modules/tm/eventsA/eventsA.css +107 -0
- package/src/modules/tm/eventsA/eventsA.html +26 -0
- package/src/modules/tm/eventsA/eventsA.stories.js +51 -0
- package/src/modules/tm/eventsA/eventsA.ts +48 -0
- package/src/modules/tm/faqA/faqA.css +87 -0
- package/src/modules/tm/faqA/faqA.html +27 -0
- package/src/modules/tm/faqA/faqA.stories.js +25 -0
- package/src/modules/tm/faqA/faqA.ts +40 -0
- package/src/modules/tm/featureGridA/__tests__/featureGridA.test.ts +116 -0
- package/src/modules/tm/featureGridA/featureGridA.css +95 -0
- package/src/modules/tm/featureGridA/featureGridA.html +34 -0
- package/src/modules/tm/featureGridA/featureGridA.stories.js +45 -0
- package/src/modules/tm/featureGridA/featureGridA.ts +59 -0
- package/src/modules/tm/footnote/footnote.css +28 -0
- package/src/modules/tm/footnote/footnote.html +3 -0
- package/src/modules/tm/footnote/footnote.stories.js +29 -0
- package/src/modules/tm/footnote/footnote.ts +35 -0
- package/src/modules/tm/heroA/__tests__/heroA.test.ts +51 -0
- package/src/modules/tm/heroA/heroA.css +116 -0
- package/src/modules/tm/heroA/heroA.html +27 -0
- package/src/modules/tm/heroA/heroA.stories.js +49 -0
- package/src/modules/tm/heroA/heroA.ts +56 -0
- package/src/modules/tm/heroB/heroB.css +78 -0
- package/src/modules/tm/heroB/heroB.html +26 -0
- package/src/modules/tm/heroB/heroB.stories.js +44 -0
- package/src/modules/tm/heroB/heroB.ts +26 -0
- package/src/modules/tm/page/__tests__/page.test.ts +35 -0
- package/src/modules/tm/page/page.css +3 -0
- package/src/modules/tm/page/page.html +3 -0
- package/src/modules/tm/page/page.stories.js +10 -0
- package/src/modules/tm/page/page.ts +3 -0
- package/src/modules/tm/pageHeaderA/pageHeaderA.css +82 -0
- package/src/modules/tm/pageHeaderA/pageHeaderA.html +24 -0
- package/src/modules/tm/pageHeaderA/pageHeaderA.stories.js +18 -0
- package/src/modules/tm/pageHeaderA/pageHeaderA.ts +51 -0
- package/src/modules/tm/pageNavigationA/pageNavigationA.css +41 -0
- package/src/modules/tm/pageNavigationA/pageNavigationA.html +9 -0
- package/src/modules/tm/pageNavigationA/pageNavigationA.stories.js +34 -0
- package/src/modules/tm/pageNavigationA/pageNavigationA.ts +18 -0
- package/src/modules/tm/promoA/__tests__/promoA.test.ts +89 -0
- package/src/modules/tm/promoA/promoA.css +95 -0
- package/src/modules/tm/promoA/promoA.html +22 -0
- package/src/modules/tm/promoA/promoA.stories.js +38 -0
- package/src/modules/tm/promoA/promoA.ts +62 -0
- package/src/modules/tm/sectionA/sectionA.css +64 -0
- package/src/modules/tm/sectionA/sectionA.html +21 -0
- package/src/modules/tm/sectionA/sectionA.stories.js +18 -0
- package/src/modules/tm/sectionA/sectionA.ts +27 -0
- package/src/modules/tm/sectionSpacer/sectionSpacer.css +4 -0
- package/src/modules/tm/sectionSpacer/sectionSpacer.html +1 -0
- package/src/modules/tm/sectionSpacer/sectionSpacer.ts +3 -0
- package/src/modules/tm/skillsCardA/skillsCardA.css +73 -0
- package/src/modules/tm/skillsCardA/skillsCardA.html +37 -0
- package/src/modules/tm/skillsCardA/skillsCardA.ts +38 -0
- package/src/modules/tm/skillsGridA/skillsGridA.css +12 -0
- package/src/modules/tm/skillsGridA/skillsGridA.html +5 -0
- package/src/modules/tm/skillsGridA/skillsGridA.stories.ts +65 -0
- package/src/modules/tm/skillsGridA/skillsGridA.ts +3 -0
- package/src/modules/tm/statsA/statsA.css +26 -0
- package/src/modules/tm/statsA/statsA.html +10 -0
- package/src/modules/tm/statsA/statsA.stories.js +29 -0
- package/src/modules/tm/statsA/statsA.ts +20 -0
- package/src/modules/tm/textItem/textItem.css +53 -0
- package/src/modules/tm/textItem/textItem.html +18 -0
- package/src/modules/tm/textItem/textItem.ts +32 -0
- package/src/modules/tm/textItemGridA/textItemGridA.css +11 -0
- package/src/modules/tm/textItemGridA/textItemGridA.html +15 -0
- package/src/modules/tm/textItemGridA/textItemGridA.stories.js +67 -0
- package/src/modules/tm/textItemGridA/textItemGridA.ts +20 -0
- package/src/modules/tm/threeCardGrid/threeCardGrid.css +6 -0
- package/src/modules/tm/threeCardGrid/threeCardGrid.html +5 -0
- package/src/modules/tm/threeCardGrid/threeCardGrid.ts +3 -0
- package/src/modules/tm/trailblazersA/trailblazersA.css +70 -0
- package/src/modules/tm/trailblazersA/trailblazersA.html +42 -0
- package/src/modules/tm/trailblazersA/trailblazersA.stories.js +52 -0
- package/src/modules/tm/trailblazersA/trailblazersA.ts +43 -0
- package/src/modules/tm/utils/utils.ts +18 -0
- package/src/modules/tm/youtube/youtube.css +7 -0
- package/src/modules/tm/youtube/youtube.html +10 -0
- package/src/modules/tm/youtube/youtube.stories.js +15 -0
- package/src/modules/tm/youtube/youtube.ts +27 -0
- package/src/modules/ui/focusTrap/focusTrap.html +5 -0
- package/src/modules/ui/focusTrap/focusTrap.ts +104 -0
- package/src/modules/ui/focusVisible/__tests__/focusVisible.test.ts +95 -0
- package/src/modules/ui/focusVisible/focusVisible.html +3 -0
- package/src/modules/ui/focusVisible/focusVisible.ts +46 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { html, renderIntoBody } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import FooterLinks from '../footerLinks';
|
|
4
|
+
|
|
5
|
+
import { track } from 'tds/instrumentation';
|
|
6
|
+
|
|
7
|
+
jest.mock('tds/instrumentation', () => {
|
|
8
|
+
return {
|
|
9
|
+
track: jest.fn()
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
customElements.define('tds-footer-links', FooterLinks.CustomElementConstructor);
|
|
14
|
+
|
|
15
|
+
const content = {
|
|
16
|
+
columns: [
|
|
17
|
+
{
|
|
18
|
+
heading: 'Learn',
|
|
19
|
+
links: [
|
|
20
|
+
{
|
|
21
|
+
href: '/',
|
|
22
|
+
label: 'Trails'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
href: '/',
|
|
26
|
+
label: 'Trailmixes'
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
heading: 'Extras',
|
|
32
|
+
links: [
|
|
33
|
+
{
|
|
34
|
+
href: '/',
|
|
35
|
+
label: 'myTrailhead'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
href: '/',
|
|
39
|
+
target: '_blank',
|
|
40
|
+
label: 'Help'
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
describe('tds-footer-links', () => {
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
(track as jest.Mock).mockClear();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('renders columns', () => {
|
|
53
|
+
const element = renderIntoBody(
|
|
54
|
+
html`
|
|
55
|
+
<tds-footer-links
|
|
56
|
+
.columns=${content.columns}
|
|
57
|
+
></tds-footer-links>
|
|
58
|
+
`
|
|
59
|
+
);
|
|
60
|
+
expect(element.shadowRoot!.innerHTML).toMatchHTMLSnapshot();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// Skip this test as LWC in test mode doesn't support child nodes for light DOM components
|
|
64
|
+
it.skip('renders columns and slots', () => {
|
|
65
|
+
const element = renderIntoBody(
|
|
66
|
+
html`
|
|
67
|
+
<tds-footer-links .columns=${content.columns}>
|
|
68
|
+
<div slot="left">left</div>
|
|
69
|
+
<div slot="right">right</div>
|
|
70
|
+
</tds-footer-links>
|
|
71
|
+
`
|
|
72
|
+
);
|
|
73
|
+
const getSlot = (name: string) =>
|
|
74
|
+
element.shadowRoot!.querySelector(
|
|
75
|
+
`slot[name="${name}"]`
|
|
76
|
+
)! as HTMLSlotElement;
|
|
77
|
+
expect(getSlot('left').assignedElements()[0].textContent).toEqual(
|
|
78
|
+
'left'
|
|
79
|
+
);
|
|
80
|
+
expect(getSlot('right').assignedElements()[0].textContent).toEqual(
|
|
81
|
+
'right'
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe('tracking', () => {
|
|
86
|
+
it('link_clicked', () => {
|
|
87
|
+
const element = renderIntoBody(
|
|
88
|
+
html`
|
|
89
|
+
<tds-footer-links
|
|
90
|
+
.columns=${content.columns}
|
|
91
|
+
></tds-footer-links>
|
|
92
|
+
`
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
let handler = jest.fn();
|
|
96
|
+
document.addEventListener('trailhead_track', handler, {
|
|
97
|
+
once: true
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
element
|
|
101
|
+
.shadowRoot!.querySelector('.links__column a')!
|
|
102
|
+
.dispatchEvent(new MouseEvent('click'));
|
|
103
|
+
|
|
104
|
+
expect(handler.mock.calls[0][0].detail).toEqual(
|
|
105
|
+
expect.objectContaining({
|
|
106
|
+
eventName: 'link_clicked',
|
|
107
|
+
payload: expect.objectContaining({
|
|
108
|
+
label: 'Trails'
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
expect(track).toBeCalledTimes(1);
|
|
114
|
+
expect(track).toBeCalledWith(element, 'custEv_bottomNavLinkClick', {
|
|
115
|
+
headingText: 'Learn',
|
|
116
|
+
linkText: 'Trails',
|
|
117
|
+
subHeadingText: 'Trails'
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('eventing', () => {
|
|
123
|
+
it('link_click', () => {
|
|
124
|
+
const element = renderIntoBody(
|
|
125
|
+
html`
|
|
126
|
+
<tds-footer-links
|
|
127
|
+
.columns=${content.columns}
|
|
128
|
+
></tds-footer-links>
|
|
129
|
+
`
|
|
130
|
+
);
|
|
131
|
+
let handler = jest.fn();
|
|
132
|
+
element.addEventListener('link_click', handler);
|
|
133
|
+
// Columns
|
|
134
|
+
element
|
|
135
|
+
.shadowRoot!.querySelector('.links__column a')!
|
|
136
|
+
.dispatchEvent(new MouseEvent('click'));
|
|
137
|
+
expect(handler.mock.calls[0][0].detail).toEqual(
|
|
138
|
+
content.columns[0].links[0]
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
a {
|
|
4
|
+
text-decoration: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
a:hover {
|
|
8
|
+
text-decoration: underline;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.footer {
|
|
12
|
+
padding: var(--tds-spacing-8) var(--tds-spacing-4) var(--tds-spacing-4);
|
|
13
|
+
border-top: 1px solid var(--tds-color-fog);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.container {
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
max-width: var(--tds-container-xl);
|
|
19
|
+
}
|
|
20
|
+
.links {
|
|
21
|
+
display: flex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.links__column {
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
font-size: var(--tds-font-size-sm);
|
|
27
|
+
padding: var(--tds-spacing-4) var(--tds-spacing-2) 0;
|
|
28
|
+
width: 17%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.heading {
|
|
32
|
+
color: var(--tds-color-meteorite);
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
margin-bottom: var(--tds-spacing-4);
|
|
35
|
+
font-size: var(--tds-font-size-md);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.links__column li {
|
|
39
|
+
margin: var(--tds-spacing-3) 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.links__column a {
|
|
43
|
+
color: var(--tds-color-meteorite);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bottom {
|
|
47
|
+
display: none;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
align-items: center;
|
|
50
|
+
margin: 0 auto;
|
|
51
|
+
margin-top: var(--tds-spacing-10);
|
|
52
|
+
max-width: 1400px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.footer[data-slots*='left'] .bottom,
|
|
56
|
+
.footer[data-slots*='right'] .bottom {
|
|
57
|
+
display: flex;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media screen and (max-width: 48rem) {
|
|
61
|
+
.bottom {
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.links {
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
}
|
|
68
|
+
.links__column {
|
|
69
|
+
width: 50%;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media screen and (max-width: 24rem) {
|
|
74
|
+
.links {
|
|
75
|
+
flex-wrap: wrap;
|
|
76
|
+
}
|
|
77
|
+
.links__column {
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="footer" data-slots={slots}>
|
|
3
|
+
<div class="container">
|
|
4
|
+
<nav class="links">
|
|
5
|
+
<template for:each={_columns} for:item="column">
|
|
6
|
+
<div class="links__column" key={column.heading}>
|
|
7
|
+
<div class="heading">{column.heading}</div>
|
|
8
|
+
<ul if:true={column.links}>
|
|
9
|
+
<template for:each={column.links} for:item="link">
|
|
10
|
+
<li key={link.label}>
|
|
11
|
+
<a
|
|
12
|
+
href={link.href}
|
|
13
|
+
target={link.target}
|
|
14
|
+
rel={link.rel}
|
|
15
|
+
onclick={link.handleClick}
|
|
16
|
+
>{link.label}</a
|
|
17
|
+
>
|
|
18
|
+
</li>
|
|
19
|
+
</template>
|
|
20
|
+
</ul>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
</nav>
|
|
24
|
+
<div class="bottom">
|
|
25
|
+
<slot name="left" onslotchange={handleSlotChange}></slot>
|
|
26
|
+
<slot name="right" onslotchange={handleSlotChange}></slot>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
import { assignedSlotNames } from 'common/slot';
|
|
4
|
+
import { track } from 'shared/track';
|
|
5
|
+
import { track as analyticsTrack } from 'tds/instrumentation';
|
|
6
|
+
|
|
7
|
+
import { FooterLink, FooterColumn } from './types';
|
|
8
|
+
import { sendInteractionEvent, InteractionEventTypes } from 'shared/helpers';
|
|
9
|
+
|
|
10
|
+
export default class extends LightningElement {
|
|
11
|
+
@api columns: FooterColumn[] = null!;
|
|
12
|
+
|
|
13
|
+
private slots: string = '';
|
|
14
|
+
|
|
15
|
+
private get _columns() {
|
|
16
|
+
return this.columns.map((col) => {
|
|
17
|
+
return Object.assign({}, col, {
|
|
18
|
+
links: col.links.map((link) => {
|
|
19
|
+
return Object.assign({}, link, {
|
|
20
|
+
handleClick: this.handleLinkClick.bind(this, link)
|
|
21
|
+
});
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private handleLinkClick(link: FooterLink, e: MouseEvent) {
|
|
28
|
+
sendInteractionEvent('Footer Click', InteractionEventTypes.CLICK, e, e.currentTarget);
|
|
29
|
+
|
|
30
|
+
this.dispatchEvent(new CustomEvent('link_click', { detail: link }));
|
|
31
|
+
track(this.template.host, 'link_clicked', { label: link.label });
|
|
32
|
+
|
|
33
|
+
const target = e.currentTarget as HTMLAnchorElement;
|
|
34
|
+
const column = target.closest('.links__column');
|
|
35
|
+
const heading = column && column.querySelector('.heading');
|
|
36
|
+
const headingText = (heading && heading.textContent) || '';
|
|
37
|
+
|
|
38
|
+
analyticsTrack(this.template.host, 'custEv_bottomNavLinkClick', {
|
|
39
|
+
headingText: headingText,
|
|
40
|
+
subHeadingText: target.textContent,
|
|
41
|
+
linkText: link.label
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private handleSlotChange() {
|
|
46
|
+
this.slots = assignedSlotNames(this.template).join(' ');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
export default class FooterMfe extends LightningElement {
|
|
4
|
+
private didRender = false;
|
|
5
|
+
|
|
6
|
+
renderedCallback() {
|
|
7
|
+
if (this.didRender) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
this.didRender = true;
|
|
11
|
+
|
|
12
|
+
// Since the footer is a third-party component, we need to create it dynamically (LWC won't recognize it as a valid component).
|
|
13
|
+
const footerElement = document.createElement('hgf-footer');
|
|
14
|
+
footerElement.setAttribute('origin', window.location.origin); // will call the route handler for `/c360/experience/v1/navigation`
|
|
15
|
+
footerElement.setAttribute('hide-language-selector', 'true');
|
|
16
|
+
footerElement.setAttribute('home-href', `/${window.location.host}`); // ugly hack: ideally this wouldn't be necessary, but the only way to remove the "See all ways to contact us" link from the footer is to set this to a non-empty value other than "us"; and given the way that the footer works, the non-empty value needs to be something that can be appended to `/` and work correctly
|
|
17
|
+
this.template.querySelector('div')!.appendChild(footerElement);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { html, renderIntoBody } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import HeaderAvatar from '../headerAvatar';
|
|
4
|
+
|
|
5
|
+
customElements.define(
|
|
6
|
+
'tds-header-avatar',
|
|
7
|
+
HeaderAvatar.CustomElementConstructor
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
describe('tds-header-avatar', () => {
|
|
11
|
+
it('sets the img src', () => {
|
|
12
|
+
let element = renderIntoBody(
|
|
13
|
+
html` <tds-header-avatar img-src="image.png"></tds-header-avatar> `
|
|
14
|
+
);
|
|
15
|
+
expect(element.shadowRoot!.querySelector('img')).toHaveAttribute(
|
|
16
|
+
'src',
|
|
17
|
+
'image.png'
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
it('sets the progress percent', () => {
|
|
21
|
+
let element = renderIntoBody(
|
|
22
|
+
html` <tds-header-avatar .percent=${50}></tds-header-avatar> `
|
|
23
|
+
);
|
|
24
|
+
expect(
|
|
25
|
+
element.shadowRoot!.querySelector('[role=progressbar]')
|
|
26
|
+
).toHaveAttribute('aria-valuenow', '50');
|
|
27
|
+
});
|
|
28
|
+
it('sets the progress path', () => {
|
|
29
|
+
let element = renderIntoBody(
|
|
30
|
+
html` <tds-header-avatar .percent=${100}></tds-header-avatar> `
|
|
31
|
+
);
|
|
32
|
+
expect(element.shadowRoot!.querySelector('path')).toHaveAttribute(
|
|
33
|
+
'd',
|
|
34
|
+
'M 1 0 A 1 1 0 1 0 1 0 L 0 0'
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
it('hides the progress if no percent is passed', () => {
|
|
38
|
+
let element = renderIntoBody(
|
|
39
|
+
html` <tds-header-avatar></tds-header-avatar> `
|
|
40
|
+
);
|
|
41
|
+
expect(element.shadowRoot!.querySelector('svg')).toBeNull();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.progress-ring {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: block;
|
|
8
|
+
height: 38px;
|
|
9
|
+
width: 38px;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
background: #dddbda;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.progress-ring__progress {
|
|
15
|
+
transform: scaleX(-1) rotate(-90deg);
|
|
16
|
+
top: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
position: absolute;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.progress-ring__path {
|
|
24
|
+
fill: rgb(44, 127, 92); /* TODO: token */
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.progress-ring__content {
|
|
28
|
+
--size: 3px;
|
|
29
|
+
background-color: white;
|
|
30
|
+
bottom: calc(var(--size) * 2);
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
box-shadow: 0px 0px 0px var(--size) white;
|
|
33
|
+
left: calc(var(--size) * 2);
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: calc(var(--size) * 2);
|
|
36
|
+
top: calc(var(--size) * 2);
|
|
37
|
+
z-index: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.progress-ring__content img {
|
|
41
|
+
border-radius: 100px;
|
|
42
|
+
height: 100%;
|
|
43
|
+
object-fit: cover;
|
|
44
|
+
width: 100%;
|
|
45
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div if:true={percent} class="progress-ring">
|
|
3
|
+
<div
|
|
4
|
+
class="progress-ring__progress"
|
|
5
|
+
role="progressbar"
|
|
6
|
+
aria-valuemin="0"
|
|
7
|
+
aria-valuemax="100"
|
|
8
|
+
aria-valuenow={percent}
|
|
9
|
+
>
|
|
10
|
+
<svg viewBox="-1 -1 2 2">
|
|
11
|
+
<path class="progress-ring__path" d={d}></path>
|
|
12
|
+
</svg>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="progress-ring__content">
|
|
15
|
+
<img alt="" src={imgSrc} loading="lazy" decoding="async" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<img
|
|
19
|
+
alt=""
|
|
20
|
+
class="progress-ring"
|
|
21
|
+
if:false={percent}
|
|
22
|
+
src={imgSrc}
|
|
23
|
+
loading="lazy"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
export default class extends LightningElement {
|
|
4
|
+
@api imgSrc: string = '';
|
|
5
|
+
@api percent: number | null = null;
|
|
6
|
+
|
|
7
|
+
private get d() {
|
|
8
|
+
if (!this.percent) return '';
|
|
9
|
+
let isLong = this.percent > 50 ? 1 : 0;
|
|
10
|
+
let fill = 1 - this.percent / 100;
|
|
11
|
+
let arcX = Math.cos(2 * Math.PI * fill);
|
|
12
|
+
let arcY = Math.sin(2 * Math.PI * fill);
|
|
13
|
+
return `M 1 0 A 1 1 0 ${isLong} 0 ${arcX} ${arcY} L 0 0`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html, renderIntoBody } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import HeaderHelpButton from '../headerHelpButton';
|
|
4
|
+
|
|
5
|
+
customElements.define(
|
|
6
|
+
'tds-header-help-button',
|
|
7
|
+
HeaderHelpButton.CustomElementConstructor
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
describe('tds-header-help-button', () => {
|
|
11
|
+
describe('tracking', () => {
|
|
12
|
+
it('header_help_clicked', () => {
|
|
13
|
+
let element = renderIntoBody(
|
|
14
|
+
html`
|
|
15
|
+
<tds-header-help-button href="/"></tds-header-help-button>
|
|
16
|
+
`
|
|
17
|
+
);
|
|
18
|
+
let handler = jest.fn();
|
|
19
|
+
document.addEventListener('trailhead_track', handler, {
|
|
20
|
+
once: true
|
|
21
|
+
});
|
|
22
|
+
element
|
|
23
|
+
.shadowRoot!.querySelector('.help')!
|
|
24
|
+
.dispatchEvent(new MouseEvent('click'));
|
|
25
|
+
expect(handler.mock.calls[0][0].detail).toEqual(
|
|
26
|
+
expect.objectContaining({
|
|
27
|
+
eventName: 'help_clicked'
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
.help-icon {
|
|
4
|
+
background-color: var(--tds-color-meteorite);
|
|
5
|
+
border-radius: 100px;
|
|
6
|
+
color: var(--tds-color-white);
|
|
7
|
+
padding: var(--tds-spacing-1);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.help,
|
|
11
|
+
.help:visited,
|
|
12
|
+
.help:active {
|
|
13
|
+
color: var(--tds-color-white);
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<tds-button-icon-link
|
|
3
|
+
aria-label={assistiveText}
|
|
4
|
+
class="help"
|
|
5
|
+
href={href}
|
|
6
|
+
onclick={onClick}
|
|
7
|
+
variant="bare"
|
|
8
|
+
rel="noopener"
|
|
9
|
+
target="_blank"
|
|
10
|
+
>
|
|
11
|
+
<span class="help-icon">
|
|
12
|
+
<tds-icon
|
|
13
|
+
size="small"
|
|
14
|
+
sprite="action"
|
|
15
|
+
symbol="question_post_action"
|
|
16
|
+
></tds-icon>
|
|
17
|
+
</span>
|
|
18
|
+
</tds-button-icon-link>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
import { track } from 'shared/track';
|
|
4
|
+
|
|
5
|
+
export default class extends LightningElement {
|
|
6
|
+
@api assistiveText: string = '';
|
|
7
|
+
@api href: string = '';
|
|
8
|
+
|
|
9
|
+
private onClick() {
|
|
10
|
+
track(this.template.host, 'help_clicked', {});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { html, renderIntoBody } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import Heading from '../heading';
|
|
4
|
+
|
|
5
|
+
customElements.define('tds-heading', Heading.CustomElementConstructor);
|
|
6
|
+
|
|
7
|
+
describe('tds-heading', () => {
|
|
8
|
+
it('level 1', () => {
|
|
9
|
+
let element = renderIntoBody(
|
|
10
|
+
html` <tds-heading level="1"></tds-heading> `
|
|
11
|
+
);
|
|
12
|
+
expect(element.shadowRoot!.querySelector('h1')).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
it('level 2', () => {
|
|
15
|
+
let element = renderIntoBody(
|
|
16
|
+
html` <tds-heading level="2"></tds-heading> `
|
|
17
|
+
);
|
|
18
|
+
expect(element.shadowRoot!.querySelector('h2')).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
it('level 3', () => {
|
|
21
|
+
let element = renderIntoBody(
|
|
22
|
+
html` <tds-heading level="3"></tds-heading> `
|
|
23
|
+
);
|
|
24
|
+
expect(element.shadowRoot!.querySelector('h3')).toBeTruthy();
|
|
25
|
+
});
|
|
26
|
+
it('level 4', () => {
|
|
27
|
+
let element = renderIntoBody(
|
|
28
|
+
html` <tds-heading level="4"></tds-heading> `
|
|
29
|
+
);
|
|
30
|
+
expect(element.shadowRoot!.querySelector('h4')).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
it('level 5', () => {
|
|
33
|
+
let element = renderIntoBody(
|
|
34
|
+
html` <tds-heading level="5"></tds-heading> `
|
|
35
|
+
);
|
|
36
|
+
expect(element.shadowRoot!.querySelector('h5')).toBeTruthy();
|
|
37
|
+
});
|
|
38
|
+
it('level 6', () => {
|
|
39
|
+
let element = renderIntoBody(
|
|
40
|
+
html` <tds-heading level="6"></tds-heading> `
|
|
41
|
+
);
|
|
42
|
+
expect(element.shadowRoot!.querySelector('h6')).toBeTruthy();
|
|
43
|
+
});
|
|
44
|
+
it('null', () => {
|
|
45
|
+
let element = renderIntoBody(html` <tds-heading></tds-heading> `);
|
|
46
|
+
expect(
|
|
47
|
+
Array.from(element.shadowRoot!.children).map((n) => n.tagName)
|
|
48
|
+
).toEqual(['SLOT']);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1 class="heading" if:true={isLevel1}><slot></slot></h1>
|
|
3
|
+
<h2 class="heading" if:true={isLevel2}><slot></slot></h2>
|
|
4
|
+
<h3 class="heading" if:true={isLevel3}><slot></slot></h3>
|
|
5
|
+
<h4 class="heading" if:true={isLevel4}><slot></slot></h4>
|
|
6
|
+
<h5 class="heading" if:true={isLevel5}><slot></slot></h5>
|
|
7
|
+
<h6 class="heading" if:true={isLevel6}><slot></slot></h6>
|
|
8
|
+
<template if:false={isHeading}><slot></slot></template>
|
|
9
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'tds/tds-heading',
|
|
5
|
+
parameters: {
|
|
6
|
+
modules: ['/modules/tds-heading.js']
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Level1 = () => html`
|
|
11
|
+
<tds-heading level="1"> Level 1 </tds-heading>
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const Level2 = () => html`
|
|
15
|
+
<tds-heading level="2"> Level 2 </tds-heading>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const Level3 = () => html`
|
|
19
|
+
<tds-heading level="3"> Level 3 </tds-heading>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
export const Level4 = () => html`
|
|
23
|
+
<tds-heading level="4"> Level 4 </tds-heading>
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
export const Level5 = () => html`
|
|
27
|
+
<tds-heading level="5"> Level 5 </tds-heading>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
export const Level6 = () => html`
|
|
31
|
+
<tds-heading level="6"> Level 6 </tds-heading>
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const NoHeading = () => html`
|
|
35
|
+
<tds-heading> Not a heading </tds-heading>
|
|
36
|
+
`;
|