@vectoriox/iox-builder 11.6.1 → 11.7.0

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.
@@ -13567,9 +13567,10 @@ function picture(createConfig, aspectRatio, src = '') {
13567
13567
  setTrait(node, 'src', src);
13568
13568
  return styled(node, { width: '100%', height: 'auto', aspectRatio });
13569
13569
  }
13570
+ const photoAt = (copy, index) => (copy.photos?.length ? copy.photos[index % copy.photos.length] : '');
13570
13571
  function card(copy, createConfig, index) {
13571
13572
  return boxed('card', createConfig, [
13572
- picture(createConfig, '4 / 3', index === 0 ? copy.photo : ''),
13573
+ picture(createConfig, '4 / 3', photoAt(copy, index)),
13573
13574
  heading('h3', copy.cardTitle, 'h3', createConfig),
13574
13575
  text(copy.cardText, createConfig, 'small'),
13575
13576
  ], { display: 'grid', gap: '8px', alignContent: 'start', minWidth: '0' });
@@ -13594,7 +13595,7 @@ function homeView(copy, createConfig, opts) {
13594
13595
  const cards = Array.from({ length: CARD_COUNT }, (_, i) => card(copy, createConfig, i));
13595
13596
  const cardRow = withChildren(styled(box(createConfig), { display: 'grid', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))', gap: '14px' }), cards);
13596
13597
  const collection = block(createConfig, SpecimenFamily.Collection, opts, [listHeading, cardRow], { [EntrancePart.Heading]: [listHeading], [EntrancePart.Items]: cards });
13597
- const rowPicture = picture(createConfig, '16 / 10');
13598
+ const rowPicture = picture(createConfig, '16 / 10', photoAt(copy, 3));
13598
13599
  const rowHeading = heading('h2', copy.rowHeading, 'h2', createConfig);
13599
13600
  const rowWords = withChildren(styled(box(createConfig), { display: 'grid', gap: '10px', alignContent: 'center' }), [rowHeading, text(copy.rowText, createConfig, 'body')]);
13600
13601
  const feature = block(createConfig, SpecimenFamily.Feature, opts, [rowPicture, rowWords], { [EntrancePart.Heading]: [rowHeading], [EntrancePart.RowMedia]: [rowPicture] }, { gridTemplateColumns: 'minmax(0, 1.1fr) minmax(0, 1fr)', gap: '18px', alignItems: 'start' });
@@ -13610,7 +13611,7 @@ function homeView(copy, createConfig, opts) {
13610
13611
  }
13611
13612
  function itemView(copy, createConfig, opts) {
13612
13613
  const title = heading('display', copy.cardTitle, 'h1', createConfig);
13613
- const media = picture(createConfig, '16 / 8', copy.photo);
13614
+ const media = picture(createConfig, '16 / 8', copy.photos?.[0]);
13614
13615
  return [block(createConfig, SpecimenFamily.Detail, opts, [text(copy.listHeading, createConfig, 'eyebrow'), title, media, text(copy.cardText, createConfig, 'lead')], { [EntrancePart.Heading]: [title], [EntrancePart.Media]: [media] })];
13615
13616
  }
13616
13617
  /**