@eldrajs/theme-cli 0.2.8 → 0.2.10

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.
Files changed (165) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/package.json +1 -1
  3. package/template/.eldra/block-types.d.ts +28 -7
  4. package/template/.eldra/manifest.json +1034 -355
  5. package/template/.eldra/previews.json +35 -35
  6. package/template/README.md +32 -0
  7. package/template/app/assets/main.css +23 -0
  8. package/template/app/plugins/eldra-storefront.ts +3 -0
  9. package/template/app/storefront/demo.ts +75 -24
  10. package/template/app/storefront/gateway.ts +16 -2
  11. package/template/blocks/announcement-bar/preview.png +0 -0
  12. package/template/blocks/article/preview.json +4 -4
  13. package/template/blocks/article/preview.png +0 -0
  14. package/template/blocks/article-list/Block.vue +48 -19
  15. package/template/blocks/article-list/__tests__/Block.spec.ts +15 -0
  16. package/template/blocks/article-list/preview.json +43 -43
  17. package/template/blocks/article-list/preview.png +0 -0
  18. package/template/blocks/breadcrumbs/preview.png +0 -0
  19. package/template/blocks/cart/preview.png +0 -0
  20. package/template/blocks/collection-grid/Block.vue +260 -9
  21. package/template/blocks/collection-grid/__tests__/Block.spec.ts +202 -0
  22. package/template/blocks/collection-grid/block.json +3 -3
  23. package/template/blocks/collection-grid/preview.png +0 -0
  24. package/template/blocks/collection-header/Block.vue +82 -58
  25. package/template/blocks/collection-header/__tests__/Block.spec.ts +77 -1
  26. package/template/blocks/collection-header/preview.json +4 -4
  27. package/template/blocks/collection-header/preview.png +0 -0
  28. package/template/blocks/contact/preview.png +0 -0
  29. package/template/blocks/cta/preview.json +4 -4
  30. package/template/blocks/cta/preview.png +0 -0
  31. package/template/blocks/faq/preview.png +0 -0
  32. package/template/blocks/feature-grid/Block.vue +73 -4
  33. package/template/blocks/feature-grid/__tests__/Block.spec.ts +43 -1
  34. package/template/blocks/feature-grid/block.json +2 -2
  35. package/template/blocks/feature-grid/preview.json +49 -24
  36. package/template/blocks/feature-grid/preview.png +0 -0
  37. package/template/blocks/footer/Block.vue +186 -71
  38. package/template/blocks/footer/__tests__/Block.spec.ts +127 -32
  39. package/template/blocks/footer/block.json +42 -4
  40. package/template/blocks/footer/mock.json +31 -34
  41. package/template/blocks/footer/preview.png +0 -0
  42. package/template/blocks/form/preview.png +0 -0
  43. package/template/blocks/gallery/preview.json +24 -24
  44. package/template/blocks/gallery/preview.png +0 -0
  45. package/template/blocks/hero/Block.vue +117 -19
  46. package/template/blocks/hero/__tests__/Block.spec.ts +46 -0
  47. package/template/blocks/hero/block.json +36 -1
  48. package/template/blocks/hero/preview.json +33 -25
  49. package/template/blocks/hero/preview.png +0 -0
  50. package/template/blocks/image/preview.json +4 -4
  51. package/template/blocks/image/preview.png +0 -0
  52. package/template/blocks/logo-cloud/preview.png +0 -0
  53. package/template/blocks/navigation/Block.vue +623 -184
  54. package/template/blocks/navigation/__tests__/Block.spec.ts +416 -68
  55. package/template/blocks/navigation/__tests__/fixtures/menu.json +182 -0
  56. package/template/blocks/navigation/block.json +102 -6
  57. package/template/blocks/navigation/mock.json +279 -52
  58. package/template/blocks/navigation/preview.json +311 -0
  59. package/template/blocks/navigation/preview.png +0 -0
  60. package/template/blocks/newsletter/Block.vue +248 -144
  61. package/template/blocks/newsletter/__tests__/Block.spec.ts +42 -0
  62. package/template/blocks/newsletter/block.json +61 -2
  63. package/template/blocks/newsletter/preview.json +35 -0
  64. package/template/blocks/newsletter/preview.png +0 -0
  65. package/template/blocks/order-status/preview.png +0 -0
  66. package/template/blocks/pricing-table/preview.png +0 -0
  67. package/template/blocks/product-carousel/Block.vue +272 -26
  68. package/template/blocks/product-carousel/__tests__/Block.spec.ts +90 -0
  69. package/template/blocks/product-carousel/block.json +61 -0
  70. package/template/blocks/product-carousel/preview.json +12 -0
  71. package/template/blocks/product-carousel/preview.png +0 -0
  72. package/template/blocks/product-detail/Block.vue +148 -96
  73. package/template/blocks/product-detail/__tests__/Block.spec.ts +98 -74
  74. package/template/blocks/product-detail/block.json +11 -4
  75. package/template/blocks/product-detail/mock.json +53 -22
  76. package/template/blocks/product-detail/parts/Gallery.vue +52 -103
  77. package/template/blocks/product-detail/preview.png +0 -0
  78. package/template/blocks/quote/preview.png +0 -0
  79. package/template/blocks/rich-text/preview.png +0 -0
  80. package/template/blocks/search/Block.vue +1 -0
  81. package/template/blocks/search/TypeSection.vue +1 -0
  82. package/template/blocks/search/__tests__/Block.spec.ts +23 -0
  83. package/template/blocks/search/preview.png +0 -0
  84. package/template/blocks/split-content/Block.vue +98 -20
  85. package/template/blocks/split-content/__tests__/Block.spec.ts +57 -18
  86. package/template/blocks/split-content/block.json +72 -6
  87. package/template/blocks/split-content/preview.json +34 -13
  88. package/template/blocks/split-content/preview.png +0 -0
  89. package/template/blocks/stats/preview.png +0 -0
  90. package/template/blocks/tabs/preview.json +16 -16
  91. package/template/blocks/tabs/preview.png +0 -0
  92. package/template/blocks/team/preview.png +0 -0
  93. package/template/blocks/testimonials/preview.png +0 -0
  94. package/template/blocks/timeline/preview.png +0 -0
  95. package/template/blocks/trust-strip/Block.vue +67 -1
  96. package/template/blocks/trust-strip/__tests__/Block.spec.ts +30 -1
  97. package/template/blocks/trust-strip/block.json +4 -4
  98. package/template/blocks/trust-strip/preview.json +21 -0
  99. package/template/blocks/trust-strip/preview.png +0 -0
  100. package/template/blocks/video-embed/preview.png +0 -0
  101. package/template/blocks/wishlist/preview.png +0 -0
  102. package/template/i18n/en-US.json +16 -9
  103. package/template/i18n/is-IS.json +16 -9
  104. package/template/pages/article.page.json +19 -18
  105. package/template/pages/cart.page.json +3 -13
  106. package/template/pages/category.page.json +15 -7
  107. package/template/pages/collection.page.json +15 -14
  108. package/template/pages/home.page.json +217 -182
  109. package/template/pages/product.page.json +46 -36
  110. package/template/pages/products.page.json +3 -13
  111. package/template/pages/search.page.json +3 -13
  112. package/template/pages/wishlist.page.json +3 -13
  113. package/template/public/images/CREDITS.md +28 -0
  114. package/template/public/images/clay-hands.webp +0 -0
  115. package/template/public/images/coffee-table.webp +0 -0
  116. package/template/public/images/cup.webp +0 -0
  117. package/template/public/images/enamel-cups.webp +0 -0
  118. package/template/public/images/hero.webp +0 -0
  119. package/template/public/images/kitchen.webp +0 -0
  120. package/template/public/images/mug.webp +0 -0
  121. package/template/public/images/northwind-mark.svg +1 -0
  122. package/template/public/images/planters.webp +0 -0
  123. package/template/public/images/plates.webp +0 -0
  124. package/template/public/images/reading.webp +0 -0
  125. package/template/public/images/sweater.webp +0 -0
  126. package/template/public/images/terracotta.webp +0 -0
  127. package/template/public/images/throws.webp +0 -0
  128. package/template/public/images/vase.webp +0 -0
  129. package/template/public/images/wheel.webp +0 -0
  130. package/template/public/images/yarn-tools.webp +0 -0
  131. package/template/public/images/yarn.webp +0 -0
  132. package/template/stories/generated/collection-grid.stories.ts +6 -0
  133. package/template/stories/generated/feature-grid.stories.ts +6 -0
  134. package/template/stories/generated/footer.stories.ts +4 -4
  135. package/template/stories/generated/hero.stories.ts +6 -0
  136. package/template/stories/generated/navigation.stories.ts +14 -1
  137. package/template/stories/generated/newsletter.stories.ts +2 -1
  138. package/template/stories/generated/product-carousel.stories.ts +12 -0
  139. package/template/stories/generated/split-content.stories.ts +12 -0
  140. package/template/stories/generated/trust-strip.stories.ts +8 -1
  141. package/template/stories/pages/article.stories.ts +2 -1
  142. package/template/stories/pages/cart.stories.ts +2 -1
  143. package/template/stories/pages/category.stories.ts +2 -1
  144. package/template/stories/pages/collection.stories.ts +2 -1
  145. package/template/stories/pages/home.stories.ts +2 -1
  146. package/template/stories/pages/product.stories.ts +2 -1
  147. package/template/stories/pages/products.stories.ts +2 -1
  148. package/template/stories/pages/search.stories.ts +2 -1
  149. package/template/stories/pages/wishlist.stories.ts +2 -1
  150. package/template/stories/support/demoChrome.ts +32 -0
  151. package/template/stories/support/pageBlocks.ts +2 -4
  152. package/template/test/countPill.browser.spec.ts +21 -13
  153. package/template/test/localePrefix.spec.ts +11 -6
  154. package/template/test/pages/article.spec.ts +1 -1
  155. package/template/test/pages/category.spec.ts +34 -11
  156. package/template/test/pages/collection.spec.ts +182 -148
  157. package/template/test/pages/home.spec.ts +35 -40
  158. package/template/test/pages/hydration.spec.ts +4 -4
  159. package/template/test/pages/product.spec.ts +17 -14
  160. package/template/test/pages/seededPages.spec.ts +11 -6
  161. package/template/test/prerenderRefresh.browser.spec.ts +36 -15
  162. package/template/test/previewParity.browser.spec.ts +36 -2
  163. package/template/test/starter.spec.ts +31 -15
  164. package/template/test/storefront/gatewayPrerender.spec.ts +26 -0
  165. package/template/tokens.json +13 -13
