@eldrajs/theme-cli 0.2.8 → 0.2.9

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 (163) hide show
  1. package/CHANGELOG.md +2 -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 +65 -52
  25. package/template/blocks/collection-header/preview.json +4 -4
  26. package/template/blocks/collection-header/preview.png +0 -0
  27. package/template/blocks/contact/preview.png +0 -0
  28. package/template/blocks/cta/preview.json +4 -4
  29. package/template/blocks/cta/preview.png +0 -0
  30. package/template/blocks/faq/preview.png +0 -0
  31. package/template/blocks/feature-grid/Block.vue +73 -4
  32. package/template/blocks/feature-grid/__tests__/Block.spec.ts +43 -1
  33. package/template/blocks/feature-grid/block.json +2 -2
  34. package/template/blocks/feature-grid/preview.json +49 -24
  35. package/template/blocks/feature-grid/preview.png +0 -0
  36. package/template/blocks/footer/Block.vue +186 -71
  37. package/template/blocks/footer/__tests__/Block.spec.ts +127 -32
  38. package/template/blocks/footer/block.json +42 -4
  39. package/template/blocks/footer/mock.json +31 -34
  40. package/template/blocks/footer/preview.png +0 -0
  41. package/template/blocks/form/preview.png +0 -0
  42. package/template/blocks/gallery/preview.json +24 -24
  43. package/template/blocks/gallery/preview.png +0 -0
  44. package/template/blocks/hero/Block.vue +117 -19
  45. package/template/blocks/hero/__tests__/Block.spec.ts +46 -0
  46. package/template/blocks/hero/block.json +36 -1
  47. package/template/blocks/hero/preview.json +33 -25
  48. package/template/blocks/hero/preview.png +0 -0
  49. package/template/blocks/image/preview.json +4 -4
  50. package/template/blocks/image/preview.png +0 -0
  51. package/template/blocks/logo-cloud/preview.png +0 -0
  52. package/template/blocks/navigation/Block.vue +622 -184
  53. package/template/blocks/navigation/__tests__/Block.spec.ts +406 -68
  54. package/template/blocks/navigation/__tests__/fixtures/menu.json +182 -0
  55. package/template/blocks/navigation/block.json +102 -6
  56. package/template/blocks/navigation/mock.json +279 -52
  57. package/template/blocks/navigation/preview.json +311 -0
  58. package/template/blocks/navigation/preview.png +0 -0
  59. package/template/blocks/newsletter/Block.vue +248 -144
  60. package/template/blocks/newsletter/__tests__/Block.spec.ts +42 -0
  61. package/template/blocks/newsletter/block.json +61 -2
  62. package/template/blocks/newsletter/preview.json +35 -0
  63. package/template/blocks/newsletter/preview.png +0 -0
  64. package/template/blocks/order-status/preview.png +0 -0
  65. package/template/blocks/pricing-table/preview.png +0 -0
  66. package/template/blocks/product-carousel/Block.vue +272 -26
  67. package/template/blocks/product-carousel/__tests__/Block.spec.ts +90 -0
  68. package/template/blocks/product-carousel/block.json +61 -0
  69. package/template/blocks/product-carousel/preview.json +12 -0
  70. package/template/blocks/product-carousel/preview.png +0 -0
  71. package/template/blocks/product-detail/Block.vue +148 -96
  72. package/template/blocks/product-detail/__tests__/Block.spec.ts +98 -74
  73. package/template/blocks/product-detail/block.json +11 -4
  74. package/template/blocks/product-detail/mock.json +53 -22
  75. package/template/blocks/product-detail/parts/Gallery.vue +52 -103
  76. package/template/blocks/product-detail/preview.png +0 -0
  77. package/template/blocks/quote/preview.png +0 -0
  78. package/template/blocks/rich-text/preview.png +0 -0
  79. package/template/blocks/search/Block.vue +1 -0
  80. package/template/blocks/search/TypeSection.vue +1 -0
  81. package/template/blocks/search/__tests__/Block.spec.ts +23 -0
  82. package/template/blocks/search/preview.png +0 -0
  83. package/template/blocks/split-content/Block.vue +98 -20
  84. package/template/blocks/split-content/__tests__/Block.spec.ts +57 -18
  85. package/template/blocks/split-content/block.json +72 -6
  86. package/template/blocks/split-content/preview.json +34 -13
  87. package/template/blocks/split-content/preview.png +0 -0
  88. package/template/blocks/stats/preview.png +0 -0
  89. package/template/blocks/tabs/preview.json +16 -16
  90. package/template/blocks/tabs/preview.png +0 -0
  91. package/template/blocks/team/preview.png +0 -0
  92. package/template/blocks/testimonials/preview.png +0 -0
  93. package/template/blocks/timeline/preview.png +0 -0
  94. package/template/blocks/trust-strip/Block.vue +67 -1
  95. package/template/blocks/trust-strip/__tests__/Block.spec.ts +30 -1
  96. package/template/blocks/trust-strip/block.json +4 -4
  97. package/template/blocks/trust-strip/preview.json +21 -0
  98. package/template/blocks/trust-strip/preview.png +0 -0
  99. package/template/blocks/video-embed/preview.png +0 -0
  100. package/template/blocks/wishlist/preview.png +0 -0
  101. package/template/i18n/en-US.json +16 -9
  102. package/template/i18n/is-IS.json +16 -9
  103. package/template/pages/article.page.json +19 -18
  104. package/template/pages/cart.page.json +3 -13
  105. package/template/pages/category.page.json +15 -7
  106. package/template/pages/collection.page.json +15 -14
  107. package/template/pages/home.page.json +217 -182
  108. package/template/pages/product.page.json +46 -36
  109. package/template/pages/products.page.json +3 -13
  110. package/template/pages/search.page.json +3 -13
  111. package/template/pages/wishlist.page.json +3 -13
  112. package/template/public/images/CREDITS.md +28 -0
  113. package/template/public/images/clay-hands.webp +0 -0
  114. package/template/public/images/coffee-table.webp +0 -0
  115. package/template/public/images/cup.webp +0 -0
  116. package/template/public/images/enamel-cups.webp +0 -0
  117. package/template/public/images/hero.webp +0 -0
  118. package/template/public/images/kitchen.webp +0 -0
  119. package/template/public/images/mug.webp +0 -0
  120. package/template/public/images/northwind-mark.svg +1 -0
  121. package/template/public/images/planters.webp +0 -0
  122. package/template/public/images/plates.webp +0 -0
  123. package/template/public/images/reading.webp +0 -0
  124. package/template/public/images/sweater.webp +0 -0
  125. package/template/public/images/terracotta.webp +0 -0
  126. package/template/public/images/throws.webp +0 -0
  127. package/template/public/images/vase.webp +0 -0
  128. package/template/public/images/wheel.webp +0 -0
  129. package/template/public/images/yarn-tools.webp +0 -0
  130. package/template/public/images/yarn.webp +0 -0
  131. package/template/stories/generated/collection-grid.stories.ts +6 -0
  132. package/template/stories/generated/feature-grid.stories.ts +6 -0
  133. package/template/stories/generated/footer.stories.ts +4 -4
  134. package/template/stories/generated/hero.stories.ts +6 -0
  135. package/template/stories/generated/navigation.stories.ts +14 -1
  136. package/template/stories/generated/newsletter.stories.ts +2 -1
  137. package/template/stories/generated/product-carousel.stories.ts +12 -0
  138. package/template/stories/generated/split-content.stories.ts +12 -0
  139. package/template/stories/generated/trust-strip.stories.ts +8 -1
  140. package/template/stories/pages/article.stories.ts +2 -1
  141. package/template/stories/pages/cart.stories.ts +2 -1
  142. package/template/stories/pages/category.stories.ts +2 -1
  143. package/template/stories/pages/collection.stories.ts +2 -1
  144. package/template/stories/pages/home.stories.ts +2 -1
  145. package/template/stories/pages/product.stories.ts +2 -1
  146. package/template/stories/pages/products.stories.ts +2 -1
  147. package/template/stories/pages/search.stories.ts +2 -1
  148. package/template/stories/pages/wishlist.stories.ts +2 -1
  149. package/template/stories/support/demoChrome.ts +32 -0
  150. package/template/stories/support/pageBlocks.ts +2 -4
  151. package/template/test/countPill.browser.spec.ts +21 -13
  152. package/template/test/localePrefix.spec.ts +11 -6
  153. package/template/test/pages/article.spec.ts +1 -1
  154. package/template/test/pages/category.spec.ts +34 -11
  155. package/template/test/pages/collection.spec.ts +182 -148
  156. package/template/test/pages/home.spec.ts +35 -40
  157. package/template/test/pages/hydration.spec.ts +4 -4
  158. package/template/test/pages/product.spec.ts +17 -14
  159. package/template/test/pages/seededPages.spec.ts +11 -6
  160. package/template/test/prerenderRefresh.browser.spec.ts +36 -15
  161. package/template/test/starter.spec.ts +31 -15
  162. package/template/test/storefront/gatewayPrerender.spec.ts +26 -0
  163. package/template/tokens.json +13 -13
