Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c564a61
Update data-slot to 1.1.3 and shadcn to 4.23
silveltman Nov 26, 2026
4a6d528
Add number field, swatch and carousel indicator on Astro, React and L…
silveltman Nov 26, 2026
040af1b
Test the storefront parts, update the menu test for shadcn 4.23, add …
silveltman Nov 26, 2026
420bd06
Count the two new Liquid components in the catalog test
silveltman Nov 26, 2026
11add1b
Keep input group slots in the number field, delegate Liquid clicks an…
silveltman Nov 26, 2026
7d145ac
Disable number field buttons at their bounds, start Embla on a linked…
silveltman Nov 26, 2026
bbe76e8
Redraw the OG images of the changed number field and swatch pages
silveltman Nov 26, 2026
3b3e151
Resync number field buttons on new bounds or markup, leave thumbnail …
silveltman Nov 26, 2026
de72692
Start an Astro carousel on the scroll position of a linked slide; doc…
silveltman Nov 26, 2026
1076c29
Keep a linked slide when the Liquid carousel starts, hide the inner i…
silveltman Nov 26, 2026
52195e8
Hide indicators without a scroll position, size the Liquid number fie…
silveltman Nov 26, 2026
d99ffe0
Base step buttons on whether a step changes the value, keep Astro ind…
silveltman Nov 26, 2026
64323dd
Sync number fields on pointer and focus, set data-disabled in Astro, …
silveltman Nov 26, 2026
1e2a50f
Keep focus while a step button is pressed, delegate Astro indicator c…
silveltman Nov 26, 2026
cf27030
Quote the swatch image URL in the Liquid docs, note that a click step…
silveltman Nov 26, 2026
5140652
Set data-disabled on a disabled Liquid number field, keep the Astro i…
silveltman Nov 26, 2026
be94b8c
Sync step buttons after every click, keep the minus key for signed fi…
silveltman Nov 26, 2026
1d095fc
Give the Liquid number field example a group role, say addons are pla…
silveltman Nov 26, 2026
ddb15c1
Hold focus only for a step button's own field, force type=button in L…
silveltman Nov 26, 2026
3094bac
Treat an empty min as unset when picking the keypad
silveltman Nov 26, 2026
12c2500
Step buttons are always type=button, guard Astro indicator indexes, n…
silveltman Nov 26, 2026
5a8e5e2
Hide an Astro indicator without a valid index
silveltman Nov 26, 2026
c980d5e
Show only the focus ring on a focused current thumbnail in Astro and …
silveltman Nov 26, 2026
e2af42c
Dim a disabled Liquid number field as a whole
silveltman Nov 26, 2026
3435b21
Logical addon spacing in Liquid input groups, guard React indicator i…
silveltman Nov 26, 2026
8c8ea0b
List Number Field and Swatch in the Astro docs navigation
silveltman Nov 26, 2026
c80e3db
Fade a disabled Liquid number field input as the input group does
silveltman Nov 26, 2026
e58390d
Keep the Vega look for a disabled Liquid number field, document that …
silveltman Nov 26, 2026
8cf9809
Fade the addons of a disabled Liquid input group, update shadcn to 4.…
silveltman Nov 26, 2026
e6017bb
Say which Fulldev UI behavior the Liquid addon fade matches
silveltman Nov 26, 2026
e641e88
Fade React step buttons that Base UI marks aria-disabled
silveltman Nov 26, 2026
e8ea385
Give the React number field demo its id on the root, so the buttons c…
silveltman Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/storefront-parts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fulldev-ui": minor
---