@@ -1,51 +1,51 @@
1
1
  {
2
2
  "items": [
3
3
  {
4
- "title": "How we glaze our stoneware",
5
- "dek": "Two firings, three pairs of hands and a kiln that always has the last word. A morning in the Portland studio.",
6
- "href": "/journal/how-we-glaze-our-stoneware",
7
- "categoryLabel": "Ceramics",
8
- "categoryHref": "/journal/ceramics",
9
- "publishedAt": "2026-09-18",
10
- "readingTime": "6 min read",
4
+ "title": "Five small rituals for a slower morning coffee",
5
+ "dek": "Warm the cup, grind by hand, sit down to drink it. Small habits that make the first ten minutes of the day your own.",
6
+ "href": "/journal/slower-morning-coffee",
7
+ "categoryLabel": "At home",
8
+ "categoryHref": "/journal/home",
9
+ "publishedAt": "2026-10-02",
10
+ "readingTime": "4 min read",
11
11
  "image": {
12
- "assetId": "demo-gallery-1",
13
- "url": "/demo/gallery-1.svg",
14
- "altText": "",
15
- "width": 1600,
16
- "height": 1000
12
+ "assetId": "demo-journal-1",
13
+ "url": "/images/coffee-table.webp",
14
+ "altText": "A polka-dot mug of coffee with biscuits and reading glasses",
15
+ "width": 1400,
16
+ "height": 933
17
17
  }
18
18
  },
19
19
  {
20
- "title": "Caring for merino: a winter guide",
21
- "dek": "Wash less, air more. How to keep a knit soft and shape-true for a decade, pills and all.",
22
- "href": "/journal/caring-for-merino",
23
- "categoryLabel": "Care",
24
- "categoryHref": "/journal/care",
25
- "publishedAt": "2026-09-09",
26
- "readingTime": "4 min read",
20
+ "title": "A morning at the wheel with Harbour Pottery",
21
+ "dek": "Six pairs of hands, two firings and a kiln that always has the last word. We spent a morning in the studio.",
22
+ "href": "/journal/harbour-pottery",
23
+ "categoryLabel": "Workshop visit",
24
+ "categoryHref": "/journal/makers",
25
+ "publishedAt": "2026-09-24",
26
+ "readingTime": "6 min read",
27
27
  "image": {
28
- "assetId": "demo-gallery-2",
29
- "url": "/demo/gallery-2.svg",
30
- "altText": "",
31
- "width": 1600,
32
- "height": 1000
28
+ "assetId": "demo-journal-2",
29
+ "url": "/images/clay-hands.webp",
30
+ "altText": "A potter's hands working wet clay",
31
+ "width": 1400,
32
+ "height": 933
33
33
  }
34
34
  },
35
35
  {
36
- "title": "Five-minute brown butter oats",
37
- "dek": "Our kitchen team's weekday breakfast, made in one Everyday saucepan with whatever fruit is in the bowl.",
38
- "href": "/journal/brown-butter-oats",
39
- "categoryLabel": "Recipes",
40
- "categoryHref": "/journal/recipes",
41
- "publishedAt": "2026-08-28",
36
+ "title": "Layering throws for a colder season",
37
+ "dek": "Wool over linen, heavy over light: how to build a sofa corner that keeps you warm from October to April.",
38
+ "href": "/journal/layering-throws",
39
+ "categoryLabel": "Knitting",
40
+ "categoryHref": "/journal/care",
41
+ "publishedAt": "2026-09-12",
42
42
  "readingTime": "3 min read",
43
43
  "image": {
44
- "assetId": "demo-gallery-3",
45
- "url": "/demo/gallery-3.svg",
46
- "altText": "",
47
- "width": 1600,
48
- "height": 1000
44
+ "assetId": "demo-journal-3",
45
+ "url": "/images/throws.webp",
46
+ "altText": "Folded knitted throws in green and grey",
47
+ "width": 1400,
48
+ "height": 910
49
49
  }
50
50
  },
51
51
  {
@@ -58,10 +58,10 @@
58
58
  "readingTime": "7 min read",
59
59
  "image": {
60
60
  "assetId": "demo-gallery-4",
61
- "url": "/demo/gallery-4.svg",
62
- "altText": "",
63
- "width": 1600,
64
- "height": 1000
61
+ "url": "/images/coffee-table.webp",
62
+ "altText": "A polka-dot mug of coffee with biscuits",
63
+ "width": 1400,
64
+ "height": 933
65
65
  }
66
66
  },
67
67
  {
@@ -74,10 +74,10 @@
74
74
  "readingTime": "5 min read",
75
75
  "image": {
76
76
  "assetId": "demo-gallery-5",
77
- "url": "/demo/gallery-5.svg",
78
- "altText": "",
79
- "width": 1600,
80
- "height": 1000
77
+ "url": "/images/terracotta.webp",
78
+ "altText": "Handmade terracotta bowls and jugs",
79
+ "width": 1400,
80
+ "height": 933
81
81
  }
82
82
  }
83
83
  ]
Binary file
@@ -3,7 +3,8 @@
3
3
  * Collection grid: a collection's products as a filterable, sortable card grid — a sticky filter
4
4
  * sidebar from 64rem of the block's own width, a filter drawer below that (and at every width in
5
5
  * `drawer-only`) (spec `02-blocks.md` "Collection grid", 3047–3170, over the shared "Product grid"
6
- * and "Progress bar" parts at 3036–3045).
6
+ * and "Progress bar" parts at 3036–3045) — or, in `filter-bar`, one horizontal row of filter chips
7
+ * above the grid with the applied filters as removable tags under it (see `isBar`).
7
8
  *
