diff --git a/.changeset/gallery-single-slide.md b/.changeset/gallery-single-slide.md
new file mode 100644
index 000000000..b8ced5a4f
--- /dev/null
+++ b/.changeset/gallery-single-slide.md
@@ -0,0 +1,5 @@
+---
+"fulldev-ui": patch
+---
+
+In Liquid, a carousel with `data-slides='single'` exposes only its shown slide to the keyboard and screen readers, as a product gallery needs. Before, a gallery whose width had a fraction of a pixel also exposed the next slide at load. Without the attribute, every slide in view stays exposed, as in a row of cards. A Liquid rating can now show part of a star: a `rating__fill` with a width, such as 50%, clips its star instead of shrinking it.
diff --git a/liquid/assets/ui-carousel.js b/liquid/assets/ui-carousel.js
index b8fdd86c7..181173e27 100644
--- a/liquid/assets/ui-carousel.js
+++ b/liquid/assets/ui-carousel.js
@@ -48,8 +48,11 @@ export function initializeCarousel(root) {
}
const target = hash ? document.getElementById(hash) : null;
const linked = target ? items().findIndex((item) => item.contains(target)) : -1;
+ // A row of cards exposes every card that is in view. A gallery that shows one slide at a time sets
+ // data-slides='single', so only the shown slide is exposed, also when a fractional width leaves a
+ // sliver of the next one in view.
const carousel = createCarousel(root, {
- slides: 'multiple',
+ slides: root.dataset.slides === 'single' ? 'single' : 'multiple',
drag: true,
loop: false,
...(linked >= 0 ? { defaultIndex: linked } : {}),
diff --git a/liquid/assets/ui-manifest.json b/liquid/assets/ui-manifest.json
index db04e316d..67ae83188 100644
--- a/liquid/assets/ui-manifest.json
+++ b/liquid/assets/ui-manifest.json
@@ -5,7 +5,7 @@
"snippets/ui-base.liquid": "bc55195b5b6c82e63deeeed1255fd19b434c47866815f82b95b9202421256d34",
"snippets/ui-init.liquid": "98f56067cf51e4cb2cd3e10ede7c00304c73ce57fe5b5a0270c0d8a9e448f7af",
"assets/ui-licenses.json": "874a6f264f1503b2e577aee651e7285fd6ac808f56cadf8c7d58914bf2396f49",
- "assets/ui-carousel.js": "749ad4112b6b2506386a6fa6c4b111ae87b22f85838cfd2f5e249631d1115b55",
+ "assets/ui-carousel.js": "34bb85998bff45a319b99a6f0e5e86ccb44295a95d3aff1a38b5aca2e7ef5caf",
"assets/ui-controls.js": "69abd94c22f5c8307f0d86d9f8be3b6724adb82778fc7021aafd33ba3b4c3789",
"assets/ui-lifecycle.js": "78c975473620171c01b1289bf5cdce56a5626c847437fa5168fb91a4300260d6",
"assets/ui-start.js": "738d7e171b5d7993bfd0a169e4382b2db08340f52a87059b94d27e1fe3606500",
@@ -49,7 +49,7 @@
"snippets/ui-logo.liquid": "5d6de7be3f7aab9e05c9533afef39ea0e9dce1b4ee12a13bf7b82780c973b126",
"snippets/ui-kbd.liquid": "024f34ed2932d183671f7fa44ff724a70ec17b766cf7e0d3f565f46f33ab2cf2",
"snippets/ui-rating.liquid": "aa57adc5a5508b368da78023b242694e6ce924b6e9e5407c141a5030a414bf1d",
- "assets/ui-rating.css": "e5efea2a9edaea78522f20ebd9e9d01abe8a2fcd310c193239adf80ec33b4975",
+ "assets/ui-rating.css": "f7edd1728c13ec0cc351e09cebd7fc13abb4aca7cbe4e45122b41a1f9e6b377c",
"snippets/ui-tooltip.liquid": "d2863a0da3090c73dda10d8615b84fc50fab64373a466fbf4e4e743cfb083c96",
"snippets/ui-avatar.liquid": "9bfb5d5f535857cc45f31afbc91c855e94972bab07ad3b4fe2dc0d241106385d",
"snippets/ui-empty.liquid": "0e7fb5b68d50abcf7213304034762b4dd535c791dd6f4dc517100145e04b0cde",
diff --git a/liquid/assets/ui-rating.css b/liquid/assets/ui-rating.css
index 5d2154078..898d7428b 100644
--- a/liquid/assets/ui-rating.css
+++ b/liquid/assets/ui-rating.css
@@ -11,9 +11,12 @@
height: calc(var(--spacing) * 4);
color: color-mix(in oklch, var(--muted-foreground) 25%, transparent);
}
+/* A star keeps its size inside a fill, so a fill with a width, such as 50%, shows part of it. */
.rating__star svg {
- width: 100%;
- height: 100%;
+ flex: none;
+ width: calc(var(--spacing) * 4);
+ max-width: none;
+ height: calc(var(--spacing) * 4);
}
.rating__fill {
position: absolute;
diff --git a/liquid/examples/carousel.liquid b/liquid/examples/carousel.liquid
index 3a58f2901..9cc3a72ed 100644
--- a/liquid/examples/carousel.liquid
+++ b/liquid/examples/carousel.liquid
@@ -11,7 +11,7 @@
>
-
+
{% for number in (1..5) %}
- {% if number < 5 -%}
-
-
-
- {%- endif %}
+
+
+
{% endfor %}
Example rating
diff --git a/public/r/liquid/components.json b/public/r/liquid/components.json
index e8ad56de7..75d6008f0 100644
--- a/public/r/liquid/components.json
+++ b/public/r/liquid/components.json
@@ -76,7 +76,7 @@
},
{
"path": "assets/ui-manifest.json",
- "content": "{\n \"registry\": \"https://ui.full.dev/r/liquid/\",\n \"files\": {\n \"assets/ui-tokens.css\": \"55a8f2810ab4a1498ca3dd2f6e7dc89009c60e2402ddfcb95783b6eba996c374\",\n \"snippets/ui-base.liquid\": \"bc55195b5b6c82e63deeeed1255fd19b434c47866815f82b95b9202421256d34\",\n \"snippets/ui-init.liquid\": \"98f56067cf51e4cb2cd3e10ede7c00304c73ce57fe5b5a0270c0d8a9e448f7af\",\n \"assets/ui-licenses.json\": \"874a6f264f1503b2e577aee651e7285fd6ac808f56cadf8c7d58914bf2396f49\",\n \"assets/ui-carousel.js\": \"749ad4112b6b2506386a6fa6c4b111ae87b22f85838cfd2f5e249631d1115b55\",\n \"assets/ui-controls.js\": \"69abd94c22f5c8307f0d86d9f8be3b6724adb82778fc7021aafd33ba3b4c3789\",\n \"assets/ui-lifecycle.js\": \"78c975473620171c01b1289bf5cdce56a5626c847437fa5168fb91a4300260d6\",\n \"assets/ui-start.js\": \"738d7e171b5d7993bfd0a169e4382b2db08340f52a87059b94d27e1fe3606500\",\n \"assets/data-slot-core.js\": \"d2879cc3a2f05a7867763b937bad3bd4a369f54670989ce535367cb690fb66e6\",\n \"assets/data-slot-dialog.js\": \"a5201f452700d04145b5156cc46880d2b5bdf7521b03ff9521c3f7693ee1b5d5\",\n \"assets/data-slot-command.js\": \"299d99c1a5f7b646692575e5d48e3f7b9209d76119508116c1a216dc80d33d13\",\n \"assets/data-slot-navigation-menu.js\": \"f9b42a9bceca8e1103718d43aa5f0d141ab63d38278cb121e790a2c80e827b68\",\n \"assets/data-slot-accordion.js\": \"fe6b0ac2c87a2e31582e5e88c509e0b508f41d0065d0a420407999ad210e6a27\",\n \"assets/data-slot-tabs.js\": \"1f187134bba755cfda9d35cf9f16174c1a183862d32d100f270f4177033058c7\",\n \"assets/data-slot-combobox.js\": \"b5f2ed9d65a43d836c59c0d4dc33c16ab12ef9fa05d510078b5d62517d854db6\",\n \"assets/data-slot-carousel.js\": \"d83ef938d3b62dc3652b123428ca2261e03fb2ba1133992b0f5545a974238d03\",\n \"assets/data-slot-alert-dialog.js\": \"1caee9a86bb2a816ea32bc1a48b82f3cc588ec3c563ebc443f836ab1dae2f618\",\n \"assets/data-slot-collapsible.js\": \"c42f76e3dfeff4570eb2f5104434fbffd3ef55710833e888965c590ce59f4f9f\",\n \"assets/data-slot-drawer.js\": \"c9343b26ea27193cc1d2da3e41bf452005bc2e534151fa1a762b2b6535de28d0\",\n \"assets/data-slot-dropdown-menu.js\": \"543c5717c9ba8363bbab4c0a11005980d75d4baaed79cf7123c7bcfe3ec8720b\",\n \"assets/data-slot-hover-card.js\": \"86e1bfa5d4822f180f3501ca7cc51bf044d4e917a7ebdb7a10b70006dba6467f\",\n \"assets/data-slot-popover.js\": \"526e30d663381329a7a6394eae886224024034d0abf96f888c932bb4b8c1b1cb\",\n \"assets/data-slot-radio-group.js\": \"7a9b90166de80d79ee42aa2df73e4d8179e9d291cb30b3095c7d8332375b0499\",\n \"assets/data-slot-select.js\": \"13d1a3fbe90f4b3b830d987b6a28267897faa3589bf00e64edca4938acbf406b\",\n \"assets/data-slot-slider.js\": \"0d10131aa95450aa1269234103ead8d805d6abdf9e0683510f4fcf58ab0f1efa\",\n \"assets/data-slot-switch.js\": \"0d5b09a89429880f61aeb540be5f87383ba5c6beb261ad468e9a6cf18e45b6a0\",\n \"assets/data-slot-toast.js\": \"817744d32eebe3bfc50df068715e0b572350ca53fe5ad0e04ec8646800e1caf0\",\n \"assets/data-slot-toggle.js\": \"7a651d578cb83be842c8e59fe1a2cd124594b1fd6c942faf0a33cf9e57326947\",\n \"assets/data-slot-toggle-group.js\": \"c1f2fc9712974e63e4e44c97ab2a1ec8bc3c3cb73c1afb4578b085fed11977f1\",\n \"assets/data-slot-tooltip.js\": \"5a9e51a54669153620eb3512e74487eac12ababe3331aff7dfed6c717b8b93c0\",\n \"snippets/ui-runtime.liquid\": \"62ae98f4ad16dc0ca406d96bbabb373cd30a63dd385e3614da0dcd2e63d0f17c\",\n \"assets/ui-motion.js\": \"2252a6794ddb162b73ee1640af212292b8c520e98ae09ea862b479078f81d3d1\",\n \"snippets/ui-banner.liquid\": \"9965b12e9a2036aca6e35f1327da8a240c894a6fd91d99f37e77107818d271a3\",\n \"snippets/ui-tabs.liquid\": \"5b57bb3d6400e44ef9343f7b45d9baf2d8581d678ccc64764be60164160687eb\",\n \"snippets/ui-form.liquid\": \"1c002d21c441e217a8f3d64268d429c97e4785af118eb7f7abb5ff1c3d10a3b6\",\n \"assets/ui-form.css\": \"ab0dd70553818fe0799e393f6811e949884eca9f44d9ceff4c2b333c0bf724b4\",\n \"snippets/ui-select.liquid\": \"2d8c99759161a024285d1b54c0ca166dc7b13c97596497351253e945b5e52ee2\",\n \"snippets/ui-field.liquid\": \"cf73aaaf3e27bc9d121dd089317610fbd08b9550a1d5fb0738337c6817879309\",\n \"assets/ui-field.css\": \"96f846a52ab0b832a9eca70ef430e5fd14664a3367d04842de320a82e622722b\",\n \"snippets/ui-item.liquid\": \"fe03c1a3e6df09192c3ac7a08520b0fc1c629a597a029d193ff91655cb7ceac0\",\n \"snippets/ui-spinner.liquid\": \"84d48693f10cb8af4549cc0d71cd847a85da0e111f2ad64dae309c128c2a8c4a\",\n \"snippets/ui-video.liquid\": \"14acea7c523198269a9165270decac21a43a5d69bf12bd248a76aceb2e9b26ed\",\n \"assets/ui-video.css\": \"c1572853f48474f6291a70ccdb1085512700fc3dcbbdaebd71374b838ec67fee\",\n \"snippets/ui-button.liquid\": \"d0b4ad1b574f10f986a7d5b2719a16c4ba29b80887962b9a8b6464afef6fe54c\",\n \"snippets/ui-toggle.liquid\": \"c86100cf7c163c0d5bc81976fd794788f68fab2ebc5c0887d8042958ce020912\",\n \"snippets/ui-logo.liquid\": \"5d6de7be3f7aab9e05c9533afef39ea0e9dce1b4ee12a13bf7b82780c973b126\",\n \"snippets/ui-kbd.liquid\": \"024f34ed2932d183671f7fa44ff724a70ec17b766cf7e0d3f565f46f33ab2cf2\",\n \"snippets/ui-rating.liquid\": \"aa57adc5a5508b368da78023b242694e6ce924b6e9e5407c141a5030a414bf1d\",\n \"assets/ui-rating.css\": \"e5efea2a9edaea78522f20ebd9e9d01abe8a2fcd310c193239adf80ec33b4975\",\n \"snippets/ui-tooltip.liquid\": \"d2863a0da3090c73dda10d8615b84fc50fab64373a466fbf4e4e743cfb083c96\",\n \"snippets/ui-avatar.liquid\": \"9bfb5d5f535857cc45f31afbc91c855e94972bab07ad3b4fe2dc0d241106385d\",\n \"snippets/ui-empty.liquid\": \"0e7fb5b68d50abcf7213304034762b4dd535c791dd6f4dc517100145e04b0cde\",\n \"snippets/ui-alert-dialog.liquid\": \"f739374035ffa0f3bca2c4b6d946710751c8268c8f1dde535251be9c2c7b0cd0\",\n \"snippets/ui-navigation-menu.liquid\": \"52aecbb36b0031810a85a99f5d4439e852dc1ba3a872b9525dd75c8df8b5a84e\",\n \"assets/ui-navigation-menu.css\": \"29a47ce0eb549e58cc8195dcb656bd2cef56360178c76acfc2d481a110463ca6\",\n \"snippets/ui-typography.liquid\": \"b03dc93c4de6636164a206c95979caa6fe9ab7cf8d1c24d75611416259da7979\",\n \"assets/ui-typography.css\": \"0daa86d256566ab8065411682cb8c90aa3b3eab6e62fbd8165dac1147e4edde9\",\n \"snippets/ui-toc.liquid\": \"04038e0870112b2335b80b4092814915105b31d08cdd36ecf1f4de1761f66acf\",\n \"snippets/ui-icon.liquid\": \"ca75a9485eb33cdb31a3a4e2e5ca03ce74d4995dbd1696d964832a87602bf3ca\",\n \"assets/ui-icon.css\": \"cfb1a47905cbd9c25b635c96926a77f8eed983a4aca62fdce758345dcc792add\",\n \"snippets/ui-combobox.liquid\": \"bacd605b44237512a74d34119d01432440b76ae60218dae6a6f37f98b32e3e00\",\n \"snippets/ui-toast.liquid\": \"bb032d90d6084fb15e12da22777635b80d09a06402513c46c89e853e3ede0405\",\n \"assets/ui-toast.css\": \"c322fab210a202fa434695025550495dbdc93e688ed7ae39303fea9830864d0b\",\n \"snippets/ui-header.liquid\": \"cc14effb4e3b6c4ac397e306e4ebd270a31b3415cc12ffbeb6cd38f411eaba80\",\n \"snippets/ui-command.liquid\": \"4a37f59dc0039fa1505de764472212d6cd7c4e5c52b737a1700e928db286f233\",\n \"snippets/ui-accordion.liquid\": \"4b58c83ae13e14e03a3129a2dccbd02eeafa90c1e48edbbf9af2dc412bf3aabf\",\n \"assets/ui-accordion.css\": \"430924440bd0f1d49ceb72baffc77404c9411c31c24b940d75861daba2649e83\",\n \"snippets/ui-slider.liquid\": \"f2de1fb9099de77bf291455447bc86b2578781e7cf0efdf12117fb4575e0b0e6\",\n \"snippets/ui-input.liquid\": \"5f4b2adf298e84ef5845fb123b0753dd76294731da657fe395313ad7fe3f01a9\",\n \"snippets/ui-input-group.liquid\": \"4c34c71677ae07b4d0e73fd10d79e96c308e65bb4d02401e4f39cc8c80b89305\",\n \"snippets/ui-triggers.liquid\": \"ba9c7b802fb0a2aba0e9cc145a9dd44134964afb53e5363cf9e0ae138b906cc9\",\n \"snippets/ui-toggle-group.liquid\": \"2d61e0b9bc746e05834157f5a75d23123f02bc2df737412e4f6099844afc4f49\",\n \"snippets/ui-dialog.liquid\": \"779bbcd609a69ed29a984df1f26f9ed80fd24d71c4ee3ead5f4daa055b28e9fb\",\n \"snippets/ui-drawer.liquid\": \"16120fdd70fac393470c3936223e78ad5f81164e2b7616fd075e8e82098a17d5\",\n \"snippets/ui-badge.liquid\": \"14b826127eaedd2f5acac0ca74fbe403ef18b08ca6651995c0bf0501210d55f6\",\n \"snippets/ui-alert.liquid\": \"392bf006b427178d4699272115317e0db934d881be9534b4638c492fa1825a83\",\n \"snippets/ui-table.liquid\": \"6599d8b3bd193761571c2b71e499f78546ba5c2768d4e0a0a60cd0e348632e5b\",\n \"snippets/ui-breadcrumb.liquid\": \"dafdeaf03286b386c90f8e72777de1946fba4718ee568bd85ca7bc768483a3ca\",\n \"snippets/ui-aspect-ratio.liquid\": \"c8aae05fcd76af7ae768aedafd7e758533e2b52135b00ff72940896ad793f177\",\n \"snippets/ui-price.liquid\": \"96156754aee3a04aa3ae7084a14470000213e8be14468c4937e9f3a87e348234\",\n \"assets/ui-price.css\": \"95c947e219621102b704164e48a83e381e6e2b27b99311a294e076745b39a36f\",\n \"snippets/ui-radio-group.liquid\": \"af9978e18716cc86d03ed21dece8304992e74a4fab88e12069b0648cfd944492\",\n \"snippets/ui-checkbox.liquid\": \"0e4dd1738b355c5a93533e0b813e2e6c72f7491c289d65aa7b6435be1c599006\",\n \"snippets/ui-switch.liquid\": \"84ed60c777e77daec8b5fe6f2ee434877d51224235dc1bc2e17927cd182fe646\",\n \"snippets/ui-skeleton.liquid\": \"1e30245f6577f73d28f4badbc293934656882a29d5dec1d2f74ef95f3bcede2c\",\n \"snippets/ui-separator.liquid\": \"90b1d2795666b6c51f35645ca8d07659f2c4868fe9553e233cddb4e962095f6e\",\n \"snippets/ui-card.liquid\": \"581a46843f1280ebace0423ee84289b40fbd46142e6a9ab3940f63eca0e4c5f2\",\n \"assets/ui-card.css\": \"ee7e4192ec814066d0c9838f810ae4ca267b9f071b7fa945c43226d46b0f8dc9\",\n \"snippets/ui-pagination.liquid\": \"30943c00686e1a23d92865465b38c964e059b14ae3a20fb7fe151824a73773eb\",\n \"snippets/ui-popup.liquid\": \"840f938aa2a331e4e7d55c659f25e841dcfb1bf5c5cadace6263243352ff8359\",\n \"snippets/ui-sheet.liquid\": \"0de705bed685bf78fa3af4517c947b38d62a1aa56bf29356c0a201b64db17614\",\n \"snippets/ui-carousel.liquid\": \"59dc0c06b2a9f2f779ca22b3ff4b005071d4909aba052d6f8f0a1aa19e84c2ce\",\n \"assets/ui-carousel.css\": \"b642a66b5cfa1daa12780c8a99cae70a69d218866a57d2c9f69952b6e2a66032\",\n \"snippets/ui-attachment.liquid\": \"6881df7cdb1b27462d8cce7c17c0b4ed4dd860d62535e1daa81378a57bb69ddf\",\n \"snippets/ui-marquee.liquid\": \"47d5df8f1ff46a2cd48a132986c2ba199c9e19b485e62fc3e0d19091d4baaab1\",\n \"assets/ui-marquee.css\": \"ef13b83f3dbcd6685fcee3dba14238386d0f34bc2266a5326c0b6f2d40a23fce\",\n \"snippets/ui-invalid-controls.liquid\": \"a169e8244cc86f5431f902f7a73b37188051ba8f2ef3e323830462dae5aed066\",\n \"snippets/ui-section.liquid\": \"da358cd87447457f3675b035b48556103d86cd11e0b2240ae2800e4c9ea54bdc\",\n \"assets/ui-section.css\": \"f4936a02aaf1927ccced898886857855e4b5e95fafe5c2a52748ecbbe87b6621\",\n \"snippets/ui-button-group.liquid\": \"a2790f8da0f8b37acc1ed558ba1548ea250a5b93e1b2dfbd11eb150f3f02783a\",\n \"snippets/ui-collapsible.liquid\": \"e6107a03d00b8cc75bb03206e64b9aa7f2989d982c0408b398b62067c6df450a\",\n \"snippets/ui-dropdown-menu.liquid\": \"25b31e09e3e7bfee9a397ca4de6e310754844c55e71639eadba917b0f4e6d2e5\",\n \"snippets/ui-popover.liquid\": \"44ff93d72eaad409f56f8a84ce25715e2c3633f2ac49ba7a414767c6dbe2ee47\",\n \"snippets/ui-hover-card.liquid\": \"ba4133d352fa14296743138c99f3694015bafe953751b8e42155f047c4beb9f0\",\n \"snippets/ui-number-field.liquid\": \"544bbc038d11fe0f3d7ddd4c1af7b6c76f2a726f1aa63cd94fc44ee7e79b2fbf\",\n \"snippets/ui-swatch.liquid\": \"9a39fc70974416ba933e90d799e6a805ba1f490c7b48d9a7e25d50caae596e7d\",\n \"snippets/ui.liquid\": \"569e78bf6f84cdc7b1f7b5ba2681e1e52c6f5d02c4fe4ade16e580bffb963ae0\"\n }\n}\n",
+ "content": "{\n \"registry\": \"https://ui.full.dev/r/liquid/\",\n \"files\": {\n \"assets/ui-tokens.css\": \"55a8f2810ab4a1498ca3dd2f6e7dc89009c60e2402ddfcb95783b6eba996c374\",\n \"snippets/ui-base.liquid\": \"bc55195b5b6c82e63deeeed1255fd19b434c47866815f82b95b9202421256d34\",\n \"snippets/ui-init.liquid\": \"98f56067cf51e4cb2cd3e10ede7c00304c73ce57fe5b5a0270c0d8a9e448f7af\",\n \"assets/ui-licenses.json\": \"874a6f264f1503b2e577aee651e7285fd6ac808f56cadf8c7d58914bf2396f49\",\n \"assets/ui-carousel.js\": \"34bb85998bff45a319b99a6f0e5e86ccb44295a95d3aff1a38b5aca2e7ef5caf\",\n \"assets/ui-controls.js\": \"69abd94c22f5c8307f0d86d9f8be3b6724adb82778fc7021aafd33ba3b4c3789\",\n \"assets/ui-lifecycle.js\": \"78c975473620171c01b1289bf5cdce56a5626c847437fa5168fb91a4300260d6\",\n \"assets/ui-start.js\": \"738d7e171b5d7993bfd0a169e4382b2db08340f52a87059b94d27e1fe3606500\",\n \"assets/data-slot-core.js\": \"d2879cc3a2f05a7867763b937bad3bd4a369f54670989ce535367cb690fb66e6\",\n \"assets/data-slot-dialog.js\": \"a5201f452700d04145b5156cc46880d2b5bdf7521b03ff9521c3f7693ee1b5d5\",\n \"assets/data-slot-command.js\": \"299d99c1a5f7b646692575e5d48e3f7b9209d76119508116c1a216dc80d33d13\",\n \"assets/data-slot-navigation-menu.js\": \"f9b42a9bceca8e1103718d43aa5f0d141ab63d38278cb121e790a2c80e827b68\",\n \"assets/data-slot-accordion.js\": \"fe6b0ac2c87a2e31582e5e88c509e0b508f41d0065d0a420407999ad210e6a27\",\n \"assets/data-slot-tabs.js\": \"1f187134bba755cfda9d35cf9f16174c1a183862d32d100f270f4177033058c7\",\n \"assets/data-slot-combobox.js\": \"b5f2ed9d65a43d836c59c0d4dc33c16ab12ef9fa05d510078b5d62517d854db6\",\n \"assets/data-slot-carousel.js\": \"d83ef938d3b62dc3652b123428ca2261e03fb2ba1133992b0f5545a974238d03\",\n \"assets/data-slot-alert-dialog.js\": \"1caee9a86bb2a816ea32bc1a48b82f3cc588ec3c563ebc443f836ab1dae2f618\",\n \"assets/data-slot-collapsible.js\": \"c42f76e3dfeff4570eb2f5104434fbffd3ef55710833e888965c590ce59f4f9f\",\n \"assets/data-slot-drawer.js\": \"c9343b26ea27193cc1d2da3e41bf452005bc2e534151fa1a762b2b6535de28d0\",\n \"assets/data-slot-dropdown-menu.js\": \"543c5717c9ba8363bbab4c0a11005980d75d4baaed79cf7123c7bcfe3ec8720b\",\n \"assets/data-slot-hover-card.js\": \"86e1bfa5d4822f180f3501ca7cc51bf044d4e917a7ebdb7a10b70006dba6467f\",\n \"assets/data-slot-popover.js\": \"526e30d663381329a7a6394eae886224024034d0abf96f888c932bb4b8c1b1cb\",\n \"assets/data-slot-radio-group.js\": \"7a9b90166de80d79ee42aa2df73e4d8179e9d291cb30b3095c7d8332375b0499\",\n \"assets/data-slot-select.js\": \"13d1a3fbe90f4b3b830d987b6a28267897faa3589bf00e64edca4938acbf406b\",\n \"assets/data-slot-slider.js\": \"0d10131aa95450aa1269234103ead8d805d6abdf9e0683510f4fcf58ab0f1efa\",\n \"assets/data-slot-switch.js\": \"0d5b09a89429880f61aeb540be5f87383ba5c6beb261ad468e9a6cf18e45b6a0\",\n \"assets/data-slot-toast.js\": \"817744d32eebe3bfc50df068715e0b572350ca53fe5ad0e04ec8646800e1caf0\",\n \"assets/data-slot-toggle.js\": \"7a651d578cb83be842c8e59fe1a2cd124594b1fd6c942faf0a33cf9e57326947\",\n \"assets/data-slot-toggle-group.js\": \"c1f2fc9712974e63e4e44c97ab2a1ec8bc3c3cb73c1afb4578b085fed11977f1\",\n \"assets/data-slot-tooltip.js\": \"5a9e51a54669153620eb3512e74487eac12ababe3331aff7dfed6c717b8b93c0\",\n \"snippets/ui-runtime.liquid\": \"62ae98f4ad16dc0ca406d96bbabb373cd30a63dd385e3614da0dcd2e63d0f17c\",\n \"assets/ui-motion.js\": \"2252a6794ddb162b73ee1640af212292b8c520e98ae09ea862b479078f81d3d1\",\n \"snippets/ui-banner.liquid\": \"9965b12e9a2036aca6e35f1327da8a240c894a6fd91d99f37e77107818d271a3\",\n \"snippets/ui-tabs.liquid\": \"5b57bb3d6400e44ef9343f7b45d9baf2d8581d678ccc64764be60164160687eb\",\n \"snippets/ui-form.liquid\": \"1c002d21c441e217a8f3d64268d429c97e4785af118eb7f7abb5ff1c3d10a3b6\",\n \"assets/ui-form.css\": \"ab0dd70553818fe0799e393f6811e949884eca9f44d9ceff4c2b333c0bf724b4\",\n \"snippets/ui-select.liquid\": \"2d8c99759161a024285d1b54c0ca166dc7b13c97596497351253e945b5e52ee2\",\n \"snippets/ui-field.liquid\": \"cf73aaaf3e27bc9d121dd089317610fbd08b9550a1d5fb0738337c6817879309\",\n \"assets/ui-field.css\": \"96f846a52ab0b832a9eca70ef430e5fd14664a3367d04842de320a82e622722b\",\n \"snippets/ui-item.liquid\": \"fe03c1a3e6df09192c3ac7a08520b0fc1c629a597a029d193ff91655cb7ceac0\",\n \"snippets/ui-spinner.liquid\": \"84d48693f10cb8af4549cc0d71cd847a85da0e111f2ad64dae309c128c2a8c4a\",\n \"snippets/ui-video.liquid\": \"14acea7c523198269a9165270decac21a43a5d69bf12bd248a76aceb2e9b26ed\",\n \"assets/ui-video.css\": \"c1572853f48474f6291a70ccdb1085512700fc3dcbbdaebd71374b838ec67fee\",\n \"snippets/ui-button.liquid\": \"d0b4ad1b574f10f986a7d5b2719a16c4ba29b80887962b9a8b6464afef6fe54c\",\n \"snippets/ui-toggle.liquid\": \"c86100cf7c163c0d5bc81976fd794788f68fab2ebc5c0887d8042958ce020912\",\n \"snippets/ui-logo.liquid\": \"5d6de7be3f7aab9e05c9533afef39ea0e9dce1b4ee12a13bf7b82780c973b126\",\n \"snippets/ui-kbd.liquid\": \"024f34ed2932d183671f7fa44ff724a70ec17b766cf7e0d3f565f46f33ab2cf2\",\n \"snippets/ui-rating.liquid\": \"aa57adc5a5508b368da78023b242694e6ce924b6e9e5407c141a5030a414bf1d\",\n \"assets/ui-rating.css\": \"f7edd1728c13ec0cc351e09cebd7fc13abb4aca7cbe4e45122b41a1f9e6b377c\",\n \"snippets/ui-tooltip.liquid\": \"d2863a0da3090c73dda10d8615b84fc50fab64373a466fbf4e4e743cfb083c96\",\n \"snippets/ui-avatar.liquid\": \"9bfb5d5f535857cc45f31afbc91c855e94972bab07ad3b4fe2dc0d241106385d\",\n \"snippets/ui-empty.liquid\": \"0e7fb5b68d50abcf7213304034762b4dd535c791dd6f4dc517100145e04b0cde\",\n \"snippets/ui-alert-dialog.liquid\": \"f739374035ffa0f3bca2c4b6d946710751c8268c8f1dde535251be9c2c7b0cd0\",\n \"snippets/ui-navigation-menu.liquid\": \"52aecbb36b0031810a85a99f5d4439e852dc1ba3a872b9525dd75c8df8b5a84e\",\n \"assets/ui-navigation-menu.css\": \"29a47ce0eb549e58cc8195dcb656bd2cef56360178c76acfc2d481a110463ca6\",\n \"snippets/ui-typography.liquid\": \"b03dc93c4de6636164a206c95979caa6fe9ab7cf8d1c24d75611416259da7979\",\n \"assets/ui-typography.css\": \"0daa86d256566ab8065411682cb8c90aa3b3eab6e62fbd8165dac1147e4edde9\",\n \"snippets/ui-toc.liquid\": \"04038e0870112b2335b80b4092814915105b31d08cdd36ecf1f4de1761f66acf\",\n \"snippets/ui-icon.liquid\": \"ca75a9485eb33cdb31a3a4e2e5ca03ce74d4995dbd1696d964832a87602bf3ca\",\n \"assets/ui-icon.css\": \"cfb1a47905cbd9c25b635c96926a77f8eed983a4aca62fdce758345dcc792add\",\n \"snippets/ui-combobox.liquid\": \"bacd605b44237512a74d34119d01432440b76ae60218dae6a6f37f98b32e3e00\",\n \"snippets/ui-toast.liquid\": \"bb032d90d6084fb15e12da22777635b80d09a06402513c46c89e853e3ede0405\",\n \"assets/ui-toast.css\": \"c322fab210a202fa434695025550495dbdc93e688ed7ae39303fea9830864d0b\",\n \"snippets/ui-header.liquid\": \"cc14effb4e3b6c4ac397e306e4ebd270a31b3415cc12ffbeb6cd38f411eaba80\",\n \"snippets/ui-command.liquid\": \"4a37f59dc0039fa1505de764472212d6cd7c4e5c52b737a1700e928db286f233\",\n \"snippets/ui-accordion.liquid\": \"4b58c83ae13e14e03a3129a2dccbd02eeafa90c1e48edbbf9af2dc412bf3aabf\",\n \"assets/ui-accordion.css\": \"430924440bd0f1d49ceb72baffc77404c9411c31c24b940d75861daba2649e83\",\n \"snippets/ui-slider.liquid\": \"f2de1fb9099de77bf291455447bc86b2578781e7cf0efdf12117fb4575e0b0e6\",\n \"snippets/ui-input.liquid\": \"5f4b2adf298e84ef5845fb123b0753dd76294731da657fe395313ad7fe3f01a9\",\n \"snippets/ui-input-group.liquid\": \"4c34c71677ae07b4d0e73fd10d79e96c308e65bb4d02401e4f39cc8c80b89305\",\n \"snippets/ui-triggers.liquid\": \"ba9c7b802fb0a2aba0e9cc145a9dd44134964afb53e5363cf9e0ae138b906cc9\",\n \"snippets/ui-toggle-group.liquid\": \"2d61e0b9bc746e05834157f5a75d23123f02bc2df737412e4f6099844afc4f49\",\n \"snippets/ui-dialog.liquid\": \"779bbcd609a69ed29a984df1f26f9ed80fd24d71c4ee3ead5f4daa055b28e9fb\",\n \"snippets/ui-drawer.liquid\": \"16120fdd70fac393470c3936223e78ad5f81164e2b7616fd075e8e82098a17d5\",\n \"snippets/ui-badge.liquid\": \"14b826127eaedd2f5acac0ca74fbe403ef18b08ca6651995c0bf0501210d55f6\",\n \"snippets/ui-alert.liquid\": \"392bf006b427178d4699272115317e0db934d881be9534b4638c492fa1825a83\",\n \"snippets/ui-table.liquid\": \"6599d8b3bd193761571c2b71e499f78546ba5c2768d4e0a0a60cd0e348632e5b\",\n \"snippets/ui-breadcrumb.liquid\": \"dafdeaf03286b386c90f8e72777de1946fba4718ee568bd85ca7bc768483a3ca\",\n \"snippets/ui-aspect-ratio.liquid\": \"c8aae05fcd76af7ae768aedafd7e758533e2b52135b00ff72940896ad793f177\",\n \"snippets/ui-price.liquid\": \"96156754aee3a04aa3ae7084a14470000213e8be14468c4937e9f3a87e348234\",\n \"assets/ui-price.css\": \"95c947e219621102b704164e48a83e381e6e2b27b99311a294e076745b39a36f\",\n \"snippets/ui-radio-group.liquid\": \"af9978e18716cc86d03ed21dece8304992e74a4fab88e12069b0648cfd944492\",\n \"snippets/ui-checkbox.liquid\": \"0e4dd1738b355c5a93533e0b813e2e6c72f7491c289d65aa7b6435be1c599006\",\n \"snippets/ui-switch.liquid\": \"84ed60c777e77daec8b5fe6f2ee434877d51224235dc1bc2e17927cd182fe646\",\n \"snippets/ui-skeleton.liquid\": \"1e30245f6577f73d28f4badbc293934656882a29d5dec1d2f74ef95f3bcede2c\",\n \"snippets/ui-separator.liquid\": \"90b1d2795666b6c51f35645ca8d07659f2c4868fe9553e233cddb4e962095f6e\",\n \"snippets/ui-card.liquid\": \"581a46843f1280ebace0423ee84289b40fbd46142e6a9ab3940f63eca0e4c5f2\",\n \"assets/ui-card.css\": \"ee7e4192ec814066d0c9838f810ae4ca267b9f071b7fa945c43226d46b0f8dc9\",\n \"snippets/ui-pagination.liquid\": \"30943c00686e1a23d92865465b38c964e059b14ae3a20fb7fe151824a73773eb\",\n \"snippets/ui-popup.liquid\": \"840f938aa2a331e4e7d55c659f25e841dcfb1bf5c5cadace6263243352ff8359\",\n \"snippets/ui-sheet.liquid\": \"0de705bed685bf78fa3af4517c947b38d62a1aa56bf29356c0a201b64db17614\",\n \"snippets/ui-carousel.liquid\": \"59dc0c06b2a9f2f779ca22b3ff4b005071d4909aba052d6f8f0a1aa19e84c2ce\",\n \"assets/ui-carousel.css\": \"b642a66b5cfa1daa12780c8a99cae70a69d218866a57d2c9f69952b6e2a66032\",\n \"snippets/ui-attachment.liquid\": \"6881df7cdb1b27462d8cce7c17c0b4ed4dd860d62535e1daa81378a57bb69ddf\",\n \"snippets/ui-marquee.liquid\": \"47d5df8f1ff46a2cd48a132986c2ba199c9e19b485e62fc3e0d19091d4baaab1\",\n \"assets/ui-marquee.css\": \"ef13b83f3dbcd6685fcee3dba14238386d0f34bc2266a5326c0b6f2d40a23fce\",\n \"snippets/ui-invalid-controls.liquid\": \"a169e8244cc86f5431f902f7a73b37188051ba8f2ef3e323830462dae5aed066\",\n \"snippets/ui-section.liquid\": \"da358cd87447457f3675b035b48556103d86cd11e0b2240ae2800e4c9ea54bdc\",\n \"assets/ui-section.css\": \"f4936a02aaf1927ccced898886857855e4b5e95fafe5c2a52748ecbbe87b6621\",\n \"snippets/ui-button-group.liquid\": \"a2790f8da0f8b37acc1ed558ba1548ea250a5b93e1b2dfbd11eb150f3f02783a\",\n \"snippets/ui-collapsible.liquid\": \"e6107a03d00b8cc75bb03206e64b9aa7f2989d982c0408b398b62067c6df450a\",\n \"snippets/ui-dropdown-menu.liquid\": \"25b31e09e3e7bfee9a397ca4de6e310754844c55e71639eadba917b0f4e6d2e5\",\n \"snippets/ui-popover.liquid\": \"44ff93d72eaad409f56f8a84ce25715e2c3633f2ac49ba7a414767c6dbe2ee47\",\n \"snippets/ui-hover-card.liquid\": \"ba4133d352fa14296743138c99f3694015bafe953751b8e42155f047c4beb9f0\",\n \"snippets/ui-number-field.liquid\": \"544bbc038d11fe0f3d7ddd4c1af7b6c76f2a726f1aa63cd94fc44ee7e79b2fbf\",\n \"snippets/ui-swatch.liquid\": \"9a39fc70974416ba933e90d799e6a805ba1f490c7b48d9a7e25d50caae596e7d\",\n \"snippets/ui.liquid\": \"569e78bf6f84cdc7b1f7b5ba2681e1e52c6f5d02c4fe4ade16e580bffb963ae0\"\n }\n}\n",
"type": "registry:file",
"target": "~/assets/ui-manifest.json"
}
diff --git a/public/r/liquid/rating.json b/public/r/liquid/rating.json
index a4469d8cd..6168b4a71 100644
--- a/public/r/liquid/rating.json
+++ b/public/r/liquid/rating.json
@@ -15,7 +15,7 @@
},
{
"path": "assets/ui-rating.css",
- "content": "[data-slot='rating'] {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing);\n color: var(--primary);\n}\n.rating__star {\n position: relative;\n display: inline-flex;\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n color: color-mix(in oklch, var(--muted-foreground) 25%, transparent);\n}\n.rating__star svg {\n width: 100%;\n height: 100%;\n}\n.rating__fill {\n position: absolute;\n inset: 0;\n overflow: hidden;\n color: var(--primary);\n}\n",
+ "content": "[data-slot='rating'] {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing);\n color: var(--primary);\n}\n.rating__star {\n position: relative;\n display: inline-flex;\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n color: color-mix(in oklch, var(--muted-foreground) 25%, transparent);\n}\n/* A star keeps its size inside a fill, so a fill with a width, such as 50%, shows part of it. */\n.rating__star svg {\n flex: none;\n width: calc(var(--spacing) * 4);\n max-width: none;\n height: calc(var(--spacing) * 4);\n}\n.rating__fill {\n position: absolute;\n inset: 0;\n overflow: hidden;\n color: var(--primary);\n}\n",
"type": "registry:file",
"target": "~/assets/ui-rating.css"
}
diff --git a/public/r/liquid/runtime.json b/public/r/liquid/runtime.json
index df77ecbef..b0b23a555 100644
--- a/public/r/liquid/runtime.json
+++ b/public/r/liquid/runtime.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "assets/ui-carousel.js",
- "content": "import { createCarousel } from '@data-slot/carousel';\n\n// @data-slot/carousel owns scrolling, snapping, dragging, the arrow keys and the previous and next\n// buttons, and keeps every visible card interactive. It writes English ARIA descriptions and slide\n// labels, so the translated ones from Liquid are put back after binding and slide updates.\nexport function initializeCarousel(root) {\n const content = root.querySelector('[data-slot=\"carousel-content\"]');\n const items = () => [...content.children].filter((item) => item.matches('[data-slot=\"carousel-item\"]'));\n const rootDescription = root.getAttribute('aria-roledescription');\n const descriptions = new WeakMap(items().map((item) => [item, item.getAttribute('aria-roledescription')]));\n let destroyed = false;\n const translate = () => {\n if (destroyed) return;\n if (rootDescription) root.setAttribute('aria-roledescription', rootDescription);\n const slides = items();\n const template = root.dataset.slideLabel;\n slides.forEach((item, index) => {\n const description = descriptions.get(item);\n if (description) item.setAttribute('aria-roledescription', description);\n if (template)\n item.setAttribute('aria-label', template.replace('[index]', index + 1).replace('[total]', slides.length));\n });\n };\n // Observe first to capture authored descriptions before data-slot rewrites them.\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations)\n for (const node of mutation.addedNodes)\n if (node instanceof Element && node.matches('[data-slot=\"carousel-item\"]'))\n descriptions.set(node, node.getAttribute('aria-roledescription'));\n queueMicrotask(translate);\n });\n observer.observe(content, { childList: true });\n // A thumbnail can link to its slide's id, which works without JavaScript. Once the controller runs,\n // a plain click only scrolls the carousel, so the page does not jump to the slide.\n const onClick = (event) => {\n const link = event.target instanceof Element ? event.target.closest('a[data-slot=\"carousel-indicator\"]') : null;\n if (!link || link.closest('[data-slot=\"carousel\"]') !== root) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n };\n // A link to a slide or to something in it, such as a thumbnail followed before this module loaded,\n // keeps that slide.\n let hash = location.hash.slice(1);\n try {\n hash = decodeURIComponent(hash);\n } catch {\n // Keep a malformed hash as it is.\n }\n const target = hash ? document.getElementById(hash) : null;\n const linked = target ? items().findIndex((item) => item.contains(target)) : -1;\n const carousel = createCarousel(root, {\n slides: 'multiple',\n drag: true,\n loop: false,\n ...(linked >= 0 ? { defaultIndex: linked } : {}),\n });\n root.addEventListener('click', onClick);\n translate();\n for (const button of root.querySelectorAll('[data-slot=\"carousel-previous\"], [data-slot=\"carousel-next\"]'))\n button.hidden = false;\n const destroy = carousel.destroy.bind(carousel);\n carousel.destroy = () => {\n destroyed = true;\n observer.disconnect();\n root.removeEventListener('click', onClick);\n destroy();\n };\n return carousel;\n}\n",
+ "content": "import { createCarousel } from '@data-slot/carousel';\n\n// @data-slot/carousel owns scrolling, snapping, dragging, the arrow keys and the previous and next\n// buttons, and keeps every visible card interactive. It writes English ARIA descriptions and slide\n// labels, so the translated ones from Liquid are put back after binding and slide updates.\nexport function initializeCarousel(root) {\n const content = root.querySelector('[data-slot=\"carousel-content\"]');\n const items = () => [...content.children].filter((item) => item.matches('[data-slot=\"carousel-item\"]'));\n const rootDescription = root.getAttribute('aria-roledescription');\n const descriptions = new WeakMap(items().map((item) => [item, item.getAttribute('aria-roledescription')]));\n let destroyed = false;\n const translate = () => {\n if (destroyed) return;\n if (rootDescription) root.setAttribute('aria-roledescription', rootDescription);\n const slides = items();\n const template = root.dataset.slideLabel;\n slides.forEach((item, index) => {\n const description = descriptions.get(item);\n if (description) item.setAttribute('aria-roledescription', description);\n if (template)\n item.setAttribute('aria-label', template.replace('[index]', index + 1).replace('[total]', slides.length));\n });\n };\n // Observe first to capture authored descriptions before data-slot rewrites them.\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations)\n for (const node of mutation.addedNodes)\n if (node instanceof Element && node.matches('[data-slot=\"carousel-item\"]'))\n descriptions.set(node, node.getAttribute('aria-roledescription'));\n queueMicrotask(translate);\n });\n observer.observe(content, { childList: true });\n // A thumbnail can link to its slide's id, which works without JavaScript. Once the controller runs,\n // a plain click only scrolls the carousel, so the page does not jump to the slide.\n const onClick = (event) => {\n const link = event.target instanceof Element ? event.target.closest('a[data-slot=\"carousel-indicator\"]') : null;\n if (!link || link.closest('[data-slot=\"carousel\"]') !== root) return;\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n };\n // A link to a slide or to something in it, such as a thumbnail followed before this module loaded,\n // keeps that slide.\n let hash = location.hash.slice(1);\n try {\n hash = decodeURIComponent(hash);\n } catch {\n // Keep a malformed hash as it is.\n }\n const target = hash ? document.getElementById(hash) : null;\n const linked = target ? items().findIndex((item) => item.contains(target)) : -1;\n // A row of cards exposes every card that is in view. A gallery that shows one slide at a time sets\n // data-slides='single', so only the shown slide is exposed, also when a fractional width leaves a\n // sliver of the next one in view.\n const carousel = createCarousel(root, {\n slides: root.dataset.slides === 'single' ? 'single' : 'multiple',\n drag: true,\n loop: false,\n ...(linked >= 0 ? { defaultIndex: linked } : {}),\n });\n root.addEventListener('click', onClick);\n translate();\n for (const button of root.querySelectorAll('[data-slot=\"carousel-previous\"], [data-slot=\"carousel-next\"]'))\n button.hidden = false;\n const destroy = carousel.destroy.bind(carousel);\n carousel.destroy = () => {\n destroyed = true;\n observer.disconnect();\n root.removeEventListener('click', onClick);\n destroy();\n };\n return carousel;\n}\n",
"type": "registry:file",
"target": "~/assets/ui-carousel.js"
},
diff --git a/skills/fulldev-ui/SKILL.md b/skills/fulldev-ui/SKILL.md
index 2e5f0a1ec..7230710c4 100644
--- a/skills/fulldev-ui/SKILL.md
+++ b/skills/fulldev-ui/SKILL.md
@@ -22,7 +22,7 @@ and the shadcn skill differ, this skill wins.
For Shopify themes, use `https://ui.full.dev/r/liquid/.json` with `shadcn add`; `components` installs the full set. Read [Liquid](https://ui.full.dev/liquid/docs/installation.md). These are universal items with explicit theme targets. Do not run `shadcn init` or add Tailwind to the theme. Render `ui` once in each layout head before theme overrides and other modules. Keep `content_for_header`; load `custom.css` after it. Existing Shopify adapters use `runtime: false` and the exported lifecycle with their own import map. Installed UI stays unchanged; theme settings and commerce code stay local. Native source supports Vega, not the Tailwind preset generator.
-For storefront parts, use the library first: `number-field` for quantities, `swatch` in option toggles and filter labels, and `carousel-indicator` thumbnails for a product gallery. Product cards, cart lines and filter panels are compositions of card, item, field, checkbox and badge in the theme.
+For storefront parts, use the library first: `number-field` for quantities, `swatch` in option toggles and filter labels, and `carousel-indicator` thumbnails for a product gallery, whose root has `data-slides='single'`. Product cards, cart lines and filter panels are compositions of card, item, field, checkbox and badge in the theme.
## Astro setup
diff --git a/src/content/pages/liquid/components/carousel.mdx b/src/content/pages/liquid/components/carousel.mdx
index 4dbf3f99e..5702efdd2 100644
--- a/src/content/pages/liquid/components/carousel.mdx
+++ b/src/content/pages/liquid/components/carousel.mdx
@@ -29,7 +29,7 @@ After this install, render these once in the layout head before theme overrides
The preview and its Usage tab render the same native Liquid source. Use `data-slot` for parts, `data-variant` for variants and `data-size` for sizes. Keep your store's labels, translations and Shopify data in your theme.
-The second carousel is a product gallery: one slide at a time with `carousel-indicator` thumbnails. Give each indicator the zero-based `data-index` of its slide; the controller scrolls to that slide on click and marks the current one with `aria-current`. The index counts scroll positions, which are the slides when one shows at a time; an indicator without a position is hidden. Give it a width and an aspect ratio; an image inside fills it. Make an indicator a link to its slide's `id` so it also works without JavaScript; once the runtime runs, a plain click scrolls the carousel without moving the page. To show a variant's image, send `carousel:set` with its index: `root.dispatchEvent(new CustomEvent('carousel:set', { detail: { index } }))`.
+The second carousel is a product gallery: one slide at a time with `carousel-indicator` thumbnails. Give its root `data-slides='single'`, so only the shown slide is exposed to the keyboard and screen readers; without it, every slide that is in view is, as in a row of cards. Give each indicator the zero-based `data-index` of its slide; the controller scrolls to that slide on click and marks the current one with `aria-current`. The index counts scroll positions, which are the slides when one shows at a time; an indicator without a position is hidden. Give it a width and an aspect ratio; an image inside fills it. Make an indicator a link to its slide's `id` so it also works without JavaScript; once the runtime runs, a plain click scrolls the carousel without moving the page. To show a variant's image, send `carousel:set` with its index: `root.dispatchEvent(new CustomEvent('carousel:set', { detail: { index } }))`.
## Parts
diff --git a/src/content/pages/liquid/components/rating.mdx b/src/content/pages/liquid/components/rating.mdx
index d4bef60f0..9728d9109 100644
--- a/src/content/pages/liquid/components/rating.mdx
+++ b/src/content/pages/liquid/components/rating.mdx
@@ -25,6 +25,8 @@ After this install, render these once in the layout head before theme overrides
The preview and its Usage tab render the same native Liquid source. Use `data-slot` for parts, `data-variant` for variants and `data-size` for sizes. Keep your store's labels, translations and Shopify data in your theme.
+Each star is a `rating__star` with a `rating__fill` over it. A fill shows the whole star; give it a width, such as `style='width: 50%'`, for part of one.
+
## Parts
`rating`.
diff --git a/tests/browser/liquid-regressions.test.mjs b/tests/browser/liquid-regressions.test.mjs
index 4e87473ef..6003fa767 100644
--- a/tests/browser/liquid-regressions.test.mjs
+++ b/tests/browser/liquid-regressions.test.mjs
@@ -178,14 +178,22 @@ for (const [name, type] of Object.entries({ chromium, firefox, webkit })) {
-
+
One
Two
12
- `
+
+
+
+
+
+
+
+
+ `
document.body.append(container)
const input = container.querySelector("input")
window.quantityEvents = []
@@ -195,6 +203,18 @@ for (const [name, type] of Object.entries({ chromium, firefox, webkit })) {
)
})
const root = page.locator("#storefront-regression")
+ // A partial fill clips its star instead of shrinking it.
+ assert.deepEqual(
+ await root.locator(".rating__star").evaluate((star) => {
+ const width = (element) => element.getBoundingClientRect().width
+ const fill = star.querySelector(".rating__fill")
+ return [
+ width(fill) / width(star),
+ width(fill.querySelector("svg")) / width(star),
+ ]
+ }),
+ [0.5, 1]
+ )
await root.locator('[data-slot="number-field"][data-enhanced]').waitFor()
const increase = root.getByRole("button", { name: "Increase" })
const decrease = root.getByRole("button", { name: "Decrease" })
@@ -241,6 +261,17 @@ for (const [name, type] of Object.entries({ chromium, firefox, webkit })) {
.locator('[data-slot="carousel-indicator"][aria-current="true"]')
.getAttribute("aria-label")
assert.equal(await current(), "Show image 1")
+ // One slide at a time: a sliver of the next one in a fractional width stays hidden.
+ const exposed = () =>
+ root
+ .locator('[data-slot="carousel-item"]')
+ .evaluateAll((items) =>
+ items.map(
+ (item) =>
+ !item.inert && item.getAttribute("aria-hidden") !== "true"
+ )
+ )
+ assert.deepEqual(await exposed(), [true, false])
await root.getByRole("link", { name: "Show image 2" }).click()
await page.waitForFunction(
() =>
@@ -251,6 +282,7 @@ for (const [name, type] of Object.entries({ chromium, firefox, webkit })) {
?.getAttribute("aria-current") === "true"
)
assert.equal(await current(), "Show image 2")
+ assert.deepEqual(await exposed(), [false, true])
// A plain click scrolls the carousel instead of following the link.
assert.equal(new URL(page.url()).hash, "")
} finally {