Add three storefront parts in Astro, React and native Liquid: `NumberField`, a number input with decrement and increment buttons for quantities; `Swatch`, a color or image beside an option or filter value; and `CarouselIndicator`, a thumbnail that shows its slide, for a product gallery. In Astro and Liquid the number field is a native `<input type="number">` in an input group, as data-slot leaves number fields to the browser, and its buttons fire `input` and `change`; in React it is Base UI's NumberField. In Liquid an indicator can link to its slide's id, so it also works without JavaScript. In React, `CarouselIndicator` goes inside the official shadcn/ui carousel. In Liquid, a native select keeps its text clear of the arrow, and an input group addon before the input gets its padding at the start, so a start icon no longer touches the border; `data-align='inline-start'` or `'inline-end'` names the side, as in Astro. Data-slot packages move to 1.1.3.
2 changes: 1 addition & 1 deletion liquid/assets/data-slot-command.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion liquid/assets/data-slot-toast.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions liquid/assets/ui-carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,38 @@
padding-left: var(--gutter);
scroll-snap-align: start;
}
/* A thumbnail that shows its slide, as data-slot's carousel-indicator with a zero-based data-index.
A link to the slide's id also works without JavaScript. The controller marks the current one. */
[data-slot='carousel-indicator'] {
position: relative;
display: block;
flex-shrink: 0;
overflow: hidden;
padding: 0;
border: 0;
border-radius: var(--radius-md);
background: var(--muted);
color: inherit;
cursor: pointer;
outline: 2px solid transparent;
outline-offset: 2px;
transition:
outline-color 150ms,
box-shadow 150ms;
}
[data-slot='carousel-indicator']:focus-visible {
outline-color: transparent;
box-shadow: var(--focus-ring);
}
[data-slot='carousel-indicator'][aria-current='true']:not(:focus-visible) {
outline-color: var(--foreground);
}
[data-slot='carousel-indicator'] > :is(img, svg) {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.carousel__controls {
display: flex;
gap: 8px;
Expand Down
27 changes: 26 additions & 1 deletion liquid/assets/ui-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,39 @@ export function initializeCarousel(root) {
queueMicrotask(translate);
});
observer.observe(content, { childList: true });
const carousel = createCarousel(root, { slides: 'multiple', drag: true, loop: false });
// A thumbnail can link to its slide's id, which works without JavaScript. Once the controller runs,
// a plain click only scrolls the carousel, so the page does not jump to the slide.
const onClick = (event) => {
const link = event.target instanceof Element ? event.target.closest('a[data-slot="carousel-indicator"]') : null;
if (!link || link.closest('[data-slot="carousel"]') !== root) return;
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
event.preventDefault();
};
// A link to a slide or to something in it, such as a thumbnail followed before this module loaded,
// keeps that slide.
let hash = location.hash.slice(1);
try {
hash = decodeURIComponent(hash);
} catch {
// Keep a malformed hash as it is.
}
const target = hash ? document.getElementById(hash) : null;
const linked = target ? items().findIndex((item) => item.contains(target)) : -1;
const carousel = createCarousel(root, {
slides: 'multiple',
drag: true,
loop: false,
...(linked >= 0 ? { defaultIndex: linked } : {}),
});
root.addEventListener('click', onClick);
translate();
for (const button of root.querySelectorAll('[data-slot="carousel-previous"], [data-slot="carousel-next"]'))
button.hidden = false;
const destroy = carousel.destroy.bind(carousel);
carousel.destroy = () => {
destroyed = true;
observer.disconnect();
root.removeEventListener('click', onClick);
destroy();
};
return carousel;
Expand Down
112 changes: 112 additions & 0 deletions liquid/assets/ui-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,116 @@ function initializeToaster({ createToast }, root) {
};
}

// A number field's buttons step its native input, as its arrow keys do, and fire the input and change
// events that typing fires, so a form or cart script sees one kind of change. As in Base UI, the
// runtime disables them when a step would not change the value: at a bound, or while the input is
// disabled or read-only. They follow new attributes, such as a variant's bounds, and markup a cart
// refresh replaces; a script that sets the value property fires input or change. Disable the input
// to disable the field. Without JavaScript the input still works on its own.
function initializeNumberField(_, root) {
const events = new AbortController();
const options = { signal: events.signal };
const buttons = () =>
root.querySelectorAll('[data-slot="number-field-decrement"], [data-slot="number-field-increment"]');
// Steps a detached copy, so min, max and step apply as the browser applies them.
const canStep = (input, decrement) => {
if (input.disabled || input.readOnly) return false;
const probe = input.cloneNode();
probe.value = input.value;
try {
if (decrement) probe.stepDown();
else probe.stepUp();
} catch {
return false;
}
return probe.value !== input.value;
};
// data-disabled marks a disabled field, as in Astro and React.
const sync = () => {
const input = root.querySelector('input');
if (!input) return;
if (input.disabled) root.setAttribute('data-disabled', 'true');
else root.removeAttribute('data-disabled');
for (const button of buttons()) {
// A step button never submits its form, also when the markup leaves out type='button'.
if (button.type !== 'button') button.type = 'button';
const disabled = !canStep(input, button.dataset.slot === 'number-field-decrement');
if (button.disabled !== disabled) button.disabled = disabled;
}
};
root.addEventListener(
'click',
(event) => {
const button =
event.target instanceof Element
? event.target.closest('[data-slot="number-field-decrement"], [data-slot="number-field-increment"]')
: null;
const input = root.querySelector('input');
if (!button || button.closest('[data-slot="number-field"]') !== root || button.disabled) return;
if (!input || input.disabled || input.readOnly) return;
const value = input.value;
try {
if (button.dataset.slot === 'number-field-decrement') input.stepDown();
else input.stepUp();
} catch {
return;
}
if (input.value !== value) {
input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true }));
}
sync();
},
options,
);
// Pressing a button keeps the focus on this field's input, so its typed value is not committed by a
// blur, and a cart that refreshes on change, before the click steps it. Another field still blurs.
root.addEventListener(
'mousedown',
(event) => {
if (
event.target instanceof Element &&
event.target.closest('[data-slot="number-field-decrement"], [data-slot="number-field-increment"]') &&
root.querySelector('input') === document.activeElement
)
event.preventDefault();
},
options,
);
// A pointer or focus that reaches the field first also syncs it, for a value a script set without an event.
for (const type of ['input', 'change', 'pointerover', 'focusin']) root.addEventListener(type, sync, options);
// A form reset restores the input after the event, also for an input in a form elsewhere.
document.addEventListener(
'reset',
(event) => {
if (root.querySelector('input')?.form === event.target)
setTimeout(() => {
if (!events.signal.aborted) sync();
});
},
options,
);
const observer = new MutationObserver((mutations) => {
if (mutations.some((mutation) => mutation.type === 'childList' || mutation.target instanceof HTMLInputElement))
sync();
});
observer.observe(root, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['min', 'max', 'step', 'value', 'disabled', 'readonly'],
});
sync();
return {
destroy() {
events.abort();
observer.disconnect();
for (const button of buttons()) button.disabled = false;
root.removeAttribute('data-disabled');
},
};
}

