@eldrajs/theme-cli 0.2.3 → 0.2.5

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 (136) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +6 -0
  3. package/dist/cli.js +9 -4
  4. package/dist/index.d.ts +6 -12
  5. package/dist/index.js +1 -1
  6. package/dist/{validate-DprFpjV7.js → validate-CC6Mp5i_.js} +11 -19
  7. package/package.json +3 -3
  8. package/template/.eldra/previews.json +35 -35
  9. package/template/README.md +3 -1
  10. package/template/app/app.vue +1 -3
  11. package/template/app/assets/main.css +13 -15
  12. package/template/app/components/ui/UiImage.vue +29 -17
  13. package/template/app/components/ui/__tests__/UiImage.spec.ts +24 -15
  14. package/template/app/pages/[...slug].vue +1 -1
  15. package/template/app/storefront/gateway.ts +0 -3
  16. package/template/app/storefront/structuredData.ts +2 -2
  17. package/template/app/storefront/types.ts +0 -5
  18. package/template/app/utils/seoInput.ts +0 -1
  19. package/template/blocks/announcement-bar/Block.vue +3 -2
  20. package/template/blocks/announcement-bar/__tests__/Block.spec.ts +1 -1
  21. package/template/blocks/announcement-bar/preview.png +0 -0
  22. package/template/blocks/article/Block.vue +3 -4
  23. package/template/blocks/article/preview.png +0 -0
  24. package/template/blocks/article-list/Block.vue +18 -9
  25. package/template/blocks/article-list/preview.png +0 -0
  26. package/template/blocks/breadcrumbs/Block.vue +1 -1
  27. package/template/blocks/breadcrumbs/__tests__/Block.spec.ts +9 -9
  28. package/template/blocks/breadcrumbs/preview.png +0 -0
  29. package/template/blocks/cart/Block.vue +1 -1
  30. package/template/blocks/cart/parts/CartLines.vue +3 -2
  31. package/template/blocks/cart/parts/ShippingBar.vue +1 -1
  32. package/template/blocks/cart/parts/Summary.vue +5 -9
  33. package/template/blocks/cart/preview.png +0 -0
  34. package/template/blocks/collection-grid/Block.vue +11 -14
  35. package/template/blocks/collection-grid/__tests__/Block.spec.ts +12 -14
  36. package/template/blocks/collection-grid/preview.png +0 -0
  37. package/template/blocks/collection-header/Block.vue +5 -5
  38. package/template/blocks/collection-header/preview.png +0 -0
  39. package/template/blocks/contact/Block.vue +1 -1
  40. package/template/blocks/contact/__tests__/Block.spec.ts +2 -2
  41. package/template/blocks/contact/preview.png +0 -0
  42. package/template/blocks/cta/Block.vue +16 -18
  43. package/template/blocks/cta/__tests__/Block.spec.ts +8 -12
  44. package/template/blocks/cta/preview.png +0 -0
  45. package/template/blocks/faq/Block.vue +3 -13
  46. package/template/blocks/faq/__tests__/Block.spec.ts +2 -2
  47. package/template/blocks/faq/preview.png +0 -0
  48. package/template/blocks/feature-grid/Block.vue +1 -1
  49. package/template/blocks/feature-grid/__tests__/Block.spec.ts +1 -1
  50. package/template/blocks/feature-grid/preview.png +0 -0
  51. package/template/blocks/footer/Block.vue +14 -11
  52. package/template/blocks/footer/__tests__/Block.spec.ts +5 -5
  53. package/template/blocks/footer/preview.png +0 -0
  54. package/template/blocks/form/Block.vue +1 -1
  55. package/template/blocks/form/preview.png +0 -0
  56. package/template/blocks/gallery/__tests__/Block.spec.ts +1 -1
  57. package/template/blocks/gallery/preview.png +0 -0
  58. package/template/blocks/hero/Block.vue +8 -11
  59. package/template/blocks/hero/__tests__/Block.spec.ts +9 -7
  60. package/template/blocks/hero/preview.png +0 -0
  61. package/template/blocks/image/Block.vue +4 -4
  62. package/template/blocks/image/__tests__/Block.spec.ts +5 -6
  63. package/template/blocks/image/preview.png +0 -0
  64. package/template/blocks/logo-cloud/__tests__/Block.spec.ts +1 -1
  65. package/template/blocks/logo-cloud/preview.png +0 -0
  66. package/template/blocks/navigation/Block.vue +16 -26
  67. package/template/blocks/navigation/__tests__/Block.spec.ts +22 -20
  68. package/template/blocks/navigation/preview.png +0 -0
  69. package/template/blocks/newsletter/__tests__/Block.spec.ts +1 -1
  70. package/template/blocks/newsletter/preview.png +0 -0
  71. package/template/blocks/order-status/Block.vue +8 -9
  72. package/template/blocks/order-status/__tests__/Block.spec.ts +1 -2
  73. package/template/blocks/order-status/preview.png +0 -0
  74. package/template/blocks/pricing-table/__tests__/Block.spec.ts +1 -1
  75. package/template/blocks/pricing-table/preview.png +0 -0
  76. package/template/blocks/product-carousel/Block.vue +6 -6
  77. package/template/blocks/product-carousel/__tests__/Block.spec.ts +26 -8
  78. package/template/blocks/product-carousel/preview.png +0 -0
  79. package/template/blocks/product-detail/Block.vue +8 -8
  80. package/template/blocks/product-detail/__tests__/Block.spec.ts +1 -1
  81. package/template/blocks/product-detail/parts/Gallery.vue +1 -1
  82. package/template/blocks/product-detail/preview.png +0 -0
  83. package/template/blocks/quote/Block.vue +1 -1
  84. package/template/blocks/quote/__tests__/Block.spec.ts +7 -4
  85. package/template/blocks/quote/preview.png +0 -0
  86. package/template/blocks/rich-text/preview.png +0 -0
  87. package/template/blocks/search/Block.vue +2 -2
  88. package/template/blocks/search/PopularChips.vue +1 -1
  89. package/template/blocks/search/preview.png +0 -0
  90. package/template/blocks/split-content/Block.vue +2 -3
  91. package/template/blocks/split-content/__tests__/Block.spec.ts +2 -2
  92. package/template/blocks/split-content/preview.png +0 -0
  93. package/template/blocks/stats/__tests__/Block.spec.ts +1 -1
  94. package/template/blocks/stats/preview.png +0 -0
  95. package/template/blocks/tabs/Block.vue +4 -5
  96. package/template/blocks/tabs/__tests__/Block.spec.ts +2 -2
  97. package/template/blocks/tabs/preview.png +0 -0
  98. package/template/blocks/team/preview.png +0 -0
  99. package/template/blocks/testimonials/Block.vue +10 -9
  100. package/template/blocks/testimonials/__tests__/Block.spec.ts +1 -1
  101. package/template/blocks/testimonials/preview.png +0 -0
  102. package/template/blocks/timeline/__tests__/Block.spec.ts +2 -2
  103. package/template/blocks/timeline/preview.png +0 -0
  104. package/template/blocks/trust-strip/Block.vue +1 -1
  105. package/template/blocks/trust-strip/__tests__/Block.spec.ts +1 -1
  106. package/template/blocks/trust-strip/preview.png +0 -0
  107. package/template/blocks/video-embed/Block.vue +3 -3
  108. package/template/blocks/video-embed/__tests__/Block.spec.ts +1 -1
  109. package/template/blocks/video-embed/preview.png +0 -0
  110. package/template/blocks/wishlist/Block.vue +1 -1
  111. package/template/blocks/wishlist/preview.png +0 -0
  112. package/template/nuxt.config.ts +5 -4
  113. package/template/package.json +2 -1
  114. package/template/stories/pages/article.stories.ts +2 -3
  115. package/template/stories/pages/cart.stories.ts +2 -3
  116. package/template/stories/pages/category.stories.ts +2 -3
  117. package/template/stories/pages/collection.stories.ts +2 -3
  118. package/template/stories/pages/home.stories.ts +2 -3
  119. package/template/stories/pages/product.stories.ts +3 -4
  120. package/template/stories/pages/products.stories.ts +2 -3
  121. package/template/stories/pages/search.stories.ts +2 -3
  122. package/template/stories/pages/wishlist.stories.ts +2 -3
  123. package/template/test/carouselKeyboard.spec.ts +2 -2
  124. package/template/test/carouselRing.browser.spec.ts +2 -2
  125. package/template/test/carouselSlideWidth.browser.spec.ts +9 -9
  126. package/template/test/eldraIcon.spec.ts +1 -1
  127. package/template/test/mainCss.spec.ts +7 -0
  128. package/template/test/pages/article.spec.ts +5 -5
  129. package/template/test/pages/collection.spec.ts +5 -5
  130. package/template/test/pages/hydration.spec.ts +10 -10
  131. package/template/test/prerenderRefresh.browser.spec.ts +51 -1
  132. package/template/test/seoInput.spec.ts +5 -4
  133. package/template/test/storefront/structuredData.spec.ts +3 -6
  134. package/template/test/structuredData.generate.spec.ts +1 -1
  135. package/template/test/support/mockGateway.ts +8 -3
  136. package/template/test/support/mountPage.ts +2 -3
