Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pricing-cards & tabs-ax #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions express/blocks/billing-radio/billing-radio.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.billing-radio {
display: flex;
justify-content: center;
gap: 12px;
align-items: center;
padding-top: 36px;
padding-bottom: 16px;
font-size: var(--body-font-size-s);
height: 32px;
}
.billing-radio button {
border: none;
padding: 0;
background: none;
color: inherit;
font: inherit;
cursor: pointer;
outline: inherit;

font-size: var(--body-font-size-xs);
display: flex;
align-items: center;
gap: 4px;
}

.billing-radio :focus-within {
border: 2px var(--color-info-accent) solid;
}

.billing-radio span {
width: 16px;
height: 16px;
border-radius: 50%;
transition: 0.2s all linear;
border: 2px solid #292929;
box-sizing: border-box;
}

.billing-radio .checked span {
border-width: 6px;
}
86 changes: 86 additions & 0 deletions express/blocks/billing-radio/billing-radio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// fires 'billing-plan' BM and has global sync values when multiple on same page
// import { createTag } from '../../scripts/utils.js';
// import BlockMediator from '../../scripts/block-mediator.min.js';
// import { addTempWrapper } from '../../scripts/decorate.js';

// const BILLING_PLAN = 'billing-plan';

export default function init(el) {
el.remove();
// const title = el.querySelector('strong');
// const plans = Array.from(el.querySelectorAll('ol > li')).map((li) => li.textContent.trim());
// el.innerHTML = '';
// el.setAttribute('role', 'radiogroup');
// el.setAttribute('aria-labelledby', 'radio-group-label');
// el.append(title);
// const label = el.children[0];
// label.setAttribute('id', 'radio-group-label');
// const buttons = [];
// if (BlockMediator.get(BILLING_PLAN) === undefined) BlockMediator.set(BILLING_PLAN, 0);
// plans.forEach((plan, planIndex) => {
// const checked = planIndex === (BlockMediator.get(BILLING_PLAN) || 0);
// const button = createTag('button', {
// id: plan,
// class: checked ? 'checked' : '',
// });
// button.setAttribute('aria-checked', !!checked);
// button.append(createTag('label', { for: plan }, plan));
// button.setAttribute('role', 'radio');
// button.prepend(createTag('span'));
// button.addEventListener('click', () => {
// if (planIndex !== BlockMediator.get(BILLING_PLAN)) {
// BlockMediator.set(BILLING_PLAN, planIndex);
// }
// });
// if (planIndex > 0) {
// button.setAttribute('tabindex', -1);
// }
// el.append(button);
// buttons.push(button);
// });

// function focusNextButton(currentIndex) {
// const nextIndex = (currentIndex + 1) % buttons.length;
// buttons[nextIndex].focus();
// }

// function focusPreviousButton(currentIndex) {
// const prevIndex = (currentIndex - 1 + buttons.length) % buttons.length;
// buttons[prevIndex].focus();
// }

// el.addEventListener('keydown', (e) => {
// if (!e.target.isEqualNode(document.activeElement)) return;
// const currentIndex = buttons.indexOf(e.target);
// switch (e.code) {
// case 'ArrowLeft':
// case 'ArrowUp':
// e.preventDefault();
// focusPreviousButton(currentIndex);
// break;
// case 'ArrowRight':
// case 'ArrowDown':
// e.preventDefault();
// focusNextButton(currentIndex);
// break;
// case 'Enter':
// case 'Space':
// e.preventDefault();
// BlockMediator.set(BILLING_PLAN, currentIndex);
// break;
// case 'Tab':
// el.nextElementSibling.focus();
// break;
// default:
// break;
// }
// });

// BlockMediator.subscribe(BILLING_PLAN, ({ newValue, oldValue }) => {
// buttons[oldValue || 0].classList.remove('checked');
// buttons[oldValue || 0].setAttribute('aria-checked', 'false');
// buttons[newValue].classList.add('checked');
// buttons[newValue].setAttribute('aria-checked', 'true');
// buttons[newValue].focus();
// });
}
4 changes: 2 additions & 2 deletions express/blocks/ckg-link-list/ckg-link-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function addColorSampler(pill, colorHex, btn) {

export default async function decorate(block) {
const headerButton = document.querySelector('.hero-color-wrapper .text-container p:last-child');
headerButton.classList.add('button-container');
headerButton.querySelector('a').classList.add('button', 'accent', 'primaryCta', 'same-fcta');
headerButton?.classList?.add('button-container');
headerButton?.querySelector('a').classList.add('button', 'accent', 'primaryCta', 'same-fcta');

block.style.visibility = 'hidden';

Expand Down
16 changes: 8 additions & 8 deletions express/blocks/faq/faq.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
.section:has(.faq) {
.section:has(> .faq) {
background-color: var(--color-gray-200);
}

.section:has(.faq) > div:first-child {
.section:has(> .faq) > div:first-child {
padding-top: 80px;
}

.section:has(.faq) > div {
.section:has(> .faq) > div {
margin: auto;
padding-top: 0;
padding-right: 24px;
padding-left: 24px;
max-width: 375px;
}

.section:has(.faq) > div > h2, .section:has(.faq) > div > h3, .section:has(.faq) > div > h4, .section:has(.faq) > div > h5, .section:has(.faq) > div > h6 {
.section:has(> .faq) > div > h2, .section:has(> .faq) > div > h3, .section:has(> .faq) > div > h4, .section:has(> .faq) > div > h5, .section:has(> .faq) > div > h6 {
margin-top: 0;
margin-bottom: 40px;
}

.section:has(.faq) h3 {
.section:has(> .faq) h3 {
margin: 0;
}

Expand Down Expand Up @@ -73,14 +73,14 @@
}

@media (min-width: 900px) {
.section:has(.faq) > div {
.section:has(> .faq) > div {
padding-top: 0;
padding-right: 56px;
padding-left: 56px;
max-width: 830px;
}

.section:has(.faq) > div > h2, .section:has(.faq) > div > h3, .section:has(.faq) > div > h4, .section:has(.faq) > div > h5, .section:has(.faq) > div > h6 {
.section:has(> .faq) > div > h2, .section:has(> .faq) > div > h3, .section:has(> .faq) > div > h4, .section:has(> .faq) > div > h5, .section:has(> .faq) > div > h6 {
margin-bottom: 80px;
}

Expand All @@ -91,7 +91,7 @@
}

@media (min-width: 1200px) {
.section:has(.faq) > div {
.section:has(> .faq) > div {
max-width: 1024px;
}
}
Loading
Loading