@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,135 @@
|
|
|
1
|
+
import { html, render, renderIntoBody, nextTick } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import Summary from '../summary';
|
|
4
|
+
|
|
5
|
+
customElements.define('tds-summary', Summary.CustomElementConstructor);
|
|
6
|
+
|
|
7
|
+
describe('tds-content-brick', () => {
|
|
8
|
+
describe('compact (string)', () => {
|
|
9
|
+
it('shows the description ', () => {
|
|
10
|
+
let element = renderIntoBody(html`
|
|
11
|
+
<tds-summary description="Hello"></tds-summary>
|
|
12
|
+
`);
|
|
13
|
+
expect(element.shadowRoot!.innerHTML).toContain('Hello');
|
|
14
|
+
});
|
|
15
|
+
it('hides the description (string)', () => {
|
|
16
|
+
let element = renderIntoBody(html`
|
|
17
|
+
<tds-summary compact description="Hello"></tds-summary>
|
|
18
|
+
`);
|
|
19
|
+
expect(element.shadowRoot!.innerHTML).not.toContain('Hello');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe('compact (bool)', () => {
|
|
23
|
+
it('shows the description (string)', () => {
|
|
24
|
+
let element = renderIntoBody(html`
|
|
25
|
+
<tds-summary
|
|
26
|
+
.compact=${false}
|
|
27
|
+
description="Hello"
|
|
28
|
+
></tds-summary>
|
|
29
|
+
`);
|
|
30
|
+
expect(element.shadowRoot!.innerHTML).toContain('Hello');
|
|
31
|
+
});
|
|
32
|
+
it('hides the description (bool)', () => {
|
|
33
|
+
let element = renderIntoBody(html`
|
|
34
|
+
<tds-summary .compact=${true} description="Hello"></tds-summary>
|
|
35
|
+
`);
|
|
36
|
+
expect(element.shadowRoot!.innerHTML).not.toContain('Hello');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
// Skip this test as LWC in test mode doesn't support dynamic slot content with conditional rendering
|
|
40
|
+
it.skip('hides the header if no slots are filled', async () => {
|
|
41
|
+
let template = ({ showImage, showAction }: any = {}) => html`
|
|
42
|
+
<tds-summary>
|
|
43
|
+
${showImage ? html` <img slot="image" /> ` : null}
|
|
44
|
+
${showAction ? html` <button slot="action" /> ` : null}
|
|
45
|
+
</tds-summary>
|
|
46
|
+
`;
|
|
47
|
+
let element = renderIntoBody(template());
|
|
48
|
+
let header = element.shadowRoot!.querySelector('.header');
|
|
49
|
+
let isHidden = () =>
|
|
50
|
+
header!.matches(
|
|
51
|
+
'.summary:not([data-slots*="image"]):not([data-slots*="action"]) .header'
|
|
52
|
+
);
|
|
53
|
+
expect(isHidden()).toBe(true);
|
|
54
|
+
render(template({ showImage: true }), element.parentElement!);
|
|
55
|
+
await nextTick();
|
|
56
|
+
expect(isHidden()).toBe(false);
|
|
57
|
+
render(template({ showAction: true }), element.parentElement!);
|
|
58
|
+
await nextTick();
|
|
59
|
+
expect(isHidden()).toBe(false);
|
|
60
|
+
});
|
|
61
|
+
it.skip('hides the footer if no slots are filled', async () => {
|
|
62
|
+
let template = ({ showMetaLeft, showMetaRight }: any = {}) => html`
|
|
63
|
+
<tds-summary>
|
|
64
|
+
${showMetaLeft ? html` <span slot="meta-left" /> ` : null}
|
|
65
|
+
${showMetaRight ? html` <span slot="meta-right" /> ` : null}
|
|
66
|
+
</tds-summary>
|
|
67
|
+
`;
|
|
68
|
+
let element = renderIntoBody(template());
|
|
69
|
+
let footer = element.shadowRoot!.querySelector('.footer');
|
|
70
|
+
let isHidden = () =>
|
|
71
|
+
footer!.matches('.summary:not([data-slots*="meta"]) .footer');
|
|
72
|
+
expect(isHidden()).toBe(true);
|
|
73
|
+
render(template({ showMetaLeft: true }), element.parentElement!);
|
|
74
|
+
await nextTick();
|
|
75
|
+
expect(isHidden()).toBe(false);
|
|
76
|
+
render(template({ showMetaRight: true }), element.parentElement!);
|
|
77
|
+
await nextTick();
|
|
78
|
+
expect(isHidden()).toBe(false);
|
|
79
|
+
});
|
|
80
|
+
describe('titleMode', () => {
|
|
81
|
+
describe('anchor', () => {
|
|
82
|
+
it('renders the correct element', () => {
|
|
83
|
+
let element = renderIntoBody(html`
|
|
84
|
+
<tds-summary
|
|
85
|
+
description="Hello"
|
|
86
|
+
path="/"
|
|
87
|
+
title-mode="anchor"
|
|
88
|
+
></tds-summary>
|
|
89
|
+
`);
|
|
90
|
+
expect(
|
|
91
|
+
element.shadowRoot!.querySelector('.title')!.tagName
|
|
92
|
+
).toBe('A');
|
|
93
|
+
});
|
|
94
|
+
it('renders a button if no path is specified', () => {
|
|
95
|
+
let element = renderIntoBody(
|
|
96
|
+
html`
|
|
97
|
+
<tds-summary
|
|
98
|
+
title="Hello"
|
|
99
|
+
title-mode="anchor"
|
|
100
|
+
></tds-summary>
|
|
101
|
+
`
|
|
102
|
+
);
|
|
103
|
+
expect(
|
|
104
|
+
element.shadowRoot!.querySelector('.title')!.tagName
|
|
105
|
+
).toBe('BUTTON');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
describe('button', () => {
|
|
109
|
+
it('renders the correct element', () => {
|
|
110
|
+
let element = renderIntoBody(html`
|
|
111
|
+
<tds-summary
|
|
112
|
+
description="Hello"
|
|
113
|
+
title-mode="button"
|
|
114
|
+
></tds-summary>
|
|
115
|
+
`);
|
|
116
|
+
expect(
|
|
117
|
+
element.shadowRoot!.querySelector('.title')!.tagName
|
|
118
|
+
).toBe('BUTTON');
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe('text', () => {
|
|
122
|
+
it('renders the correct element', () => {
|
|
123
|
+
let element = renderIntoBody(html`
|
|
124
|
+
<tds-summary
|
|
125
|
+
description="Hello"
|
|
126
|
+
title-mode="text"
|
|
127
|
+
></tds-summary>
|
|
128
|
+
`);
|
|
129
|
+
expect(
|
|
130
|
+
element.shadowRoot!.querySelector('.title')!.tagName
|
|
131
|
+
).toBe('SPAN');
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
.summary {
|
|
4
|
+
display: flex;
|
|
5
|
+
padding-bottom: 0.75rem;
|
|
6
|
+
padding-top: 0.75rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[data-display='brick'] {
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-display*='tile'] {
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.body,
|
|
18
|
+
.footer {
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
margin-top: var(--tds-spacing-3);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.header {
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header__actions {
|
|
30
|
+
margin-bottom: -1.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.header__actions[data-alignment='start'] {
|
|
34
|
+
align-self: flex-start;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.header__actions[data-alignment='center'] {
|
|
38
|
+
align-self: flex-center;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.header__actions[data-alignment='end'] {
|
|
42
|
+
align-self: flex-end;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.summary:not([data-slots*='image']):not([data-slots*='action']) .header {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.content {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.content-start {
|
|
55
|
+
flex: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.pretitle,
|
|
59
|
+
.title,
|
|
60
|
+
.description {
|
|
61
|
+
margin-top: var(--tds-spacing-1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.pretitle {
|
|
65
|
+
color: var(--tds-color-meteorite);
|
|
66
|
+
font-size: var(--tds-font-size-sm);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.pretitle a {
|
|
70
|
+
color: var(--tds-color-brand);
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pretitle a:hover {
|
|
75
|
+
text-decoration: underline;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.title {
|
|
79
|
+
display: inline-block;
|
|
80
|
+
font-size: var(--title-font-size, var(--tds-font-size-lg));
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
text-align: left;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.title--link {
|
|
86
|
+
appearance: none;
|
|
87
|
+
-webkit-appearance: none;
|
|
88
|
+
background: none;
|
|
89
|
+
border: none;
|
|
90
|
+
color: var(--tds-color-brand);
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.title--link:hover {
|
|
96
|
+
text-decoration: underline;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.description {
|
|
100
|
+
color: var(--tds-color-meteorite);
|
|
101
|
+
font-size: var(--tds-font-size-sm);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.footer {
|
|
105
|
+
display: flex;
|
|
106
|
+
font-size: var(--tds-font-size-sm);
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
align-items: center;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.summary:not([data-slots*='meta']) .footer {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-display='brick'] .body {
|
|
116
|
+
flex: 1;
|
|
117
|
+
margin-top: 0;
|
|
118
|
+
margin-left: var(--tds-spacing-4);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[data-display='brick'] .body .content {
|
|
122
|
+
margin-top: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media screen and (min-width: 640px) {
|
|
126
|
+
[data-display^='brick-tile'] {
|
|
127
|
+
flex-direction: row;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
[data-display^='brick-tile'] .body {
|
|
131
|
+
margin-left: var(--tds-spacing-4);
|
|
132
|
+
margin-top: 0;
|
|
133
|
+
flex: 1;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="summary" data-display={displayMode}>
|
|
3
|
+
<div class="header">
|
|
4
|
+
<div class="image">
|
|
5
|
+
<slot name="image" onslotchange={onSlotChange}></slot>
|
|
6
|
+
</div>
|
|
7
|
+
<template if:true={isTile}>
|
|
8
|
+
<div data-alignment={actionsAlignment} class="header__actions">
|
|
9
|
+
<slot name="action" onslotchange={onSlotChange}></slot>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="body">
|
|
14
|
+
<div class="content">
|
|
15
|
+
<div class="content-start">
|
|
16
|
+
<div class="pretitle">
|
|
17
|
+
<slot name="pretitle" onslotchange={onSlotChange}>
|
|
18
|
+
{pretitle}
|
|
19
|
+
<a
|
|
20
|
+
if:true={pretitleLinkHref}
|
|
21
|
+
href={pretitleLinkHref}
|
|
22
|
+
target={pretitleLinkTarget}
|
|
23
|
+
>{pretitleLinkTitle}</a
|
|
24
|
+
>
|
|
25
|
+
</slot>
|
|
26
|
+
</div>
|
|
27
|
+
<tds-heading level={titleHeadingLevel}>
|
|
28
|
+
<template if:true={titleIsAnchor}>
|
|
29
|
+
<a
|
|
30
|
+
class="title title--link"
|
|
31
|
+
href={path}
|
|
32
|
+
onclick={onTitleClick}
|
|
33
|
+
target={pathTarget}
|
|
34
|
+
>{title}</a
|
|
35
|
+
>
|
|
36
|
+
</template>
|
|
37
|
+
<template if:true={titleIsButton}>
|
|
38
|
+
<button
|
|
39
|
+
class="title title--link"
|
|
40
|
+
onclick={onTitleButtonClick}
|
|
41
|
+
>
|
|
42
|
+
{title}
|
|
43
|
+
</button>
|
|
44
|
+
</template>
|
|
45
|
+
<template if:true={titleIsText}>
|
|
46
|
+
<span class="title">{title}</span>
|
|
47
|
+
</template>
|
|
48
|
+
</tds-heading>
|
|
49
|
+
<template if:true={showDescription}>
|
|
50
|
+
<div class="description">{description}</div>
|
|
51
|
+
</template>
|
|
52
|
+
</div>
|
|
53
|
+
<template if:false={isTile}>
|
|
54
|
+
<div class="content-end">
|
|
55
|
+
<slot name="action" onslotchange={onSlotChange}></slot>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="footer">
|
|
60
|
+
<div>
|
|
61
|
+
<slot name="meta-left" onslotchange={onSlotChange}></slot>
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
<slot name="meta-right" onslotchange={onSlotChange}></slot>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'tds/tds-summary',
|
|
5
|
+
parameters: {
|
|
6
|
+
modules: ['/modules/tds-summary.js'],
|
|
7
|
+
chromatic: {
|
|
8
|
+
viewports: [400, 800, 1199]
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Base = () => html`
|
|
14
|
+
<tds-summary
|
|
15
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
16
|
+
path="/"
|
|
17
|
+
pretitle="Pretitle by "
|
|
18
|
+
pretitle-link-href="/"
|
|
19
|
+
pretitle-link-title="Link"
|
|
20
|
+
title="Title"
|
|
21
|
+
>
|
|
22
|
+
<tds-content-icon
|
|
23
|
+
slot="image"
|
|
24
|
+
src="/images/badge-1.png"
|
|
25
|
+
></tds-content-icon>
|
|
26
|
+
<button slot="action">Action</button>
|
|
27
|
+
<span slot="meta-left">Meta left</span>
|
|
28
|
+
<span slot="meta-right">Meta right</span>
|
|
29
|
+
</tds-summary>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
export const CustomPretitle = () => html`
|
|
33
|
+
<tds-summary
|
|
34
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
35
|
+
path="/"
|
|
36
|
+
title="Title"
|
|
37
|
+
>
|
|
38
|
+
<tds-content-icon
|
|
39
|
+
slot="image"
|
|
40
|
+
src="/images/badge-1.png"
|
|
41
|
+
></tds-content-icon>
|
|
42
|
+
<div slot="pretitle">
|
|
43
|
+
Pretitle by <a href="#">Link</a> (custom content)
|
|
44
|
+
</div>
|
|
45
|
+
<button slot="action">Action</button>
|
|
46
|
+
<span slot="meta-left">Meta left</span>
|
|
47
|
+
<span slot="meta-right">Meta right</span>
|
|
48
|
+
</tds-summary>
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
export const Brick = () => html`
|
|
52
|
+
<tds-summary
|
|
53
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
54
|
+
display-mode="brick"
|
|
55
|
+
path="/"
|
|
56
|
+
title="Title"
|
|
57
|
+
>
|
|
58
|
+
<tds-content-icon
|
|
59
|
+
slot="image"
|
|
60
|
+
src="/images/badge-1.png"
|
|
61
|
+
size="small"
|
|
62
|
+
></tds-content-icon>
|
|
63
|
+
|
|
64
|
+
<div slot="pretitle">
|
|
65
|
+
Pretitle by <a href="#">Link</a> (custom content)
|
|
66
|
+
</div>
|
|
67
|
+
<button slot="action">Action</button>
|
|
68
|
+
<span slot="meta-left">Meta left</span>
|
|
69
|
+
<span slot="meta-right">Meta right</span>
|
|
70
|
+
</tds-summary>
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
export const BrickTile = () => html`
|
|
74
|
+
<tds-summary
|
|
75
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
76
|
+
display-mode="brick-tile"
|
|
77
|
+
path="/"
|
|
78
|
+
title="Title"
|
|
79
|
+
>
|
|
80
|
+
<tds-content-icon
|
|
81
|
+
slot="image"
|
|
82
|
+
src="/images/badge-1.png"
|
|
83
|
+
size="small"
|
|
84
|
+
></tds-content-icon>
|
|
85
|
+
|
|
86
|
+
<div slot="pretitle">
|
|
87
|
+
Pretitle by <a href="#">Link</a> (custom content)
|
|
88
|
+
</div>
|
|
89
|
+
<button slot="action">Action</button>
|
|
90
|
+
<span slot="meta-left">Meta left</span>
|
|
91
|
+
<span slot="meta-right">Meta right</span>
|
|
92
|
+
</tds-summary>
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
export const BrickCompact = () => html`
|
|
96
|
+
<tds-summary
|
|
97
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
98
|
+
compact
|
|
99
|
+
display-mode="brick-tile"
|
|
100
|
+
path="/"
|
|
101
|
+
title="Title"
|
|
102
|
+
>
|
|
103
|
+
<tds-content-icon
|
|
104
|
+
slot="image"
|
|
105
|
+
src="/images/badge-1.png"
|
|
106
|
+
size="small"
|
|
107
|
+
></tds-content-icon>
|
|
108
|
+
|
|
109
|
+
<div slot="pretitle">
|
|
110
|
+
Pretitle by <a href="#">Link</a> (custom content)
|
|
111
|
+
</div>
|
|
112
|
+
<button slot="action">Action</button>
|
|
113
|
+
<span slot="meta-left">Meta left</span>
|
|
114
|
+
<span slot="meta-right">Meta right</span>
|
|
115
|
+
</tds-summary>
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
export const TitleButton = () => html`
|
|
119
|
+
<tds-summary
|
|
120
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
121
|
+
pretitle="Pretitle by "
|
|
122
|
+
pretitle-link-href="/"
|
|
123
|
+
pretitle-link-title="Link"
|
|
124
|
+
title="Title"
|
|
125
|
+
title-mode="button"
|
|
126
|
+
>
|
|
127
|
+
<tds-content-icon
|
|
128
|
+
slot="image"
|
|
129
|
+
src="/images/badge-1.png"
|
|
130
|
+
></tds-content-icon>
|
|
131
|
+
</tds-summary>
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
export const TitleText = () => html`
|
|
135
|
+
<tds-summary
|
|
136
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
137
|
+
pretitle="Pretitle by "
|
|
138
|
+
pretitle-link-href="/"
|
|
139
|
+
pretitle-link-title="Link"
|
|
140
|
+
title="Title"
|
|
141
|
+
title-mode="text"
|
|
142
|
+
>
|
|
143
|
+
<tds-content-icon
|
|
144
|
+
slot="image"
|
|
145
|
+
src="/images/badge-1.png"
|
|
146
|
+
></tds-content-icon>
|
|
147
|
+
</tds-summary>
|
|
148
|
+
`;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
type TitleMode = 'anchor' | 'button' | 'text';
|
|
4
|
+
export default class extends LightningElement {
|
|
5
|
+
@api actionsAlignment: 'start' | 'center' | 'end' = 'start';
|
|
6
|
+
@api compact: boolean | string | null = null;
|
|
7
|
+
@api description: string | null = null;
|
|
8
|
+
@api displayMode: 'brick' | 'brick-tile' | 'tile' = 'tile';
|
|
9
|
+
@api path: string | null = null;
|
|
10
|
+
@api pathTarget: string | null = null;
|
|
11
|
+
@api pretitle: string | null = null;
|
|
12
|
+
@api pretitleLinkHref: string | null = null;
|
|
13
|
+
@api pretitleLinkTarget: string | null = null;
|
|
14
|
+
@api pretitleLinkTitle: string | null = null;
|
|
15
|
+
@api title: string = '';
|
|
16
|
+
@api titleHeadingLevel: '1' | '2' | '3' | '4' | null = null;
|
|
17
|
+
|
|
18
|
+
private _titleMode: TitleMode = 'anchor';
|
|
19
|
+
|
|
20
|
+
@api
|
|
21
|
+
get titleMode(): TitleMode {
|
|
22
|
+
// Backwards compatability
|
|
23
|
+
if (this._titleMode === 'anchor' && !this.path) {
|
|
24
|
+
if (process.env.NODE_ENV === 'development') {
|
|
25
|
+
console.warn(
|
|
26
|
+
`title-mode was set to "anchor" but is missing "path" attribute, falling back to "button"`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return 'button';
|
|
30
|
+
}
|
|
31
|
+
return this._titleMode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set titleMode(value) {
|
|
35
|
+
this._titleMode = value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private isTile = true;
|
|
39
|
+
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
this.onMediaQueryTile(mediaQueryTile);
|
|
42
|
+
mediaQueryTile.addListener(this.onMediaQueryTile);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
mediaQueryTile.removeListener(this.onMediaQueryTile);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private get isCompact() {
|
|
50
|
+
return typeof this.compact === 'boolean'
|
|
51
|
+
? this.compact
|
|
52
|
+
: this.compact !== null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private onMediaQueryTile = (e: { matches: boolean }) => {
|
|
56
|
+
this.isTile =
|
|
57
|
+
this.displayMode === 'tile' ||
|
|
58
|
+
(this.displayMode === 'brick-tile' && mediaQueryTile.matches);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
private onSlotChange() {
|
|
62
|
+
let slots = Array.from(
|
|
63
|
+
this.template.querySelectorAll('slot')
|
|
64
|
+
) as HTMLSlotElement[];
|
|
65
|
+
let slotNames = slots
|
|
66
|
+
.filter((slot) => slot.assignedNodes()[0])
|
|
67
|
+
.map((slot) => slot.getAttribute('name'))
|
|
68
|
+
.join(' ');
|
|
69
|
+
this.template
|
|
70
|
+
.querySelector('.summary')!
|
|
71
|
+
.setAttribute('data-slots', slotNames);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private onTitleButtonClick(e: MouseEvent) {
|
|
75
|
+
this.dispatchEvent(new CustomEvent('navigate'));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private get showDescription() {
|
|
79
|
+
return !this.isCompact;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private get titleIsAnchor() {
|
|
83
|
+
return this.titleMode === 'anchor';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private get titleIsButton() {
|
|
87
|
+
return this.titleMode === 'button';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private get titleIsText() {
|
|
91
|
+
return this.titleMode === 'text';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const mediaQueryTile = window.matchMedia(`(max-width: 640px)`);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { html, renderIntoBody, nextTick } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import Tab from '../tab';
|
|
4
|
+
|
|
5
|
+
customElements.define('tds-tab', Tab.CustomElementConstructor);
|
|
6
|
+
|
|
7
|
+
describe('tds-tab', () => {
|
|
8
|
+
it('can be loaded and unloaded', async () => {
|
|
9
|
+
const element = renderIntoBody(html` <tds-tab>Hello</tds-tab> `);
|
|
10
|
+
|
|
11
|
+
expect(element.shadowRoot!.innerHTML).toEqual('');
|
|
12
|
+
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
element.load();
|
|
15
|
+
await nextTick();
|
|
16
|
+
|
|
17
|
+
expect(element.shadowRoot!.innerHTML).toEqual('<slot></slot>');
|
|
18
|
+
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
element.unload();
|
|
21
|
+
await nextTick();
|
|
22
|
+
|
|
23
|
+
expect(element.shadowRoot!.innerHTML).toEqual('');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LightningElement, api } from 'lwc';
|
|
2
|
+
|
|
3
|
+
let uid = 0;
|
|
4
|
+
|
|
5
|
+
export type TabElement = {
|
|
6
|
+
label: string;
|
|
7
|
+
load: () => void;
|
|
8
|
+
title: string;
|
|
9
|
+
unload: () => void;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default class extends LightningElement {
|
|
14
|
+
@api label: string | null = null;
|
|
15
|
+
@api value: string | null = null;
|
|
16
|
+
|
|
17
|
+
private loaded: boolean = false;
|
|
18
|
+
|
|
19
|
+
@api load() {
|
|
20
|
+
this.loaded = true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@api unload() {
|
|
24
|
+
this.loaded = false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
setTimeout(()=> {
|
|
29
|
+
this.dispatchEvent(
|
|
30
|
+
new CustomEvent('privatetabregister', {
|
|
31
|
+
cancelable: true,
|
|
32
|
+
bubbles: true,
|
|
33
|
+
composed: true,
|
|
34
|
+
detail: {
|
|
35
|
+
label: this.label,
|
|
36
|
+
title: this.title || this.label,
|
|
37
|
+
value: this.value || `tab-${uid++}`,
|
|
38
|
+
load: () => this.load(),
|
|
39
|
+
unload: () => this.unload()
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
}, 0);
|
|
45
|
+
}
|
|
46
|
+
}
|