@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,63 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
type TitleMode = 'anchor' | 'button' | 'text';
|
|
4
|
+
|
|
5
|
+
export default class extends LightningElement {
|
|
6
|
+
@api complete: boolean = false;
|
|
7
|
+
@api path: string | null = null;
|
|
8
|
+
@api subtitle: string | null = null;
|
|
9
|
+
@api title: string = '';
|
|
10
|
+
|
|
11
|
+
private _titleMode: TitleMode = 'anchor';
|
|
12
|
+
|
|
13
|
+
@api
|
|
14
|
+
get titleMode(): TitleMode {
|
|
15
|
+
// Backwards compatability
|
|
16
|
+
if (this._titleMode === 'anchor' && !this.path) {
|
|
17
|
+
if (process.env.NODE_ENV === 'development') {
|
|
18
|
+
console.warn(
|
|
19
|
+
`title-mode was set to "anchor" but is missing "path" attribute, falling back to "button"`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return 'button';
|
|
23
|
+
}
|
|
24
|
+
return this._titleMode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
set titleMode(value) {
|
|
28
|
+
this._titleMode = value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private onButtonClick(e: MouseEvent) {
|
|
32
|
+
this.dispatchEvent(new CustomEvent('navigate'));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private onItemClick(e: MouseEvent) {
|
|
36
|
+
// This code allows the entire component to be clicked,
|
|
37
|
+
// but we don't want to override the default behavior of anchors/buttons
|
|
38
|
+
switch (this.titleMode) {
|
|
39
|
+
case 'anchor': {
|
|
40
|
+
if (e.target && (e.target as HTMLElement).tagName === 'A')
|
|
41
|
+
break;
|
|
42
|
+
window.location.href = this.path!;
|
|
43
|
+
}
|
|
44
|
+
case 'button': {
|
|
45
|
+
if (e.target && (e.target as HTMLElement).tagName === 'BUTTON')
|
|
46
|
+
break;
|
|
47
|
+
this.dispatchEvent(new CustomEvent('navigate'));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private get titleIsAnchor() {
|
|
53
|
+
return this.titleMode === 'anchor';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private get titleIsButton() {
|
|
57
|
+
return this.titleMode === 'button';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private get titleIsText() {
|
|
61
|
+
return this.titleMode === 'text';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { querySelector } from 'kagekiri';
|
|
2
|
+
import ContentChildListItem from '../contentChildListItem';
|
|
3
|
+
|
|
4
|
+
import { html, renderIntoBody } from 'shared/testutils';
|
|
5
|
+
|
|
6
|
+
customElements.define(
|
|
7
|
+
'tds-content-child-list-item',
|
|
8
|
+
ContentChildListItem.CustomElementConstructor
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
describe('tds-content-child-list-item', () => {
|
|
12
|
+
it('dispatches a navigate event', async () => {
|
|
13
|
+
let handler = jest.fn();
|
|
14
|
+
let element = renderIntoBody(html`
|
|
15
|
+
<tds-content-child-list-item
|
|
16
|
+
.summary=${{ title: 'Hello' }}
|
|
17
|
+
title-mode="button"
|
|
18
|
+
></tds-content-child-list-item>
|
|
19
|
+
`);
|
|
20
|
+
element.addEventListener('navigate', handler);
|
|
21
|
+
querySelector('button', element)!.dispatchEvent(
|
|
22
|
+
new MouseEvent('click')
|
|
23
|
+
);
|
|
24
|
+
expect(handler).toHaveBeenCalledWith(
|
|
25
|
+
expect.objectContaining({
|
|
26
|
+
detail: {
|
|
27
|
+
title: 'Hello'
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
// Fixtures not found - using placeholder types
|
|
4
|
+
const unit: any = {};
|
|
5
|
+
const unitComplete: any = {};
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'tds/tds-content-child-list-item',
|
|
9
|
+
parameters: {
|
|
10
|
+
modules: ['/modules/tds-content-child-list-item.js']
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const navigateHandler = (e: CustomEvent) => {
|
|
15
|
+
console.log('onNavigate', e.detail);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const Base = () => html`
|
|
19
|
+
<div style="padding: 20px; background-color: #f0f0f0;">
|
|
20
|
+
<tds-content-child-list-item
|
|
21
|
+
@navigate=${navigateHandler}
|
|
22
|
+
.summary=${unit}
|
|
23
|
+
></tds-content-child-list-item>
|
|
24
|
+
</div>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const Complete = () => html`
|
|
28
|
+
<div style="padding: 20px; background-color: #f0f0f0;">
|
|
29
|
+
<tds-content-child-list-item
|
|
30
|
+
@navigate=${navigateHandler}
|
|
31
|
+
.summary=${unitComplete}
|
|
32
|
+
>
|
|
33
|
+
</tds-content-child-list-item>
|
|
34
|
+
</div>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
export const CompleteSpanish = () => html`
|
|
38
|
+
<div style="padding: 20px; background-color: #f0f0f0;">
|
|
39
|
+
<tds-content-child-list-item
|
|
40
|
+
lang="es-MX"
|
|
41
|
+
@navigate=${navigateHandler}
|
|
42
|
+
.summary=${unitComplete}
|
|
43
|
+
>
|
|
44
|
+
</tds-content-child-list-item>
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
import { ChildSummary } from '../childSummary/types';
|
|
3
|
+
import { hoursMinutesLabel } from 'shared/labels/timeHelpers';
|
|
4
|
+
import { pointLabel } from 'shared/labels/pointHelpers';
|
|
5
|
+
|
|
6
|
+
export default class extends LightningElement {
|
|
7
|
+
@api lang: string = 'en';
|
|
8
|
+
@api summary: ChildSummary = null!;
|
|
9
|
+
@api titleMode: 'anchor' | 'button' | 'text' = 'anchor';
|
|
10
|
+
|
|
11
|
+
private onNavigate() {
|
|
12
|
+
this.dispatchEvent(
|
|
13
|
+
new CustomEvent('navigate', { detail: this.summary })
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private get user() {
|
|
18
|
+
return this.summary.user || { finishedAt: null, pointsEarned: null };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private get subtitle() {
|
|
22
|
+
if (this.user.finishedAt) {
|
|
23
|
+
return pointLabel(this.lang, this.user.pointsEarned);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (this.summary.estimatedTime) {
|
|
27
|
+
return hoursMinutesLabel(this.lang, this.summary.estimatedTime);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private get complete() {
|
|
32
|
+
return this.user.finishedAt ? true : false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
.image-container {
|
|
4
|
+
border-radius: var(--tds-radius-lg);
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.image {
|
|
9
|
+
border-radius: var(--tds-radius-lg);
|
|
10
|
+
display: block;
|
|
11
|
+
height: 100%;
|
|
12
|
+
object-fit: cover;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.icon {
|
|
17
|
+
align-self: center;
|
|
18
|
+
color: var(--tds-color-white);
|
|
19
|
+
display: flex;
|
|
20
|
+
background-color: var(--tds-color-evergreen);
|
|
21
|
+
border-radius: var(--tds-radius-full);
|
|
22
|
+
border: 3px solid var(--tds-color-white);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
height: var(--size);
|
|
26
|
+
position: absolute;
|
|
27
|
+
right: -10px;
|
|
28
|
+
top: -4px;
|
|
29
|
+
width: var(--size);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.icon--small,
|
|
33
|
+
.icon--medium {
|
|
34
|
+
--size: 30px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.icon--large,
|
|
38
|
+
.icon--xlarge {
|
|
39
|
+
--size: 38px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-svg {
|
|
43
|
+
--icon-size: 100%;
|
|
44
|
+
height: 60%;
|
|
45
|
+
margin: auto;
|
|
46
|
+
width: 60%;
|
|
47
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="image-container" style={imageContainerStyles}>
|
|
3
|
+
<img src={src} class="image" loading="lazy" decoding="async"/>
|
|
4
|
+
<template if:true={checked}>
|
|
5
|
+
<div class={iconClassName}>
|
|
6
|
+
<tds-icon
|
|
7
|
+
class="icon-svg"
|
|
8
|
+
size="override"
|
|
9
|
+
sprite="action"
|
|
10
|
+
symbol="check"
|
|
11
|
+
></tds-icon>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'tds/tds-content-icon',
|
|
5
|
+
parameters: {
|
|
6
|
+
modules: ['/modules/tds-content-icon.js']
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Base = () => html`
|
|
11
|
+
<tds-content-icon src="/images/badge-1.png"></tds-content-icon>
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export const BaseChecked = () => html`
|
|
15
|
+
<tds-content-icon
|
|
16
|
+
.checked=${true}
|
|
17
|
+
src="/images/badge-1.png"
|
|
18
|
+
></tds-content-icon>
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const BaseSmall = () => html`
|
|
22
|
+
<tds-content-icon size="small" src="/images/badge-1.png"></tds-content-icon>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const BaseSmallChecked = () => html`
|
|
26
|
+
<tds-content-icon
|
|
27
|
+
.checked=${true}
|
|
28
|
+
size="small"
|
|
29
|
+
src="/images/badge-1.png"
|
|
30
|
+
></tds-content-icon>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const BaseLarge = () => html`
|
|
34
|
+
<tds-content-icon size="large" src="/images/badge-1.png"></tds-content-icon>
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
export const BaseLargeChecked = () => html`
|
|
38
|
+
<tds-content-icon
|
|
39
|
+
.checked=${true}
|
|
40
|
+
size="large"
|
|
41
|
+
src="/images/badge-1.png"
|
|
42
|
+
></tds-content-icon>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const BaseXLarge = () => html`
|
|
46
|
+
<tds-content-icon
|
|
47
|
+
size="xlarge"
|
|
48
|
+
src="/images/badge-1.png"
|
|
49
|
+
></tds-content-icon>
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const BaseXLargeChecked = () => html`
|
|
53
|
+
<tds-content-icon
|
|
54
|
+
.checked=${true}
|
|
55
|
+
size="xlarge"
|
|
56
|
+
src="/images/badge-1.png"
|
|
57
|
+
></tds-content-icon>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
export const Trail = () => html`
|
|
61
|
+
<tds-content-icon
|
|
62
|
+
.background=${true}
|
|
63
|
+
color="rgb(221, 49, 49)"
|
|
64
|
+
src="/images/badge-trail-1.png"
|
|
65
|
+
></tds-content-icon>
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export const TrailChecked = () => html`
|
|
69
|
+
<tds-content-icon
|
|
70
|
+
.background=${true}
|
|
71
|
+
color="rgb(221, 49, 49)"
|
|
72
|
+
.checked=${true}
|
|
73
|
+
src="/images/badge-trail-1.png"
|
|
74
|
+
></tds-content-icon>
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
export const TrailSmall = () => html`
|
|
78
|
+
<tds-content-icon
|
|
79
|
+
.background=${true}
|
|
80
|
+
color="rgb(221, 49, 49)"
|
|
81
|
+
size="small"
|
|
82
|
+
src="/images/badge-trail-1.png"
|
|
83
|
+
></tds-content-icon>
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
export const TrailLarge = () => html`
|
|
87
|
+
<tds-content-icon
|
|
88
|
+
.background=${true}
|
|
89
|
+
color="rgb(221, 49, 49)"
|
|
90
|
+
size="large"
|
|
91
|
+
src="/images/badge-trail-1.png"
|
|
92
|
+
></tds-content-icon>
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
export const Trailmix = () => html`
|
|
96
|
+
<tds-content-icon
|
|
97
|
+
.background=${true}
|
|
98
|
+
size="large"
|
|
99
|
+
src="/images/trailblazer-1.png"
|
|
100
|
+
></tds-content-icon>
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
export const TrailmixComplete = () => html`
|
|
104
|
+
<tds-content-icon
|
|
105
|
+
.background=${true}
|
|
106
|
+
size="large"
|
|
107
|
+
.checked=${true}
|
|
108
|
+
src="/images/trailblazer-1.png"
|
|
109
|
+
></tds-content-icon>
|
|
110
|
+
`;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
export default class extends LightningElement {
|
|
4
|
+
@api background: boolean = false;
|
|
5
|
+
@api checked: boolean = false;
|
|
6
|
+
@api color: string | null = null;
|
|
7
|
+
@api size: 'small' | 'medium' | 'large' | 'xlarge' = 'medium';
|
|
8
|
+
_src: string = '';
|
|
9
|
+
|
|
10
|
+
@api
|
|
11
|
+
get src() {
|
|
12
|
+
return this._src;
|
|
13
|
+
}
|
|
14
|
+
set src(value) {
|
|
15
|
+
const cms = value?.indexOf('sf-archs');
|
|
16
|
+
if (cms !== -1) {
|
|
17
|
+
this._src = `https://${value.substring(value.indexOf('sf-archs'))}`;
|
|
18
|
+
} else {
|
|
19
|
+
this._src = value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
private get imageSize() {
|
|
23
|
+
switch (this.size) {
|
|
24
|
+
case 'small':
|
|
25
|
+
return 64;
|
|
26
|
+
case 'medium':
|
|
27
|
+
return 72;
|
|
28
|
+
case 'large':
|
|
29
|
+
return 96;
|
|
30
|
+
case 'xlarge':
|
|
31
|
+
return 128;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private get imageContainerStyles() {
|
|
36
|
+
let styles = `height: ${this.imageSize}px; width: ${this.imageSize}px;`;
|
|
37
|
+
if (this.background) {
|
|
38
|
+
return [styles, `background-color: ${this.color};`].join(' ');
|
|
39
|
+
}
|
|
40
|
+
return styles;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private get iconClassName() {
|
|
44
|
+
return `icon icon--${this.size}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
private get imgSrcSetWebP() {
|
|
48
|
+
const imgType = this.src.split('.').pop();
|
|
49
|
+
const imgName = this.src.replace(`.${imgType}`, '');
|
|
50
|
+
return `${imgName}-search.webp 75w`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private get imgSrcSetJpg() {
|
|
54
|
+
const imgType = this.src.split('.').pop();
|
|
55
|
+
const imgName = this.src.replace(`.${imgType}`, '');
|
|
56
|
+
return `${imgName}-search.jpg 75w`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private get imgTagNoSvg() {
|
|
60
|
+
return !this.src.toLowerCase().endsWith('svg');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private get imgTagSvg() {
|
|
64
|
+
return this.src.toLowerCase().endsWith('svg');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ContextWireAdapter } from '../../../common/context';
|
|
2
|
+
import {
|
|
3
|
+
ContextAdapter,
|
|
4
|
+
setDefaultValue,
|
|
5
|
+
setGlobalContext,
|
|
6
|
+
ContextAdapterValue,
|
|
7
|
+
ContextAdapterConfig,
|
|
8
|
+
ContextAdapterContext
|
|
9
|
+
} from '../contextAdapter';
|
|
10
|
+
|
|
11
|
+
describe('tds-context-adapter', () => {
|
|
12
|
+
let setValue: jest.Mock<(value: string) => void>;
|
|
13
|
+
let adapter: ContextWireAdapter<
|
|
14
|
+
ContextAdapterValue,
|
|
15
|
+
ContextAdapterConfig,
|
|
16
|
+
ContextAdapterContext
|
|
17
|
+
>;
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
setValue = jest.fn();
|
|
20
|
+
adapter = new ContextAdapter(setValue);
|
|
21
|
+
});
|
|
22
|
+
it('default values', () => {
|
|
23
|
+
adapter = new ContextAdapter(setValue);
|
|
24
|
+
expect(adapter.value).toEqual(
|
|
25
|
+
expect.objectContaining({
|
|
26
|
+
assetsUrl: '/assets/images',
|
|
27
|
+
crossOriginAssets: false,
|
|
28
|
+
locale: 'en'
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
describe('resolution', () => {
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
setGlobalContext(null!);
|
|
35
|
+
setDefaultValue({
|
|
36
|
+
assetsUrl: '/default/ui',
|
|
37
|
+
crossOriginAssets: false,
|
|
38
|
+
locale: 'en'
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
it('uses the default value', () => {
|
|
42
|
+
setDefaultValue({
|
|
43
|
+
assetsUrl: '/default/ui',
|
|
44
|
+
crossOriginAssets: false,
|
|
45
|
+
locale: 'en'
|
|
46
|
+
});
|
|
47
|
+
adapter = new ContextAdapter(setValue);
|
|
48
|
+
expect(adapter.value).toEqual(
|
|
49
|
+
expect.objectContaining({ assetsUrl: '/default/ui' })
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
it('uses the global context', () => {
|
|
53
|
+
setGlobalContext({ assetsUrl: '/global/ui' });
|
|
54
|
+
expect(adapter.value).toEqual(
|
|
55
|
+
expect.objectContaining({ assetsUrl: '/global/ui' })
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
it('uses the local context', () => {
|
|
59
|
+
setGlobalContext({ assetsUrl: '/global/ui' });
|
|
60
|
+
adapter.update({}, { assetsUrl: '/local/ui' });
|
|
61
|
+
expect(adapter.value).toEqual(
|
|
62
|
+
expect.objectContaining({ assetsUrl: '/local/ui' })
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
it('uses the adapter config', () => {
|
|
66
|
+
setGlobalContext({ assetsUrl: '/global/ui' });
|
|
67
|
+
adapter.update(
|
|
68
|
+
{ assetsUrl: '/adapter/ui' },
|
|
69
|
+
{ assetsUrl: '/global/ui' }
|
|
70
|
+
);
|
|
71
|
+
expect(adapter.value).toEqual(
|
|
72
|
+
expect.objectContaining({ assetsUrl: '/adapter/ui' })
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_LOCALE = 'en';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<template></template>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Locale } from 'shared/i18n';
|
|
2
|
+
import { DEFAULT_LOCALE } from './constants';
|
|
3
|
+
import { createContextAdapter } from 'common/context';
|
|
4
|
+
|
|
5
|
+
type Nullable<T> = T | null;
|
|
6
|
+
|
|
7
|
+
export type ContextAdapterValue = {
|
|
8
|
+
crossOriginAssets: boolean;
|
|
9
|
+
assetsUrl: string;
|
|
10
|
+
locale: Locale;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ContextAdapterConfig = {
|
|
14
|
+
crossOriginAssets?: Nullable<boolean>;
|
|
15
|
+
assetsUrl?: Nullable<string>;
|
|
16
|
+
locale?: Nullable<Locale>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type ContextAdapterContext = {
|
|
20
|
+
crossOriginAssets?: Nullable<boolean>;
|
|
21
|
+
assetsUrl?: Nullable<string>;
|
|
22
|
+
locale?: Nullable<Locale>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const ContextAdapter = createContextAdapter<
|
|
26
|
+
ContextAdapterValue,
|
|
27
|
+
ContextAdapterConfig,
|
|
28
|
+
ContextAdapterContext
|
|
29
|
+
>(
|
|
30
|
+
(): ContextAdapterValue => {
|
|
31
|
+
return {
|
|
32
|
+
crossOriginAssets: process.env.CROSS_ORIGIN_ASSETS === 'true',
|
|
33
|
+
// See `rollup.config.js` for more explanation of this variable
|
|
34
|
+
// If set, we trim everything after /modules to get the absolute assets url on `th-components`
|
|
35
|
+
// If not, we default to the relative assets url on `th-components`
|
|
36
|
+
assetsUrl: process.env.IMPORT_META_URL
|
|
37
|
+
? String(process.env.IMPORT_META_URL).replace(/\/modules.*/, '')
|
|
38
|
+
: '/assets/images',
|
|
39
|
+
locale: getDefaultLocale() as Locale
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
assetsUrl: 'optional',
|
|
44
|
+
crossOriginAssets: 'optional',
|
|
45
|
+
locale: 'optional'
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const { setGlobalContext, setDefaultValue } = ContextAdapter;
|
|
50
|
+
|
|
51
|
+
function getDefaultLocale() {
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
return window.locale || DEFAULT_LOCALE;
|
|
54
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
@import 'tds/reset';
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
--nubbin-size: 14px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
[aria-hidden='true'] {
|
|
8
|
+
visibility: hidden;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.with-nubbin::before,
|
|
13
|
+
.with-nubbin::after {
|
|
14
|
+
content: '';
|
|
15
|
+
width: var(--nubbin-size);
|
|
16
|
+
height: var(--nubbin-size);
|
|
17
|
+
transform: rotate(45deg);
|
|
18
|
+
position: absolute;
|
|
19
|
+
z-index: -1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.with-nubbin::before {
|
|
23
|
+
background-color: inherit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.with-nubbin::after {
|
|
27
|
+
box-shadow: var(--tds-shadow-sm);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.with-nubbin[data-popper-placement^='top']::before,
|
|
31
|
+
.with-nubbin[data-popper-placement^='top']::after {
|
|
32
|
+
bottom: calc(var(--nubbin-size) / 2 * -1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.with-nubbin[data-popper-placement^='bottom']::before,
|
|
36
|
+
.with-nubbin[data-popper-placement^='bottom']::after {
|
|
37
|
+
top: calc(var(--nubbin-size) / 2 * -1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.with-nubbin[data-popper-placement^='right']::before,
|
|
41
|
+
.with-nubbin[data-popper-placement^='right']::after {
|
|
42
|
+
left: calc(var(--nubbin-size) / 2 * -1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.with-nubbin[data-popper-placement^='left']::before,
|
|
46
|
+
.with-nubbin[data-popper-placement^='left']::after {
|
|
47
|
+
right: calc(var(--nubbin-size) / 2 * -1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.with-nubbin[data-popper-placement='top']::before,
|
|
51
|
+
.with-nubbin[data-popper-placement='bottom']::before,
|
|
52
|
+
.with-nubbin[data-popper-placement='top']::after,
|
|
53
|
+
.with-nubbin[data-popper-placement='bottom']::after {
|
|
54
|
+
left: calc(50% - var(--nubbin-size) / 2);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.with-nubbin[data-popper-placement='top-start']::before,
|
|
58
|
+
.with-nubbin[data-popper-placement='bottom-start']::before,
|
|
59
|
+
.with-nubbin[data-popper-placement='top-start']::after,
|
|
60
|
+
.with-nubbin[data-popper-placement='bottom-start']::after {
|
|
61
|
+
left: var(--nubbin-size);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.with-nubbin[data-popper-placement='top-end']::before,
|
|
65
|
+
.with-nubbin[data-popper-placement='bottom-end']::before,
|
|
66
|
+
.with-nubbin[data-popper-placement='top-end']::after,
|
|
67
|
+
.with-nubbin[data-popper-placement='bottom-end']::after {
|
|
68
|
+
right: var(--nubbin-size);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.with-nubbin[data-popper-placement='right']::before,
|
|
72
|
+
.with-nubbin[data-popper-placement='left']::before,
|
|
73
|
+
.with-nubbin[data-popper-placement='right']::after,
|
|
74
|
+
.with-nubbin[data-popper-placement='left']::after {
|
|
75
|
+
top: calc(50% - var(--nubbin-size) / 2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.with-nubbin[data-popper-placement='right-start']::before,
|
|
79
|
+
.with-nubbin[data-popper-placement='left-start']::before,
|
|
80
|
+
.with-nubbin[data-popper-placement='right-start']::after,
|
|
81
|
+
.with-nubbin[data-popper-placement='left-start']::after {
|
|
82
|
+
top: var(--nubbin-size);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.with-nubbin[data-popper-placement='right-end']::before,
|
|
86
|
+
.with-nubbin[data-popper-placement='left-end']::before,
|
|
87
|
+
.with-nubbin[data-popper-placement='right-end']::after,
|
|
88
|
+
.with-nubbin[data-popper-placement='left-end']::after {
|
|
89
|
+
bottom: var(--nubbin-size);
|
|
90
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`undefined: toMatchHTMLSnapshot 1`] = `"<div class="footer" data-slots=""><div class="container"><nav class="links"><div class="links__column"><div class="heading">Learn</div><ul><li><a href="/">Trails</a></li><li><a href="/">Trailmixes</a></li></ul></div><div class="links__column"><div class="heading">Extras</div><ul><li><a href="/">myTrailhead</a></li><li><a href="/" target="_blank">Help</a></li></ul></div></nav><div class="bottom"><slot name="left"></slot><slot name="right"></slot></div></div></div>"`;
|