@@ -6,7 +6,8 @@ import { Badge } from '@eldrajs/ui';
6
6
  import { enUS as uiEnUS } from '@eldrajs/ui';
7
7
  import { axe } from '../../../test/support/axe';
8
8
  import Block from '../Block.vue';
9
- import mock from '../mock.json';
9
+ import seed from '../mock.json';
10
+ import menuFixture from './fixtures/menu.json';
10
11
  import { mountOptions } from '../../../test/support/mountBlock';
11
12
  import { computed, nextTick, ref, type Ref } from 'vue';
12
13
  import { STOREFRONT_KEY } from '../../../app/storefront/types';
@@ -21,6 +22,15 @@ import { createDemoStorefront } from '../../../app/storefront/demo';
21
22
  // slug and a title before rendering. `resolveTargets` does both here, so a spec can assert the
22
23
  // hrefs a real page produces; `mock` itself stays the unresolved seed, which is what a header
23
24
  // looks like the moment it is inserted and nothing has resolved yet.
25
+ // The menu and keyboard specs below were written against a five-item bar — Knitwear and Ceramics
26
+ // as mega-menus, then Kitchen, Journal and Visit the studio as plain links — and they count
27
+ // triggers and walk panels by position. That menu is kept as a fixture (`fixtures/menu.json`, the
28
+ // seed's links before the Northwind redesign) so those specs keep measuring `NavMenu`'s behaviour
29
+ // rather than whichever demo menu the seed happens to ship; everything else is the real seed, info
30
+ // strip included. The redesigned seed's own menu (sections with cards, a badge, a dropdown) has its
31
+ // own specs under "the Northwind menu".
32
+ const mock = { ...seed, links: menuFixture.links, searchStyle: 'icon' as const };
33
+
24
34
  const COLLECTION_TEMPLATE = {
25
35
  id: 'rt-collection',
26
36
  data: {
@@ -107,6 +117,16 @@ function stubFocusVisible(matches: boolean): () => void {
107
117
  };
108
118
  }
109
119
 
120
+ /** The labelled Search tool: named by its visible label, so it carries no `aria-label` to find it by. */
121
+ function findSearchTool(wrapper: { findAll: (selector: string) => DOMWrapper<Element>[] }) {
122
+ return wrapper.findAll('button').find((button) => button.text().trim() === 'Search');
123
+ }
124
+ function searchTool(wrapper: { findAll: (selector: string) => DOMWrapper<Element>[] }) {
125
+ const button = findSearchTool(wrapper);
126
+ if (button === undefined) throw new Error('no Search tool in the bar');
127
+ return button;
128
+ }
129
+
110
130
  function mountBlock(data: Record<string, unknown>, opts?: { attachTo?: Element }) {
111
131
  const base = mountOptions({ entry: { id: 'e1', data } }, { links: resolved.links });
112
132
  return mount(Block, {
@@ -344,7 +364,7 @@ describe('header block (navigation apiId)', () => {
344
364
  expect(cards).toHaveLength(2);
345
365
  const image = cards[0]!.get('img');
346
366
  expect(image.attributes('src')).toBe('https://media.test/mug-md.jpg');
347
- expect((image.element as HTMLImageElement).style.aspectRatio).toBe('4 / 3');
367
+ expect((image.element as HTMLImageElement).style.aspectRatio).toBe('4 / 5');
348
368
  expect(cards[0]!.get('[data-part="cardTitle"]').text()).toBe('Ash glaze mug');
349
369
  expect(cards[0]!.get('[data-part="cardPrice"]').text()).toMatch(/28/);
350
370
  expect(cards[1]!.get('img').attributes('src')).toBe('https://media.test/winter-md.jpg');
@@ -543,11 +563,20 @@ describe('header block (navigation apiId)', () => {
543
563
  expect(spacer.classes()).toContain('@container');
544
564
  expect(spacer.classes()).toContain('border-b');
545
565
  expect(spacer.classes()).toContain('border-transparent');
546
- const reserved = spacer.get('div');
566
+ // The info strip's box first (the seed has one), then the bar's. The strip mirrors its own
567
+ // two boxes too: the hairline on the outer, the height on the inner, so the border adds to
568
+ // the height (36px + 1px) rather than eating into it (`border-box`).
569
+ const [strip, reserved] = spacer.findAll(':scope > div');
570
+ const info = wrapper.get('[data-eldra-header-info]');
571
+ expect(info.classes()).toContain('border-b');
572
+ expect(strip!.classes()).toContain('border-b');
573
+ expect(strip!.classes()).not.toContain('min-h-9');
574
+ expect(info.get(':scope > div').classes()).toContain('min-h-9');
575
+ expect(strip!.get(':scope > div').classes()).toContain('min-h-9');
547
576
  const bar = wrapper.get('[data-eldra-header-bar]');
548
- for (const height of ['h-16', '@content:h-[4.5rem]']) {
577
+ for (const height of ['min-h-[4.5rem]', '@max-[47.5625rem]:min-h-[3.75rem]']) {
549
578
  expect(bar.classes()).toContain(height);
550
- expect(reserved.classes()).toContain(height);
579
+ expect(reserved!.classes()).toContain(height);
551
580
  }
552
581
 
553
582
  wrapper.unmount();
@@ -645,7 +674,7 @@ describe('header block (navigation apiId)', () => {
645
674
  window.dispatchEvent(new Event('scroll'));
646
675
  await nextTick();
647
676
  };
648
- const searchButton = wrapper.get('button[aria-label="Search"]');
677
+ const searchButton = searchTool(wrapper);
649
678
 
650
679
  await searchButton.trigger('focusin');
651
680
  await scrollTo(300);
@@ -1215,38 +1244,37 @@ describe('header block (navigation apiId)', () => {
1215
1244
  });
1216
1245
 
1217
1246
  /**
1218
- * A corner badge, not the spec's own "1.25rem, flush right,
1219
- * ring" pill — that reading put the pill beside the bag's icon rather than on it. 0.875rem
1220
- * (`-3.5`) square, nudged just outside the button's own top-right corner (`-top-0.5
1221
- * -right-0.5`: `top-0.5 right-0.5` was tried first and, measured in a real browser, still
1222
- * buried roughly a third of the icon under it), no ring (a ring separates a pill from what
1223
- * sits *beside* it; this one sits deliberately *on* the icon's corner). `Badge`'s own
1224
- * `min-h-6`/`text-badge` must not survive the merge — that overshoot (1.5rem tall, the wrong
1225
- * type scale) was the original defect.
1247
+ * The Northwind design's corner badge on a labelled tool: 1.125rem tall, `0.6875rem` bold
1248
+ * figures, at the tool's top-right (`top-0.5 right-1.5`, `right-0.5` on a phone), no ring (a ring
1249
+ * separates a pill from what sits *beside* it; this one sits deliberately *on* the icon's
1250
+ * corner). `Badge`'s own `min-h-6`/`text-badge` must not survive the merge — that overshoot
1251
+ * (1.5rem tall, the wrong type scale) was the original defect. The real-browser measurement is
1252
+ * `test/countPill.browser.spec.ts`.
1226
1253
  */
1227
1254
  it('sizes and positions the pill as a corner badge, with none of Badge’s own oversized defaults left behind', async () => {
1228
1255
  const wrapper = mountWithCartCount(mock, 2);
1229
1256
  await nextTick();
1230
1257
  const badge = countPill(findCartButton(wrapper))!;
1231
1258
  for (const token of [
1232
- 'min-h-3.5',
1233
- 'min-w-3.5',
1234
- 'h-3.5',
1259
+ 'min-h-[1.125rem]',
1260
+ 'min-w-[1.125rem]',
1261
+ 'h-[1.125rem]',
1235
1262
  'px-1',
1236
- 'text-[0.625rem]',
1263
+ 'text-[0.6875rem]',
1237
1264
  'font-bold',
1238
1265
  'tabular-nums',
1239
1266
  'leading-none',
1240
- '-top-0.5',
1241
- '-right-0.5',
1267
+ 'top-0.5',
1268
+ 'right-1.5',
1269
+ '@max-[47.5625rem]:right-0.5',
1242
1270
  ]) {
1243
1271
  expect([...badge.classList]).toContain(token);
1244
1272
  }
1245
1273
  for (const stale of [
1246
1274
  'min-h-6',
1247
1275
  'text-badge',
1248
- 'top-0.5',
1249
- 'right-0.5',
1276
+ '-top-0.5',
1277
+ '-right-0.5',
1250
1278
  'ring-2',
1251
1279
  'ring-background',
1252
1280
  'min-h-5',
@@ -1318,7 +1346,7 @@ describe('header block (navigation apiId)', () => {
1318
1346
  function findHeart(wrapper: ReturnType<typeof mountBlock>) {
1319
1347
  return wrapper
1320
1348
  .findAll('a, button')
1321
- .find((control) => control.attributes('aria-label')?.startsWith('Wishlist'));
1349
+ .find((control) => control.attributes('aria-label')?.startsWith('Saved'));
1322
1350
  }
1323
1351
 
1324
1352
  function saveInBrowser(...handles: string[]): void {
@@ -1330,7 +1358,7 @@ describe('header block (navigation apiId)', () => {
1330
1358
  const heart = findHeart(wrapper)!;
1331
1359
  // No number in the name, so the prerendered header reads the same for every visitor — and
1332
1360
  // the destination is there from the first paint, not grown later.
1333
- expect(heart.attributes('aria-label')).toBe('Wishlist');
1361
+ expect(heart.attributes('aria-label')).toBe('Saved');
1334
1362
  expect(heart.attributes('href')).toBe('/wishlist');
1335
1363
  expect(countPill(heart)).toBeNull();
1336
1364
  // The bag's own pill is absent too (an empty cart), so this is the whole actions row: two
@@ -1361,7 +1389,7 @@ describe('header block (navigation apiId)', () => {
1361
1389
  await nextTick();
1362
1390
 
1363
1391
  const heart = findHeart(wrapper)!;
1364
- expect(heart.attributes('aria-label')).toBe('Wishlist, 1 item');
1392
+ expect(heart.attributes('aria-label')).toBe('Saved, 1 item');
1365
1393
  expect(heart.element.tagName).toBe('A');
1366
1394
  expect(heart.attributes('href')).toBe('/wishlist');
1367
1395
  // It is a link to a page, so it claims no popup — the same rule the bag's link form follows.
@@ -1374,7 +1402,7 @@ describe('header block (navigation apiId)', () => {
1374
1402
  await nextTick();
1375
1403
 
1376
1404
  const heart = findHeart(wrapper)!;
1377
- expect(heart.attributes('aria-label')).toBe('Wishlist, 2 items');
1405
+ expect(heart.attributes('aria-label')).toBe('Saved, 2 items');
1378
1406
  const badge = countPill(heart)!;
1379
1407
  expect(badge.getAttribute('aria-hidden')).toBe('true');
1380
1408
  expect(badge.textContent?.trim()).toBe('2');
@@ -1387,7 +1415,7 @@ describe('header block (navigation apiId)', () => {
1387
1415
  await nextTick();
1388
1416
 
1389
1417
  const heart = findHeart(wrapper)!;
1390
- expect(heart.attributes('aria-label')).toBe('Wishlist, 120 items');
1418
+ expect(heart.attributes('aria-label')).toBe('Saved, 120 items');
1391
1419
  expect(countPill(heart)?.textContent?.trim()).toBe('99+');
1392
1420
  });
1393
1421
 
@@ -1413,7 +1441,13 @@ describe('header block (navigation apiId)', () => {
1413
1441
  expect(heartPill.className).toBe(cartPill.className);
1414
1442
  // And the corner-badge classes are actually on it, not just shared with an equally-wrong
1415
1443
  // sibling.
1416
- for (const token of ['min-h-3.5', 'min-w-3.5', 'h-3.5', '-top-0.5', '-right-0.5']) {
1444
+ for (const token of [
1445
+ 'min-h-[1.125rem]',
1446
+ 'min-w-[1.125rem]',
1447
+ 'h-[1.125rem]',
1448
+ 'top-0.5',
1449
+ 'right-1.5',
1450
+ ]) {
1417
1451
  expect([...heartPill.classList]).toContain(token);
1418
1452
  }
1419
1453
  });
@@ -1431,7 +1465,7 @@ describe('header block (navigation apiId)', () => {
1431
1465
  * control's own, which is the state every prerendered page is served in. */
1432
1466
  it('is axe-clean with nothing saved, where the heart carries no pill', async () => {
1433
1467
  const wrapper = mountBlock(resolved.data);
1434
- expect(findHeart(wrapper)!.attributes('aria-label')).toBe('Wishlist');
1468
+ expect(findHeart(wrapper)!.attributes('aria-label')).toBe('Saved');
1435
1469
  expect(await axe(wrapper.element)).toHaveNoViolations();
1436
1470
  });
1437
1471
  });
@@ -1561,15 +1595,15 @@ describe('header block (navigation apiId)', () => {
1561
1595
  });
1562
1596
 
1563
1597
  describe('mega-menu panel geometry', () => {
1564
- // jsdom computes no layout, so the proof that the panel really lands on the brand's left edge
1565
- // and the actions' right edge is the browser case in `test/prerenderRefresh.browser.spec.ts`.
1566
- // What is checkable here is the arrangement that produces it: the panel is pinned to the
1567
- // header's own content box — the bar's grid — rather than to the item that opened it, and its
1568
- // columns are the container's 12-column grid.
1598
+ // jsdom computes no layout; what is checkable here is the arrangement. The Northwind panel is a
1599
+ // full-bleed sheet: pinned to the whole `<header>` (fixed when sticky, `relative` when not) rather
1600
+ // than to the item that opened it or to the bar's grid, with its columns held inside the same
1601
+ // wide container the bar uses.
1569
1602
  it('pins the panel to the header container, not to the trigger that opened it', async () => {
1570
1603
  const wrapper = mountBlock(resolved.data, { attachTo: document.body });
1571
- // The bar's grid is the panel's positioning box; the menu's own root takes no box at all.
1572
- expect(wrapper.get('[data-eldra-header-bar]').classes()).toContain('relative');
1604
+ // The header is the panel's positioning box; the bar's grid and the menu's own root take none.
1605
+ expect(wrapper.get('header').classes()).toContain('fixed');
1606
+ expect(wrapper.get('[data-eldra-header-bar]').classes()).not.toContain('relative');
1573
1607
  const root = [...menuRoot(wrapper).classList];
1574
1608
  expect(root).toContain('static');
1575
1609
  expect(root).toContain('contents');
@@ -1589,30 +1623,34 @@ describe('header block (navigation apiId)', () => {
1589
1623
  const panelTokens = panel.classes().map((token) => token.replace(/^eldra:/, ''));
1590
1624
  expect(panelTokens).not.toContain('w-screen');
1591
1625
  expect(panelTokens.some((token) => token.startsWith('max-w-'))).toBe(false);
1592
- // The bar's own bottom border is the sheet's top edge, so only the other three sides and corners are drawn.
1626
+ // The bar's own bottom border is the sheet's top edge; the sheet draws only a bottom rule and
1627
+ // the float shadow, square-cornered, 2rem above and below, the page's own gutters at the sides.
1593
1628
  const sheet = panel.get('[data-part="content"]').classes();
1594
1629
  for (const token of [
1595
- 'eldra:border',
1596
- 'border-t-0',
1597
- 'eldra:border-border',
1598
1630
  'rounded-none',
1599
- 'rounded-b-lg',
1631
+ 'border-0',
1632
+ 'border-b',
1633
+ 'border-border',
1600
1634
  'shadow-(--eldra-shadow-float)',
1601
- 'eldra:p-6',
1602
- '@wide:p-8',
1635
+ 'py-8',
1636
+ 'px-(--eldra-gutter-mobile)',
1637
+ '@tablet:px-(--eldra-gutter-tablet)',
1638
+ '@content:px-(--eldra-gutter-desktop)',
1603
1639
  ]) {
1604
1640
  expect(sheet).toContain(token);
1605
1641
  }
1606
1642
 
1607
- // The container's grid: 12 columns, 24px gutters, and an inset that keeps every column off
1608
- // the panel's own edges — 24px, 32px once the container passes `wide`. The browser case
1609
- // measures what this produces; here it is only the arrangement.
1643
+ // The columns: inside the wide container, 12 tracks with 2rem gutters.
1610
1644
  const columns = panel.get('[data-part="columns"]').classes();
1611
- for (const token of ['eldra:grid', 'grid-cols-12', 'gap-6']) {
1645
+ for (const token of [
1646
+ 'eldra:grid',
1647
+ 'grid-cols-12',
1648
+ 'gap-8',
1649
+ 'mx-auto',
1650
+ 'max-w-[calc(var(--eldra-container-wide)-2*var(--eldra-gutter-desktop))]',
1651
+ ]) {
1612
1652
  expect(columns).toContain(token);
1613
1653
  }
1614
- expect(sheet).not.toContain('eldra:py-8');
1615
- expect(sheet).not.toContain('py-8');
1616
1654
  wrapper.unmount();
1617
1655
  });
1618
1656
 
@@ -1738,7 +1776,7 @@ describe('header block (navigation apiId)', () => {
1738
1776
 
1739
1777
  it('the search control has aria-haspopup="dialog" and opens SearchModal', async () => {
1740
1778
  const wrapper = mountBlock(resolved.data, { attachTo: document.body });
1741
- const searchButton = wrapper.get('button[aria-label="Search"]');
1779
+ const searchButton = searchTool(wrapper);
1742
1780
  expect(searchButton.attributes('aria-haspopup')).toBe('dialog');
1743
1781
  await searchButton.trigger('click');
1744
1782
  const dialogs = wrapper.findAll('dialog');
@@ -1823,7 +1861,7 @@ describe('header block (navigation apiId)', () => {
1823
1861
  }
1824
1862
 
1825
1863
  async function openOverlay(wrapper: ReturnType<typeof mountWithSearch>) {
1826
- await wrapper.get('button[aria-label="Search"]').trigger('click');
1864
+ await searchTool(wrapper).trigger('click');
1827
1865
  return wrapper.get('dialog[open] input[type="search"]');
1828
1866
  }
1829
1867
 
@@ -1956,32 +1994,43 @@ describe('header block (navigation apiId)', () => {
1956
1994
  });
1957
1995
 
1958
1996
  describe('actions row spacing', () => {
1959
- // Regression for an uneven header: a `@tablet:gap-4` on the bar's own grid put 1rem between
1960
- // the search column and this row, against the 0.25rem `gap-1` puts between its own buttons —
1961
- // so search read as detached from the wishlist/cart cluster, which themselves looked glued
1962
- // together.
1963
- it('puts one 0.25rem gap everywhere in the bar’s grid — never a larger one between columns', () => {
1997
+ // Below 68.8125rem the brand is centred by symmetry alone: Menu and Search on one side, Saved
1998
+ // and Cart on the other, all one fixed width, with the grid's gap equal to the actions row's own
1999
+ // — so the two sides measure the same. A larger gap on either breaks the centring.
2000
+ it('puts the same 0.125rem gap in the bar’s grid and in the actions row, so the brand stays centred', () => {
1964
2001
  const wrapper = mountBlock(resolved.data);
1965
2002
  const bar = wrapper.get('[data-eldra-header-bar]');
1966
- expect(bar.classes()).toContain('gap-1');
1967
- expect(bar.classes().some((cls) => cls.includes('gap-4'))).toBe(false);
1968
-
2003
+ expect(bar.classes()).toContain('gap-x-0.5');
2004
+ expect(bar.classes()).toContain(
2005
+ 'grid-cols-[auto_auto_minmax(0,1fr)_minmax(0,auto)_minmax(0,1fr)_auto]'
2006
+ );
1969
2007
  const actions = wrapper.get('[data-eldra-header-actions]');
1970
- expect(actions.classes()).toContain('gap-1');
2008
+ expect(actions.classes()).toContain('gap-0.5');
2009
+ // Every tool on either side is the same fixed width.
2010
+ const menu = wrapper.get('button[aria-label="Menu"]');
2011
+ const saved = wrapper.get('[aria-label^="Saved"]');
2012
+ const tools = [menu, searchTool(wrapper), saved, findCartButtonIn(wrapper)!];
2013
+ for (const tool of tools) {
2014
+ expect(tool.classes()).toEqual(
2015
+ expect.arrayContaining(['w-14', '@max-[47.5625rem]:w-11', '@max-[22.5rem]:w-10'])
2016
+ );
2017
+ }
1971
2018
  });
1972
2019
 
1973
2020
  it('gives the call to action its own 0.75rem from the cart, not only the row’s 0.25rem gap', () => {
1974
2021
  const wrapper = mountBlock(resolved.data);
1975
2022
  const actions = wrapper.get('[data-eldra-header-actions]');
1976
2023
  const cta = actions.findAll('a, button').find((el) => el.text() === mock.ctaLabel)!;
1977
- // 0.5rem of margin on top of the row's own 0.25rem `gap-1` — spec "Header" -> Layout, "From
1978
- // 64rem": the call to action "sits 0.75rem after the cart".
1979
- expect(cta.classes()).toContain('@content:ml-2');
2024
+ // 0.625rem of margin on top of the row's own 0.125rem gap: the call to action "sits 0.75rem
2025
+ // after the cart".
2026
+ expect(cta.classes()).toContain('ml-2.5');
1980
2027
  // And the row's only hidden/visible pair lands on the button's own root — the flex item the
1981
2028
  // row's `gap-1` actually counts — not on a wrapper around it. A wrapper carrying `hidden`
1982
2029
  // while the button inside it carries the visible class would still occupy a gap slot: the
1983
2030
  // parent check is what rules that out, not just the classes existing somewhere in the tree.
1984
- expect(cta.classes()).toEqual(expect.arrayContaining(['hidden', '@content:inline-flex']));
2031
+ expect(cta.classes()).toEqual(
2032
+ expect.arrayContaining(['hidden', '@min-[68.8125rem]:inline-flex'])
2033
+ );
1985
2034
  expect(cta.element.parentElement).toBe(actions.element);
1986
2035
  });
1987
2036
  });
@@ -2009,7 +2058,7 @@ describe('header block (navigation apiId)', () => {
2009
2058
  // The bar's link list is not drawn at all with nothing in it, so no empty `<ul>` is left
2010
2059
  // sitting in the grid.
2011
2060
  expect(wrapper.find('ul.list-none.items-center').exists()).toBe(false);
2012
- expect(wrapper.find('button[aria-label="Search"]').exists()).toBe(true);
2061
+ expect(findSearchTool(wrapper)).toBeDefined();
2013
2062
  expect(wrapper.find('[aria-label="Cart, empty"]').exists()).toBe(true);
2014
2063
  expect(await axe(wrapper.element)).toHaveNoViolations();
2015
2064
  });
@@ -2018,7 +2067,7 @@ describe('header block (navigation apiId)', () => {
2018
2067
  // The drawer holds the links and the call to action. With neither there is nothing to open,
2019
2068
  // and a Menu button that opens an empty sheet is a control that does nothing.
2020
2069
  const wrapper = mountBlock(SEEDED);
2021
- expect(wrapper.find('button[aria-label="Open menu"]').exists()).toBe(false);
2070
+ expect(wrapper.find('button[aria-label="Menu"]').exists()).toBe(false);
2022
2071
  // `dialog[aria-label="Menu"]` is the drawer itself; the search overlay's own `<dialog>`
2023
2072
  // renders either way, so the drawer has to be named rather than counted.
2024
2073
  expect(wrapper.find('dialog[aria-label="Menu"]').exists()).toBe(false);
@@ -2031,7 +2080,7 @@ describe('header block (navigation apiId)', () => {
2031
2080
  { ...SEEDED, ctaLabel: 'Shop', cta: { kind: 'url', url: '/collections/all' } },
2032
2081
  ]) {
2033
2082
  const wrapper = mountBlock(data);
2034
- expect(wrapper.find('button[aria-label="Open menu"]').exists()).toBe(true);
2083
+ expect(wrapper.find('button[aria-label="Menu"]').exists()).toBe(true);
2035
2084
  }
2036
2085
  });
2037
2086
 
@@ -2049,7 +2098,7 @@ describe('header block (navigation apiId)', () => {
2049
2098
  wrapper.findAll('a, button').some((control) => control.attributes('href') === '/account')
2050
2099
  ).toBe(false);
2051
2100
  expect(wrapper.text()).not.toContain('Account');
2052
- expect(wrapper.find('button[aria-label="Open menu"]').exists()).toBe(false);
2101
+ expect(wrapper.find('button[aria-label="Menu"]').exists()).toBe(false);
2053
2102
  expect(wrapper.find('dialog[aria-label="Menu"]').exists()).toBe(false);
2054
2103
  }
2055
2104
  });
@@ -2212,3 +2261,292 @@ describe('header block (navigation apiId)', () => {
2212
2261
  });
2213
2262
  });
2214
2263
  });
2264
+
2265
+ /**
2266
+ * The redesigned seed: an info strip, labelled tools, a scalable brand, and a menu of sections with
2267
+ * cards, a badge and a dropdown — the Northwind design's header boards.
2268
+ */
2269
+ describe('the Northwind menu (the seed’s own)', () => {
2270
+ const PRODUCT_TEMPLATE = {
2271
+ id: 'rt-product',
2272
+ data: { schemaApiId: 'catalog:product', routePattern: '/products/:slug', slugField: 'slug' },
2273
+ };
2274
+ const PRODUCT_TARGETS: Record<string, { image: string; price: number }> = {
2275
+ 'speckled-latte-mug': { image: '/images/mug.webp', price: 28 },
2276
+ 'merino-crew-sweater': { image: '/images/sweater.webp', price: 96 },
2277
+ 'hand-thrown-serving-bowl': { image: '/images/bowl.webp', price: 64 },
2278
+ };
2279
+ const northwind = resolveTargets(seed);
2280
+ const links = {
2281
+ templates: [COLLECTION_TEMPLATE, PRODUCT_TEMPLATE] as (typeof COLLECTION_TEMPLATE)[],
2282
+ targets: new Map(
2283
+ [...northwind.links.targets].map(([key, info]) => {
2284
+ const slug = (info as { slug: string }).slug;
2285
+ const extra = key.startsWith('product:') ? PRODUCT_TARGETS[slug] : undefined;
2286
+ return [key, { ...(info as object), ...extra }];
2287
+ })
2288
+ ),
2289
+ };
2290
+ function mountSeed(data: Record<string, unknown> = {}) {
2291
+ return mount(Block, {
2292
+ ...mountOptions({ entry: { id: 'e1', data: { ...northwind.data, ...data } } }, { links }),
2293
+ attachTo: document.body,
2294
+ });
2295
+ }
2296
+ type Wrapper = ReturnType<typeof mountSeed>;
2297
+ const trigger = (wrapper: Wrapper, label: string) =>
2298
+ wrapper.findAll('button').find((button) => button.text().includes(label))!;
2299
+ const panel = (wrapper: Wrapper, label: string) =>
2300
+ wrapper.get(`#${trigger(wrapper, label).attributes('aria-controls')}`);
2301
+
2302
+ afterEach(() => {
2303
+ document.body.innerHTML = '';
2304
+ });
2305
+
2306
+ it('renders the seed axe-clean in every variant', async () => {
2307
+ for (const variant of ['default', 'centered', 'minimal']) {
2308
+ const wrapper = mountSeed({ variant });
2309
+ expect(await axe(wrapper.element), variant).toHaveNoViolations();
2310
+ wrapper.unmount();
2311
+ }
2312
+ });
2313
+
2314
+ describe('info strip', () => {
2315
+ it('is a named region: the start items with icons, the end items as links', async () => {
2316
+ const wrapper = mountSeed();
2317
+ const strip = wrapper.get('[data-eldra-header-info]');
2318
+ expect(strip.attributes('role')).toBe('region');
2319
+ expect(strip.attributes('aria-label')).toBe('Store information');
2320
+ const [start, end] = strip.findAll('ul');
2321
+ expect(start!.findAll('li').map((li) => li.text())).toEqual([
2322
+ 'Free delivery over $80',
2323
+ '30-day returns',
2324
+ 'Shop open today 10–18',
2325
+ ]);
2326
+ const phone = end!.findAll('a').find((a) => a.text() === '(555) 014-2290')!;
2327
+ expect(phone.attributes('href')).toBe('tel:+15550142290');
2328
+ expect(await axe(wrapper.element)).toHaveNoViolations();
2329
+ });
2330
+
2331
+ it('keeps only the first item on a phone, and moves the end of the strip into the drawer', () => {
2332
+ const wrapper = mountSeed();
2333
+ const [start, end] = wrapper.get('[data-eldra-header-info]').findAll('ul');
2334
+ const items = start!.findAll('li');
2335
+ expect(items[0]!.classes()).not.toContain('@max-[47.5625rem]:hidden');
2336
+ for (const item of items.slice(1))
2337
+ expect(item.classes()).toContain('@max-[47.5625rem]:hidden');
2338
+ expect(end!.classes()).toContain('@max-[68.8125rem]:hidden');
2339
+ // The drawer's footer repeats the end links the strip hides there.
2340
+ const drawerLinks = wrapper.get('[data-eldra-header-drawer-links]');
2341
+ expect(drawerLinks.text()).toContain('Order status');
2342
+ expect(drawerLinks.text()).toContain('(555) 014-2290');
2343
+ expect(drawerLinks.text()).toContain('Saved items');
2344
+ });
2345
+
2346
+ it('is not drawn with no items, and drops a javascript: link to plain text', () => {
2347
+ const empty = mountSeed({ infoItems: [] });
2348
+ expect(empty.find('[data-eldra-header-info]').exists()).toBe(false);
2349
+ empty.unmount();
2350
+ const wrapper = mountSeed({
2351
+ infoItems: [{ text: 'Call us', href: 'javascript:alert(1)' }],
2352
+ });
2353
+ const strip = wrapper.get('[data-eldra-header-info]');
2354
+ expect(strip.find('a').exists()).toBe(false);
2355
+ expect(strip.text()).toBe('Call us');
2356
+ });
2357
+ });
2358
+
2359
+ describe('labelled tools', () => {
2360
+ it('names every tool with its visible label first (WCAG 2.5.3)', async () => {
2361
+ const wrapper = mountSeed();
2362
+ const menu = wrapper.get('button[aria-label="Menu"]');
2363
+ expect(menu.text()).toBe('Menu');
2364
+ const search = wrapper
2365
+ .findAll('button')
2366
+ .filter((button) => button.text().trim() === 'Search');
2367
+ expect(search).toHaveLength(1);
2368
+ expect(search[0]!.attributes('aria-label')).toBeUndefined();
2369
+ // The design's pill field, from 80rem; the Search tool below it.
2370
+ const pill = wrapper.findAll('button').find((b) => b.text().trim() === 'Search the shop')!;
2371
+ expect(pill.classes()).toEqual(expect.arrayContaining(['hidden', '@wide:inline-flex']));
2372
+ expect(search[0]!.classes()).toContain('@wide:hidden');
2373
+ for (const tool of [
2374
+ wrapper.get('[aria-label^="Saved"]'),
2375
+ wrapper.get('[aria-label^="Cart"]'),
2376
+ ]) {
2377
+ const label = tool.get('[data-part="label"]').text().trim();
2378
+ expect(tool.attributes('aria-label')!.startsWith(label)).toBe(true);
2379
+ }
2380
+ });
2381
+
2382
+ it('shows Account only when it is linked, as a tool and in the drawer', async () => {
2383
+ const bare = mountSeed();
2384
+ expect(bare.text()).not.toContain('Account');
2385
+ bare.unmount();
2386
+ const wrapper = mountSeed({ account: { kind: 'url', url: '/account' } });
2387
+ const tools = wrapper
2388
+ .get('[data-eldra-header-actions]')
2389
+ .findAll('a')
2390
+ .filter((a) => a.text().trim() === 'Account');
2391
+ expect(tools).toHaveLength(1);
2392
+ expect(tools[0]!.attributes('href')).toBe('/account');
2393
+ expect(tools[0]!.classes()).toContain('@max-[68.8125rem]:hidden');
2394
+ expect(wrapper.get('[data-eldra-header-drawer-links]').text()).toContain('Account');
2395
+ expect(await axe(wrapper.element)).toHaveNoViolations();
2396
+ });
2397
+ });
2398
+
2399
+ describe('brand', () => {
2400
+ const logo = (width: number, height: number) => ({
2401
+ assetId: 'logo',
2402
+ url: '/logo.svg',
2403
+ altText: 'Northwind Goods',
2404
+ width,
2405
+ height,
2406
+ });
2407
+ const mark = { assetId: 'mark', url: '/mark.svg', altText: '', width: 64, height: 64 };
2408
+ const brand = (wrapper: Wrapper) => wrapper.get('[data-eldra-header-brand]');
2409
+
2410
+ it('names the link once, so whichever picture a width shows, it reads the same', async () => {
2411
+ const wrapper = mountSeed({ brandMark: mark, brandLogo: logo(300, 100) });
2412
+ expect(brand(wrapper).attributes('aria-label')).toBe('Northwind Goods, home');
2413
+ for (const img of brand(wrapper).findAll('img')) expect(img.attributes('alt')).toBe('');
2414
+ expect(await axe(wrapper.element)).toHaveNoViolations();
2415
+ });
2416
+
2417
+ it('draws a mark beside the wordmark, and the mark alone below 400px', () => {
2418
+ const wrapper = mountSeed({ brandMark: mark });
2419
+ const [img] = brand(wrapper).findAll('img');
2420
+ expect(img!.classes()).not.toContain('hidden');
2421
+ expect(brand(wrapper).get('span span').classes()).toContain('@max-[25.0625rem]:hidden');
2422
+ });
2423
+
2424
+ it('swaps a logo for its mark below 400px', () => {
2425
+ const wrapper = mountSeed({ brandMark: mark, brandLogo: logo(300, 100) });
2426
+ const [markImg, logoImg] = brand(wrapper).findAll('img');
2427
+ expect(markImg!.classes()).toEqual(
2428
+ expect.arrayContaining(['hidden', '@max-[25.0625rem]:block'])
2429
+ );
2430
+ expect(logoImg!.classes()).toContain('@max-[25.0625rem]:hidden');
2431
+ expect(brand(wrapper).text()).toBe('');
2432
+ });
2433
+
2434
+ it('prints the store name below 400px for a logo wider than 4:1 with no mark', () => {
2435
+ const wrapper = mountSeed({ brandLogo: logo(1000, 100) });
2436
+ const [logoImg] = brand(wrapper).findAll('img');
2437
+ expect(logoImg!.classes()).toContain('@max-[25.0625rem]:hidden');
2438
+ const name = brand(wrapper).get('span span');
2439
+ expect(name.text()).toBe('Northwind Goods');
2440
+ expect(name.classes()).toEqual(expect.arrayContaining(['hidden', '@max-[25.0625rem]:block']));
2441
+ });
2442
+
2443
+ it('keeps a logo of 4:1 or narrower at every width, sized by height', () => {
2444
+ const wrapper = mountSeed({ brandLogo: logo(400, 100) });
2445
+ const [logoImg] = brand(wrapper).findAll('img');
2446
+ expect(logoImg!.classes()).toEqual(
2447
+ expect.arrayContaining(['h-9', 'w-auto', 'max-w-60', '@max-[47.5625rem]:max-h-8'])
2448
+ );
2449
+ expect(logoImg!.classes()).not.toContain('@max-[25.0625rem]:hidden');
2450
+ expect(brand(wrapper).text()).toBe('');
2451
+ });
2452
+
2453
+ it('wraps a text-only wordmark onto two centred lines below 360px', () => {
2454
+ const wrapper = mountSeed();
2455
+ const name = brand(wrapper).get('span span');
2456
+ expect(name.classes()).toEqual(
2457
+ expect.arrayContaining([
2458
+ '@max-[22.5rem]:whitespace-normal',
2459
+ '@max-[22.5rem]:text-center',
2460
+ '@max-[22.5rem]:max-w-[5.75rem]',
2461
+ ])
2462
+ );
2463
+ });
2464
+ });
2465
+
2466
+ describe('panels', () => {
2467
+ it('draws column headings, linked or plain, a badge and a see-all link', async () => {
2468
+ const wrapper = mountSeed();
2469
+ await trigger(wrapper, 'Ceramics').trigger('click');
2470
+ const ceramics = panel(wrapper, 'Ceramics');
2471
+ const headings = ceramics.findAll('[data-part="groupHeading"]');
2472
+ expect(headings.map((heading) => heading.text())).toEqual([
2473
+ 'By type',
2474
+ 'By glaze',
2475
+ 'Makers',
2476
+ 'Best sellers',
2477
+ ]);
2478
+ expect(headings[0]!.find('a').exists()).toBe(true);
2479
+ expect(headings[1]!.find('a').exists()).toBe(false);
2480
+ const vases = ceramics.findAll('a').find((a) => a.text().startsWith('Vases'))!;
2481
+ expect(vases.get('[data-part="label"]').text()).toBe('New');
2482
+ const seeAll = ceramics.get('[data-see-all]');
2483
+ expect(seeAll.text()).toBe('All ceramics');
2484
+ expect(seeAll.attributes('href')).toBe('/categories/home/ceramics');
2485
+ // A column's own see-all link stands in for the panel's "View all" row.
2486
+ expect(ceramics.find('[data-eldra-mega-view-all]').exists()).toBe(false);
2487
+ expect(await axe(wrapper.element)).toHaveNoViolations();
2488
+ });
2489
+
2490
+ it('draws product cards with their picture, title and price', async () => {
2491
+ const wrapper = mountSeed();
2492
+ await trigger(wrapper, 'Shop').trigger('click');
2493
+ const cards = panel(wrapper, 'Shop').findAll('[data-part="card"]');
2494
+ expect(cards).toHaveLength(2);
2495
+ expect(cards[0]!.get('img').attributes('src')).toBe('/images/mug.webp');
2496
+ expect(cards[0]!.get('[data-part="cardTitle"]').text()).toBe('Speckled latte mug');
2497
+ expect(cards[0]!.find('[data-part="cardPrice"]').exists()).toBe(true);
2498
+ expect(cards[0]!.element.closest('a')!.getAttribute('href')).toBe(
2499
+ '/products/speckled-latte-mug'
2500
+ );
2501
+ });
2502
+
2503
+ it('hangs a one-column panel with no heading under its trigger, descriptions under the links', async () => {
2504
+ const wrapper = mountSeed();
2505
+ await trigger(wrapper, 'Journal').trigger('click');
2506
+ const journal = panel(wrapper, 'Journal');
2507
+ expect(journal.get('[data-part="content"]').classes()).toContain(
2508
+ 'eldra:eldra-nav-menu-dropdown'
2509
+ );
2510
+ expect(journal.findAll('[data-part="description"]').map((d) => d.text())).toEqual([
2511
+ 'Washing linen, seasoning boards, storing wool',
2512
+ 'Mornings with the people who make our goods',
2513
+ 'Small rituals and slow mornings',
2514
+ ]);
2515
+ expect(await axe(wrapper.element)).toHaveNoViolations();
2516
+ });
2517
+
2518
+ it('opens the dropdown from the keyboard and walks its links', async () => {
2519
+ const wrapper = mountSeed();
2520
+ const journal = trigger(wrapper, 'Journal');
2521
+ (journal.element as HTMLElement).focus();
2522
+ await journal.trigger('keydown', { key: 'ArrowDown' });
2523
+ await nextTick();
2524
+ expect(journal.attributes('aria-expanded')).toBe('true');
2525
+ const rows = panel(wrapper, 'Journal').findAll('a');
2526
+ expect(document.activeElement).toBe(rows[0]!.element);
2527
+ await rows[0]!.trigger('keydown', { key: 'ArrowDown' });
2528
+ expect(document.activeElement).toBe(rows[1]!.element);
2529
+ await rows[1]!.trigger('keydown', { key: 'Escape' });
2530
+ await nextTick();
2531
+ expect(journal.attributes('aria-expanded')).toBe('false');
2532
+ expect(document.activeElement).toBe(journal.element);
2533
+ });
2534
+
2535
+ it('lays the drawer out as an accordion by default, and as open sections on request', async () => {
2536
+ const accordion = mountSeed();
2537
+ expect(accordion.find('[data-part="drawerSectionHeading"]').exists()).toBe(false);
2538
+ accordion.unmount();
2539
+ const sections = mountSeed({ drawerLayout: 'sections' });
2540
+ const headings = sections.findAll('[data-part="drawerSectionHeading"]');
2541
+ expect(headings.map((heading) => heading.text())).toEqual(['Shop', 'Ceramics', 'Journal']);
2542
+ expect(await axe(sections.element)).toHaveNoViolations();
2543
+ });
2544
+ });
2545
+
2546
+ it('pads the fixed bar by the scrollbar width an open overlay takes away', () => {
2547
+ expect(mountSeed().get('header').classes()).toContain('pr-(--eldra-scrollbar-width,0px)');
2548
+ expect(mountSeed({ sticky: false }).get('header').classes()).not.toContain(
2549
+ 'pr-(--eldra-scrollbar-width,0px)'
2550
+ );
2551
+ });
2552
+ });