@lime-bundles/widget 2.2.1 → 2.4.0
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/dist/index.cjs +195 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +197 -76
- package/dist/index.js.map +1 -1
- package/dist/lime-bundle.global.js +99 -47
- package/dist/lime-bundle.global.js.map +1 -1
- package/docs/css-variables.md +8 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -27,7 +27,8 @@ import {
|
|
|
27
27
|
formatCents,
|
|
28
28
|
percentageDiscountUnit,
|
|
29
29
|
computeFixedPricing,
|
|
30
|
-
computeBundleSaleCents
|
|
30
|
+
computeBundleSaleCents,
|
|
31
|
+
formatUnitPrice
|
|
31
32
|
} from "@lime-bundles/core";
|
|
32
33
|
|
|
33
34
|
// src/renderers/countdown.ts
|
|
@@ -332,6 +333,11 @@ function renderProductRow(state, currency, qtyFor, onVariantChange) {
|
|
|
332
333
|
prices.appendChild(compare);
|
|
333
334
|
prices.appendChild(priceEl);
|
|
334
335
|
info.appendChild(prices);
|
|
336
|
+
const unitPriceEl = el("span", "lb-bundle-product-unit-price", {
|
|
337
|
+
"data-product-unit-price": ""
|
|
338
|
+
});
|
|
339
|
+
unitPriceEl.setAttribute("hidden", "");
|
|
340
|
+
info.appendChild(unitPriceEl);
|
|
335
341
|
const applyVariantToRow = (variant) => {
|
|
336
342
|
const unit = parseCents(variant.price.amount);
|
|
337
343
|
priceEl.textContent = formatCents(unit, currency);
|
|
@@ -346,12 +352,24 @@ function renderProductRow(state, currency, qtyFor, onVariantChange) {
|
|
|
346
352
|
} else {
|
|
347
353
|
compare.setAttribute("hidden", "");
|
|
348
354
|
}
|
|
355
|
+
const unitText = formatUnitPrice(
|
|
356
|
+
variant.unitPrice,
|
|
357
|
+
variant.unitPriceMeasurement,
|
|
358
|
+
currency
|
|
359
|
+
);
|
|
360
|
+
if (unitText) {
|
|
361
|
+
unitPriceEl.textContent = unitText;
|
|
362
|
+
unitPriceEl.removeAttribute("hidden");
|
|
363
|
+
} else {
|
|
364
|
+
unitPriceEl.setAttribute("hidden", "");
|
|
365
|
+
}
|
|
349
366
|
};
|
|
350
367
|
applyVariantToRow(state.selected);
|
|
351
368
|
if (state.eligibleVariants.length > 1) {
|
|
352
369
|
const select = document.createElement("select");
|
|
353
370
|
select.className = "lb-bundle-variant-select";
|
|
354
371
|
select.setAttribute("data-variant-select", "");
|
|
372
|
+
select.name = `lb-variant-${state.product.id.replace(/^.*\//, "")}`;
|
|
355
373
|
select.setAttribute(
|
|
356
374
|
"aria-label",
|
|
357
375
|
`Select variant for ${state.product.title}`
|
|
@@ -571,7 +589,12 @@ function renderMixMatchBundle(container, bundle, onAddToCart, onCleanup) {
|
|
|
571
589
|
variantTitle: firstVariant.title,
|
|
572
590
|
imageUrl: firstEligible.product.featuredImage?.url ?? null,
|
|
573
591
|
priceCents: parseCents(firstVariant.price.amount),
|
|
574
|
-
compareCents: firstVariant.compareAtPrice ? parseCents(firstVariant.compareAtPrice.amount) : null
|
|
592
|
+
compareCents: firstVariant.compareAtPrice ? parseCents(firstVariant.compareAtPrice.amount) : null,
|
|
593
|
+
unitPriceLabel: formatUnitPrice(
|
|
594
|
+
firstVariant.unitPrice,
|
|
595
|
+
firstVariant.unitPriceMeasurement,
|
|
596
|
+
currency
|
|
597
|
+
)
|
|
575
598
|
});
|
|
576
599
|
}
|
|
577
600
|
afterMutation();
|
|
@@ -584,7 +607,12 @@ function renderMixMatchBundle(container, bundle, onAddToCart, onCleanup) {
|
|
|
584
607
|
variantTitle: variant.title,
|
|
585
608
|
imageUrl: product.featuredImage?.url ?? null,
|
|
586
609
|
priceCents: parseCents(variant.price.amount),
|
|
587
|
-
compareCents: variant.compareAtPrice ? parseCents(variant.compareAtPrice.amount) : null
|
|
610
|
+
compareCents: variant.compareAtPrice ? parseCents(variant.compareAtPrice.amount) : null,
|
|
611
|
+
unitPriceLabel: formatUnitPrice(
|
|
612
|
+
variant.unitPrice,
|
|
613
|
+
variant.unitPriceMeasurement,
|
|
614
|
+
currency
|
|
615
|
+
)
|
|
588
616
|
});
|
|
589
617
|
afterMutation();
|
|
590
618
|
}
|
|
@@ -771,6 +799,11 @@ function renderFilledSlot(selection, index, currency, onRemove) {
|
|
|
771
799
|
priceEl.textContent = formatCents(selection.priceCents, currency);
|
|
772
800
|
priceWrap.appendChild(priceEl);
|
|
773
801
|
info.appendChild(priceWrap);
|
|
802
|
+
if (selection.unitPriceLabel) {
|
|
803
|
+
const unitPrice = el("span", "lb-bundle-product-unit-price");
|
|
804
|
+
unitPrice.textContent = selection.unitPriceLabel;
|
|
805
|
+
info.appendChild(unitPrice);
|
|
806
|
+
}
|
|
774
807
|
slot.appendChild(info);
|
|
775
808
|
const remove = document.createElement("button");
|
|
776
809
|
remove.type = "button";
|
|
@@ -925,8 +958,10 @@ function renderModal(bundle, eligible, currency, handlers) {
|
|
|
925
958
|
rowsBuilt = true;
|
|
926
959
|
list.innerHTML = "";
|
|
927
960
|
eligible.forEach((ep) => {
|
|
928
|
-
const
|
|
929
|
-
|
|
961
|
+
const availableVariants = ep.variants.filter((v) => v.availableForSale);
|
|
962
|
+
const firstAvailVariant = availableVariants[0] ?? ep.firstAvailableVariant ?? ep.variants[0];
|
|
963
|
+
if (!firstAvailVariant) return;
|
|
964
|
+
let currentVariant = firstAvailVariant;
|
|
930
965
|
const productEl = el(
|
|
931
966
|
"div",
|
|
932
967
|
ep.isOos ? "lb-mix-match__modal-product lb-mix-match__modal-product--sold-out" : "lb-mix-match__modal-product",
|
|
@@ -948,70 +983,116 @@ function renderModal(bundle, eligible, currency, handlers) {
|
|
|
948
983
|
} else {
|
|
949
984
|
thumb.insertAdjacentHTML("beforeend", PLACEHOLDER_THUMB_SVG2);
|
|
950
985
|
}
|
|
986
|
+
const countBadge = el("span", "lb-bundle-qty-badge");
|
|
987
|
+
countBadge.style.display = "none";
|
|
988
|
+
thumb.appendChild(countBadge);
|
|
951
989
|
productEl.appendChild(thumb);
|
|
952
990
|
const info = el("div", "lb-mix-match__modal-product-info");
|
|
953
|
-
const title = el("
|
|
991
|
+
const title = el("p", "lb-mix-match__modal-product-title");
|
|
954
992
|
title.textContent = ep.product.title;
|
|
955
993
|
info.appendChild(title);
|
|
956
|
-
const price = el("
|
|
957
|
-
price.textContent = formatCents(
|
|
994
|
+
const price = el("p", "lb-mix-match__modal-product-price");
|
|
995
|
+
price.textContent = formatCents(
|
|
996
|
+
parseCents(currentVariant.price.amount),
|
|
997
|
+
currency
|
|
998
|
+
);
|
|
958
999
|
info.appendChild(price);
|
|
1000
|
+
const unitPrice = el(
|
|
1001
|
+
"p",
|
|
1002
|
+
"lb-mix-match__modal-product-unit-price lb-bundle-product-unit-price"
|
|
1003
|
+
);
|
|
1004
|
+
const initialUnitText = formatUnitPrice(
|
|
1005
|
+
currentVariant.unitPrice,
|
|
1006
|
+
currentVariant.unitPriceMeasurement,
|
|
1007
|
+
currency
|
|
1008
|
+
);
|
|
1009
|
+
if (initialUnitText) {
|
|
1010
|
+
unitPrice.textContent = initialUnitText;
|
|
1011
|
+
} else {
|
|
1012
|
+
unitPrice.hidden = true;
|
|
1013
|
+
}
|
|
1014
|
+
info.appendChild(unitPrice);
|
|
1015
|
+
const row = {
|
|
1016
|
+
el: productEl,
|
|
1017
|
+
product: ep.product,
|
|
1018
|
+
variant: firstAvailVariant,
|
|
1019
|
+
updateCount: () => {
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
if (availableVariants.length > 1) {
|
|
1023
|
+
const select = document.createElement("select");
|
|
1024
|
+
select.className = "lb-mix-match__variant-select";
|
|
1025
|
+
select.setAttribute("data-variant-select", "");
|
|
1026
|
+
select.name = `lb-variant-${ep.product.id.replace(/^.*\//, "")}`;
|
|
1027
|
+
select.setAttribute(
|
|
1028
|
+
"aria-label",
|
|
1029
|
+
`Select variant for ${ep.product.title}`
|
|
1030
|
+
);
|
|
1031
|
+
availableVariants.forEach((v) => {
|
|
1032
|
+
const opt = document.createElement("option");
|
|
1033
|
+
opt.value = v.id;
|
|
1034
|
+
opt.textContent = v.title;
|
|
1035
|
+
if (v.id === firstAvailVariant.id) opt.selected = true;
|
|
1036
|
+
select.appendChild(opt);
|
|
1037
|
+
});
|
|
1038
|
+
select.addEventListener("change", () => {
|
|
1039
|
+
const next = availableVariants.find((v) => v.id === select.value);
|
|
1040
|
+
if (!next) return;
|
|
1041
|
+
currentVariant = next;
|
|
1042
|
+
row.variant = next;
|
|
1043
|
+
price.textContent = formatCents(
|
|
1044
|
+
parseCents(currentVariant.price.amount),
|
|
1045
|
+
currency
|
|
1046
|
+
);
|
|
1047
|
+
const nextUnitText = formatUnitPrice(
|
|
1048
|
+
currentVariant.unitPrice,
|
|
1049
|
+
currentVariant.unitPriceMeasurement,
|
|
1050
|
+
currency
|
|
1051
|
+
);
|
|
1052
|
+
if (nextUnitText) {
|
|
1053
|
+
unitPrice.textContent = nextUnitText;
|
|
1054
|
+
unitPrice.hidden = false;
|
|
1055
|
+
} else {
|
|
1056
|
+
unitPrice.textContent = "";
|
|
1057
|
+
unitPrice.hidden = true;
|
|
1058
|
+
}
|
|
1059
|
+
rowUpdateCount();
|
|
1060
|
+
});
|
|
1061
|
+
info.appendChild(select);
|
|
1062
|
+
} else if (availableVariants.length === 1 && firstAvailVariant.title !== "Default Title") {
|
|
1063
|
+
const variantLabel = el("span", "lb-mix-match__filled-variant");
|
|
1064
|
+
variantLabel.textContent = firstAvailVariant.title;
|
|
1065
|
+
info.appendChild(variantLabel);
|
|
1066
|
+
}
|
|
959
1067
|
if (ep.isOos) {
|
|
960
1068
|
const soldOut = el("span", "lb-mix-match__modal-sold-out-label");
|
|
961
1069
|
soldOut.textContent = "Sold out";
|
|
962
1070
|
info.appendChild(soldOut);
|
|
963
1071
|
}
|
|
964
1072
|
productEl.appendChild(info);
|
|
1073
|
+
const rowUpdateCount = () => {
|
|
1074
|
+
const count = handlers.countFor(ep.product.id, currentVariant.id);
|
|
1075
|
+
if (count > 0) {
|
|
1076
|
+
countBadge.textContent = String(count);
|
|
1077
|
+
countBadge.style.display = "";
|
|
1078
|
+
} else {
|
|
1079
|
+
countBadge.style.display = "none";
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
965
1082
|
if (!ep.isOos) {
|
|
966
1083
|
const addBtn = document.createElement("button");
|
|
967
1084
|
addBtn.type = "button";
|
|
968
1085
|
addBtn.className = "lb-mix-match__modal-add";
|
|
969
|
-
addBtn.
|
|
970
|
-
addBtn.innerHTML = PLUS_ICON_SVG;
|
|
971
|
-
const countBadge = el("span", "lb-bundle-qty-badge");
|
|
972
|
-
countBadge.style.display = "none";
|
|
973
|
-
addBtn.appendChild(countBadge);
|
|
1086
|
+
addBtn.textContent = "Add";
|
|
974
1087
|
addBtn.addEventListener("click", () => {
|
|
975
1088
|
if (handlers.isOverMax()) return;
|
|
976
|
-
handlers.onAdd(ep.product,
|
|
1089
|
+
handlers.onAdd(ep.product, currentVariant);
|
|
977
1090
|
});
|
|
978
1091
|
productEl.appendChild(addBtn);
|
|
979
|
-
const removeBtn = document.createElement("button");
|
|
980
|
-
removeBtn.type = "button";
|
|
981
|
-
removeBtn.className = "lb-mix-match__slot-remove";
|
|
982
|
-
removeBtn.setAttribute("aria-label", `Remove one ${ep.product.title}`);
|
|
983
|
-
removeBtn.style.display = "none";
|
|
984
|
-
removeBtn.innerHTML = CLOSE_ICON_SVG;
|
|
985
|
-
removeBtn.addEventListener("click", (e) => {
|
|
986
|
-
e.stopPropagation();
|
|
987
|
-
handlers.onRemove(ep.product.id, variant.id);
|
|
988
|
-
});
|
|
989
|
-
productEl.appendChild(removeBtn);
|
|
990
|
-
productRows.push({
|
|
991
|
-
el: productEl,
|
|
992
|
-
product: ep.product,
|
|
993
|
-
variant,
|
|
994
|
-
updateCount: () => {
|
|
995
|
-
const count = handlers.countFor(ep.product.id, variant.id);
|
|
996
|
-
if (count > 0) {
|
|
997
|
-
countBadge.textContent = String(count);
|
|
998
|
-
countBadge.style.display = "";
|
|
999
|
-
removeBtn.style.display = "";
|
|
1000
|
-
} else {
|
|
1001
|
-
countBadge.style.display = "none";
|
|
1002
|
-
removeBtn.style.display = "none";
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
} else {
|
|
1007
|
-
productRows.push({
|
|
1008
|
-
el: productEl,
|
|
1009
|
-
product: ep.product,
|
|
1010
|
-
variant,
|
|
1011
|
-
updateCount: () => {
|
|
1012
|
-
}
|
|
1013
|
-
});
|
|
1014
1092
|
}
|
|
1093
|
+
row.updateCount = ep.isOos ? () => {
|
|
1094
|
+
} : rowUpdateCount;
|
|
1095
|
+
productRows.push(row);
|
|
1015
1096
|
list.appendChild(productEl);
|
|
1016
1097
|
});
|
|
1017
1098
|
refreshCounts();
|
|
@@ -1421,7 +1502,6 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1421
1502
|
|
|
1422
1503
|
.lb-bundle-widget {
|
|
1423
1504
|
/* Internal CSS-only vars (not merchant-configurable). */
|
|
1424
|
-
--lb-text-muted: #666666;
|
|
1425
1505
|
--lb-thumbnail-bg: #F0F0F0;
|
|
1426
1506
|
--lb-widget-pad: 20px;
|
|
1427
1507
|
--lb-progress-color: var(--lb-primary-color);
|
|
@@ -1444,7 +1524,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1444
1524
|
margin: 0 calc(-1 * var(--lb-widget-pad)) 20px;
|
|
1445
1525
|
padding: 12px 20px;
|
|
1446
1526
|
background: var(--lb-countdown-bg);
|
|
1447
|
-
border-top: 1px solid
|
|
1527
|
+
border-top: 1px solid color-mix(in srgb, var(--lb-text) 6%, transparent);
|
|
1448
1528
|
display: flex;
|
|
1449
1529
|
align-items: center;
|
|
1450
1530
|
justify-content: space-between;
|
|
@@ -1540,7 +1620,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1540
1620
|
font-size: 16px;
|
|
1541
1621
|
font-weight: 400;
|
|
1542
1622
|
line-height: 20px;
|
|
1543
|
-
color: var(--lb-text
|
|
1623
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1544
1624
|
margin: 4px 0 0;
|
|
1545
1625
|
}
|
|
1546
1626
|
|
|
@@ -1583,15 +1663,18 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1583
1663
|
/* Product rows */
|
|
1584
1664
|
.lb-bundle-product-row {
|
|
1585
1665
|
display: flex;
|
|
1586
|
-
gap:
|
|
1666
|
+
gap: 20px;
|
|
1587
1667
|
padding: 12px 0;
|
|
1588
1668
|
}
|
|
1589
1669
|
|
|
1590
1670
|
.lb-bundle-thumbnail {
|
|
1591
1671
|
position: relative;
|
|
1592
1672
|
width: 48px;
|
|
1593
|
-
height: 48px;
|
|
1594
1673
|
min-width: 48px;
|
|
1674
|
+
/* Aspect-ratio comes from the merchant \`thumbnailRatio\` enum via Liquid;
|
|
1675
|
+
"original" sets it to \`auto\` so the box sizes to the image's intrinsic
|
|
1676
|
+
ratio. Default keeps the historical 1:1 behaviour. */
|
|
1677
|
+
aspect-ratio: var(--lb-thumbnail-aspect-ratio, 1 / 1);
|
|
1595
1678
|
background: var(--lb-thumbnail-bg);
|
|
1596
1679
|
border-radius: 8px;
|
|
1597
1680
|
overflow: hidden;
|
|
@@ -1602,14 +1685,16 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1602
1685
|
|
|
1603
1686
|
.lb-bundle-thumbnail img {
|
|
1604
1687
|
width: 100%;
|
|
1605
|
-
|
|
1606
|
-
|
|
1688
|
+
/* Height + fit come from the same merchant enum; "original" sets them to
|
|
1689
|
+
\`auto\` / \`contain\` so the image renders uncropped at intrinsic ratio. */
|
|
1690
|
+
height: var(--lb-thumbnail-img-height, 100%);
|
|
1691
|
+
object-fit: var(--lb-thumbnail-img-fit, cover);
|
|
1607
1692
|
}
|
|
1608
1693
|
|
|
1609
1694
|
.lb-bundle-thumbnail svg {
|
|
1610
1695
|
width: 28px;
|
|
1611
1696
|
height: 28px;
|
|
1612
|
-
color:
|
|
1697
|
+
color: color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
1613
1698
|
}
|
|
1614
1699
|
|
|
1615
1700
|
.lb-bundle-product-info {
|
|
@@ -1634,7 +1719,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1634
1719
|
.lb-bundle-product-price {
|
|
1635
1720
|
/* --lb-product-price-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
1636
1721
|
display: var(--lb-product-price-display, block);
|
|
1637
|
-
font-size:
|
|
1722
|
+
font-size: 14px;
|
|
1638
1723
|
font-weight: 400;
|
|
1639
1724
|
line-height: 20px;
|
|
1640
1725
|
color: var(--lb-text);
|
|
@@ -1651,7 +1736,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1651
1736
|
.lb-bundle-product-compare-price {
|
|
1652
1737
|
/* --lb-product-compare-display fallback is the "on" branch; Liquid sets 'none' when merchant disables. */
|
|
1653
1738
|
display: var(--lb-product-compare-display, inline);
|
|
1654
|
-
font-size:
|
|
1739
|
+
font-size: 14px;
|
|
1655
1740
|
font-weight: 400;
|
|
1656
1741
|
line-height: 20px;
|
|
1657
1742
|
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
@@ -1664,6 +1749,22 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1664
1749
|
display: none;
|
|
1665
1750
|
}
|
|
1666
1751
|
|
|
1752
|
+
/* Unit price (e.g. "$0.50/100ml") \u2014 only rendered when the merchant has
|
|
1753
|
+
configured unit pricing on the variant in the Shopify admin. No merchant
|
|
1754
|
+
toggle: present in admin \u2192 shown; absent \u2192 hidden. Styled as muted
|
|
1755
|
+
secondary text beneath the price row so it doesn't compete visually. */
|
|
1756
|
+
.lb-bundle-product-unit-price {
|
|
1757
|
+
display: block;
|
|
1758
|
+
font-size: 12px;
|
|
1759
|
+
line-height: 16px;
|
|
1760
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1761
|
+
margin-top: 2px;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
.lb-bundle-product-unit-price[hidden] {
|
|
1765
|
+
display: none;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1667
1768
|
.lb-bundle-variant-badge {
|
|
1668
1769
|
display: inline-block;
|
|
1669
1770
|
border: var(--lb-variant-border-width) solid var(--lb-variant-border-color);
|
|
@@ -1671,14 +1772,14 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1671
1772
|
padding: 8px 12px;
|
|
1672
1773
|
font-size: 12px;
|
|
1673
1774
|
line-height: 16px;
|
|
1674
|
-
color: var(--lb-text
|
|
1775
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1675
1776
|
margin-top: 8px;
|
|
1676
1777
|
}
|
|
1677
1778
|
|
|
1678
1779
|
.lb-bundle-quantity {
|
|
1679
1780
|
font-size: 12px;
|
|
1680
1781
|
line-height: 16px;
|
|
1681
|
-
color: var(--lb-text
|
|
1782
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
1682
1783
|
margin-left: 8px;
|
|
1683
1784
|
white-space: nowrap;
|
|
1684
1785
|
}
|
|
@@ -1733,7 +1834,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1733
1834
|
font-size: 16px;
|
|
1734
1835
|
font-weight: 600;
|
|
1735
1836
|
line-height: 20px;
|
|
1736
|
-
padding: 12px
|
|
1837
|
+
padding: 8px 12px;
|
|
1737
1838
|
border-radius: var(--lb-savings-bar-radius);
|
|
1738
1839
|
margin-bottom: 12px;
|
|
1739
1840
|
}
|
|
@@ -1777,7 +1878,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1777
1878
|
grid-template-rows: 1fr;
|
|
1778
1879
|
grid-template-columns: 1fr;
|
|
1779
1880
|
width: 100%;
|
|
1780
|
-
padding: 16px;
|
|
1881
|
+
padding: 12px 16px;
|
|
1781
1882
|
border: var(--lb-cta-border-width) solid var(--lb-cta-border-color);
|
|
1782
1883
|
border-radius: var(--lb-cta-radius);
|
|
1783
1884
|
font-size: 16px;
|
|
@@ -1878,7 +1979,7 @@ var BUNDLE_BASE_CSS = `/* Lime Bundles \u2014 shared base styles for all bundle
|
|
|
1878
1979
|
.lb-bundle-placeholder-icon {
|
|
1879
1980
|
width: 28px;
|
|
1880
1981
|
height: 28px;
|
|
1881
|
-
stroke:
|
|
1982
|
+
stroke: color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
1882
1983
|
stroke-width: 1.5;
|
|
1883
1984
|
fill: none;
|
|
1884
1985
|
}
|
|
@@ -1912,14 +2013,14 @@ var BUNDLE_FIXED_CSS = `/* Lime Bundles \u2014 Fixed bundle styles */
|
|
|
1912
2013
|
|
|
1913
2014
|
/* Fixed bundles: product rows */
|
|
1914
2015
|
.lb-fixed .lb-bundle-product-row {
|
|
1915
|
-
gap:
|
|
2016
|
+
gap: 20px;
|
|
1916
2017
|
align-items: center;
|
|
1917
2018
|
}
|
|
1918
2019
|
|
|
1919
|
-
/* Fixed bundles: larger thumbnails
|
|
2020
|
+
/* Fixed bundles: larger thumbnails. Height comes from --lb-thumbnail-aspect-ratio
|
|
2021
|
+
(set on .lb-bundle-widget via Liquid / applyWidgetConfigVars). */
|
|
1920
2022
|
.lb-fixed .lb-bundle-thumbnail {
|
|
1921
2023
|
width: 60px;
|
|
1922
|
-
height: 60px;
|
|
1923
2024
|
min-width: 60px;
|
|
1924
2025
|
border-radius: var(--lb-image-border-radius);
|
|
1925
2026
|
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
@@ -2020,7 +2121,10 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2020
2121
|
width: 60px;
|
|
2021
2122
|
height: 60px;
|
|
2022
2123
|
min-width: 60px;
|
|
2023
|
-
border
|
|
2124
|
+
/* 2px border is intentionally independent of --lb-image-border-width \u2014
|
|
2125
|
+
empty slots always need a visible dashed outline as an affordance,
|
|
2126
|
+
regardless of how the merchant has styled populated thumbnails. */
|
|
2127
|
+
border: 2px dashed color-mix(in srgb, var(--lb-text) 35%, transparent);
|
|
2024
2128
|
border-radius: var(--lb-image-border-radius);
|
|
2025
2129
|
box-sizing: border-box;
|
|
2026
2130
|
display: flex;
|
|
@@ -2040,9 +2144,10 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2040
2144
|
cursor: default;
|
|
2041
2145
|
}
|
|
2042
2146
|
|
|
2147
|
+
/* Mix-match thumbnails. Height comes from --lb-thumbnail-aspect-ratio
|
|
2148
|
+
(set on .lb-bundle-widget via Liquid / applyWidgetConfigVars). */
|
|
2043
2149
|
.lb-mix-match .lb-bundle-thumbnail {
|
|
2044
2150
|
width: 60px;
|
|
2045
|
-
height: 60px;
|
|
2046
2151
|
min-width: 60px;
|
|
2047
2152
|
border-radius: var(--lb-image-border-radius);
|
|
2048
2153
|
border: var(--lb-image-border-width) solid var(--lb-image-border-color);
|
|
@@ -2277,7 +2382,7 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2277
2382
|
.lb-mix-match__modal-product {
|
|
2278
2383
|
display: flex;
|
|
2279
2384
|
align-items: center;
|
|
2280
|
-
gap:
|
|
2385
|
+
gap: 20px;
|
|
2281
2386
|
padding: 12px 0;
|
|
2282
2387
|
border-bottom: 1px solid color-mix(in srgb, var(--lb-picker-text) 7%, transparent);
|
|
2283
2388
|
}
|
|
@@ -2289,13 +2394,16 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2289
2394
|
.lb-mix-match__modal-product-thumb {
|
|
2290
2395
|
position: relative;
|
|
2291
2396
|
width: 48px;
|
|
2292
|
-
height: 48px;
|
|
2293
2397
|
min-width: 48px;
|
|
2398
|
+
/* Modal picker thumbs follow the merchant's pickerThumbnailRatio \u2014
|
|
2399
|
+
independent from the main widget's thumbnailRatio so a merchant can
|
|
2400
|
+
e.g. show tall picker thumbs with square main thumbs. */
|
|
2401
|
+
aspect-ratio: var(--lb-picker-thumbnail-aspect-ratio, 1 / 1);
|
|
2294
2402
|
border-radius: var(--lb-picker-product-radius);
|
|
2295
2403
|
border: var(--lb-picker-product-border-width) solid var(--lb-picker-product-border-color);
|
|
2296
2404
|
box-sizing: border-box;
|
|
2297
2405
|
overflow: visible;
|
|
2298
|
-
background:
|
|
2406
|
+
background: var(--lb-thumbnail-bg);
|
|
2299
2407
|
}
|
|
2300
2408
|
|
|
2301
2409
|
/* Qty badge inside the picker modal inherits picker-product border (width + color) plus
|
|
@@ -2311,8 +2419,10 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2311
2419
|
|
|
2312
2420
|
.lb-mix-match__modal-product-thumb img {
|
|
2313
2421
|
width: 100%;
|
|
2314
|
-
|
|
2315
|
-
|
|
2422
|
+
/* Height + fit come from pickerThumbnailRatio \u2014 "original" sets both
|
|
2423
|
+
to auto/contain so the image renders uncropped at intrinsic ratio. */
|
|
2424
|
+
height: var(--lb-picker-thumbnail-img-height, 100%);
|
|
2425
|
+
object-fit: var(--lb-picker-thumbnail-img-fit, cover);
|
|
2316
2426
|
border-radius: max(0px, calc(var(--lb-picker-product-radius) - var(--lb-picker-product-border-width)));
|
|
2317
2427
|
}
|
|
2318
2428
|
|
|
@@ -2336,6 +2446,17 @@ var BUNDLE_MIX_MATCH_CSS = `/* Lime Bundles \u2014 Mix & Match styles */
|
|
|
2336
2446
|
margin: 4px 0 0;
|
|
2337
2447
|
}
|
|
2338
2448
|
|
|
2449
|
+
.lb-mix-match__modal-product-unit-price {
|
|
2450
|
+
font-size: 11px;
|
|
2451
|
+
line-height: 16px;
|
|
2452
|
+
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
2453
|
+
margin: 2px 0 0;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
.lb-mix-match__modal-product-unit-price[hidden] {
|
|
2457
|
+
display: none;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2339
2460
|
.lb-mix-match__variant-select {
|
|
2340
2461
|
font-size: 12px;
|
|
2341
2462
|
margin: 4px 0 0;
|
|
@@ -2536,7 +2657,7 @@ var BUNDLE_VOLUME_CSS = `/* Lime Bundles \u2014 Volume / Quantity Breaks styles
|
|
|
2536
2657
|
|
|
2537
2658
|
.lb-volume__tier-price {
|
|
2538
2659
|
grid-column: 1 / -1;
|
|
2539
|
-
font-size:
|
|
2660
|
+
font-size: 14px;
|
|
2540
2661
|
font-weight: 500;
|
|
2541
2662
|
color: var(--lb-text);
|
|
2542
2663
|
}
|
|
@@ -2548,7 +2669,7 @@ var BUNDLE_VOLUME_CSS = `/* Lime Bundles \u2014 Volume / Quantity Breaks styles
|
|
|
2548
2669
|
|
|
2549
2670
|
/* Compare-at (strikethrough) price */
|
|
2550
2671
|
.lb-volume__tier-compare {
|
|
2551
|
-
font-size:
|
|
2672
|
+
font-size: 14px;
|
|
2552
2673
|
line-height: 16px;
|
|
2553
2674
|
color: color-mix(in srgb, var(--lb-text) 60%, transparent);
|
|
2554
2675
|
text-decoration: line-through;
|