// Each entry loads its data-slot package, then starts one root with it and returns a controller
// with destroy(). theme.js starts the root only if it is still current once the package has
// loaded. Select, tooltip and hover card keep their closed content connected (eager), so nested
Expand Down Expand Up @@ -192,4 +302,6 @@ export const controls = {
'alert-dialog': [() => import('@data-slot/alert-dialog'), initializeAlertDialog],
drawer: [() => import('@data-slot/drawer'), ({ createDrawer }, root) => createDrawer(root)],
toast: [() => import('@data-slot/toast'), initializeToaster],
// data-slot leaves a number field to the native input, so this entry loads no package.
'number-field': [async () => ({}), initializeNumberField],
};
2 changes: 1 addition & 1 deletion liquid/assets/ui-licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"text": "MIT License\n\nCopyright (c) 2023 shadcn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
},
{
"name": "data-slot 1.1.2",
"name": "data-slot 1.1.3",
"text": "MIT License\n\nCopyright (c) 2026 Bejamas\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
}
]
20 changes: 11 additions & 9 deletions liquid/assets/ui-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"assets/ui-tokens.css": "55a8f2810ab4a1498ca3dd2f6e7dc89009c60e2402ddfcb95783b6eba996c374",
"snippets/ui-base.liquid": "bc55195b5b6c82e63deeeed1255fd19b434c47866815f82b95b9202421256d34",
"snippets/ui-init.liquid": "98f56067cf51e4cb2cd3e10ede7c00304c73ce57fe5b5a0270c0d8a9e448f7af",
"assets/ui-licenses.json": "a1fad640a342c9ccd79d233a3aed9631cbf5525ee81e67f49322d0a0f0c2effc",
"assets/ui-carousel.js": "3337447a9e0051cebbc1726bca7c7966de1035819fb8e0b676383b85f1917632",
"assets/ui-controls.js": "cf51f6d8b23c93e30d3355e993ff21a1aee79f38facfa413bed64e9815df255d",
"assets/ui-licenses.json": "874a6f264f1503b2e577aee651e7285fd6ac808f56cadf8c7d58914bf2396f49",
"assets/ui-carousel.js": "749ad4112b6b2506386a6fa6c4b111ae87b22f85838cfd2f5e249631d1115b55",
"assets/ui-controls.js": "69abd94c22f5c8307f0d86d9f8be3b6724adb82778fc7021aafd33ba3b4c3789",
"assets/ui-lifecycle.js": "78c975473620171c01b1289bf5cdce56a5626c847437fa5168fb91a4300260d6",
"assets/ui-start.js": "738d7e171b5d7993bfd0a169e4382b2db08340f52a87059b94d27e1fe3606500",
"assets/data-slot-core.js": "d2879cc3a2f05a7867763b937bad3bd4a369f54670989ce535367cb690fb66e6",
"assets/data-slot-dialog.js": "a5201f452700d04145b5156cc46880d2b5bdf7521b03ff9521c3f7693ee1b5d5",
"assets/data-slot-command.js": "f7944120617676b14dfda2ea3f3e8a15767e0766d5312b4ed9519affe9b7444a",
"assets/data-slot-command.js": "299d99c1a5f7b646692575e5d48e3f7b9209d76119508116c1a216dc80d33d13",
"assets/data-slot-navigation-menu.js": "f9b42a9bceca8e1103718d43aa5f0d141ab63d38278cb121e790a2c80e827b68",
"assets/data-slot-accordion.js": "fe6b0ac2c87a2e31582e5e88c509e0b508f41d0065d0a420407999ad210e6a27",
"assets/data-slot-tabs.js": "1f187134bba755cfda9d35cf9f16174c1a183862d32d100f270f4177033058c7",
Expand All @@ -27,7 +27,7 @@
"assets/data-slot-select.js": "13d1a3fbe90f4b3b830d987b6a28267897faa3589bf00e64edca4938acbf406b",
"assets/data-slot-slider.js": "0d10131aa95450aa1269234103ead8d805d6abdf9e0683510f4fcf58ab0f1efa",
"assets/data-slot-switch.js": "0d5b09a89429880f61aeb540be5f87383ba5c6beb261ad468e9a6cf18e45b6a0",
"assets/data-slot-toast.js": "acfd86824d0ff37fbd62d0c48672e527d7391412780730e9a3a8d61268b3aaf2",
"assets/data-slot-toast.js": "817744d32eebe3bfc50df068715e0b572350ca53fe5ad0e04ec8646800e1caf0",
"assets/data-slot-toggle.js": "7a651d578cb83be842c8e59fe1a2cd124594b1fd6c942faf0a33cf9e57326947",
"assets/data-slot-toggle-group.js": "c1f2fc9712974e63e4e44c97ab2a1ec8bc3c3cb73c1afb4578b085fed11977f1",
"assets/data-slot-tooltip.js": "5a9e51a54669153620eb3512e74487eac12ababe3331aff7dfed6c717b8b93c0",
Expand Down Expand Up @@ -69,8 +69,8 @@
"snippets/ui-accordion.liquid": "4b58c83ae13e14e03a3129a2dccbd02eeafa90c1e48edbbf9af2dc412bf3aabf",
"assets/ui-accordion.css": "430924440bd0f1d49ceb72baffc77404c9411c31c24b940d75861daba2649e83",
"snippets/ui-slider.liquid": "f2de1fb9099de77bf291455447bc86b2578781e7cf0efdf12117fb4575e0b0e6",
"snippets/ui-input.liquid": "d29e280ce1d08c7450902e69a73a0b7aa125f1cb662c50dbfc80a4a4fef0a85e",
"snippets/ui-input-group.liquid": "b862a0c63e23dc7ae4ffe3a8e057a87f38fa8e6c8842ddf3c86b826de0283d70",
"snippets/ui-input.liquid": "5f4b2adf298e84ef5845fb123b0753dd76294731da657fe395313ad7fe3f01a9",
"snippets/ui-input-group.liquid": "4c34c71677ae07b4d0e73fd10d79e96c308e65bb4d02401e4f39cc8c80b89305",
"snippets/ui-triggers.liquid": "ba9c7b802fb0a2aba0e9cc145a9dd44134964afb53e5363cf9e0ae138b906cc9",
"snippets/ui-toggle-group.liquid": "2d61e0b9bc746e05834157f5a75d23123f02bc2df737412e4f6099844afc4f49",
"snippets/ui-dialog.liquid": "779bbcd609a69ed29a984df1f26f9ed80fd24d71c4ee3ead5f4daa055b28e9fb",
Expand All @@ -93,7 +93,7 @@
"snippets/ui-popup.liquid": "840f938aa2a331e4e7d55c659f25e841dcfb1bf5c5cadace6263243352ff8359",
"snippets/ui-sheet.liquid": "0de705bed685bf78fa3af4517c947b38d62a1aa56bf29356c0a201b64db17614",
"snippets/ui-carousel.liquid": "59dc0c06b2a9f2f779ca22b3ff4b005071d4909aba052d6f8f0a1aa19e84c2ce",
"assets/ui-carousel.css": "5317c251b3d3599ba330947fc9709ea50acfb858a5d7e08573b5d34ada2f3bf4",
"assets/ui-carousel.css": "b642a66b5cfa1daa12780c8a99cae70a69d218866a57d2c9f69952b6e2a66032",
"snippets/ui-attachment.liquid": "6881df7cdb1b27462d8cce7c17c0b4ed4dd860d62535e1daa81378a57bb69ddf",
"snippets/ui-marquee.liquid": "47d5df8f1ff46a2cd48a132986c2ba199c9e19b485e62fc3e0d19091d4baaab1",
"assets/ui-marquee.css": "ef13b83f3dbcd6685fcee3dba14238386d0f34bc2266a5326c0b6f2d40a23fce",
Expand All @@ -105,6 +105,8 @@
"snippets/ui-dropdown-menu.liquid": "25b31e09e3e7bfee9a397ca4de6e310754844c55e71639eadba917b0f4e6d2e5",
"snippets/ui-popover.liquid": "44ff93d72eaad409f56f8a84ce25715e2c3633f2ac49ba7a414767c6dbe2ee47",
"snippets/ui-hover-card.liquid": "ba4133d352fa14296743138c99f3694015bafe953751b8e42155f047c4beb9f0",
"snippets/ui.liquid": "30679056b2eafefbaeef5ecd271604951676893a65a8eccb0f970c787a67b900"
"snippets/ui-number-field.liquid": "544bbc038d11fe0f3d7ddd4c1af7b6c76f2a726f1aa63cd94fc44ee7e79b2fbf",
"snippets/ui-swatch.liquid": "9a39fc70974416ba933e90d799e6a805ba1f490c7b48d9a7e25d50caae596e7d",
"snippets/ui.liquid": "569e78bf6f84cdc7b1f7b5ba2681e1e52c6f5d02c4fe4ade16e580bffb963ae0"
}
}
15 changes: 14 additions & 1 deletion liquid/contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"navigation-menu-indicator",
"navigation-menu-item",
"navigation-menu-trigger",
"number-field",
"number-field-decrement",
"number-field-increment",
"radio-group-indicator",
"select-group",
"select-item",
Expand Down Expand Up @@ -242,7 +245,8 @@
],
"input-group": [
"input-group",
"input-group-addon"
"input-group-addon",
"number-field"
],
"triggers": [
"alert-dialog",
Expand Down Expand Up @@ -390,6 +394,7 @@
"carousel": [
"carousel",
"carousel-content",
"carousel-indicator",
"carousel-item"
],
"attachment": [
Expand Down Expand Up @@ -424,5 +429,13 @@
"button-group",
"button-group-separator",
"button-group-text"
],
"number-field": [
"number-field",
"number-field-decrement",
"number-field-increment"
],
"swatch": [
"swatch"
]
}
46 changes: 46 additions & 0 deletions liquid/examples/carousel.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,49 @@
<button data-slot='carousel-previous' data-button data-variant='outline' type='button' hidden>Previous</button
><button data-slot='carousel-next' data-button data-variant='outline' type='button' hidden>Next</button>
</section>

