8000 MWPW-175341: M@S Express card by Axelcureno · Pull Request #4511 · adobecom/milo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

MWPW-175341: M@S Express card #4511

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

Draft
wants to merge 11 commits into
base: stage
Choose a base branch
from
Draft
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ tmp
libs/navigation/dist/
*.mdc
/.cursor*/
.cursor\ 2/
/.cursor 2
CLAUDE.md
319 changes: 247 additions & 72 deletions libs/deps/mas/merch-card.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Large diffs are not rendered by default.

327 changes: 251 additions & 76 deletions libs/features/mas/dist/mas.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion libs/features/mas/src/global.css.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ styles.innerHTML = `
--consonant-merch-card-heading-s-line-height: 25px;
--consonant-merch-card-heading-m-font-size: 24px;
--consonant-merch-card-heading-m-line-height: 30px;
--consonant-merch-card-heading-l-font-size: 28px;
--consonant-merch-card-heading-l-line-height: 36.4px;

/* detail */
--consonant-merch-card-detail-xs-line-height: 12px;
Expand All @@ -47,7 +49,7 @@ styles.innerHTML = `
--consonant-merch-card-detail-m-font-weight: 700;
--consonant-merch-card-detail-m-letter-spacing: 1px;
--consonant-merch-card-detail-l-line-height: 18px;
--consonant-merch-card-detail-xl-line-height: 23px;
--consonant-merch-card-detail-l-line-height: 23px;

