@sarimarcus/content-sites-tourism 0.24.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 CHANGED
@@ -2,6 +2,15 @@
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
+
5
14
  ## 0.24.0 (2026-10-05)
6
15
 
7
16
  - Cards and `RankedListingRow` render their images through ui `ResponsivePicture`; output loses only the redundant `<source>` (SLA-2960).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-tourism",
3
- "version": "0.24.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.24.0",
40
- "@sarimarcus/content-sites-ui": "0.24.0"
39
+ "@sarimarcus/content-sites-core": "0.25.0",
40
+ "@sarimarcus/content-sites-ui": "0.25.0"
41
41
  }
42
42
  }
@@ -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
- * Hrefs and strings come from the site adapter.
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
- name: string;
11
- href: string;
12
- description: string;
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
- ctaLabel: string;
22
- ctaHref: string;
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
- ctaLabel,
32
- ctaHref,
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.href}
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.name}
74
+ {stop.neighborhood}
73
75
  </h3>
74
76
  <p class:list={['text-sm text-overlay-foreground/60', stop.duration && 'mb-3']}>
75
- {stop.description}
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
- {ctaLabel}
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>
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * RankedListingRow — one entry in a numbered editorial ranking list, e.g. a proximity page that reads top-to-bottom by
4
4
  * distance. Rendered inside the caller's `<ol>`. The whole row is one real link, so the name stays selectable text.
5
- * The site adapter resolves the image and supplies every visible string.
5
+ * The site adapter resolves the image.
6
6
  */
7
7
  import type { ImageMetadata } from 'astro';
8
8
  import { Icon, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
@@ -19,14 +19,14 @@ interface Props {
19
19
  /** e.g. "6 min walk" */
20
20
  walkLabel: string;
21
21
  rating?: number;
22
- /** Screen-reader suffix after the rating, e.g. "out of 5". */
23
- ratingSuffix: string;
22
+ /** Screen-reader suffix after the rating. */
23
+ ratingSuffix?: string;
24
24
  /** Cuisine, category or star line. */
25
25
  meta?: string;
26
26
  priceLine?: string;
27
27
  specialties?: string[];
28
28
  description: string;
29
- ctaLabel: string;
29
+ ctaLabel?: string;
30
30
  }
31
31
 
32
32
  const {
@@ -39,12 +39,12 @@ const {
39
39
  distanceText,
40
40
  walkLabel,
41
41
  rating,
42
- ratingSuffix,
42
+ ratingSuffix = 'out of 5',
43
43
  meta,
44
44
  priceLine,
45
45
  specialties = [],
46
46
  description,
47
- ctaLabel,
47
+ ctaLabel = 'Read more',
48
48
  } = Astro.props;
49
49
 
50
50
  const paddedRank = String(rank).padStart(2, '0');
@@ -1,30 +1,48 @@
1
1
  ---
2
2
  /**
3
- * WalkStops — numbered stop-by-stop route for a walk detail page. The site adapter resolves each stop's href and type
4
- * label and supplies the heading and tip label.
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
- typeLabel: string;
13
- /** Omitted when the stop has no page of its own. */
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: string;
22
- /** Prefix before a stop's tip, e.g. "Tip:". */
23
- tipLabel: string;
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
- {stop.href ? (
53
- <a href={stop.href} class="text-lg sm:text-xl font-display font-semibold text-foreground hover:text-primary transition-colors">
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.typeLabel}
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 links (dropping tags with nowhere to go) and supplies the label and aria-label. Fewer than two
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 WhoItsForLink {
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
- links: WhoItsForLink[];
17
- label: string;
18
- ariaLabel: string;
18
+ tags: readonly WhoItsForTag[];
19
+ label?: string;
20
+ ariaLabel?: string;
19
21
  class?: string;
20
22
  }
21
23
 
22
- const { links, label, ariaLabel, class: className = '' } = Astro.props;
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
 
@@ -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 { WhoItsForLink } from './WhoItsFor.astro';
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';