@@ -179,11 +179,6 @@ export interface StorefrontProduct extends StorefrontProductListItem {
179
179
  */
180
180
  inventory: number | null;
181
181
  shipsBy?: string | null;
182
- /**
183
- * The product's brand, when the platform carries one (`brand` on the public product read). Read
184
- * by the page's structured data only; the page itself does not show it.
185
- */
186
- brand?: string | null;
187
182
  /**
188
183
  * **Every variant, with the price and stock the page's own variant resolves from** — what the
189
184
  * page's structured data writes one offer per. Absent from a source that has no variants to
@@ -72,7 +72,6 @@ export function seoInput(parts: SeoInputParts): SeoInput {
72
72
  data['product.sku'] = text(variants[0]?.sku) ?? '';
73
73
  data['product.price'] = prices.length === 0 ? '' : parts.formatPrice(Math.min(...prices));
74
74
  data['product.shortDescription'] = shortDescription(entryData.description);
75
- data['product.brand'] = text(entryData.brand) ?? '';
76
75
  data['product.category'] = text(parts.productCategory) ?? '';
77
76
  contentImage = shareImage(list(entryData.images)[0]);
78
77
  } else if (catalogKind !== null) {
@@ -127,7 +127,7 @@ function moveFocusAfterDismiss(): void {
127
127
  * `Section` marks every ground, `none` included, with `data-section-bg`, which is what its own
128
128
  * adjacent-same-background CSS rule keys off to drop the *next* sibling's top padding — the reason
129
129
  * `breadcrumbs` deliberately avoids it (see that block's own comment). This bar needs `Section`
130
- * anyway: `background` is `primary` or `accent`, and `Section` is what marks `group/section` +
130
+ * anyway: `background` is `primary` or `accent`, and `Section` is what marks
131
131
  * `data-section` so the `Link` inside the bar inverts itself against an inverted ground.
132
132
  * Hand-rolling that marker would be re-implementing `Section`, which the starter's rules forbid
133
133
  * outright.
@@ -165,7 +165,8 @@ function moveFocusAfterDismiss(): void {
165
165
  :as="linkAs"
166
166
  variant="standalone"
167
167
  arrow
168
- :classes="{ root: 'ml-2', label: 'whitespace-nowrap' }"
168
+ class="ml-2"
169
+ :classes="{ label: 'whitespace-nowrap' }"
169
170
  >
170
171
  {{ data.linkLabel }}
171
172
  </Link>
@@ -188,7 +188,7 @@ describe('announcement-bar block', () => {
188
188
  it('the link is identifiable by its underline, not colour alone', () => {
189
189
  const wrapper = mountAnnouncement({ ...mock, linkHref: '/pages/shipping' });
190
190
  const link = wrapper.get('a');
191
- expect(link.classes()).toContain('underline');
191
+ expect(link.classes()).toContain('eldra:underline');
192
192
  });
193
193
 
194
194
  it('renders no editor placeholder (or anything else) for an empty message outside the editor', () => {
@@ -166,7 +166,7 @@ useRichTextScrollRegions(richTextRoot, (caption) => caption ?? t('article.richTe
166
166
  v-if="hasCategory"
167
167
  :href="categoryHref!"
168
168
  :as="categoryLinkAs"
169
- :classes="{ root: 'target-min text-accent inline-flex items-center font-semibold' }"
169
+ class="target-min text-accent inline-flex items-center font-semibold"
170
170
  >
171
171
  {{ categoryLabel }}
172
172
  </Link>
@@ -205,7 +205,7 @@ useRichTextScrollRegions(richTextRoot, (caption) => caption ?? t('article.richTe
205
205
  v-if="hasAuthorLink"
206
206
  :href="authorLinkHref!"
207
207
  :as="authorLinkAs"
208
- :classes="{ root: 'font-semibold' }"
208
+ class="font-semibold"
209
209
  >{{ authorName }}</Link
210
210
  ><template v-else>{{ authorName }}</template
211
211
  >{{ bylineRoleSuffix }}{{ bylineParts.after }}
@@ -233,10 +233,9 @@ useRichTextScrollRegions(richTextRoot, (caption) => caption ?? t('article.richTe
233
233
  <EditorPlaceholder
234
234
  v-else-if="showCoverHint"
235
235
  inline
236
- class="@tablet:mt-12 mt-8"
236
+ class="@tablet:mt-12 @tablet:aspect-[16/9] mt-8 aspect-[4/3] w-full"
237
237
  :label="t('article.coverHintLabel')"
238
238
  :help="t('article.coverHintHelp')"
239
- :classes="{ root: 'aspect-[4/3] w-full @tablet:aspect-[16/9]' }"
240
239
  />
241
240
  </Container>
242
241
 
Binary file
@@ -212,16 +212,24 @@ const GRID_ROOT_CLASS =
212
212
  const LIST_ROOT_CLASS = 'flex flex-col border-t border-border';
213
213
  const listContainerClass = computed(() => (isList.value ? LIST_ROOT_CLASS : GRID_ROOT_CLASS));
214
214
 
215
+ const FEATURED_CARD_CLASS =
216
+ 'grid gap-6 @tablet:grid-cols-[7fr_5fr] @tablet:items-center @tablet:gap-8 @content:gap-12';
215
217
  const FEATURED_CARD_CLASSES: Partial<Record<ContentCardPart, string>> = {
216
- root: 'grid gap-6 @tablet:grid-cols-[7fr_5fr] @tablet:items-center @tablet:gap-8 @content:gap-12',
217
218
  title: '@content:text-[2rem] @content:leading-[1.15]',
218
219
  body: '@content:gap-4',
219
220
  };
221
+ const LIST_CARD_CLASS =
222
+ 'grid grid-cols-[6.5rem_1fr] items-start gap-4 @tablet:grid-cols-[15rem_1fr] @tablet:items-center @tablet:gap-8';
220
223
  const LIST_CARD_CLASSES: Partial<Record<ContentCardPart, string>> = {
221
- root: 'grid grid-cols-[6.5rem_1fr] items-start gap-4 @tablet:grid-cols-[15rem_1fr] @tablet:items-center @tablet:gap-8',
222
224
  excerpt: '@max-tablet:hidden',
223
225
  };
224
226
 
227
+ function cardClass(card: CardView): string | undefined {
228
+ if (card.featured) return FEATURED_CARD_CLASS;
229
+ if (isList.value) return LIST_CARD_CLASS;
230
+ return undefined;
231
+ }
232
+
225
233
  function cardClasses(card: CardView): Partial<Record<ContentCardPart, string>> | undefined {
226
234
  if (card.featured) return FEATURED_CARD_CLASSES;
227
235
  if (isList.value) return LIST_CARD_CLASSES;
@@ -261,7 +269,7 @@ function itemWrapperClass(card: CardView): string {
261
269
  :as="viewAllLinkAs"
262
270
  variant="standalone"
263
271
  arrow
264
- :classes="{ root: 'text-control' }"
272
+ class="text-control"
265
273
  >
266
274
  {{ viewAllLabel }}
267
275
  </Link>
@@ -275,12 +283,12 @@ function itemWrapperClass(card: CardView): string {
275
283
  :as="filter.linkAs"
276
284
  :underline="false"
277
285
  :aria-current="filter.active ? 'true' : undefined"
278
- :classes="{
279
- root: filter.active
280
- ? 'inline-flex min-h-10 items-center rounded-full border border-primary bg-primary px-4 text-control font-semibold text-primary-contrast'
281
- : 'inline-flex min-h-10 items-center rounded-full border border-border-strong px-4 text-control font-medium text-text hover:border-text',
282
- label: 'inline-flex items-center gap-1',
283
- }"
286
+ :class="
287
+ filter.active
288
+ ? 'border-primary bg-primary text-control text-primary-contrast inline-flex min-h-10 items-center rounded-full border px-4 font-semibold'
289
+ : 'border-border-strong text-control text-text hover:border-text inline-flex min-h-10 items-center rounded-full border px-4 font-medium'
290
+ "
291
+ :classes="{ label: 'inline-flex items-center gap-1' }"
284
292
  >
285
293
  <EldraIcon v-if="filter.active" name="check" size="sm" />
286
294
  {{ filter.label }}
@@ -303,6 +311,7 @@ function itemWrapperClass(card: CardView): string {
303
311
  :meta="card.readingTime"
304
312
  :excerpt="card.dek"
305
313
  :heading-level="3"
314
+ :class="cardClass(card)"
306
315
  :classes="cardClasses(card)"
307
316
  />
308
317
  </li>
@@ -258,7 +258,7 @@ watchEffect(() => {
258
258
 
259
259
  <template>
260
260
  <div v-if="hasTrail" class="bg-background text-text @container">
261
- <Container :width="containerWidth" :classes="{ root: 'py-3' }">
261
+ <Container :width="containerWidth" class="py-3">
262
262
  <div ref="breadcrumbRoot" class="contents">
263
263
  <Breadcrumb
264
264
  :items="items"
@@ -118,7 +118,7 @@ describe('breadcrumbs block', () => {
118
118
  async (container) => {
119
119
  const wrapper = mountBlock({ ...mock, container });
120
120
  const wideOrContent =
121
- container === 'wide' ? 'eldra-container-wide' : 'eldra-container-content';
121
+ container === 'wide' ? 'eldra:eldra-container-wide' : 'eldra:eldra-container-content';
122
122
  expect(wrapper.getComponent(Container).classes()).toContain(wideOrContent);
123
123
  expect(await axe(wrapper.element)).toHaveNoViolations();
124
124
  }
@@ -189,20 +189,20 @@ describe('breadcrumbs block', () => {
189
189
 
190
190
  const hiddenLevels = wrapper
191
191
  .findAll('[data-part="item"]')
192
- .filter((item) => item.classes().includes('@max-tablet:hidden'));
192
+ .filter((item) => item.classes().includes('eldra:@max-tablet:hidden'));
193
193
  expect(hiddenLevels.map((item) => item.text())).toEqual(['Kitchen', 'Table & serving']);
194
194
  });
195
195
 
196
196
  it('reaches Home, then the "…" button, then the parent, in that order', () => {
197
- // The collapsed middle levels carry `@max-tablet:hidden` (a container-query class jsdom does
198
- // not evaluate — there is no real layout — so "reaches" is asserted the same way the
199
- // package's own Breadcrumb.spec.ts does: by document order over the levels that are *not*
200
- // collapse-hidden, which below the 48rem collapse threshold is exactly the operable Tab path
201
- // a real browser gives (a `display:none` element is never a Tab stop).
197
+ // The collapsed middle levels carry `eldra:@max-tablet:hidden` (a container-query class
198
+ // jsdom does not evaluate — there is no real layout — so "reaches" is asserted the same way
199
+ // the package's own Breadcrumb.spec.ts does: by document order over the levels that are
200
+ // *not* collapse-hidden, which below the 48rem collapse threshold is exactly the operable Tab
201
+ // path a real browser gives (a `display:none` element is never a Tab stop).
202
202
  const wrapper = mountBlock(deepTrailData);
203
203
  const visibleFocusable = wrapper
204
204
  .findAll('[data-part="item"]')
205
- .filter((item) => !item.classes().includes('@max-tablet:hidden'))
205
+ .filter((item) => !item.classes().includes('eldra:@max-tablet:hidden'))
206
206
  .map((item) => {
207
207
  const link = item.find('[data-part="link"]');
208
208
  if (link.exists()) return link.text();
@@ -239,7 +239,7 @@ describe('breadcrumbs block', () => {
239
239
 
240
240
  expect(wrapper.find('[data-part="ellipsis"]').exists()).toBe(false);
241
241
  for (const item of wrapper.findAll('[data-part="item"]')) {
242
- expect(item.classes()).not.toContain('@max-tablet:hidden');
242
+ expect(item.classes()).not.toContain('eldra:@max-tablet:hidden');
243
243
  }
244
244
 
245
245
  const links = wrapper.findAll('[data-part="link"]');
@@ -271,7 +271,7 @@ const DRAWER_CLASSES = {
271
271
  <span class="text-text text-base font-semibold">{{ t('cart.subtotal') }}</span>
272
272
  <Price
273
273
  :amount="money.minor(subtotal)"
274
- :classes="{ root: 'text-text text-base font-semibold tabular-nums' }"
274
+ class="text-text text-base font-semibold tabular-nums"
275
275
  />
276
276
  </div>
277
277
  <p v-if="note" class="text-muted text-body-sm text-center">{{ note }}</p>
@@ -207,7 +207,8 @@ const STEPPER_CLASSES = {
207
207
  <Price
208
208
  :amount="money.minor(line.unitPrice)"
209
209
  size="sm"
210
- :classes="{ root: 'inline', current: 'text-muted' }"
210
+ class="inline"
211
+ :classes="{ current: 'text-muted' }"
211
212
  />
212
213
  <span class="text-muted">{{ t('cart.each') }}</span>
213
214
  </div>
@@ -218,7 +219,7 @@ const STEPPER_CLASSES = {
218
219
  :aria-busy="busy"
219
220
  >
220
221
  <VisuallyHidden>{{ t('cart.lineTotal') }}</VisuallyHidden>
221
- <Price :amount="money.minor(line.lineTotal)" :classes="{ root: 'inline' }" />
222
+ <Price :amount="money.minor(line.lineTotal)" class="inline" />
222
223
  </div>
223
224
 
224
225
  <div
@@ -90,7 +90,7 @@ const rootClass = computed(() =>
90
90
  </template>
91
91
  <template v-else>
92
92
  <span>{{ awayParts.before }}</span>
93
- <Price :amount="money.minor(remaining)" :classes="{ root: 'inline font-semibold' }" />
93
+ <Price :amount="money.minor(remaining)" class="inline font-semibold" />
94
94
  <span>{{ awayParts.after }}</span>
95
95
  </template>
96
96
  </div>
@@ -229,7 +229,7 @@ const VALUE_CLASS = 'text-text text-body-sm font-medium tabular-nums';
229
229
  <div :class="ROW_CLASS">
230
230
  <dt :class="LABEL_CLASS">{{ t('cart.subtotal') }}</dt>
231
231
  <dd :class="VALUE_CLASS">
232
- <Price :amount="money.minor(totals.subtotal)" size="sm" :classes="{ root: 'inline' }" />
232
+ <Price :amount="money.minor(totals.subtotal)" size="sm" class="inline" />
233
233
  </dd>
234
234
  </div>
235
235
  <div v-if="discount" :class="ROW_CLASS">
@@ -238,7 +238,8 @@ const VALUE_CLASS = 'text-text text-body-sm font-medium tabular-nums';
238
238
  <Price
239
239
  :amount="money.minor(-discount.amount)"
240
240
  size="sm"
241
- :classes="{ root: 'inline', current: 'text-success' }"
241
+ class="inline"
242
+ :classes="{ current: 'text-success' }"
242
243
  />
243
244
  </dd>
244
245
  </div>
@@ -247,18 +248,13 @@ const VALUE_CLASS = 'text-text text-body-sm font-medium tabular-nums';
247
248
  <dd :class="VALUE_CLASS">
248
249
  <span v-if="totals.shipping === null">{{ t('cart.shippingPending') }}</span>
249
250
  <span v-else-if="totals.shipping === 0">{{ t('cart.shippingFree') }}</span>
250
- <Price
251
- v-else
252
- :amount="money.minor(totals.shipping)"
253
- size="sm"
254
- :classes="{ root: 'inline' }"
255
- />
251
+ <Price v-else :amount="money.minor(totals.shipping)" size="sm" class="inline" />
256
252
  </dd>
257
253
  </div>
258
254
  <div class="border-border flex items-baseline justify-between gap-4 border-t pt-3">
259
255
  <dt class="text-text text-base font-semibold">{{ t('cart.total') }}</dt>
260
256
  <dd class="text-text text-base font-semibold tabular-nums">
261
- <Price :amount="money.minor(totals.total)" :classes="{ root: 'inline' }" />
257
+ <Price :amount="money.minor(totals.total)" class="inline" />
262
258
  </dd>
263
259
  </div>
264
260
  </dl>
Binary file
@@ -135,7 +135,7 @@ const SortIcon = iconComponent('arrows-sort');
135
135
  * the width it is: two tracks of 14rem plus a gap do not fit a phone, and the card's minimum
136
136
  * would push the second column off the edge. The track decides the width here, as in the carousel.
137
137
  */
138
- const CARD_CLASSES = { root: 'min-w-0' } as const;
138
+ const CARD_CLASS = 'min-w-0';
139
139
  /** The freshly-inserted editor hint's box icon (spec States, "Empty (freshly inserted)"). */
140
140
  const BoxIcon = iconComponent('box');
141
141
 
@@ -1605,7 +1605,7 @@ function hrefForPage(page: number): string {
1605
1605
  v-if="hasCollection || showNoCollectionHint || showNoCategoryHint"
1606
1606
  spacing="none"
1607
1607
  :aria-label="sectionLabel"
1608
- :classes="{ root: 'pt-6 pb-[var(--eldra-section-md)]' }"
1608
+ class="pt-6 pb-[var(--eldra-section-md)]"
1609
1609
  >
1610
1610
  <Container width="wide">
1611
1611
  <EditorPlaceholder
@@ -1662,7 +1662,7 @@ function hrefForPage(page: number): string {
1662
1662
  v-if="hasFilters"
1663
1663
  variant="outline"
1664
1664
  :icon-left="AdjustmentsIcon"
1665
- :classes="{ container: 'min-h-11' }"
1665
+ class="min-h-11"
1666
1666
  aria-haspopup="dialog"
1667
1667
  :aria-expanded="drawerOpen ? 'true' : 'false'"
1668
1668
  :aria-controls="drawerId"
@@ -1673,7 +1673,7 @@ function hrefForPage(page: number): string {
1673
1673
  v-if="activeCount > 0"
1674
1674
  tone="primary"
1675
1675
  pill
1676
- :classes="{ root: 'ms-1' }"
1676
+ class="ms-1"
1677
1677
  :hidden-suffix="t('grid.nActive', { count: activeCount })"
1678
1678
  >
1679
1679
  <span aria-hidden="true">{{ activeCount }}</span>
@@ -1682,7 +1682,8 @@ function hrefForPage(page: number): string {
1682
1682
  <FieldWrapper
1683
1683
  v-if="hasSort"
1684
1684
  :label="t('grid.sortBy')"
1685
- :classes="{ root: TOP_BAR_SORT, label: 'sr-only' }"
1685
+ :class="TOP_BAR_SORT"
1686
+ :classes="{ label: 'sr-only' }"
1686
1687
  >
1687
1688
  <Select
1688
1689
  :model-value="sort"
@@ -1710,10 +1711,8 @@ function hrefForPage(page: number): string {
1710
1711
  <FieldWrapper
1711
1712
  v-if="hasSort"
1712
1713
  :label="t('grid.sortBy')"
1713
- :classes="{
1714
- root: 'flex items-center gap-2',
1715
- label: 'text-body-sm text-muted mb-0 shrink-0 font-medium',
1716
- }"
1714
+ class="flex items-center gap-2"
1715
+ :classes="{ label: 'text-body-sm text-muted mb-0 shrink-0 font-medium' }"
1717
1716
  >
1718
1717
  <Select
1719
1718
  :model-value="sort"
@@ -1725,10 +1724,8 @@ function hrefForPage(page: number): string {
1725
1724
  <FieldWrapper
1726
1725
  v-if="showColumnSelect"
1727
1726
  :label="t('grid.columns')"
1728
- :classes="{
1729
- root: 'flex items-center gap-2',
1730
- label: 'text-body-sm text-muted mb-0 shrink-0 font-medium',
1731
- }"
1727
+ class="flex items-center gap-2"
1728
+ :classes="{ label: 'text-body-sm text-muted mb-0 shrink-0 font-medium' }"
1732
1729
  >
1733
1730
  <Select
1734
1731
  :model-value="columnsChoice"
@@ -1780,7 +1777,7 @@ function hrefForPage(page: number): string {
1780
1777
  :product="entry.product"
1781
1778
  ratio="4x5"
1782
1779
  :heading-level="3"
1783
- :classes="CARD_CLASSES"
1780
+ :class="CARD_CLASS"
1784
1781
  :quick-add="false"
1785
1782
  :revalidating="entry.revalidating"
1786
1783
  :announce="false"
@@ -290,7 +290,7 @@ const SEEDED_GROUPS = 5;
290
290
  /** The grid's single visually hidden live region for the volatile refresh. The count line above
291
291
  * and `LoadMore`'s own "Showing N of M" are the block's other `role="status"` elements, and both
292
292
  * are visible — this is the only hidden one. */
293
- const liveRegion = (wrapper: VueWrapper) => wrapper.get('p.sr-only[role="status"]');
293
+ const liveRegion = (wrapper: VueWrapper) => wrapper.get('p.eldra\\:sr-only[role="status"]');
294
294
  /** The grid itself: the list of product cards (never the skeleton list, which is aria-hidden). */
295
295
  const cards = (wrapper: VueWrapper) =>
296
296
  wrapper.findAll('ul[aria-labelledby]:not([aria-hidden]) > li');
@@ -388,7 +388,7 @@ describe('collection-grid block', () => {
388
388
  const h2 = wrapper
389
389
  .findAll('h2')
390
390
  .find((candidate) => candidate.text() === enUS.grid.products)!;
391
- expect(h2.classes()).toContain('sr-only');
391
+ expect(h2.classes()).toContain('eldra:sr-only');
392
392
 
393
393
  const titles = wrapper.findAll('h3');
394
394
  expect(titles.some((title) => title.text() === 'Merino crew sweater')).toBe(true);
@@ -421,7 +421,7 @@ describe('collection-grid block', () => {
421
421
  const { trigger, panel } = panelFor(wrapper, legend);
422
422
  expect(trigger.attributes('aria-expanded')).toBe('true');
423
423
  expect(panel.element.tagName).toBe('FIELDSET');
424
- expect(panel.get('legend').classes()).toContain('sr-only');
424
+ expect(panel.get('legend').classes()).toContain('eldra:sr-only');
425
425
  }
426
426
  });
427
427
 
@@ -488,12 +488,12 @@ describe('collection-grid block', () => {
488
488
  const dot = row.get('span');
489
489
  const name = row.get('[data-part="rowLabel"]');
490
490
 
491
- expect(dot.classes()).toContain('border-transparent');
492
- expect(name.classes()).not.toContain('font-semibold');
491
+ expect(dot.classes()).toContain('eldra:border-transparent');
492
+ expect(name.classes()).not.toContain('eldra:font-semibold');
493
493
  await input.setValue(true);
494
494
 
495
- expect(dot.classes()).toContain('border-text');
496
- expect(name.classes()).toContain('font-semibold');
495
+ expect(dot.classes()).toContain('eldra:border-text');
496
+ expect(name.classes()).toContain('eldra:font-semibold');
497
497
  });
498
498
 
499
499
  /**
@@ -1249,7 +1249,7 @@ describe('collection-grid block', () => {
1249
1249
  await wrapper.vm.$nextTick();
1250
1250
  const soldOut = cards(wrapper).find((card) => card.text().includes('Linen tea towels'))!;
1251
1251
  expect(soldOut.text()).toContain('Sold out');
1252
- expect(soldOut.get('img').classes()).toContain('opacity-60');
1252
+ expect(soldOut.get('img').classes()).toContain('eldra:opacity-60');
1253
1253
  });
1254
1254
 
1255
1255
  /**
@@ -1293,7 +1293,7 @@ describe('collection-grid block', () => {
1293
1293
  const loadMore = wrapper.get('[data-part="button"]');
1294
1294
  const bar = wrapper
1295
1295
  .findAll('div[aria-hidden="true"]')
1296
- .find((div) => div.classes().includes('rounded-full'))!;
1296
+ .find((div) => div.classes().includes('eldra:rounded-full'))!;
1297
1297
  expect(bar.attributes('aria-hidden')).toBe('true');
1298
1298
 
1299
1299
  loadMore.element.focus();
@@ -1432,9 +1432,8 @@ describe('collection-grid block', () => {
1432
1432
  // background fill, supplied by the Drawer's own chrome.
1433
1433
  expect(footer.classes()).toContain('grid');
1434
1434
  expect(footer.classes()).toContain('grid-cols-[auto_1fr]');
1435
- expect(footer.classes()).not.toContain('flex');
1436
- expect(footer.classes()).toContain('border-t');
1437
- expect(footer.classes()).toContain('bg-background');
1435
+ expect(footer.classes()).toContain('eldra:border-t');
1436
+ expect(footer.classes()).toContain('eldra:bg-background');
1438
1437
 
1439
1438
  const footerButtons = footer.findAll('button');
1440
1439
  expect(footerButtons.map((button) => button.text())).toEqual([
@@ -2600,7 +2599,7 @@ describe('collection-grid block', () => {
2600
2599
  await wrapper.vm.$nextTick();
2601
2600
 
2602
2601
  expect(liveRegion(wrapper).text()).toBe(enUS.storefront.updatingValues);
2603
- expect(wrapper.findAll('p.sr-only[role="status"]')).toHaveLength(1);
2602
+ expect(wrapper.findAll('p.eldra\\:sr-only[role="status"]')).toHaveLength(1);
2604
2603
  // `announce: false` on every card — the per-value regions are gone, not merely empty.
2605
2604
  expect(wrapper.findAll('[data-part="srStatus"]')).toHaveLength(0);
2606
2605
  expect(
@@ -3145,7 +3144,6 @@ describe('collection-grid — card width on a phone', () => {
3145
3144
  // The card's own root is the list item's first element; `cards()` answers the items.
3146
3145
  const root = cards(wrapper)[0]!.element.firstElementChild as HTMLElement;
3147
3146
  expect(root.className).toContain('min-w-0');
3148
- expect(root.className).not.toMatch(/\bmin-w-56\b/);
3149
3147
  wrapper.unmount();
3150
3148
  });
3151
3149
  });
@@ -402,9 +402,9 @@ function pillClass(pill: ResolvedPill): string {
402
402
  * carry these exact asymmetric steps, so `spacing="none"` on `Section` and the padding is written
403
403
  * here — the same pattern `footer`'s own `paddingClass` uses. */
404
404
  const PADDING_CLASS = 'pt-6 pb-8 @tablet:pt-8 @tablet:pb-12';
405
- const sectionClasses = computed(() => ({
406
- root: isImageVariant.value ? PADDING_CLASS : `${PADDING_CLASS} border-border border-b`,
407
- }));
405
+ const sectionClass = computed(() =>
406
+ isImageVariant.value ? PADDING_CLASS : `${PADDING_CLASS} border-border border-b`
407
+ );
408
408
 
409
409
  const rootClass = computed(() =>
410
410
  isImageVariant.value
@@ -424,7 +424,7 @@ const textColumnClass = computed(() =>
424
424
  as="header"
425
425
  spacing="none"
426
426
  :labelled-by="headingId"
427
- :classes="sectionClasses"
427
+ :class="sectionClass"
428
428
  >
429
429
  <Container width="wide">
430
430
  <div :class="rootClass">
@@ -519,7 +519,7 @@ const textColumnClass = computed(() =>
519
519
  :as="pill.as"
520
520
  :underline="false"
521
521
  :aria-current="pill.current ? 'page' : undefined"
522
- :classes="{ root: pillClass(pill) }"
522
+ :class="pillClass(pill)"
523
523
  >
524
524
  {{ pill.label }}
525
525
  </Link>
@@ -632,7 +632,7 @@ const successText = computed(() => data.value.successText || t('contact.successT
632
632
  variant="standalone"
633
633
  arrow
634
634
  external
635
- :classes="{ root: 'text-body-sm font-semibold' }"
635
+ class="text-body-sm font-semibold"
636
636
  >{{ mapLinkLabel }}</Link
637
637
  >
638
638
  </div>
@@ -116,7 +116,7 @@ describe('contact block', () => {
116
116
  const wrapper = mountContact(merged);
117
117
  const section = wrapper.find('section');
118
118
  expect(section.exists()).toBe(true);
119
- expect(section.classes()).toContain('@container');
119
+ expect(section.classes()).toContain('eldra:@container');
120
120
  });
121
121
 
122
122
  it('form-only with hideHeading keeps the h2 in the outline but hides it visually', () => {
@@ -124,7 +124,7 @@ describe('contact block', () => {
124
124
  const heading = wrapper.find('h2');
125
125
  expect(heading.exists()).toBe(true);
126
126
  expect(heading.text()).toBe(mock.heading);
127
- expect(heading.classes()).toContain('sr-only');
127
+ expect(heading.classes()).toContain('eldra:sr-only');
128
128
  });
129
129
 
130
130
  it('every field has a visible, programmatically tied label, and the optional one says "(optional)"', () => {
Binary file