Sha256: d8ab50ea0fab5bb08bf68ac28e097b70be34deff2caf5b5dfa6bd6d11bfbe185
Contents?: true
Size: 1.16 KB
Versions: 90
Compression:
Stored size: 1.16 KB
Contents
import '@github/tab-container-element'; // keep in sync with tab_container_component.rb const DEFAULT_SELECTED_CLASSES = ['ariadne-border-slate-500', 'ariadne-text-slate-600']; const DEFAULT_UNSELECTED_CLASSES = [ 'ariadne-text-gray-500', 'hover:ariadne-text-gray-700', 'hover:ariadne-border-gray-300', ]; for (const tabContainer of document.getElementsByTagName('tab-container')) { tabContainer.addEventListener('tab-container-change', function (event) { var _a; const newPanel = event.detail.relatedTarget; const tabContainer = newPanel.closest('tab-container'); const tabList = tabContainer.firstElementChild; const currentTab = tabList.querySelector('[aria-selected="true"]'); const tabId = (_a = newPanel.getAttribute('id')) === null || _a === void 0 ? void 0 : _a.split('-').slice(1).join('-'); const newTab = tabList.querySelector(`#${tabId}`); currentTab.classList.remove(...DEFAULT_SELECTED_CLASSES); currentTab.classList.add(...DEFAULT_UNSELECTED_CLASSES); newTab.classList.add(...DEFAULT_SELECTED_CLASSES); newTab.classList.remove(...DEFAULT_UNSELECTED_CLASSES); }); }
Version data entries
90 entries across 90 versions & 1 rubygems