<section data-slot='carousel' aria-label='Product images' style='margin-top:48px'>
<div data-slot='carousel-content'>
<div data-slot='carousel-item' id='gallery-image-1'>
<div data-slot='aspect-ratio' data-variant='framed' style='--ratio:4/3;background:var(--muted)'>
<span style='position:absolute;inset:0;display:grid;place-items:center'>Image 1</span>
</div>
</div>
<div data-slot='carousel-item' id='gallery-image-2'>
<div data-slot='aspect-ratio' data-variant='framed' style='--ratio:4/3;background:var(--secondary)'>
<span style='position:absolute;inset:0;display:grid;place-items:center'>Image 2</span>
</div>
</div>
<div data-slot='carousel-item' id='gallery-image-3'>
<div data-slot='aspect-ratio' data-variant='framed' style='--ratio:4/3;background:var(--accent)'>
<span style='position:absolute;inset:0;display:grid;place-items:center'>Image 3</span>
</div>
</div>
</div>
<div style='display:flex;gap:8px'>
<a
data-slot='carousel-indicator'
data-index='0'
href='#gallery-image-1'
aria-label='Show image 1'
style='display:grid;place-items:center;width:64px;aspect-ratio:1;background:var(--muted)'
>1</a
>
<a
data-slot='carousel-indicator'
data-index='1'
href='#gallery-image-2'
aria-label='Show image 2'
style='display:grid;place-items:center;width:64px;aspect-ratio:1;background:var(--secondary)'
>2</a
>
<a
data-slot='carousel-indicator'
data-index='2'
href='#gallery-image-3'
aria-label='Show image 3'
style='display:grid;place-items:center;width:64px;aspect-ratio:1;background:var(--accent)'
>3</a
>
</div>
</section>
4 changes: 3 additions & 1 deletion liquid/examples/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@
"hover-card": ["hover-card", "typography", "button"],
"marquee": ["marquee"],
"section": ["section"],
"button-group": ["button-group"]
"button-group": ["button-group"],
"number-field": ["number-field", "field"],
"swatch": ["swatch", "toggle", "field"]
}
Loading