/* body */
--consonant-merch-card-body-xxs-font-size: 12px;
Expand Down Expand Up @@ -267,6 +269,13 @@ merch-card [slot='heading-m-price'] {
color: var(--spectrum-gray-800, #2c2c2c);
}

merch-card [slot='heading-l'] {
font-size: var(--consonant-merch-card-heading-l-font-size);
line-height: var(--consonant-merch-card-heading-l-line-height);
font-weight: 900;
margin: 0;
}

merch-card [slot='offers'] {
padding: var(--consonant-merch-spacing-xxs) var(--consonant-merch-spacing-s);
}
Expand Down
2 changes: 1 addition & 1 deletion libs/features/mas/src/variants/ah-promoted-plans.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class AHPromotedPlans extends VariantLayout {
);
color: var(--consonant-merch-card-heading-xxxs-color);
border-radius: 10px;
border: 1px solid var(--merch-card-custom-border-color, transparent);
border: 2px solid var(--merch-card-custom-border-color, transparent);
display: flex;
flex-direction: column;
overflow: hidden;
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export const CSS = `
:root {
--consonant-merch-card-simplified-pricing-express-width: 294px;
}

merch-card[variant="simplified-pricing-express"] {
min-width: var(--consonant-merch-card-simplified-pricing-express-width);
background-color: var(--spectrum-gray-50);
border-radius: 16px;
}

merch-card[variant="simplified-pricing-express"] [slot="body-s"] {
font-size: var(--consonant-merch-card-body-s-font-size);
line-height: var(--merch-card-simplified-pricing-express-body-s-line-height);
}

merch-card[variant="simplified-pricing-express"] [slot="cta"] {
display: flex;
flex-direction: row;
gap: 8px;
margin-top: auto;
}

merch-card[variant="simplified-pricing-express"] [slot="cta"] sp-button,
merch-card[variant="simplified-pricing-express"] [slot="cta"] button {
width: 100%;
}

merch-card[variant="simplified-pricing-express"] [slot="price"] {
display: flex;
flex-direction: column;
gap: 8px;
}

merch-card[variant="simplified-pricing-express"] [slot="price"] span[is="inline-price"] {
font-size: var(--merch-card-simplified-pricing-express-price-font-size);
font-weight: var(--merch-card-simplified-pricing-express-price-font-weight);
line-height: var(--merch-card-simplified-pricing-express-price-line-height);
}

merch-card[variant="simplified-pricing-express"] [slot="price"] .price p {
font-size: var(--merch-card-simplified-pricing-express-price-p-font-size);
font-weight: var(--merch-card-simplified-pricing-express-price-p-font-weight);
line-height: var(--merch-card-simplified-pricing-express-price-p-line-height);
}

merch-card[variant="simplified-pricing-express"] [slot="price"] .price .price-currency-symbol {
font-size: var(--merch-card-simplified-pricing-express-price-currency-symbol-font-size);
font-weight: var(--merch-card-simplified-pricing-express-price-currency-symbol-font-weight);
line-height: var(--merch-card-simplified-pricing-express-price-currency-symbol-line-height);
color: var(--spectrum-gray-700);
}

merch-card[variant="simplified-pricing-express"] [slot="cta"] sp-button[variant="accent"],
merch-card[variant="simplified-pricing-express"] [slot="cta"] button.spectrum-Button--accent {
background-color: var(--spectrum-indigo-900);
}

merch-card[variant="simplified-pricing-express"] [slot="footer"] sp-button[variant="accent"] {
background-color: var(--spectrum-indigo-900);
`;
165 changes: 165 additions & 0 deletions libs/features/mas/src/variants/simplified-pricing-express.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
import { html, css } from 'lit';
import { VariantLayout } from './variant-layout.js';
import { CSS } from './simplified-pricing-express.css.js';

export const SIMPLIFIED_PRICING_EXPRESS_AEM_FRAGMENT_MAPPING = {
"mnemonics": {
"size": "s"
},
"title": {
"tag": "h3",
"slot": "heading-l",
"maxCount": 250,
"withSuffix": true
},
"badge": {
"tag": "div",
"slot": "badge",

},
"description": {
"tag": "div",
"slot": "body-s",
"maxCount": 2000,
"withSuffix": false
},
"prices": {
"tag": "p",
"slot": "price"
},
"ctas": {
"slot": "cta",
"size": "L"
},
"borderColor": {
"attribute": "border-color",
"specialValues": {
"gray": "--spectrum-gray-300",
"blue": "--spectrum-blue-400"
}
}
};

export class SimplifiedPricingExpress extends VariantLayout {
getGlobalCSS() {
return CSS;
}

get aemFragmentMapping() {
return SIMPLIFIED_PRICING_EXPRESS_AEM_FRAGMENT_MAPPING;
}

renderLayout() {
return html`
<div class="header">
<slot name="heading-l"></slot>
<slot name="badge"></slot>
</div>
<div class="description">
<slot name="body-s"></slot>
</div>
<div class="price">
<slot name="price"></slot>
</div>
<div class="cta">
<slot name="cta"></slot>
</div>
`;
}

static variantStyle = css`
:host([variant='simplified-pricing-express']) {
--merch-card-simplified-pricing-express-max-width: 246px;
--merch-card-simplified-pricing-express-padding: 24px;
--merch-card-simplified-pricing-express-min-height: 341px;
--merch-card-simplified-pricing-express-price-font-size: 28px;
--merch-card-simplified-pricing-express-price-font-weight: 900;
--merch-card-simplified-pricing-express-price-line-height: 36.4px;
--merch-card-simplified-pricing-express-price-currency-font-size: 22px;
--merch-card-simplified-pricing-express-price-currency-font-weight: 700;
--merch-card-simplified-pricing-express-price-currency-line-height: 28.6px;
--merch-card-simplified-pricing-express-price-currency-symbol-font-size: 22px;
--merch-card-simplified-pricing-express-price-currency-symbol-font-weight: 700;
--merch-card-simplified-pricing-express-price-currency-symbol-line-height: 28.6px;
--merch-card-simplified-pricing-express-body-s-line-height: 20.8px;
--merch-card-simplified-pricing-express-price-p-font-size: 14px;
--merch-card-simplified-pricing-express-price-p-font-weight: 400;
--merch-card-simplified-pricing-express-price-p-line-height: 15.6px;
max-width: var(--merch-card-simplified-pricing-express-max-width);
min-height: var(--merch-card-simplified-pricing-express-min-height);
background: var(--spectrum-gray-50);
border: 1px solid var(--merch-card-custom-border-color, transparent);
border-radius: 16px;
display: flex;
flex-direction: column;
overflow: hidden;
padding: var(--merch-card-simplified-pricing-express-padding);
gap: 16px;
box-sizing: border-box;
position: relative;
}

:host([variant='simplified-pricing-express']) .header {
display: flex;
flex-direction: row;
align-items: flex-end;
justify-content: space-between;
gap: 8px;
}

:host([variant='simplified-pricing-express']) .badge {
position: absolute;
top: -10px;
left: 50%;
transform: translateX(-50%);
background: var(--spectrum-blue-400);
color: white;
padding: 4px 12px;
border-radius: 6px;
font-size: 16px;
font-weight: 700;
z-index: 1;
}

:host([variant='simplified-pricing-express']) .pricing-section {
display: flex;
flex-direction: column;
gap: 8px;
}

:host([variant='simplified-pricing-express']) .price-container {
display: flex;
flex-direction: row;
align-items: baseline;
gap: 4px;
}

:host([variant='simplified-pricing-express']) .cta-section {
display: flex;
flex-direction: column;
gap: 12px;
margin-top: auto;
}

:host([variant='simplified-pricing-express']) .cta {
width: 100%;
display: flex;
flex-direction: row;
gap: 8px;
margin-top: auto;
}

:host([variant='simplified-pricing-express']) .cta ::slotted(*) {
flex: 1;
width: 100%;
}

:host([variant='simplified-pricing-express']) .footer-text {
font-size: 12px;
line-height: 1.4;
color: var(--spectrum-gray-700);
}
`;
}

customElements.define('simplified-pricing-express-card', SimplifiedPricingExpress);
7 changes: 7 additions & 0 deletions libs/features/mas/src/variants/variants.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
SPECIAL_OFFERS_AEM_FRAGMENT_MAPPING,
SpecialOffer,
} from './special-offer.js';
import { SimplifiedPricingExpress, SIMPLIFIED_PRICING_EXPRESS_AEM_FRAGMENT_MAPPING } from './simplified-pricing-express.js';

// Registry for dynamic variants
const variantRegistry = new Map();
Expand Down Expand Up @@ -53,6 +54,12 @@ registerVariant(
SPECIAL_OFFERS_AEM_FRAGMENT_MAPPING,
SpecialOffer.variantStyle,
);
registerVariant(
'simplified-pricing-express',
SimplifiedPricingExpress,
SIMPLIFIED_PRICING_EXPRESS_AEM_FRAGMENT_MAPPING,
SimplifiedPricingExpress.variantStyle,
);

const getVariantLayout = (card, mustMatch = false) => {
const variantInfo = variantRegistry.get(card.variant);
Expand Down
Loading
0