@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,18 @@
|
|
|
1
|
+
export function waitForPageSettled() {
|
|
2
|
+
return new Promise<void>((resolve) => {
|
|
3
|
+
let prevH: number = 0;
|
|
4
|
+
let prevY = window.scrollY;
|
|
5
|
+
function check() {
|
|
6
|
+
let nextH = window.innerHeight + document.body.scrollHeight;
|
|
7
|
+
let nextY = window.scrollY;
|
|
8
|
+
let settled = nextH === prevH;
|
|
9
|
+
if (settled) {
|
|
10
|
+
if (nextY === prevY) resolve();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
prevH = nextH;
|
|
14
|
+
requestAnimationFrame(check);
|
|
15
|
+
}
|
|
16
|
+
requestAnimationFrame(check);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'tm/tm-youtube',
|
|
5
|
+
parameters: {
|
|
6
|
+
modules: ['/modules/tm-youtube.js'],
|
|
7
|
+
chromatic: {
|
|
8
|
+
disable: true
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Base = () => html`
|
|
14
|
+
<tm-youtube video-id="dQw4w9WgXcQ"></tm-youtube>
|
|
15
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { api, LightningElement, track } from 'lwc';
|
|
2
|
+
import { waitForPageSettled } from 'tm/utils';
|
|
3
|
+
|
|
4
|
+
export default class extends LightningElement {
|
|
5
|
+
@api videoId: string = undefined!;
|
|
6
|
+
|
|
7
|
+
@track private height = 0;
|
|
8
|
+
@track private width = 0;
|
|
9
|
+
|
|
10
|
+
private didSetSize = false;
|
|
11
|
+
|
|
12
|
+
private get src() {
|
|
13
|
+
return `https://www.youtube.com/embed/${this.videoId}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
renderedCallback() {
|
|
17
|
+
if (!this.didSetSize) {
|
|
18
|
+
this.didSetSize = true;
|
|
19
|
+
waitForPageSettled().then(() => {
|
|
20
|
+
let w = this.template.host.offsetWidth;
|
|
21
|
+
let ratio = 0.5625;
|
|
22
|
+
this.height = w * ratio;
|
|
23
|
+
this.width = w;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
import { isFocusable, isHidden } from '@a11y/focus-trap';
|
|
4
|
+
import { queryShadowRoot } from '@a11y/focus-trap/shadow';
|
|
5
|
+
|
|
6
|
+
import { debounce } from 'shared/debounce';
|
|
7
|
+
|
|
8
|
+
// This is a re-implementation of https://github.com/andreasbm/focus-trap
|
|
9
|
+
// since LWC does not currently support custom elements in a template
|
|
10
|
+
export default class extends LightningElement {
|
|
11
|
+
@api private inactive = false;
|
|
12
|
+
private focused = false;
|
|
13
|
+
private init = false;
|
|
14
|
+
|
|
15
|
+
private $start!: HTMLElement;
|
|
16
|
+
private $end!: HTMLElement;
|
|
17
|
+
|
|
18
|
+
private $activeElement: Element | null = null;
|
|
19
|
+
|
|
20
|
+
private get startTabIndex() {
|
|
21
|
+
return !this.focused || this.inactive ? '-1' : '0';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private get endTabIndex() {
|
|
25
|
+
return !this.focused || this.inactive ? '-1' : '0';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
renderedCallback() {
|
|
29
|
+
if (this.init) return;
|
|
30
|
+
else this.init = true;
|
|
31
|
+
|
|
32
|
+
this.$start = this.template.querySelector(
|
|
33
|
+
`[data-id="start"]`
|
|
34
|
+
) as HTMLElement;
|
|
35
|
+
this.$end = this.template.querySelector(
|
|
36
|
+
`[data-id="end"]`
|
|
37
|
+
) as HTMLElement;
|
|
38
|
+
|
|
39
|
+
this.$start.addEventListener('focus', this.focusLastElement);
|
|
40
|
+
this.$end.addEventListener('focus', this.focusFirstElement);
|
|
41
|
+
|
|
42
|
+
this.addEventListener('focusin', this.onFocusIn);
|
|
43
|
+
this.addEventListener('focusout', this.onFocusOut);
|
|
44
|
+
this.addEventListener('keyup', this.onKeyUp as EventListener);
|
|
45
|
+
|
|
46
|
+
this.$activeElement = getActiveElement(document.activeElement);
|
|
47
|
+
|
|
48
|
+
this.focusFirstElement();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
disconnectedCallback() {
|
|
52
|
+
this.removeEventListener('focusin', this.onFocusIn);
|
|
53
|
+
this.removeEventListener('focusout', this.onFocusOut);
|
|
54
|
+
if (this.$activeElement && this.$activeElement instanceof HTMLElement)
|
|
55
|
+
this.$activeElement.focus();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private focusFirstElement = () => {
|
|
59
|
+
this.trapFocus();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
private focusLastElement = () => {
|
|
63
|
+
this.trapFocus(true);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
private onFocusIn = debounce(() => {
|
|
67
|
+
this.focused = true;
|
|
68
|
+
}, 0);
|
|
69
|
+
|
|
70
|
+
private onFocusOut = debounce(() => {
|
|
71
|
+
this.focused = false;
|
|
72
|
+
}, 0);
|
|
73
|
+
|
|
74
|
+
private onKeyUp = (e: KeyboardEvent) => {
|
|
75
|
+
if (e.key === 'Esc' || e.key === 'Escape') {
|
|
76
|
+
this.dispatchEvent(new CustomEvent('requestclose'));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
private getFocusableElements(): HTMLElement[] {
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
let children = this.template.querySelector('slot').assignedElements();
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
return queryShadowRoot({ children }, isHidden, isFocusable);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private trapFocus(trapToEnd?: boolean) {
|
|
88
|
+
if (this.inactive) return;
|
|
89
|
+
let focusableElements = this.getFocusableElements();
|
|
90
|
+
if (focusableElements.length > 0) {
|
|
91
|
+
if (trapToEnd) {
|
|
92
|
+
focusableElements[focusableElements.length - 1].focus();
|
|
93
|
+
} else {
|
|
94
|
+
focusableElements[0].focus();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function getActiveElement(element: Element | null): Element | null {
|
|
101
|
+
if (element && element.shadowRoot)
|
|
102
|
+
return getActiveElement(element.shadowRoot.activeElement);
|
|
103
|
+
return element;
|
|
104
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { html, renderIntoBody, nextTick } from 'shared/testutils';
|
|
2
|
+
|
|
3
|
+
import FocusVisible from '../focusVisible';
|
|
4
|
+
|
|
5
|
+
customElements.define(
|
|
6
|
+
'ui-focus-visible',
|
|
7
|
+
FocusVisible.CustomElementConstructor
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
describe('ui-focus-visible', () => {
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
while (document.body.firstChild) {
|
|
13
|
+
document.body.removeChild(document.body.firstChild);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// Skip these tests as LWC in test mode doesn't support child nodes for light DOM components
|
|
18
|
+
// The focusVisible component requires child elements in slots
|
|
19
|
+
it.skip('defaults to true', async () => {
|
|
20
|
+
const element = renderIntoBody(html`
|
|
21
|
+
<ui-focus-visible>
|
|
22
|
+
<div></div>
|
|
23
|
+
</ui-focus-visible>
|
|
24
|
+
`);
|
|
25
|
+
await nextTick();
|
|
26
|
+
expect(element.querySelector('div')).toHaveAttribute(
|
|
27
|
+
'data-focus-visible',
|
|
28
|
+
'true'
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
it.skip('handles mutation', async () => {
|
|
32
|
+
const element = renderIntoBody(html`
|
|
33
|
+
<ui-focus-visible></ui-focus-visible>
|
|
34
|
+
`);
|
|
35
|
+
await nextTick();
|
|
36
|
+
element.appendChild(document.createElement('div'));
|
|
37
|
+
await nextTick();
|
|
38
|
+
expect(element.querySelector('div')).toHaveAttribute(
|
|
39
|
+
'data-focus-visible',
|
|
40
|
+
'true'
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
it.skip('changes to false on mousedown', async () => {
|
|
44
|
+
const element = renderIntoBody(html`
|
|
45
|
+
<ui-focus-visible>
|
|
46
|
+
<div></div>
|
|
47
|
+
</ui-focus-visible>
|
|
48
|
+
`);
|
|
49
|
+
await nextTick();
|
|
50
|
+
document.dispatchEvent(new MouseEvent('mousedown'));
|
|
51
|
+
expect(element.querySelector('div')).toHaveAttribute(
|
|
52
|
+
'data-focus-visible',
|
|
53
|
+
'false'
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
it.skip('changes to false on mousemove', async () => {
|
|
57
|
+
const element = renderIntoBody(html`
|
|
58
|
+
<ui-focus-visible>
|
|
59
|
+
<div></div>
|
|
60
|
+
</ui-focus-visible>
|
|
61
|
+
`);
|
|
62
|
+
await nextTick();
|
|
63
|
+
document.dispatchEvent(new MouseEvent('mousemove'));
|
|
64
|
+
expect(element.querySelector('div')).toHaveAttribute(
|
|
65
|
+
'data-focus-visible',
|
|
66
|
+
'false'
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
it.skip('changes to true on keydown', async () => {
|
|
70
|
+
const element = renderIntoBody(html`
|
|
71
|
+
<ui-focus-visible>
|
|
72
|
+
<div></div>
|
|
73
|
+
</ui-focus-visible>
|
|
74
|
+
`);
|
|
75
|
+
await nextTick();
|
|
76
|
+
document.dispatchEvent(new MouseEvent('mousemove'));
|
|
77
|
+
expect(element.querySelector('div')).toHaveAttribute(
|
|
78
|
+
'data-focus-visible',
|
|
79
|
+
'false'
|
|
80
|
+
);
|
|
81
|
+
document.dispatchEvent(new KeyboardEvent('keydown'));
|
|
82
|
+
expect(element.querySelector('div')).toHaveAttribute(
|
|
83
|
+
'data-focus-visible',
|
|
84
|
+
'true'
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('renders the component', () => {
|
|
89
|
+
const element = renderIntoBody(
|
|
90
|
+
html`<ui-focus-visible></ui-focus-visible>`
|
|
91
|
+
);
|
|
92
|
+
expect(element).toBeTruthy();
|
|
93
|
+
expect(element.shadowRoot).toBeTruthy();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LightningElement } from 'lwc';
|
|
2
|
+
|
|
3
|
+
let focusVisible = true;
|
|
4
|
+
let handlers: (() => void)[] = [];
|
|
5
|
+
|
|
6
|
+
export default class extends LightningElement {
|
|
7
|
+
private observer!: MutationObserver;
|
|
8
|
+
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
this.observer = new MutationObserver(() => {
|
|
11
|
+
this.onChange();
|
|
12
|
+
});
|
|
13
|
+
this.observer.observe(this.template.host, {
|
|
14
|
+
childList: true
|
|
15
|
+
});
|
|
16
|
+
handlers.push(this.onChange);
|
|
17
|
+
this.onChange();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
disconnectedCallback() {
|
|
21
|
+
handlers = handlers.filter((h) => h !== this.onChange);
|
|
22
|
+
this.observer.disconnect();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private onChange = () => {
|
|
26
|
+
for (let node of Array.from(this.template.host.children)) {
|
|
27
|
+
node.setAttribute('data-focus-visible', String(focusVisible));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
document.addEventListener('mousedown', onMouse, { passive: true });
|
|
33
|
+
document.addEventListener('mousemove', onMouse, { passive: true });
|
|
34
|
+
document.addEventListener('keydown', onKeyboard, { passive: true });
|
|
35
|
+
|
|
36
|
+
function onMouse(event: MouseEvent) {
|
|
37
|
+
if (!focusVisible) return;
|
|
38
|
+
else focusVisible = false;
|
|
39
|
+
for (let handler of handlers) handler();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function onKeyboard(event: KeyboardEvent) {
|
|
43
|
+
if (focusVisible) return;
|
|
44
|
+
else focusVisible = true;
|
|
45
|
+
for (let handler of handlers) handler();
|
|
46
|
+
}
|