@sarimarcus/content-sites-tourism 0.23.0 → 0.25.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.
- package/CHANGELOG.md +17 -0
- package/package.json +3 -3
- package/src/cards/BarCard.astro +2 -7
- package/src/cards/DishCard.astro +2 -7
- package/src/cards/MonumentCard.astro +2 -7
- package/src/cards/NeighborhoodCard.astro +2 -7
- package/src/cards/RestaurantCard.astro +2 -7
- package/src/cards/WalkCard.astro +2 -7
- package/src/sections/ItineraryTeaser.astro +16 -14
- package/src/sections/RankedListingRow.astro +8 -13
- package/src/sections/WalkStops.astro +31 -12
- package/src/sections/WhoItsFor.astro +15 -8
- package/src/sections/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.25.0 (2026-10-05)
|
|
6
|
+
|
|
7
|
+
- `./sections` `WalkStops` and `ItineraryTeaser` own the tourism wiring that the sites' adapters held: the entity routes, type labels and copy are defaults, and they apply `url()` (SLA-2961).
|
|
8
|
+
- `./sections` `WhoItsFor` takes the resolved tags (`field`, `label`, site-relative `href`) and picks the tone and applies `url()` itself; its label and aria label have defaults. `RankedListingRow` defaults `ratingSuffix` and `ctaLabel` (SLA-2961).
|
|
9
|
+
|
|
10
|
+
### Breaking
|
|
11
|
+
|
|
12
|
+
- `WalkStops` takes raw stops (`type`, `slug`) instead of `typeLabel`/`href`; `ItineraryTeaser` takes `neighborhood`, `slug`, `highlight`, `ctaText` and `ctaUrl` instead of resolved names and hrefs; `WhoItsFor` takes `tags` instead of `links` (type `WhoItsForTag` replaces `WhoItsForLink`). Migration: `rewrite-imports.mjs --delete-local` drops the WalkStops and ItineraryTeaser adapters, then `scripts/platform/migrations/promoted-adapters.mjs` updates the kept WhoItsFor and RankedListingRow adapters (SLA-2961).
|
|
13
|
+
|
|
14
|
+
## 0.24.0 (2026-10-05)
|
|
15
|
+
|
|
16
|
+
- Cards and `RankedListingRow` render their images through ui `ResponsivePicture`; output loses only the redundant `<source>` (SLA-2960).
|
|
17
|
+
|
|
18
|
+
### Breaking
|
|
19
|
+
|
|
20
|
+
- Sites must run the `responsive-image.mjs` codemod when pinning 0.24.0; see the core CHANGELOG (SLA-2960).
|
|
21
|
+
|
|
5
22
|
## 0.23.0 (2026-10-04)
|
|
6
23
|
|
|
7
24
|
- No changes; lockstep release with core (SLA-2958).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-tourism",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "City-tourism vertical: city-entity components, pages templates and utilities for the tourism sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"astro": "^7.0.6",
|
|
38
38
|
"tailwindcss": "^4.1.18",
|
|
39
|
-
"@sarimarcus/content-sites-core": "0.
|
|
40
|
-
"@sarimarcus/content-sites-ui": "0.
|
|
39
|
+
"@sarimarcus/content-sites-core": "0.25.0",
|
|
40
|
+
"@sarimarcus/content-sites-ui": "0.25.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/cards/BarCard.astro
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* BarCard — bar teaser. The category key picks the badge colour; its label, the feature labels and icons (sites store
|
|
5
4
|
* different feature keys), the closing line and every other visible string come from the site adapter, which also
|
|
6
5
|
* resolves the image, href and placeholder. The price pill renders only when the value is label-length.
|
|
7
6
|
*/
|
|
8
|
-
import { Picture } from 'astro:assets';
|
|
9
7
|
import type { ImageMetadata } from 'astro';
|
|
10
|
-
import { Badge, isBadgeLength, PRICE_LABEL_MAX } from '@sarimarcus/content-sites-ui/primitives';
|
|
8
|
+
import { Badge, isBadgeLength, PRICE_LABEL_MAX, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
11
9
|
import type { CardRating } from './RestaurantCard.astro';
|
|
12
10
|
|
|
13
11
|
export interface BarFeature {
|
|
@@ -84,13 +82,10 @@ const categoryStyle = categoryColors[category] || { bg: 'bg-muted', text: 'text-
|
|
|
84
82
|
<a href={href} class="flex flex-col flex-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-xl">
|
|
85
83
|
<div class="relative h-56 overflow-hidden img-placeholder shrink-0">
|
|
86
84
|
{image ? (
|
|
87
|
-
<
|
|
85
|
+
<ResponsivePicture
|
|
88
86
|
src={image}
|
|
89
87
|
alt={imageAlt}
|
|
90
|
-
widths={IMAGE_LADDER}
|
|
91
88
|
sizes="(max-width: 1023px) 100vw, 50vw"
|
|
92
|
-
formats={['webp']}
|
|
93
|
-
fallbackFormat="webp"
|
|
94
89
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
95
90
|
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
96
91
|
loading={index < 3 ? "eager" : "lazy"}
|
package/src/cards/DishCard.astro
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* DishCard — dish teaser. The category key picks the badge colour; the label, tags and every other visible string
|
|
5
4
|
* come from the site adapter, which also resolves the image, href and placeholder.
|
|
6
5
|
*/
|
|
7
|
-
import { Picture } from 'astro:assets';
|
|
8
6
|
import type { ImageMetadata } from 'astro';
|
|
9
|
-
import { Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
+
import { Badge, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
10
8
|
|
|
11
9
|
interface Props {
|
|
12
10
|
href: string;
|
|
@@ -66,13 +64,10 @@ const audienceLabels = tagLabels.slice(0, 3);
|
|
|
66
64
|
<a href={href} class="flex flex-col h-full focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-xl">
|
|
67
65
|
<div class="relative h-56 overflow-hidden img-placeholder shrink-0">
|
|
68
66
|
{image ? (
|
|
69
|
-
<
|
|
67
|
+
<ResponsivePicture
|
|
70
68
|
src={image}
|
|
71
69
|
alt={imageAlt}
|
|
72
|
-
widths={IMAGE_LADDER}
|
|
73
70
|
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
74
|
-
formats={['webp']}
|
|
75
|
-
fallbackFormat="webp"
|
|
76
71
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
77
72
|
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
78
73
|
loading={loadingStrategy}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* MonumentCard — monument or museum teaser (exported under both names) for listings and related rails. The site
|
|
5
4
|
* adapter resolves the image, the href, the placeholder and every visible string; the card only lays them out.
|
|
6
5
|
*/
|
|
7
|
-
import { Picture } from 'astro:assets';
|
|
8
6
|
import type { ImageMetadata } from 'astro';
|
|
9
|
-
import { ArrowLabel, Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
+
import { ArrowLabel, Badge, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
10
8
|
|
|
11
9
|
interface Props {
|
|
12
10
|
href: string;
|
|
@@ -68,13 +66,10 @@ const loadingStrategy = index < eager ? "eager" : "lazy";
|
|
|
68
66
|
<a href={href} class="flex flex-col h-full focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 rounded-xl">
|
|
69
67
|
<div class="relative h-56 sm:h-64 overflow-hidden img-placeholder shrink-0">
|
|
70
68
|
{image ? (
|
|
71
|
-
<
|
|
69
|
+
<ResponsivePicture
|
|
72
70
|
src={image}
|
|
73
71
|
alt={imageAlt}
|
|
74
|
-
widths={IMAGE_LADDER}
|
|
75
72
|
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
76
|
-
formats={['webp']}
|
|
77
|
-
fallbackFormat="webp"
|
|
78
73
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
79
74
|
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
80
75
|
loading={loadingStrategy}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* NeighborhoodCard — rich neighbourhood card: title over the image, counts, an editorial badge and a "top attractions"
|
|
5
4
|
* preview (always visible below the image on mobile, sliding up on hover from lg). The site adapter resolves the
|
|
6
5
|
* image, href, placeholder, badge (sites store different badge keys) and every visible string, counts included.
|
|
7
6
|
* Layers: image 0, gradient 10, title and meta 20, badge 30, attractions 40.
|
|
8
7
|
*/
|
|
9
|
-
import { Picture } from 'astro:assets';
|
|
10
8
|
import type { ImageMetadata } from 'astro';
|
|
11
|
-
import { Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
|
+
import { Badge, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
12
10
|
|
|
13
11
|
export type NeighborhoodBadgeTone = 'primary' | 'accent' | 'secondary' | 'overlay';
|
|
14
12
|
|
|
@@ -96,13 +94,10 @@ const cardHeight = 'h-72 sm:h-80';
|
|
|
96
94
|
<a href={href} class="block h-full">
|
|
97
95
|
<div class:list={['relative overflow-hidden img-placeholder', cardHeight]}>
|
|
98
96
|
{image ? (
|
|
99
|
-
<
|
|
97
|
+
<ResponsivePicture
|
|
100
98
|
src={image}
|
|
101
99
|
alt={imageAlt}
|
|
102
|
-
widths={IMAGE_LADDER}
|
|
103
100
|
sizes="(max-width: 767px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
104
|
-
formats={['webp']}
|
|
105
|
-
fallbackFormat="webp"
|
|
106
101
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
107
102
|
class="w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"
|
|
108
103
|
loading={loadingStrategy}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* RestaurantCard — restaurant teaser for listings, facets and related rails. The site adapter resolves the image, href,
|
|
5
4
|
* placeholder, badge decisions and every visible string; the card only lays them out.
|
|
@@ -7,9 +6,8 @@ import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
|
7
6
|
* overflow ceiling. The price pill renders only when the value is label-length; a prose-length price stays in the
|
|
8
7
|
* inline price row.
|
|
9
8
|
*/
|
|
10
|
-
import { Picture } from 'astro:assets';
|
|
11
9
|
import type { ImageMetadata } from 'astro';
|
|
12
|
-
import { Badge, isBadgeLength, PRICE_LABEL_MAX } from '@sarimarcus/content-sites-ui/primitives';
|
|
10
|
+
import { Badge, isBadgeLength, PRICE_LABEL_MAX, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
13
11
|
|
|
14
12
|
export interface CardRating {
|
|
15
13
|
value: number;
|
|
@@ -79,13 +77,10 @@ const loadingStrategy = index < eager ? "eager" : "lazy";
|
|
|
79
77
|
<a href={href} class="flex flex-col flex-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-xl">
|
|
80
78
|
<div class="relative h-44 sm:h-52 overflow-hidden img-placeholder shrink-0">
|
|
81
79
|
{image ? (
|
|
82
|
-
<
|
|
80
|
+
<ResponsivePicture
|
|
83
81
|
src={image}
|
|
84
82
|
alt={imageAlt}
|
|
85
|
-
widths={IMAGE_LADDER}
|
|
86
83
|
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
87
|
-
formats={['webp']}
|
|
88
|
-
fallbackFormat="webp"
|
|
89
84
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
90
85
|
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
91
86
|
loading={loadingStrategy}
|
package/src/cards/WalkCard.astro
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* WalkCard — walking-route teaser. Theme and difficulty keys pick the badge colours; their labels and every other
|
|
5
4
|
* visible string come from the site adapter. Without an image the card shows a footsteps placeholder.
|
|
6
5
|
*/
|
|
7
|
-
import { Picture } from 'astro:assets';
|
|
8
6
|
import type { ImageMetadata } from 'astro';
|
|
9
|
-
import { ArrowLabel, Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
+
import { ArrowLabel, Badge, Icon, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
10
8
|
|
|
11
9
|
export interface WalkCardStrings {
|
|
12
10
|
/** Screen-reader labels before each meta value. */
|
|
@@ -75,13 +73,10 @@ const difficultyColor = difficultyColors[difficulty] || 'bg-muted text-muted-for
|
|
|
75
73
|
<a href={href} class="flex flex-col h-full focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 rounded-xl">
|
|
76
74
|
<div class="relative aspect-[3/2] overflow-hidden img-placeholder shrink-0">
|
|
77
75
|
{image ? (
|
|
78
|
-
<
|
|
76
|
+
<ResponsivePicture
|
|
79
77
|
src={image}
|
|
80
78
|
alt={imageAlt}
|
|
81
|
-
widths={IMAGE_LADDER}
|
|
82
79
|
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
83
|
-
formats={['webp']}
|
|
84
|
-
fallbackFormat="webp"
|
|
85
80
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
86
81
|
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
87
82
|
loading={index < 3 ? "eager" : "lazy"}
|
|
@@ -2,36 +2,38 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* ItineraryTeaser — dark gradient panel on the neighbourhoods hub: a numbered multi-stop journey joined by a line on
|
|
4
4
|
* desktop, one card per stop and a large CTA. A stop's duration row renders only when the site has a duration for it.
|
|
5
|
-
*
|
|
5
|
+
* Each stop links to its neighborhood page.
|
|
6
6
|
*/
|
|
7
7
|
import { Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
8
|
+
import { url } from '@sarimarcus/content-sites-core/url';
|
|
8
9
|
|
|
9
10
|
export interface ItineraryTeaserStop {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
neighborhood: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
highlight: string;
|
|
13
14
|
duration?: string;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
interface Props {
|
|
17
|
-
badgeLabel: string;
|
|
18
18
|
title: string;
|
|
19
19
|
description: string;
|
|
20
20
|
stops: ItineraryTeaserStop[];
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
ctaText: string;
|
|
22
|
+
ctaUrl: string;
|
|
23
|
+
badgeLabel?: string;
|
|
23
24
|
class?: string;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
const {
|
|
27
|
-
badgeLabel,
|
|
28
28
|
title,
|
|
29
29
|
description,
|
|
30
30
|
stops,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
ctaText,
|
|
32
|
+
ctaUrl,
|
|
33
|
+
badgeLabel = 'Suggested itinerary',
|
|
33
34
|
class: className,
|
|
34
35
|
} = Astro.props;
|
|
36
|
+
const ctaHref = url(ctaUrl);
|
|
35
37
|
---
|
|
36
38
|
|
|
37
39
|
<section class:list={['relative py-12 px-6 sm:px-8 bg-gradient-to-br from-overlay to-muted-foreground rounded-2xl overflow-hidden', className]}>
|
|
@@ -65,14 +67,14 @@ const {
|
|
|
65
67
|
</div>
|
|
66
68
|
|
|
67
69
|
<a
|
|
68
|
-
href={stop.
|
|
70
|
+
href={url(`/neighborhood/${stop.slug}`)}
|
|
69
71
|
class="block mt-6 p-5 bg-overlay-foreground/5 hover:bg-overlay-foreground/10 border border-overlay-foreground/10 hover:border-overlay-foreground/20 rounded-xl transition-all duration-200 group"
|
|
70
72
|
>
|
|
71
73
|
<h3 class="text-lg font-display font-medium text-overlay-foreground mb-2 group-hover:text-accent transition-colors">
|
|
72
|
-
{stop.
|
|
74
|
+
{stop.neighborhood}
|
|
73
75
|
</h3>
|
|
74
76
|
<p class:list={['text-sm text-overlay-foreground/60', stop.duration && 'mb-3']}>
|
|
75
|
-
{stop.
|
|
77
|
+
{stop.highlight}
|
|
76
78
|
</p>
|
|
77
79
|
{stop.duration && (
|
|
78
80
|
<div class="flex items-center gap-2 text-xs text-overlay-foreground/50">
|
|
@@ -91,7 +93,7 @@ const {
|
|
|
91
93
|
href={ctaHref}
|
|
92
94
|
class="inline-flex items-center gap-3 px-6 py-3 bg-primary hover:bg-primary-strong text-overlay-foreground rounded-lg font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-overlay"
|
|
93
95
|
>
|
|
94
|
-
{
|
|
96
|
+
{ctaText}
|
|
95
97
|
<Icon name="arrow-right" class="w-4 h-4 transition-transform group-hover:translate-x-1" />
|
|
96
98
|
</a>
|
|
97
99
|
</div>
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { IMAGE_LADDER } from '@sarimarcus/content-sites-core/images';
|
|
3
2
|
/**
|
|
4
3
|
* RankedListingRow — one entry in a numbered editorial ranking list, e.g. a proximity page that reads top-to-bottom by
|
|
5
4
|
* distance. Rendered inside the caller's `<ol>`. The whole row is one real link, so the name stays selectable text.
|
|
6
|
-
* The site adapter resolves the image
|
|
5
|
+
* The site adapter resolves the image.
|
|
7
6
|
*/
|
|
8
|
-
import { Picture } from 'astro:assets';
|
|
9
7
|
import type { ImageMetadata } from 'astro';
|
|
10
|
-
import { Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
8
|
+
import { Icon, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
11
9
|
|
|
12
10
|
interface Props {
|
|
13
11
|
rank: number;
|
|
@@ -21,14 +19,14 @@ interface Props {
|
|
|
21
19
|
/** e.g. "6 min walk" */
|
|
22
20
|
walkLabel: string;
|
|
23
21
|
rating?: number;
|
|
24
|
-
/** Screen-reader suffix after the rating
|
|
25
|
-
ratingSuffix
|
|
22
|
+
/** Screen-reader suffix after the rating. */
|
|
23
|
+
ratingSuffix?: string;
|
|
26
24
|
/** Cuisine, category or star line. */
|
|
27
25
|
meta?: string;
|
|
28
26
|
priceLine?: string;
|
|
29
27
|
specialties?: string[];
|
|
30
28
|
description: string;
|
|
31
|
-
ctaLabel
|
|
29
|
+
ctaLabel?: string;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
const {
|
|
@@ -41,12 +39,12 @@ const {
|
|
|
41
39
|
distanceText,
|
|
42
40
|
walkLabel,
|
|
43
41
|
rating,
|
|
44
|
-
ratingSuffix,
|
|
42
|
+
ratingSuffix = 'out of 5',
|
|
45
43
|
meta,
|
|
46
44
|
priceLine,
|
|
47
45
|
specialties = [],
|
|
48
46
|
description,
|
|
49
|
-
ctaLabel,
|
|
47
|
+
ctaLabel = 'Read more',
|
|
50
48
|
} = Astro.props;
|
|
51
49
|
|
|
52
50
|
const paddedRank = String(rank).padStart(2, '0');
|
|
@@ -67,13 +65,10 @@ const paddedRank = String(rank).padStart(2, '0');
|
|
|
67
65
|
<div class="col-start-2 grid grid-cols-[5.5rem_1fr] sm:grid-cols-[9rem_1fr] gap-4 sm:gap-6 w-full min-w-0">
|
|
68
66
|
<div class="relative aspect-square rounded-lg overflow-hidden img-placeholder border border-border shrink-0">
|
|
69
67
|
{image ? (
|
|
70
|
-
<
|
|
68
|
+
<ResponsivePicture
|
|
71
69
|
src={image}
|
|
72
70
|
alt={imageAlt}
|
|
73
|
-
widths={IMAGE_LADDER}
|
|
74
71
|
sizes="(max-width: 639px) 88px, 144px"
|
|
75
|
-
formats={['webp']}
|
|
76
|
-
fallbackFormat="webp"
|
|
77
72
|
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
78
73
|
class="w-full h-full object-cover transition-transform duration-500 ease-out group-hover:scale-[1.04]"
|
|
79
74
|
loading={rank <= 2 ? 'eager' : 'lazy'}
|
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* WalkStops — numbered stop-by-stop route for a walk detail page.
|
|
4
|
-
*
|
|
3
|
+
* WalkStops — numbered stop-by-stop route for a walk detail page. A stop links to its entity page when its type has a
|
|
4
|
+
* route and it has a slug.
|
|
5
5
|
*/
|
|
6
6
|
import { Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
+
import { url } from '@sarimarcus/content-sites-core/url';
|
|
7
8
|
|
|
8
9
|
export interface WalkStop {
|
|
9
10
|
order: number;
|
|
10
11
|
name: string;
|
|
11
12
|
description: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
href?: string;
|
|
13
|
+
type: string;
|
|
14
|
+
slug?: string;
|
|
15
15
|
duration: string;
|
|
16
|
+
coordinates?: { lat: number; lng: number };
|
|
16
17
|
tip?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
interface Props {
|
|
20
21
|
stops: WalkStop[];
|
|
21
|
-
heading
|
|
22
|
-
/** Prefix before a stop's tip
|
|
23
|
-
tipLabel
|
|
22
|
+
heading?: string;
|
|
23
|
+
/** Prefix before a stop's tip. */
|
|
24
|
+
tipLabel?: string;
|
|
24
25
|
class?: string;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
const { stops, heading, tipLabel, class: className } = Astro.props;
|
|
28
|
+
const { stops, heading = 'Stop-by-Stop Route', tipLabel = 'Tip:', class: className } = Astro.props;
|
|
29
|
+
|
|
30
|
+
// Stop types with an entity page at /<type>/<slug>.
|
|
31
|
+
const ROUTED = new Set(['monument', 'museum', 'restaurant', 'bar', 'neighborhood', 'activity', 'dish', 'event']);
|
|
32
|
+
|
|
33
|
+
const typeLabels: Record<string, string> = {
|
|
34
|
+
monument: 'Monument',
|
|
35
|
+
museum: 'Museum',
|
|
36
|
+
restaurant: 'Restaurant',
|
|
37
|
+
bar: 'Bar',
|
|
38
|
+
neighborhood: 'Neighborhood',
|
|
39
|
+
activity: 'Activity',
|
|
40
|
+
dish: 'Dish',
|
|
41
|
+
event: 'Event',
|
|
42
|
+
landmark: 'Landmark',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const stopHref = (stop: WalkStop) => (ROUTED.has(stop.type) && stop.slug ? url(`/${stop.type}/${stop.slug}`) : undefined);
|
|
28
46
|
---
|
|
29
47
|
|
|
30
48
|
<section class:list={['walk-stops', className]}>
|
|
@@ -35,6 +53,7 @@ const { stops, heading, tipLabel, class: className } = Astro.props;
|
|
|
35
53
|
<ol class="relative space-y-0">
|
|
36
54
|
{stops.map((stop, i) => {
|
|
37
55
|
const isLast = i === stops.length - 1;
|
|
56
|
+
const href = stopHref(stop);
|
|
38
57
|
|
|
39
58
|
return (
|
|
40
59
|
<li class="relative pl-14 pb-10 group">
|
|
@@ -49,8 +68,8 @@ const { stops, heading, tipLabel, class: className } = Astro.props;
|
|
|
49
68
|
<div class="bg-card rounded-xl border border-border p-5 sm:p-6 hover:border-primary/30 transition-colors">
|
|
50
69
|
<div class="flex flex-wrap items-start justify-between gap-2 mb-2">
|
|
51
70
|
<div>
|
|
52
|
-
{
|
|
53
|
-
<a href={
|
|
71
|
+
{href ? (
|
|
72
|
+
<a href={href} class="text-lg sm:text-xl font-display font-semibold text-foreground hover:text-primary transition-colors">
|
|
54
73
|
{stop.name}
|
|
55
74
|
</a>
|
|
56
75
|
) : (
|
|
@@ -60,7 +79,7 @@ const { stops, heading, tipLabel, class: className } = Astro.props;
|
|
|
60
79
|
)}
|
|
61
80
|
<div class="flex flex-wrap items-center gap-2 mt-1">
|
|
62
81
|
<Badge tone="custom" toneClass="bg-muted text-muted-foreground" size="sm" lines={0} class="![font-weight:inherit] !gap-1">
|
|
63
|
-
{stop.
|
|
82
|
+
{typeLabels[stop.type] || stop.type}
|
|
64
83
|
</Badge>
|
|
65
84
|
<span class="inline-flex items-center gap-1 text-xs text-muted-foreground">
|
|
66
85
|
<Icon name="clock" class="w-3 h-3" />
|
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
3
|
* WhoItsFor — an entity's audience and theme tags as a row of links to the pages that own those intents. The site
|
|
4
|
-
* adapter resolves the
|
|
5
|
-
* links render nothing: one tag is an orphan, not a row.
|
|
4
|
+
* adapter resolves the tags (dropping any with nowhere to go). Audiences render in the primary tone, themes in the
|
|
5
|
+
* secondary one. Fewer than two links render nothing: one tag is an orphan, not a row.
|
|
6
6
|
*/
|
|
7
7
|
import { LinkArrow } from '@sarimarcus/content-sites-ui/primitives';
|
|
8
|
+
import { url } from '@sarimarcus/content-sites-core/url';
|
|
8
9
|
|
|
9
|
-
export interface
|
|
10
|
+
export interface WhoItsForTag {
|
|
11
|
+
field: 'audiences' | 'themes';
|
|
10
12
|
label: string;
|
|
13
|
+
/** Site-relative; the base path is added here. */
|
|
11
14
|
href: string;
|
|
12
|
-
tone: 'primary' | 'secondary';
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
interface Props {
|
|
16
|
-
|
|
17
|
-
label
|
|
18
|
-
ariaLabel
|
|
18
|
+
tags: readonly WhoItsForTag[];
|
|
19
|
+
label?: string;
|
|
20
|
+
ariaLabel?: string;
|
|
19
21
|
class?: string;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
const {
|
|
24
|
+
const { tags, label = "Who it's for", ariaLabel = 'Related audiences and themes', class: className = '' } = Astro.props;
|
|
23
25
|
|
|
26
|
+
const links = tags.map((tag) => ({
|
|
27
|
+
label: tag.label,
|
|
28
|
+
href: url(tag.href),
|
|
29
|
+
tone: tag.field === 'audiences' ? ('primary' as const) : ('secondary' as const),
|
|
30
|
+
}));
|
|
24
31
|
const show = links.length >= 2;
|
|
25
32
|
---
|
|
26
33
|
|
package/src/sections/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { default as ItineraryTeaser } from './ItineraryTeaser.astro';
|
|
|
9
9
|
export { default as HomeMonuments } from './HomeMonuments.astro';
|
|
10
10
|
export { default as TourismNavigation } from './TourismNavigation.astro';
|
|
11
11
|
export type { WalkStop } from './WalkStops.astro';
|
|
12
|
-
export type {
|
|
12
|
+
export type { WhoItsForTag } from './WhoItsFor.astro';
|
|
13
13
|
export type { NeighborhoodCategoryType } from './NeighborhoodCategory.astro';
|
|
14
14
|
export type { SituationalScenario } from './SituationalNav.astro';
|
|
15
15
|
export type { HubCategoryPill } from './NeighborhoodHubHero.astro';
|