8
9
  * **Where the data comes from.** Everything a shopper sees — cards, prices, filter values, counts,
9
10
  * the total — is `useStorefront().catalog.collectionProducts()`; the CMS fields only configure the
@@ -53,6 +54,7 @@ import {
53
54
  import {
54
55
  Badge,
55
56
  Button,
57
+ Chip,
56
58
  Container,
57
59
  Drawer,
58
60
  EditorPlaceholder,
@@ -61,6 +63,7 @@ import {
61
63
  FilterPanel,
62
64
  LoadMore,
63
65
  Pagination,
66
+ Popover,
64
67
  ProductCard,
65
68
  Section,
66
69
  Select,
@@ -72,6 +75,7 @@ import {
72
75
  type FilterFacetLayout,
73
76
  type FilterSelection as UiFilterSelection,
74
77
  type SelectOption,
78
+ type UiMessages,
75
79
  } from '@eldrajs/ui';
76
80
  import { useEldraLink } from '@eldrajs/theme-vue';
77
81
  import { useBlockData } from '../../app/composables/useBlockData';
@@ -81,6 +85,7 @@ import { useRevalidating } from '../../app/composables/useRevalidating';
81
85
  import { useStorefront } from '../../app/composables/useStorefront';
82
86
  import { useI18n } from 'vue-i18n';
83
87
  import { useUiId } from '../../app/composables/useUiId';
88
+ import EldraIcon from '../../app/components/EldraIcon.vue';
84
89
  import EldraRouterLink from '../../app/components/EldraRouterLink.vue';
85
90
  import { toProductCardEntries } from '../../app/storefront/toProductCard';
86
91
  import { useMoney } from '../../app/storefront/money';
@@ -167,11 +172,24 @@ const filterPanelMessages = useMessages();
167
172
  * visually hidden `h2` 'Products'"). */
168
173
  const productsHeadingId = `collection-grid-products-${uid}`;
169
174
 
170
- type Variant = 'sidebar' | 'drawer-only';
175
+ type Variant = 'sidebar' | 'drawer-only' | 'filter-bar';
171
176
  const variant = computed<Variant>(() =>
172
- data.value.variant === 'drawer-only' ? 'drawer-only' : 'sidebar'
177
+ data.value.variant === 'drawer-only'
178
+ ? 'drawer-only'
179
+ : data.value.variant === 'filter-bar'
180
+ ? 'filter-bar'
181
+ : 'sidebar'
173
182
  );
174
183
  const hasSidebar = computed(() => variant.value === 'sidebar');
184
+ /**
185
+ * **`filter-bar`**: one horizontal row of filter chips above the grid instead of a sidebar or a
186
+ * drawer — a chip per group that opens that group's own `FilterPanel` in a `Popover`, a pressed chip
187
+ * per on/off value (In stock only), and the sort on the far end — with the applied filters as
188
+ * removable tags under it beside the count. Only the **layout** differs: every change goes through
189
+ * the sidebar's own live path (`onPanelChange` and its debounce, `onPanelRemove`'s focus rule,
190
+ * `onClearAll`), so the requests, the URL and the results are exactly the sidebar variant's.
191
+ */
192
+ const isBar = computed(() => variant.value === 'filter-bar');
175
193
 
176
194
  /** The column counts the field, the Select and a shared URL all agree on. */
177
195
  const COLUMN_CHOICES = ['2', '3', '4'];
@@ -1358,8 +1376,11 @@ async function onClearAll(): Promise<void> {
1358
1376
  * for the Nth remove button in document order is exactly what a shopper's or a screen reader's own
1359
1377
  * next stop would be, and does not depend on that internal bookkeeping.
1360
1378
  */
1361
- function focusNthRemoveButton(panel: InstanceType<typeof FilterPanel> | null, index: number): void {
1362
- const root = (panel as { $el?: Element } | null)?.$el;
1379
+ function focusNthRemoveButton(
1380
+ panel: InstanceType<typeof FilterPanel> | Element | null,
1381
+ index: number
1382
+ ): void {
1383
+ const root = panel instanceof Element ? panel : (panel as { $el?: Element } | null)?.$el;
1363
1384
  const button = root?.querySelectorAll('[data-part="removeButton"]')[index];
1364
1385
  (button as HTMLElement | undefined)?.focus();
1365
1386
  }
@@ -1382,9 +1403,98 @@ async function onPanelRemove(removal: { facetId: string; value: string }): Promi
1382
1403
  focusCount();
1383
1404
  return;
1384
1405
  }
1385
- focusNthRemoveButton(sidebarPanelEl.value, Math.min(index, remaining.length - 1));
1406
+ focusNthRemoveButton(
1407
+ isBar.value ? barTagsEl.value : sidebarPanelEl.value,
1408
+ Math.min(index, remaining.length - 1)
1409
+ );
1410
+ }
1411
+
1412
+ // ---------------------------------------------------------------------------------------------
1413
+ // The filter bar (`filter-bar` only)
1414
+ // ---------------------------------------------------------------------------------------------
1415
+
1416
+ /** The bar's applied-filter tags, for `onPanelRemove`'s "focus the next tag" rule. */
1417
+ const barTagsEl = ref<HTMLElement | null>(null);
1418
+
1419
+ /** The applied values as tags — `@eldrajs/ui`'s own `appliedFilters`, the same list the sidebar
1420
+ * panel's chips are drawn from, so a range contributes none here either. */
1421
+ const barTags = computed(() => appliedFilters(filterFacets.value, panelSelection.value));
1422
+
1423
+ /** On/off groups (availability and the store's own toggles) are pressed chips in the bar itself;
1424
+ * every other group opens its own popover. */
1425
+ const barToggleFacets = computed(() =>
1426
+ filterFacets.value.filter((facet) => facet.type === 'toggle')
1427
+ );
1428
+ const barPopoverFacets = computed(() =>
1429
+ filterFacets.value.filter((facet) => facet.type !== 'toggle')
1430
+ );
1431
+
1432
+ /** A popover holds one group, open: the facet's own "Start closed" belongs to a list of groups,
1433
+ * and a popover the shopper just asked for showing a collapsed group would be one click too many. */
1434
+ function popoverFacets(facet: FilterFacet): FilterFacet[] {
1435
+ return [{ ...facet, collapsed: false }];
1436
+ }
1437
+
1438
+ function selectedIn(facetId: string): string[] {
1439
+ const value = panelSelection.value[facetId];
1440
+ return Array.isArray(value) && typeof value[0] !== 'number' ? (value as string[]) : [];
1441
+ }
1442
+
1443
+ /** The digit beside a chip: checked values, or 1 for a price range away from its limits. */
1444
+ function barCount(facet: FilterFacet): number {
1445
+ if (facet.type === 'range') return priceMin.value !== '' || priceMax.value !== '' ? 1 : 0;
1446
+ return selectedIn(facet.id).length;
1447
+ }
1448
+
1449
+ function isBarValuePressed(facetId: string, value: string): boolean {
1450
+ return selectedIn(facetId).includes(value);
1451
+ }
1452
+
1453
+ /** A pressed chip is one checkbox of its group: the whole resulting selection goes through the
1454
+ * sidebar's live path, as the panel's own `change` does. */
1455
+ function toggleBarValue(facetId: string, value: string): void {
1456
+ const current = selectedIn(facetId);
1457
+ const nextValues = current.includes(value)
1458
+ ? current.filter((entry) => entry !== value)
1459
+ : [...current, value];
1460
+ const next: UiFilterSelection = { ...panelSelection.value };
1461
+ if (nextValues.length > 0) next[facetId] = nextValues;
1462
+ else delete next[facetId];
1463
+ onPanelChange(next);
1464
+ }
1465
+
1466
+ /** A tag's remove button: the panel's own chip removal, replayed — `change` with the value gone,
1467
+ * then `remove`, which flushes and moves focus to the next tag or the count. */
1468
+ function removeBarTag(tag: { facetId: string; value: string }): void {
1469
+ const nextValues = selectedIn(tag.facetId).filter((entry) => entry !== tag.value);
1470
+ const next: UiFilterSelection = { ...panelSelection.value };
1471
+ if (nextValues.length > 0) next[tag.facetId] = nextValues;
1472
+ else delete next[tag.facetId];
1473
+ onPanelChange(next);
1474
+ void onPanelRemove({ facetId: tag.facetId, value: tag.value });
1475
+ }
1476
+
1477
+ function barTagMessages(tag: { facetLabel: string; label: string }): Partial<UiMessages> {
1478
+ return {
1479
+ removeTag: () => filterPanelMessages.value.filterPanelRemoveFilter(tag.facetLabel, tag.label),
1480
+ };
1386
1481
  }
1387
1482
 
1483
+ /** The Northwind chip: outlined, 2.5rem, filled with `text` while pressed or open. Exclusive
1484
+ * branches, so no class is ever overridden by another on the same element. */
1485
+ const BAR_CHIP_BASE =
1486
+ 'eldra-focus inline-flex min-h-10 cursor-pointer items-center gap-1.5 whitespace-nowrap ' +
1487
+ 'rounded-full border px-4 text-[0.9375rem] font-medium motion-safe:transition-colors ' +
1488
+ 'motion-safe:duration-fast disabled:cursor-not-allowed disabled:opacity-50';
1489
+ const BAR_CHIP_ON = `${BAR_CHIP_BASE} bg-text text-background border-text`;
1490
+ const BAR_CHIP_OFF = `${BAR_CHIP_BASE} border-border-strong text-text hover:bg-surface`;
1491
+ const BAR_POPOVER_CLASSES = {
1492
+ panel: 'w-[20rem] max-w-[calc(100vw-2rem)] max-h-[min(30rem,70vh)] overflow-y-auto px-4 pb-2',
1493
+ };
1494
+ /** The group's own disclosure row reads as the popover's heading; its rules are the popover's
1495
+ * border already. */
1496
+ const BAR_PANEL_CLASSES = { group: 'border-0', foot: 'hidden' };
1497
+
1388
1498
  /** Widen the window first, resolve an armed sidebar wait second — the ordering `onColumns` explains
1389
1499
  * at length. Flushing first assigned the mirror on the old window, and the wider one that followed
1390
1500
  * queued the mirror behind the result's own watcher: two reads for one press, the first of them
@@ -1668,8 +1778,146 @@ function hrefForPage(page: number): string {
1668
1778
  </aside>
1669
1779
 
1670
1780
  <div class="min-w-0">
1781
+ <!-- The filter bar (`filter-bar`): a chip per group, the pressed on/off chips and the
1782
+ sort, one row that wraps on a narrow screen and stays in view while the grid
1783
+ scrolls from 48rem. -->
1784
+ <template v-if="isBar">
1785
+ <div
1786
+ v-if="showTopBar"
1787
+ role="group"
1788
+ :aria-label="t('grid.filterAndSort')"
1789
+ class="border-border bg-background @tablet:sticky @tablet:top-[var(--eldra-header-height,0px)] @tablet:z-10 flex flex-wrap items-center gap-2 border-y py-3.5"
1790
+ >
1791
+ <Popover
1792
+ v-for="facet in barPopoverFacets"
1793
+ :key="facet.id"
1794
+ role="dialog"
1795
+ haspopup="dialog"
1796
+ placement="bottom-start"
1797
+ :aria-label="facet.label"
1798
+ :classes="BAR_POPOVER_CLASSES"
1799
+ >
1800
+ <template #trigger="{ attrs, open }">
1801
+ <button v-bind="attrs" :class="open ? BAR_CHIP_ON : BAR_CHIP_OFF">
1802
+ {{ facet.label }}
1803
+ <Badge
1804
+ v-if="barCount(facet) > 0"
1805
+ tone="primary"
1806
+ pill
1807
+ :hidden-suffix="t('grid.nActive', { count: barCount(facet) })"
1808
+ >
1809
+ <span aria-hidden="true">{{ barCount(facet) }}</span>
1810
+ </Badge>
1811
+ <EldraIcon
1812
+ name="chevron-down"
1813
+ size="sm"
1814
+ :class="
1815
+ open
1816
+ ? 'rotate-180 motion-safe:transition-transform'
1817
+ : 'motion-safe:transition-transform'
1818
+ "
1819
+ />
1820
+ </button>
1821
+ </template>
1822
+ <FilterPanel
1823
+ mode="drawer"
1824
+ dense
1825
+ :show-head="false"
1826
+ :label="facet.label"
1827
+ :facets="popoverFacets(facet)"
1828
+ :model-value="panelSelection"
1829
+ :currency="money.currency.value"
1830
+ :id-prefix="`collection-grid-bar-${uid}-${facet.id}`"
1831
+ :classes="BAR_PANEL_CLASSES"
1832
+ @change="onPanelChange"
1833
+ >
1834
+ <template #foot><span /></template>
1835
+ </FilterPanel>
1836
+ </Popover>
1837
+
1838
+ <template v-for="facet in barToggleFacets" :key="facet.id">
1839
+ <button
1840
+ v-for="value in facet.values ?? []"
1841
+ :key="value.value"
1842
+ type="button"
1843
+ :aria-pressed="isBarValuePressed(facet.id, value.value) ? 'true' : 'false'"
1844
+ :disabled="value.disabled && !isBarValuePressed(facet.id, value.value)"
1845
+ :class="isBarValuePressed(facet.id, value.value) ? BAR_CHIP_ON : BAR_CHIP_OFF"
1846
+ @click="toggleBarValue(facet.id, value.value)"
1847
+ >
1848
+ {{ value.label }}
1849
+ </button>
1850
+ </template>
1851
+
1852
+ <div
1853
+ class="@tablet:ms-auto @tablet:w-auto flex w-full flex-wrap items-center gap-x-6 gap-y-2"
1854
+ >
1855
+ <FieldWrapper
1856
+ v-if="hasSort"
1857
+ :label="t('grid.sort')"
1858
+ class="flex min-w-0 flex-1 items-center gap-3"
1859
+ :classes="{ label: 'mb-0 shrink-0 font-semibold', control: 'min-w-0 flex-1' }"
1860
+ >
1861
+ <Select
1862
+ :model-value="sort"
1863
+ size="md"
1864
+ :options="sortOptions"
1865
+ class="@tablet:min-w-48 w-full"
1866
+ @update:model-value="onSort"
1867
+ />
1868
+ </FieldWrapper>
1869
+ <FieldWrapper
1870
+ v-if="showColumnSelect"
1871
+ :label="t('grid.columns')"
1872
+ class="@content:flex hidden items-center gap-3"
1873
+ :classes="{ label: 'mb-0 shrink-0 font-semibold' }"
1874
+ >
1875
+ <Select
1876
+ :model-value="columnsChoice"
1877
+ size="md"
1878
+ :options="columnOptions"
1879
+ @update:model-value="onColumns"
1880
+ />
1881
+ </FieldWrapper>
1882
+ </div>
1883
+ </div>
1884
+
1885
+ <!-- The count and the applied filters as removable tags, then Clear all. -->
1886
+ <div class="flex flex-wrap items-center gap-2 pt-4">
1887
+ <p
1888
+ ref="countEl"
1889
+ tabindex="-1"
1890
+ role="status"
1891
+ aria-live="polite"
1892
+ class="text-muted me-2 tabular-nums"
1893
+ >
1894
+ {{ countText }}
1895
+ </p>
1896
+ <ul
1897
+ v-if="barTags.length > 0"
1898
+ ref="barTagsEl"
1899
+ :aria-label="filterPanelMessages.filterPanelApplied"
1900
+ class="flex flex-wrap gap-2"
1901
+ >
1902
+ <li v-for="tag in barTags" :key="`${tag.facetId}:${tag.value}`">
1903
+ <Chip
1904
+ size="sm"
1905
+ removable
1906
+ :label="tag.label"
1907
+ :messages="barTagMessages(tag)"
1908
+ class="bg-surface-strong border-transparent"
1909
+ @remove="removeBarTag(tag)"
1910
+ />
1911
+ </li>
1912
+ </ul>
1913
+ <Button v-if="activeCount > 0" variant="link" size="sm" @click="onClearAll">
1914
+ {{ filterPanelMessages.filterPanelClearAll }}
1915
+ </Button>
1916
+ </div>
1917
+ </template>
1918
+
1671
1919
  <!-- Top bar: Filter + sort, below 64rem (always in drawer-only). -->
1672
- <div v-if="showTopBar" :class="topBarClass">
1920
+ <div v-if="showTopBar && !isBar" :class="topBarClass">
1673
1921
  <Button
1674
1922
  v-if="hasFilters"
1675
1923
  variant="outline"
@@ -1709,7 +1957,10 @@ function hrefForPage(page: number): string {
1709
1957
  </div>
1710
1958
 
1711
1959
  <!-- Toolbar: the count, and Sort by + Columns from 64rem. -->
1712
- <div class="border-border flex flex-wrap items-center gap-x-6 gap-y-2 border-b pb-4">
1960
+ <div
1961
+ v-if="!isBar"
1962
+ class="border-border flex flex-wrap items-center gap-x-6 gap-y-2 border-b pb-4"
1963
+ >
1713
1964
  <p
1714
1965
  ref="countEl"
1715
1966
  tabindex="-1"
@@ -1838,7 +2089,7 @@ function hrefForPage(page: number): string {
1838
2089
  </div>
1839
2090
 
1840
2091
  <Drawer
1841
- v-if="hasFilters"
2092
+ v-if="hasFilters && !isBar"
1842
2093
  :id="drawerId"
1843
2094
  v-model="drawerOpen"
1844
2095
  side="right"