Skip to content

Commit c6df597

Browse files
committed
fix(webcomponent): fix after rebase - error in resolving conflicts
1 parent d47bb7b commit c6df597

4 files changed

Lines changed: 59 additions & 5 deletions

File tree

widgets-lit/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Ultra-lightweight, zero-dependency widgets with complete CSS isolation, reactive
1818
| **♿ Accessibility** | WCAG 2.1 AA (partial) - Skip links + focus trap + arrow navigation; Home/End keys missing |
1919
| **📱 Responsive** | Desktop modal, mobile drawer, tablet layouts |
2020
| **🎨 Customizable** | Monochrome mode, custom card logos, suggested plans |
21-
| **📦 Lightweight** | ~31 KB gzipped (30% smaller than Preact version) |
21+
| **📦 Lightweight** | ~37 KB gzipped (20% smaller than Preact version) |
2222
| **🔄 Zero Config** | Drop-in CDN script; auto-detects merchant & API mode |
2323

2424
---
@@ -612,10 +612,10 @@ See [docs/I18N.md](docs/I18N.md) for adding custom translations or Crowdin integ
612612

613613
| Format | Uncompressed | Gzipped |
614614
|--------|-------------|---------|
615-
| UMD | ~95 KB | ~27 KB |
616-
| ES Module | ~133 KB | ~35 KB |
615+
| UMD | ~148 KB | ~37 KB |
616+
| ES Module | ~203 KB | ~49 KB |
617617

618-
Load time: Typically <1.5s via CDN (before API call).
618+
> Sizes from actual build output. Load time: Typically <2s via CDN (before API call).
619619
620620
### Session Caching
621621

@@ -1189,7 +1189,7 @@ widgets.add(Alma.Widgets.PaymentPlans, {
11891189
```
11901190

11911191
**Improvements you get:**
1192-
-70% smaller bundle
1192+
-20% smaller bundle (37 KB gzipped vs 46 KB)
11931193
- ✅ No re-mount needed for property updates
11941194
- ✅ CSS fully isolated (Shadow DOM)
11951195
- ✅ Faster cache hits (75% fewer API calls)

widgets-lit/examples/playground.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,9 @@ <h3 class="section-title"><span class="step-badge">7</span> Advanced</h3>
10291029
...(modalIntegration === 'manual' && { modalSelector: '#alma-modal alma-modal' }),
10301030
})})`
10311031

1032+
// Assign generated JavaScript code to output element
1033+
document.getElementById('code-output-js').textContent = jsCode
1034+
10321035
document.getElementById('code-output-config').textContent = JSON.stringify({
10331036
merchantId, apiMode, purchaseAmount: amountCents, locale,
10341037
...(colorScheme !== 'orange' && { colorScheme }),

widgets-lit/src/components/styles/payment-plans.styles.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,50 @@ export const paymentPlansStyles = css`
198198
outline: 1px solid var(--alma-color-focus-outline-monochrome);
199199
}
200200
201+
/* Ineligible plans (disabled state) */
202+
.plan-button.not-eligible {
203+
cursor: not-allowed;
204+
opacity: 0.5;
205+
color: var(--text-secondary);
206+
background-color: transparent;
207+
}
208+
209+
.plan-button.not-eligible:hover {
210+
transform: none;
211+
background-color: transparent;
212+
}
213+
214+
.plan-button.not-eligible:focus,
215+
.plan-button.not-eligible:focus-visible {
216+
outline: none;
217+
}
218+
219+
/* Color scheme specific disabled styles */
220+
:host([color-scheme='white']) .plan-button.not-eligible,
221+
:host([color-scheme='light-gray']) .plan-button.not-eligible,
222+
:host([color-scheme='gray']) .plan-button.not-eligible {
223+
color: var(--gray-700);
224+
opacity: 0.6;
225+
}
226+
227+
:host([color-scheme='dark-gray']) .plan-button.not-eligible,
228+
:host([color-scheme='black']) .plan-button.not-eligible {
229+
color: var(--gray-600);
230+
opacity: 0.5;
231+
}
232+
233+
.plan-button.monochrome.not-eligible {
234+
color: var(--gray-700);
235+
opacity: 0.5;
236+
}
237+
238+
/* Tabs style disabled */
239+
.payment-plans.tabs .plan-button.not-eligible {
240+
color: var(--text-secondary);
241+
border-bottom-color: transparent;
242+
opacity: 0.4;
243+
}
244+
201245
.info {
202246
font-family: var(--alma-payment-font-family-sans);
203247
font-size: var(--alma-payment-info-font-size, 10px);

widgets-lit/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ class AlmaWidgets {
345345
panelMode?: boolean
346346
bottomSheet?: boolean
347347
planStyle?: 'buttons' | 'tabs'
348+
plans?: Array<{
349+
installmentsCount: number
350+
deferredDays?: number
351+
deferredMonths?: number
352+
minAmount: number
353+
maxAmount: number
354+
}>
348355
cards?: Array<'cb' | 'amex' | 'mastercard' | 'visa'>
349356
customerBillingCountry?: string
350357
customerShippingCountry?: string

0 commit comments

Comments
 (0)