@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,36 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
export default class extends LightningElement {
|
|
4
|
+
// In the future, this could accept a value of "auto" which
|
|
5
|
+
// could traverse the DOM tree and figure out the appropriate level
|
|
6
|
+
@api level: '1' | '2' | '3' | '4' | '5' | '6' | null = null;
|
|
7
|
+
|
|
8
|
+
private get isHeading() {
|
|
9
|
+
// If "level" is null, we render a <slot> and with no heading
|
|
10
|
+
return this.level !== null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
private get isLevel1() {
|
|
14
|
+
return this.level === '1';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private get isLevel2() {
|
|
18
|
+
return this.level === '2';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private get isLevel3() {
|
|
22
|
+
return this.level === '3';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private get isLevel4() {
|
|
26
|
+
return this.level === '4';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private get isLevel5() {
|
|
30
|
+
return this.level === '5';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
private get isLevel6() {
|
|
34
|
+
return this.level === '6';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
svg {
|
|
4
|
+
display: block;
|
|
5
|
+
fill: currentColor;
|
|
6
|
+
height: var(--icon-size);
|
|
7
|
+
width: var(--icon-size);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.size--x-small {
|
|
11
|
+
--icon-size: var(--tds-spacing-3);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.size--small {
|
|
15
|
+
--icon-size: var(--tds-spacing-4);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.size--medium {
|
|
19
|
+
--icon-size: var(--tds-spacing-5);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.size--large {
|
|
23
|
+
--icon-size: var(--tds-spacing-6);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.size--xlarge {
|
|
27
|
+
--icon-size: var(--tds-spacing-10);
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
aria-hidden="true"
|
|
4
|
+
class={className}
|
|
5
|
+
if:false={context.crossOriginAssets}
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
>
|
|
8
|
+
<use xlink:href={href}></use>
|
|
9
|
+
</svg>
|
|
10
|
+
<svg
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
class={className}
|
|
13
|
+
if:true={context.crossOriginAssets}
|
|
14
|
+
lwc:dom="manual"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
></svg>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'tds/tds-icon',
|
|
5
|
+
parameters: {
|
|
6
|
+
modules: ['/modules/tds-icon.js']
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Base = () => html`
|
|
11
|
+
<tds-icon size="large" symbol="edit"></tds-icon>
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const Action = () => html`
|
|
15
|
+
<div style="color: red">
|
|
16
|
+
<tds-icon size="large" sprite="action" symbol="check"></tds-icon>
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { api, LightningElement, wire } from 'lwc';
|
|
2
|
+
import { ContextAdapter, ContextAdapterValue } from 'tds/contextAdapter';
|
|
3
|
+
|
|
4
|
+
/* ROLLUP_PLATFORM
|
|
5
|
+
import * as iconUtils from 'lightning/iconUtils';
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
type Size = 'x-small' | 'small' | 'medium' | 'large' | 'xlarge' | 'override';
|
|
9
|
+
|
|
10
|
+
type Sprite =
|
|
11
|
+
| 'action'
|
|
12
|
+
| 'custom'
|
|
13
|
+
| 'doctype'
|
|
14
|
+
| 'social'
|
|
15
|
+
| 'social-round'
|
|
16
|
+
| 'utility';
|
|
17
|
+
|
|
18
|
+
const fetches = new Map<string, Promise<any>>();
|
|
19
|
+
|
|
20
|
+
export default class extends LightningElement {
|
|
21
|
+
@api sprite: Sprite = 'utility';
|
|
22
|
+
@api size: Size = 'medium';
|
|
23
|
+
@api symbol: string = '';
|
|
24
|
+
|
|
25
|
+
private node: SVGSymbolElement | undefined;
|
|
26
|
+
|
|
27
|
+
@wire(ContextAdapter)
|
|
28
|
+
private context: ContextAdapterValue = null!;
|
|
29
|
+
|
|
30
|
+
private get className() {
|
|
31
|
+
return `size--${this.size}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private get href() {
|
|
35
|
+
/* ROLLUP_PLATFORM
|
|
36
|
+
return iconUtils.getIconPath(`${this.sprite}:${this.symbol}`);
|
|
37
|
+
*/
|
|
38
|
+
return `${this.context.assetsUrl}/icons/${this.sprite}-sprite/svg/symbols.svg#${this.symbol}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private get symbolId() {
|
|
42
|
+
return `tds__${this.sprite}__${this.symbol}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
renderedCallback() {
|
|
46
|
+
if (this.context.crossOriginAssets) this.appendNodes();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private async appendNodes() {
|
|
50
|
+
if (process.env.NODE_ENV === 'test') return;
|
|
51
|
+
let { symbolId } = this;
|
|
52
|
+
if (this.node && this.node.id === symbolId) return;
|
|
53
|
+
await this.fetchSprite(this.sprite);
|
|
54
|
+
let svg = this.template.querySelector('svg')!;
|
|
55
|
+
let node = document
|
|
56
|
+
.getElementById(symbolId)!
|
|
57
|
+
.cloneNode(true) as SVGSymbolElement;
|
|
58
|
+
while (svg.firstChild) svg.removeChild(svg.firstChild);
|
|
59
|
+
for (let n of Array.from(node.childNodes)) svg.appendChild(n);
|
|
60
|
+
svg.setAttribute('viewBox', node.getAttribute('viewBox')!);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private async fetchSprite(sprite: Sprite) {
|
|
64
|
+
if (fetches.has(sprite)) return fetches.get(sprite);
|
|
65
|
+
let promise = fetch(
|
|
66
|
+
`${this.context.assetsUrl}/icons/${this.sprite}-sprite/svg/symbols.svg`
|
|
67
|
+
)
|
|
68
|
+
.then((res) => res.text())
|
|
69
|
+
.then((svg) => svg.replace(/id=\"/g, `id="tds__${sprite}__`))
|
|
70
|
+
.then((svg) => {
|
|
71
|
+
let node = document.createElement('div');
|
|
72
|
+
node.innerHTML = svg;
|
|
73
|
+
node.style.display = 'none';
|
|
74
|
+
document.body.appendChild(node);
|
|
75
|
+
});
|
|
76
|
+
fetches.set(sprite, promise);
|
|
77
|
+
return promise;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { html, renderIntoBody } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import Input from '../input';
|
|
4
|
+
|
|
5
|
+
customElements.define('tds-input', Input.CustomElementConstructor);
|
|
6
|
+
|
|
7
|
+
describe('tds-input', () => {
|
|
8
|
+
it('renders a text input by default', () => {
|
|
9
|
+
const element = renderIntoBody(html` <tds-input></tds-input> `);
|
|
10
|
+
|
|
11
|
+
const input = element.shadowRoot!.querySelector('input');
|
|
12
|
+
|
|
13
|
+
expect(input).toHaveAttribute('type', 'text');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('accepts attributes', () => {
|
|
17
|
+
const element = renderIntoBody(
|
|
18
|
+
html`
|
|
19
|
+
<tds-input
|
|
20
|
+
value="value"
|
|
21
|
+
placeholder="placeholder"
|
|
22
|
+
disabled
|
|
23
|
+
></tds-input>
|
|
24
|
+
`
|
|
25
|
+
);
|
|
26
|
+
const input = element.shadowRoot!.querySelector('input');
|
|
27
|
+
|
|
28
|
+
expect(input!.value).toBe('value');
|
|
29
|
+
expect(input!.placeholder).toBe('placeholder');
|
|
30
|
+
expect(input!.disabled).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('ignores undefined attributes', () => {
|
|
34
|
+
const element = renderIntoBody(html` <tds-input></tds-input> `);
|
|
35
|
+
const input = element.shadowRoot!.querySelector('input');
|
|
36
|
+
|
|
37
|
+
expect(input!.value).toBe('');
|
|
38
|
+
expect(input!.placeholder).toBe('');
|
|
39
|
+
expect(input!.disabled).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
label {
|
|
4
|
+
overflow-wrap: break-word;
|
|
5
|
+
word-wrap: break-word;
|
|
6
|
+
hyphens: auto;
|
|
7
|
+
display: block;
|
|
8
|
+
padding-right: var(--tds-spacing-2);
|
|
9
|
+
padding-top: var(--tds-spacing-2);
|
|
10
|
+
color: var(--tds-color-meteorite);
|
|
11
|
+
font-size: var(--tds-font-size-xs);
|
|
12
|
+
margin-bottom: var(--tds-spacing-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.text-input {
|
|
16
|
+
font-size: var(--tds-font-size-sm);
|
|
17
|
+
background-color: var(--tds-color-white);
|
|
18
|
+
border: 1px solid var(--tds-color-fog);
|
|
19
|
+
border-radius: var(--tds-radius-md);
|
|
20
|
+
transition: border 0.1s linear, background-color 0.1s linear;
|
|
21
|
+
display: block;
|
|
22
|
+
width: 100%;
|
|
23
|
+
padding: var(--tds-spacing-1) var(--tds-spacing-4) var(--tds-spacing-1)
|
|
24
|
+
var(--tds-spacing-3);
|
|
25
|
+
line-height: 1.875rem;
|
|
26
|
+
min-height: calc(1.875rem + (1px * 2));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.text-input[disabled] {
|
|
30
|
+
background-color: var(--tds-color-fog);
|
|
31
|
+
border-color: var(--tds-color-granite);
|
|
32
|
+
cursor: not-allowed;
|
|
33
|
+
user-select: none;
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'tds/tds-input',
|
|
5
|
+
parameters: {
|
|
6
|
+
modules: ['/modules/tds-input.js']
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Base = () => html`
|
|
11
|
+
<tds-input
|
|
12
|
+
type="text"
|
|
13
|
+
label="Input Label"
|
|
14
|
+
value="Hello, World!"
|
|
15
|
+
></tds-input>
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const Disabled = () => html`
|
|
19
|
+
<tds-input
|
|
20
|
+
type="text"
|
|
21
|
+
label="Input Label"
|
|
22
|
+
value="Hello, World!"
|
|
23
|
+
disabled
|
|
24
|
+
></tds-input>
|
|
25
|
+
`;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LightningElement, api } from 'lwc';
|
|
2
|
+
import { BooleanAttr } from 'shared/types.d';
|
|
3
|
+
import { attrToBool } from 'shared/helpers';
|
|
4
|
+
// @ts-ignore - LWC HTML template
|
|
5
|
+
import input from './input.html';
|
|
6
|
+
|
|
7
|
+
// TODO add other options in the future (date, color, password, etc)
|
|
8
|
+
export type InputType = 'text';
|
|
9
|
+
|
|
10
|
+
export default class extends LightningElement {
|
|
11
|
+
@api type: InputType = 'text';
|
|
12
|
+
@api value: string | null = null;
|
|
13
|
+
@api label: string | null = null;
|
|
14
|
+
@api placeholder: string | null = null;
|
|
15
|
+
@api disabled: BooleanAttr = false;
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
switch (this.type) {
|
|
19
|
+
default:
|
|
20
|
+
return input;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private get _value() {
|
|
25
|
+
return typeof this.value === 'string' ? this.value : null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private get isDisabled() {
|
|
29
|
+
return attrToBool(this.disabled);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private get isTypeText(): boolean {
|
|
33
|
+
return this.type === 'text';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private handleChange(e: { target: HTMLInputElement }) {
|
|
37
|
+
this.dispatchEvent(
|
|
38
|
+
new CustomEvent('change', { detail: e.target.value })
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<template></template>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { LightningElement, api } from 'lwc';
|
|
2
|
+
|
|
3
|
+
const TRACKING_EVENT_NAME = 'architectssite_track';
|
|
4
|
+
const LISTENER_QUEUE = '__TDS_INSTRUMENTATION_QUEUE__';
|
|
5
|
+
const LISTENER_INDICATOR = '__TDS_INSTRUMENTATION_IS_INITIALIZED__';
|
|
6
|
+
|
|
7
|
+
export function track(
|
|
8
|
+
element: EventTarget,
|
|
9
|
+
event: string,
|
|
10
|
+
payload: Record<string, unknown>
|
|
11
|
+
): void {
|
|
12
|
+
const detail = { event, payload };
|
|
13
|
+
// if window.LISTENER_INDICATOR is undefined, `tds-instrumentation` has not
|
|
14
|
+
// been mounted, and the listener hasn't been attached.
|
|
15
|
+
if ((window as any)[LISTENER_INDICATOR] === undefined) {
|
|
16
|
+
(window as any)[LISTENER_QUEUE] = (window as any)[LISTENER_QUEUE] || [];
|
|
17
|
+
(window as any)[LISTENER_QUEUE].push(detail);
|
|
18
|
+
} else {
|
|
19
|
+
const e = new CustomEvent(TRACKING_EVENT_NAME, {
|
|
20
|
+
bubbles: true,
|
|
21
|
+
composed: true,
|
|
22
|
+
detail
|
|
23
|
+
});
|
|
24
|
+
element.dispatchEvent(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const googleTagManager = {
|
|
29
|
+
track: function (e: Event) {
|
|
30
|
+
if ((window as any).dataLayer === undefined) {
|
|
31
|
+
(window as any).dataLayer = [];
|
|
32
|
+
}
|
|
33
|
+
const { event, payload } = (e as CustomEvent).detail;
|
|
34
|
+
(window as any).dataLayer.push({ ...payload, event });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
interface TrackEventListener {
|
|
39
|
+
add: () => void;
|
|
40
|
+
remove: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function trackEventListener(
|
|
44
|
+
trackerFns: { track: (e: Event) => void }[] = []
|
|
45
|
+
): TrackEventListener {
|
|
46
|
+
if (trackerFns.length === 0) {
|
|
47
|
+
throw new Error('No tracker functions passed');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const trackWebEvent = (e: Event) => {
|
|
51
|
+
trackerFns.forEach((tracker) => {
|
|
52
|
+
tracker.track(e);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const attachEventListener = () => {
|
|
57
|
+
document.addEventListener(TRACKING_EVENT_NAME, trackWebEvent);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const removeEventListener = () => {
|
|
61
|
+
document.removeEventListener(TRACKING_EVENT_NAME, trackWebEvent);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
add: attachEventListener,
|
|
66
|
+
remove: removeEventListener
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default class Instrumentation extends LightningElement {
|
|
71
|
+
@api useGoogleTagManager = false;
|
|
72
|
+
|
|
73
|
+
private tracker: TrackEventListener | null = null;
|
|
74
|
+
|
|
75
|
+
private setupTracker() {
|
|
76
|
+
const trackerFunctions = this.useGoogleTagManager
|
|
77
|
+
? [googleTagManager]
|
|
78
|
+
: [];
|
|
79
|
+
this.tracker = trackEventListener(trackerFunctions);
|
|
80
|
+
this.tracker.add();
|
|
81
|
+
(window as any)[LISTENER_INDICATOR] = true;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private dispatchQueuedEvents() {
|
|
85
|
+
while ((window as any)[LISTENER_QUEUE].length > 0) {
|
|
86
|
+
const event = (window as any)[LISTENER_QUEUE].pop() as {
|
|
87
|
+
event: string;
|
|
88
|
+
payload: Record<string, unknown>;
|
|
89
|
+
};
|
|
90
|
+
track(this, event.event, event.payload);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
renderedCallback() {
|
|
95
|
+
if (this.tracker === null) {
|
|
96
|
+
this.setupTracker();
|
|
97
|
+
|
|
98
|
+
if (
|
|
99
|
+
(window as any)[LISTENER_QUEUE] !== undefined &&
|
|
100
|
+
(window as any)[LISTENER_QUEUE].length > 0
|
|
101
|
+
) {
|
|
102
|
+
this.dispatchQueuedEvents();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
disconnectedCallback() {
|
|
108
|
+
if (this.tracker !== null) {
|
|
109
|
+
this.tracker.remove();
|
|
110
|
+
this.tracker = null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.body {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
min-height: 185px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.text > div {
|
|
9
|
+
margin-bottom: var(--tds-spacing-3);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.title {
|
|
13
|
+
font-size: var(--tds-font-size-xl);
|
|
14
|
+
font-weight: 700;
|
|
15
|
+
line-height: var(--tds-line-height-relaxed);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.subtitle {
|
|
19
|
+
font-size: var(--tds-font-size-sm);
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
line-height: var(--tds-line-height-snug);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cta {
|
|
25
|
+
text-decoration: underline;
|
|
26
|
+
color: var(--dx-g-blue-vibrant-20);
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dx-card-content borderless="false" fix-orientation="true" href={href}>
|
|
3
|
+
<div slot="body" class="body">
|
|
4
|
+
<div class="text">
|
|
5
|
+
<div lwc:if={showBadge}>
|
|
6
|
+
<tds-badge color="blue">{badgeText}</tds-badge>
|
|
7
|
+
</div>
|
|
8
|
+
<div>
|
|
9
|
+
<span class="subtitle">{subtitle}</span>
|
|
10
|
+
<div class="title">{title}</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div>
|
|
13
|
+
<span>{body}</span>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div>
|
|
17
|
+
<a href={href} class="cta">{ctaText}</a>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</dx-card-content>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LightningElement, api } from 'lwc';
|
|
2
|
+
|
|
3
|
+
export default class extends LightningElement {
|
|
4
|
+
@api href: string = '#';
|
|
5
|
+
@api includeBadge: boolean | string = false;
|
|
6
|
+
@api badgeText: string = '';
|
|
7
|
+
@api subtitle: string = '';
|
|
8
|
+
@api title: string = '';
|
|
9
|
+
@api body: string = '';
|
|
10
|
+
@api ctaText: string = '';
|
|
11
|
+
|
|
12
|
+
get showBadge() {
|
|
13
|
+
return (
|
|
14
|
+
(this.includeBadge === true || this.includeBadge === 'true') &&
|
|
15
|
+
this.badgeText
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { html, renderIntoBody, nextTick } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import Pill from '../pill';
|
|
4
|
+
|
|
5
|
+
customElements.define('tds-pill', Pill.CustomElementConstructor);
|
|
6
|
+
|
|
7
|
+
const TITLE = 'Title';
|
|
8
|
+
const LABEL = 'Label';
|
|
9
|
+
|
|
10
|
+
describe('tds-pill', () => {
|
|
11
|
+
// Skip these tests as LWC in test mode doesn't support child nodes for light DOM components
|
|
12
|
+
// The pill component uses slots for label text, which isn't compatible with lit-html rendering in tests
|
|
13
|
+
it.skip('forwards the title attribute to the label', async () => {
|
|
14
|
+
const element = renderIntoBody(
|
|
15
|
+
html` <tds-pill title=${TITLE}>${LABEL}</tds-pill> `
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
await nextTick();
|
|
19
|
+
|
|
20
|
+
expect(
|
|
21
|
+
element
|
|
22
|
+
.shadowRoot!.querySelector('.pill__label')!
|
|
23
|
+
.getAttribute('title')
|
|
24
|
+
).toEqual(TITLE);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it.skip('uses slot text as a title fallback', async () => {
|
|
28
|
+
const element = renderIntoBody(html` <tds-pill>${LABEL}</tds-pill> `);
|
|
29
|
+
|
|
30
|
+
await nextTick();
|
|
31
|
+
|
|
32
|
+
expect(
|
|
33
|
+
element
|
|
34
|
+
.shadowRoot!.querySelector('.pill__label')!
|
|
35
|
+
.getAttribute('title')
|
|
36
|
+
).toEqual(LABEL);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it.skip('accepts a title for the remove button', async () => {
|
|
40
|
+
const element = renderIntoBody(
|
|
41
|
+
html` <tds-pill remove-button-title="Clear">${LABEL}</tds-pill> `
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
expect(
|
|
45
|
+
element
|
|
46
|
+
.shadowRoot!.querySelector('.pill__remove')!
|
|
47
|
+
.getAttribute('title')
|
|
48
|
+
).toEqual('Clear');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders the component', () => {
|
|
52
|
+
const element = renderIntoBody(html`<tds-pill></tds-pill>`);
|
|
53
|
+
expect(element).toBeTruthy();
|
|
54
|
+
expect(element.shadowRoot).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.pill {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
position: relative;
|
|
12
|
+
color: var(--tds-color-meteorite);
|
|
13
|
+
border: 1px solid var(--tds-color-granite);
|
|
14
|
+
border-radius: var(--tds-radius-md);
|
|
15
|
+
padding-left: var(--tds-spacing-3);
|
|
16
|
+
padding-right: var(--tds-spacing-8);
|
|
17
|
+
height: var(--tds-spacing-10);
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.pill:not(.pill--bare):hover {
|
|
23
|
+
background-color: var(--tds-color-sand);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pill--link {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
color: var(--tds-color-brand);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pill--bare {
|
|
32
|
+
border-color: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pill__label {
|
|
36
|
+
font-size: var(--tds-font-size-sm);
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pill__remove {
|
|
43
|
+
color: var(--tds-color-meteorite);
|
|
44
|
+
border: none;
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
padding: 2px;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
position: absolute;
|
|
49
|
+
right: var(--tds-spacing-2);
|
|
50
|
+
top: 50%;
|
|
51
|
+
transform: translateY(-50%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.pill__remove:hover,
|
|
55
|
+
.pill__remove:focus {
|
|
56
|
+
color: var(--tds-color-black);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.assistive-text {
|
|
60
|
+
position: absolute !important;
|
|
61
|
+
margin: -1px !important;
|
|
62
|
+
border: 0 !important;
|
|
63
|
+
padding: 0 !important;
|
|
64
|
+
width: 1px !important;
|
|
65
|
+
height: 1px !important;
|
|
66
|
+
overflow: hidden !important;
|
|
67
|
+
clip: rect(0 0 0 0) !important;
|
|
68
|
+
text-transform: none !important;
|
|
69
|
+
white-space: nowrap !important;
|
|
70
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class={className} role="option" aria-selected="true">
|
|
3
|
+
<div class="pill__label" title={titleWithFallback}>
|
|
4
|
+
<slot onslotchange={setTitle}></slot>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<button
|
|
8
|
+
class="pill__remove"
|
|
9
|
+
title={removeButtonTitle}
|
|
10
|
+
onclick={handleRemove}
|
|
11
|
+
>
|
|
12
|
+
<tds-icon symbol="close" size="x-small"></tds-icon>
|
|
13
|
+
|
|
14
|
+
<div class="assistive-text">{removeButtonTitle}</div>
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|