@sarimarcus/content-sites-tourism 0.31.0 → 0.31.2
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 +9 -0
- package/package.json +3 -3
- package/src/cards/ActivityCard.astro +4 -10
- package/src/cards/BarCard.astro +85 -132
- package/src/cards/DishCard.astro +39 -73
- package/src/cards/HotelCard.astro +8 -25
- package/src/cards/MonumentCard.astro +37 -83
- package/src/cards/NeighborhoodCard.astro +3 -12
- package/src/cards/RestaurantCard.astro +79 -131
- package/src/cards/WalkCard.astro +50 -66
- package/src/templates/FacetHero.astro +2 -6
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.31.2 (2026-10-08)
|
|
6
|
+
|
|
7
|
+
- `./cards`: `RestaurantCard`, `BarCard`, `MonumentCard`/`MuseumCard`, `DishCard` and `WalkCard` render on ui `EntityCard`; every card's props are unchanged and Monument, Dish and Restaurant keep `eager` default 1 and `priority`. Intended output changes: Restaurant, Monument/Museum and Dish non-priority images drop `fetchpriority="auto"` (the spec default); the first `WalkCard` gains `fetchpriority="high"`; Monument's scoped `<style>` and its cid attributes are gone (its reduced-motion zoom cancel, which did not stop Tailwind's `scale`, is replaced by EntityCard's); whitespace around the frame changes (SLA-3019).
|
|
8
|
+
- `./cards`: the hand-written arrow CTAs (Restaurant, Bar, Hotel, Dish) become ui `ArrowLabel` (svg gains `shrink-0`); map-pin (Restaurant, Bar, Monument, Hotel, Activity), euro, circle-dollar-sign and Activity's clock draw through ui `Icon` (map-pin takes Lucide's current outline; Hotel's landmark and Restaurant's budget glyph keep stroke 2.5); Restaurant, Bar and Hotel stars use ui `RatingStars` (Hotel's star attributes reorder). `NeighborhoodCard` stays off EntityCard; only its restaurant and hotel count glyphs become `Icon` utensils and bed. Pages: the restaurant, dish, bar, hotel, activity, monument/museum, walk and neighbourhood listings and their category/facet pages, `index`, and the `dish/`, `restaurant/`, `neighborhood/` and Córdoba `discover/` pages that rail these cards (SLA-3019).
|
|
9
|
+
|
|
10
|
+
## 0.31.1 (2026-10-08)
|
|
11
|
+
|
|
12
|
+
- `FacetHero` (the Category, Neighborhood and Proximity facet pages) renders its breadcrumb strip through ui `<BreadcrumbBand ignore={false}>` instead of a hand-written copy; the output is byte-identical (SLA-3018).
|
|
13
|
+
|
|
5
14
|
## 0.31.0 (2026-10-08)
|
|
6
15
|
|
|
7
16
|
- `./cards` adds `GuideCard` (`GuideCardTone`: gold, terracotta, azulejo) and `EventCard` (takes `href`, `image`, `fallbackSrc`, `imageAlt`, `tagLabels`; the site adapter keeps the image glob, placeholder, tag labels and city alt) (SLA-3017).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-tourism",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.2",
|
|
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.31.
|
|
40
|
-
"@sarimarcus/content-sites-ui": "0.31.
|
|
39
|
+
"@sarimarcus/content-sites-core": "0.31.2",
|
|
40
|
+
"@sarimarcus/content-sites-ui": "0.31.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* other visible string come from the site adapter, which also resolves the image, href and placeholder.
|
|
6
6
|
*/
|
|
7
7
|
import type { ImageMetadata } from 'astro';
|
|
8
|
-
import { ArrowLabel, Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
8
|
+
import { ArrowLabel, Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
9
|
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
10
10
|
|
|
11
11
|
export interface ActivityCardStrings {
|
|
@@ -98,18 +98,14 @@ const categoryColor = categoryColors[category] || 'bg-accent text-foreground';
|
|
|
98
98
|
<div class="flex flex-wrap gap-3 text-sm text-muted-foreground mb-4">
|
|
99
99
|
{duration && (
|
|
100
100
|
<span class="inline-flex items-center gap-1.5">
|
|
101
|
-
<
|
|
102
|
-
<circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" />
|
|
103
|
-
</svg>
|
|
101
|
+
<Icon name="clock" class="w-3.5 h-3.5 text-accent-strong" />
|
|
104
102
|
<span class="sr-only">{strings.duration}</span>
|
|
105
103
|
<span>{duration}</span>
|
|
106
104
|
</span>
|
|
107
105
|
)}
|
|
108
106
|
{priceLabel && (
|
|
109
107
|
<span class="inline-flex items-center gap-1.5">
|
|
110
|
-
<
|
|
111
|
-
<path d="M4 10h12"/><path d="M4 14h9"/><path d="M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2"/>
|
|
112
|
-
</svg>
|
|
108
|
+
<Icon name="euro" class="w-3.5 h-3.5 text-accent" />
|
|
113
109
|
<span class="sr-only">{strings.price}</span>
|
|
114
110
|
<span>{priceLabel}</span>
|
|
115
111
|
</span>
|
|
@@ -125,9 +121,7 @@ const categoryColor = categoryColors[category] || 'bg-accent text-foreground';
|
|
|
125
121
|
)}
|
|
126
122
|
|
|
127
123
|
<span slot="footer-meta" class="inline-flex items-center gap-1.5 text-sm text-muted-foreground">
|
|
128
|
-
<
|
|
129
|
-
<path d="M12 22s-8-4.5-8-11.8A8 8 0 0 1 12 2a8 8 0 0 1 8 8.2c0 7.3-8 11.8-8 11.8z" /><circle cx="12" cy="10" r="3" />
|
|
130
|
-
</svg>
|
|
124
|
+
<Icon name="map-pin" class="w-3.5 h-3.5" />
|
|
131
125
|
<span class="sr-only">{strings.location}</span>
|
|
132
126
|
{locationLabel}
|
|
133
127
|
</span>
|
package/src/cards/BarCard.astro
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* BarCard — bar teaser. The category key picks the badge colour; its
|
|
4
|
-
* different feature keys), the closing line and every other visible
|
|
5
|
-
* resolves the image, href and placeholder. The price pill renders only
|
|
3
|
+
* BarCard — bar teaser on the ui EntityCard frame (media variant). The category key picks the badge colour; its
|
|
4
|
+
* label, the feature labels and icons (sites store different feature keys), the closing line and every other visible
|
|
5
|
+
* string come from the site adapter, which also resolves the image, href and placeholder. The price pill renders only
|
|
6
|
+
* when the value is label-length.
|
|
6
7
|
*/
|
|
7
8
|
import type { ImageMetadata } from 'astro';
|
|
8
|
-
import { Badge, isBadgeLength, PRICE_LABEL_MAX
|
|
9
|
+
import { ArrowLabel, Badge, Icon, RatingStars, isBadgeLength, PRICE_LABEL_MAX } from '@sarimarcus/content-sites-ui/primitives';
|
|
10
|
+
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
9
11
|
import type { CardRating } from './RestaurantCard.astro';
|
|
10
12
|
|
|
11
13
|
export interface BarFeature {
|
|
@@ -78,142 +80,93 @@ const categoryColors: Record<string, { bg: string; text: string }> = {
|
|
|
78
80
|
const categoryStyle = categoryColors[category] || { bg: 'bg-muted', text: 'text-muted-foreground' };
|
|
79
81
|
---
|
|
80
82
|
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
<div class="
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
sizes="(max-width: 1023px) 100vw, 50vw"
|
|
89
|
-
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
90
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
91
|
-
loading={index < 3 ? "eager" : "lazy"}
|
|
92
|
-
fetchpriority={index === 0 ? "high" : undefined}
|
|
93
|
-
decoding="async"
|
|
94
|
-
/>
|
|
95
|
-
) : (
|
|
96
|
-
<img
|
|
97
|
-
src={fallbackSrc}
|
|
98
|
-
alt={imageAlt}
|
|
99
|
-
width="320"
|
|
100
|
-
height="192"
|
|
101
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
102
|
-
loading={index < 3 ? "eager" : "lazy"}
|
|
103
|
-
fetchpriority={index === 0 ? "high" : undefined}
|
|
104
|
-
decoding="async"
|
|
105
|
-
/>
|
|
106
|
-
)}
|
|
83
|
+
<EntityCard href={href} image={image} fallbackSrc={fallbackSrc} imageAlt={imageAlt} index={index} mediaClass="h-56" sizes="(max-width: 1023px) 100vw, 50vw" class={className}>
|
|
84
|
+
<Fragment slot="overlay">
|
|
85
|
+
<div class="absolute top-3 left-3">
|
|
86
|
+
<Badge tone="custom" toneClass={`${categoryStyle.bg} ${categoryStyle.text}`} size="lg" lines={0} class="shadow-md backdrop-blur-sm">
|
|
87
|
+
{categoryLabel}
|
|
88
|
+
</Badge>
|
|
89
|
+
</div>
|
|
107
90
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
91
|
+
{isBadgeLength(priceLabel, PRICE_LABEL_MAX) && (
|
|
92
|
+
<div class="absolute bottom-3 left-3 max-w-[calc(100%-1.5rem)]">
|
|
93
|
+
<Badge tone="onImage" size="lg" lines={0} class="!px-2 !py-1">
|
|
94
|
+
<Icon name="euro" class="w-3 h-3 text-accent shrink-0" />{priceLabel}
|
|
111
95
|
</Badge>
|
|
112
96
|
</div>
|
|
97
|
+
)}
|
|
98
|
+
</Fragment>
|
|
113
99
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<div class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-1 sm:gap-2 mb-2">
|
|
128
|
-
<h3
|
|
129
|
-
class="text-lg sm:text-xl font-semibold text-card-foreground leading-tight font-display"
|
|
130
|
-
>
|
|
131
|
-
{name}
|
|
132
|
-
</h3>
|
|
133
|
-
{rating && (
|
|
134
|
-
<div class="flex items-center gap-1.5">
|
|
135
|
-
<div class="flex items-center gap-0.5" role="img" aria-label={rating.ariaLabel}>
|
|
136
|
-
{[1, 2, 3, 4, 5].map((star) => (
|
|
137
|
-
<svg
|
|
138
|
-
class={`w-4 h-4 ${star <= Math.round(rating.value) ? 'text-accent fill-current' : 'text-muted fill-current'}`}
|
|
139
|
-
aria-hidden="true"
|
|
140
|
-
viewBox="0 0 24 24"
|
|
141
|
-
>
|
|
142
|
-
<path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z" />
|
|
143
|
-
</svg>
|
|
144
|
-
))}
|
|
145
|
-
</div>
|
|
146
|
-
<span class="text-sm text-muted-foreground">{rating.text}</span>
|
|
147
|
-
</div>
|
|
148
|
-
)}
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
|
-
<p class="text-sm sm:text-base text-muted-foreground line-clamp-2 mb-3">
|
|
152
|
-
{description}
|
|
153
|
-
</p>
|
|
154
|
-
|
|
155
|
-
{atmosphere && (
|
|
156
|
-
<div class="mb-3">
|
|
157
|
-
<span class="inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted/90 text-muted-foreground rounded">
|
|
158
|
-
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
159
|
-
<path d="M9 18V5l12-2v13M6 18c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm12 0c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z" />
|
|
160
|
-
</svg>
|
|
161
|
-
{atmosphere}
|
|
162
|
-
</span>
|
|
163
|
-
</div>
|
|
164
|
-
)}
|
|
100
|
+
<div class="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-1 sm:gap-2 mb-2">
|
|
101
|
+
<h3
|
|
102
|
+
class="text-lg sm:text-xl font-semibold text-card-foreground leading-tight font-display"
|
|
103
|
+
>
|
|
104
|
+
{name}
|
|
105
|
+
</h3>
|
|
106
|
+
{rating && (
|
|
107
|
+
<div class="flex items-center gap-1.5">
|
|
108
|
+
<RatingStars value={rating.value} ariaLabel={rating.ariaLabel} sizeClass="w-4 h-4" />
|
|
109
|
+
<span class="text-sm text-muted-foreground">{rating.text}</span>
|
|
110
|
+
</div>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
165
113
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<span class="inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-muted/90 text-muted-foreground rounded" title={feature.key}>
|
|
170
|
-
{feature.iconPath && (
|
|
171
|
-
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
172
|
-
<path d={feature.iconPath} />
|
|
173
|
-
</svg>
|
|
174
|
-
)}
|
|
175
|
-
{feature.label}
|
|
176
|
-
</span>
|
|
177
|
-
))}
|
|
178
|
-
{featuresMoreLabel && (
|
|
179
|
-
<span class="inline-flex items-center px-2 py-0.5 text-xs bg-muted/60 text-muted-foreground rounded">
|
|
180
|
-
{featuresMoreLabel}
|
|
181
|
-
</span>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
)}
|
|
114
|
+
<p class="text-sm sm:text-base text-muted-foreground line-clamp-2 mb-3">
|
|
115
|
+
{description}
|
|
116
|
+
</p>
|
|
185
117
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
</
|
|
192
|
-
|
|
193
|
-
</
|
|
118
|
+
{atmosphere && (
|
|
119
|
+
<div class="mb-3">
|
|
120
|
+
<span class="inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted/90 text-muted-foreground rounded">
|
|
121
|
+
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
122
|
+
<path d="M9 18V5l12-2v13M6 18c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3zm12 0c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3z" />
|
|
123
|
+
</svg>
|
|
124
|
+
{atmosphere}
|
|
125
|
+
</span>
|
|
126
|
+
</div>
|
|
127
|
+
)}
|
|
194
128
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
129
|
+
{features.length > 0 && (
|
|
130
|
+
<div class="flex flex-wrap gap-1.5 mb-4">
|
|
131
|
+
{features.slice(0, 3).map((feature) => (
|
|
132
|
+
<span class="inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-muted/90 text-muted-foreground rounded" title={feature.key}>
|
|
133
|
+
{feature.iconPath && (
|
|
134
|
+
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
135
|
+
<path d={feature.iconPath} />
|
|
200
136
|
</svg>
|
|
201
|
-
{neighborhood}
|
|
202
|
-
</span>
|
|
203
|
-
{closingLabel && (
|
|
204
|
-
<span class="text-sm text-muted-foreground">
|
|
205
|
-
{closingLabel}
|
|
206
|
-
</span>
|
|
207
137
|
)}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
<span class="inline-flex items-center gap-2 text-sm font-medium text-primary group-hover:text-primary-strong transition-colors">
|
|
211
|
-
{ctaLabel}
|
|
212
|
-
<svg class="w-4 h-4 transition-transform group-hover:translate-x-1" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
213
|
-
<path d="M5 12h14" /><path d="m12 5 7 7-7 7" />
|
|
214
|
-
</svg>
|
|
138
|
+
{feature.label}
|
|
215
139
|
</span>
|
|
216
|
-
|
|
140
|
+
))}
|
|
141
|
+
{featuresMoreLabel && (
|
|
142
|
+
<span class="inline-flex items-center px-2 py-0.5 text-xs bg-muted/60 text-muted-foreground rounded">
|
|
143
|
+
{featuresMoreLabel}
|
|
144
|
+
</span>
|
|
145
|
+
)}
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
|
|
149
|
+
{tagLabels.length > 0 && (
|
|
150
|
+
<div class="flex flex-wrap gap-1.5 mb-3">
|
|
151
|
+
{tagLabels.map((label) => (
|
|
152
|
+
<Badge tone="primary" size="sm">{label}</Badge>
|
|
153
|
+
))}
|
|
217
154
|
</div>
|
|
218
|
-
|
|
219
|
-
|
|
155
|
+
)}
|
|
156
|
+
|
|
157
|
+
<div slot="footer-meta" class="flex flex-col gap-1">
|
|
158
|
+
<span class="inline-flex items-center gap-1.5 text-sm text-muted-foreground">
|
|
159
|
+
<Icon name="map-pin" class="w-3.5 h-3.5" />
|
|
160
|
+
{neighborhood}
|
|
161
|
+
</span>
|
|
162
|
+
{closingLabel && (
|
|
163
|
+
<span class="text-sm text-muted-foreground">
|
|
164
|
+
{closingLabel}
|
|
165
|
+
</span>
|
|
166
|
+
)}
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<ArrowLabel slot="footer-cta" class="text-sm font-medium text-primary group-hover:text-primary-strong transition-colors">
|
|
170
|
+
{ctaLabel}
|
|
171
|
+
</ArrowLabel>
|
|
172
|
+
</EntityCard>
|
package/src/cards/DishCard.astro
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* DishCard — dish teaser
|
|
4
|
-
*
|
|
3
|
+
* DishCard — dish teaser on the ui EntityCard frame (poster variant, no footer row: the CTA ends the body). The
|
|
4
|
+
* category key picks the badge colour; the label, tags and every other visible string come from the site adapter,
|
|
5
|
+
* which also resolves the image, href and placeholder.
|
|
5
6
|
*/
|
|
6
7
|
import type { ImageMetadata } from 'astro';
|
|
7
|
-
import {
|
|
8
|
+
import { ArrowLabel, Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
|
+
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
8
10
|
|
|
9
11
|
interface Props {
|
|
10
12
|
href: string;
|
|
@@ -45,9 +47,6 @@ const {
|
|
|
45
47
|
class: className,
|
|
46
48
|
} = Astro.props;
|
|
47
49
|
|
|
48
|
-
const fetchPriority = priority || index === 0 ? "high" : "auto";
|
|
49
|
-
const loadingStrategy = index < eager ? "eager" : "lazy";
|
|
50
|
-
|
|
51
50
|
// Contrast is AA for 12px text on every pairing.
|
|
52
51
|
const categoryColors: Record<string, string> = {
|
|
53
52
|
'starter': 'bg-primary text-overlay-foreground',
|
|
@@ -60,75 +59,42 @@ const categoryColor = categoryColors[category] || 'bg-accent text-foreground';
|
|
|
60
59
|
const audienceLabels = tagLabels.slice(0, 3);
|
|
61
60
|
---
|
|
62
61
|
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
<
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
alt={imageAlt}
|
|
70
|
-
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
71
|
-
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
72
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
73
|
-
loading={loadingStrategy}
|
|
74
|
-
fetchpriority={fetchPriority}
|
|
75
|
-
decoding="async"
|
|
76
|
-
/>
|
|
77
|
-
) : (
|
|
78
|
-
<img
|
|
79
|
-
src={fallbackSrc}
|
|
80
|
-
alt={imageAlt}
|
|
81
|
-
width="640"
|
|
82
|
-
height="384"
|
|
83
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
84
|
-
loading={loadingStrategy}
|
|
85
|
-
fetchpriority={fetchPriority}
|
|
86
|
-
decoding="async"
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
89
|
-
|
|
90
|
-
<div class="absolute top-3 left-3">
|
|
91
|
-
<Badge tone="custom" toneClass={categoryColor} size="lg" lines={0}>
|
|
92
|
-
{categoryLabel}
|
|
93
|
-
</Badge>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<div class="p-4 sm:p-5 flex flex-col flex-1">
|
|
98
|
-
<h3
|
|
99
|
-
class="text-xl font-semibold text-card-foreground mb-2 group-hover:text-primary transition-colors font-display"
|
|
100
|
-
>
|
|
101
|
-
{name}
|
|
102
|
-
</h3>
|
|
62
|
+
<EntityCard variant="poster" mediaClass="h-56" fallbackWidth="640" fallbackHeight="384" footer={false} href={href} image={image} fallbackSrc={fallbackSrc} imageAlt={imageAlt} index={index} eager={eager} priority={priority} class={className}>
|
|
63
|
+
<div slot="overlay" class="absolute top-3 left-3">
|
|
64
|
+
<Badge tone="custom" toneClass={categoryColor} size="lg" lines={0}>
|
|
65
|
+
{categoryLabel}
|
|
66
|
+
</Badge>
|
|
67
|
+
</div>
|
|
103
68
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
69
|
+
<h3
|
|
70
|
+
class="text-xl font-semibold text-card-foreground mb-2 group-hover:text-primary transition-colors font-display"
|
|
71
|
+
>
|
|
72
|
+
{name}
|
|
73
|
+
</h3>
|
|
107
74
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<span class="px-2 py-0.5 text-xs bg-muted text-muted-foreground rounded">
|
|
112
|
-
{tag}
|
|
113
|
-
</span>
|
|
114
|
-
))}
|
|
115
|
-
</div>
|
|
116
|
-
)}
|
|
75
|
+
<p class="text-base text-muted-foreground line-clamp-3 mb-4">
|
|
76
|
+
{description}
|
|
77
|
+
</p>
|
|
117
78
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
</
|
|
124
|
-
)}
|
|
79
|
+
{tags.length > 0 && (
|
|
80
|
+
<div class="flex flex-wrap gap-1.5 mb-4">
|
|
81
|
+
{tags.slice(0, 3).map((tag) => (
|
|
82
|
+
<span class="px-2 py-0.5 text-xs bg-muted text-muted-foreground rounded">
|
|
83
|
+
{tag}
|
|
84
|
+
</span>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
125
88
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
</div>
|
|
89
|
+
{audienceLabels.length > 0 && (
|
|
90
|
+
<div class="flex flex-wrap gap-1.5 mb-3">
|
|
91
|
+
{audienceLabels.map((label) => (
|
|
92
|
+
<Badge tone="primary" size="sm">{label}</Badge>
|
|
93
|
+
))}
|
|
132
94
|
</div>
|
|
133
|
-
|
|
134
|
-
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
<ArrowLabel class="text-sm font-medium text-primary group-hover:text-primary-strong transition-colors mt-auto">
|
|
98
|
+
{ctaLabel}
|
|
99
|
+
</ArrowLabel>
|
|
100
|
+
</EntityCard>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* visible string come from the site adapter, which also resolves the image, href and placeholder.
|
|
6
6
|
*/
|
|
7
7
|
import type { ImageMetadata } from 'astro';
|
|
8
|
-
import { Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
8
|
+
import { ArrowLabel, Badge, Icon, RatingStars } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
9
|
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
10
10
|
|
|
11
11
|
export interface CardAmenity {
|
|
@@ -90,9 +90,7 @@ const categoryStyle = categoryColors[category] || { bg: 'bg-muted', text: 'text-
|
|
|
90
90
|
<div class="absolute top-3 right-3 flex flex-col gap-1.5">
|
|
91
91
|
{landmarkBadge && (
|
|
92
92
|
<Badge tone="custom" toneClass="bg-primary text-overlay-foreground" size="sm" lines={0} class="!py-1 !gap-1">
|
|
93
|
-
<
|
|
94
|
-
<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" /><circle cx="12" cy="10" r="3" />
|
|
95
|
-
</svg>
|
|
93
|
+
<Icon name="map-pin" class="w-3 h-3" strokeWidth={2.5} />
|
|
96
94
|
{landmarkBadge}
|
|
97
95
|
</Badge>
|
|
98
96
|
)}
|
|
@@ -100,9 +98,7 @@ const categoryStyle = categoryColors[category] || { bg: 'bg-muted', text: 'text-
|
|
|
100
98
|
|
|
101
99
|
<div class="absolute bottom-3 left-3 max-w-[calc(100%-1.5rem)]">
|
|
102
100
|
<Badge tone="onImage" size="lg" lines={0} class="!px-2 !py-1">
|
|
103
|
-
<
|
|
104
|
-
<path d="M4 10h12"/><path d="M4 14h9"/><path d="M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2"/>
|
|
105
|
-
</svg>{priceLabel}
|
|
101
|
+
<Icon name="euro" class="w-3 h-3 text-accent shrink-0" />{priceLabel}
|
|
106
102
|
</Badge>
|
|
107
103
|
</div>
|
|
108
104
|
</Fragment>
|
|
@@ -115,20 +111,12 @@ const categoryStyle = categoryColors[category] || { bg: 'bg-muted', text: 'text-
|
|
|
115
111
|
{name}
|
|
116
112
|
</h3>
|
|
117
113
|
{stars && (
|
|
118
|
-
<
|
|
119
|
-
{Array.from({ length: stars.count }).map(() => (
|
|
120
|
-
<svg class="w-3.5 h-3.5 text-accent fill-current" viewBox="0 0 24 24" aria-hidden="true">
|
|
121
|
-
<path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z" />
|
|
122
|
-
</svg>
|
|
123
|
-
))}
|
|
124
|
-
</div>
|
|
114
|
+
<RatingStars count={stars.count} ariaLabel={stars.ariaLabel} class="shrink-0" />
|
|
125
115
|
)}
|
|
126
116
|
</div>
|
|
127
117
|
{budgetBadge && (
|
|
128
118
|
<Badge tone="custom" toneClass="bg-secondary/20 text-secondary" size="sm" lines={0} class="shrink-0 !gap-1">
|
|
129
|
-
<
|
|
130
|
-
<circle cx="12" cy="12" r="10" /><path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8" /><path d="M12 18V6" />
|
|
131
|
-
</svg>
|
|
119
|
+
<Icon name="circle-dollar-sign" class="w-3 h-3" />
|
|
132
120
|
{budgetBadge}
|
|
133
121
|
</Badge>
|
|
134
122
|
)}
|
|
@@ -167,16 +155,11 @@ const categoryStyle = categoryColors[category] || { bg: 'bg-muted', text: 'text-
|
|
|
167
155
|
)}
|
|
168
156
|
|
|
169
157
|
<span slot="footer-meta" class="inline-flex items-center gap-1.5 text-sm text-muted-foreground">
|
|
170
|
-
<
|
|
171
|
-
<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" /><circle cx="12" cy="10" r="3" />
|
|
172
|
-
</svg>
|
|
158
|
+
<Icon name="map-pin" class="w-3.5 h-3.5" />
|
|
173
159
|
{neighborhood}
|
|
174
160
|
</span>
|
|
175
161
|
|
|
176
|
-
<
|
|
162
|
+
<ArrowLabel slot="footer-cta" class="text-sm font-medium text-accent-strong group-hover:text-accent transition-colors">
|
|
177
163
|
{ctaLabel}
|
|
178
|
-
|
|
179
|
-
<path d="M5 12h14" /><path d="m12 5 7 7-7 7" />
|
|
180
|
-
</svg>
|
|
181
|
-
</span>
|
|
164
|
+
</ArrowLabel>
|
|
182
165
|
</EntityCard>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* MonumentCard — monument or museum teaser (exported under both names) for listings and related rails
|
|
4
|
-
* adapter resolves the image, the href, the placeholder and
|
|
3
|
+
* MonumentCard — monument or museum teaser (exported under both names) for listings and related rails, on the ui
|
|
4
|
+
* EntityCard frame (poster variant, accent tone). The site adapter resolves the image, the href, the placeholder and
|
|
5
|
+
* every visible string; the card only lays them out.
|
|
5
6
|
*/
|
|
6
7
|
import type { ImageMetadata } from 'astro';
|
|
7
|
-
import { ArrowLabel, Badge,
|
|
8
|
+
import { ArrowLabel, Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
|
+
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
8
10
|
|
|
9
11
|
interface Props {
|
|
10
12
|
href: string;
|
|
@@ -46,49 +48,10 @@ const {
|
|
|
46
48
|
priority = false,
|
|
47
49
|
class: className,
|
|
48
50
|
} = Astro.props;
|
|
49
|
-
|
|
50
|
-
const fetchPriority = priority || index === 0 ? "high" : "auto";
|
|
51
|
-
const loadingStrategy = index < eager ? "eager" : "lazy";
|
|
52
51
|
---
|
|
53
52
|
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
.group:hover .object-cover {
|
|
57
|
-
transform: none !important;
|
|
58
|
-
}
|
|
59
|
-
article {
|
|
60
|
-
transition: none !important;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
</style>
|
|
64
|
-
|
|
65
|
-
<article class:list={['group relative bg-card rounded-xl overflow-hidden card-lift border border-accent/20 flex flex-col h-full', className]}>
|
|
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">
|
|
67
|
-
<div class="relative h-56 sm:h-64 overflow-hidden img-placeholder shrink-0">
|
|
68
|
-
{image ? (
|
|
69
|
-
<ResponsivePicture
|
|
70
|
-
src={image}
|
|
71
|
-
alt={imageAlt}
|
|
72
|
-
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
73
|
-
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
74
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
75
|
-
loading={loadingStrategy}
|
|
76
|
-
fetchpriority={fetchPriority}
|
|
77
|
-
decoding="async"
|
|
78
|
-
/>
|
|
79
|
-
) : (
|
|
80
|
-
<img
|
|
81
|
-
src={fallbackSrc}
|
|
82
|
-
alt={imageAlt}
|
|
83
|
-
width="400"
|
|
84
|
-
height="224"
|
|
85
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
86
|
-
loading={loadingStrategy}
|
|
87
|
-
fetchpriority={fetchPriority}
|
|
88
|
-
decoding="async"
|
|
89
|
-
/>
|
|
90
|
-
)}
|
|
91
|
-
|
|
53
|
+
<EntityCard variant="poster" tone="accent" mediaClass="h-56 sm:h-64" href={href} image={image} fallbackSrc={fallbackSrc} imageAlt={imageAlt} index={index} eager={eager} priority={priority} class={className}>
|
|
54
|
+
<Fragment slot="overlay">
|
|
92
55
|
<div class="absolute top-3 left-3 flex flex-wrap gap-2">
|
|
93
56
|
{highlightBadge && (
|
|
94
57
|
<Badge tone="custom" toneClass="bg-accent-strong text-overlay-foreground" size="lg" lines={1} class="max-sm:text-xs">
|
|
@@ -101,47 +64,38 @@ const loadingStrategy = index < eager ? "eager" : "lazy";
|
|
|
101
64
|
<Badge tone="secondary" size="lg" lines={1} class="max-sm:text-xs">{badge}</Badge>
|
|
102
65
|
)}
|
|
103
66
|
</div>
|
|
104
|
-
</
|
|
105
|
-
|
|
106
|
-
<div class="p-4 sm:p-5 flex flex-col flex-1">
|
|
107
|
-
<h3 class="text-xl sm:text-2xl font-semibold leading-tight font-display mb-3">
|
|
108
|
-
{name}
|
|
109
|
-
</h3>
|
|
110
|
-
<p class="text-base text-muted-foreground line-clamp-3 mb-4">
|
|
111
|
-
{description}
|
|
112
|
-
</p>
|
|
67
|
+
</Fragment>
|
|
113
68
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<span>{priceLabel}</span>
|
|
121
|
-
</span>
|
|
122
|
-
</div>
|
|
123
|
-
)}
|
|
69
|
+
<h3 class="text-xl sm:text-2xl font-semibold leading-tight font-display mb-3">
|
|
70
|
+
{name}
|
|
71
|
+
</h3>
|
|
72
|
+
<p class="text-base text-muted-foreground line-clamp-3 mb-4">
|
|
73
|
+
{description}
|
|
74
|
+
</p>
|
|
124
75
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
</div>
|
|
131
|
-
)}
|
|
132
|
-
|
|
133
|
-
<div class="flex items-center justify-between pt-3 border-t border-border mt-auto">
|
|
134
|
-
<span class="inline-flex items-center gap-1.5 text-sm text-muted-foreground font-medium">
|
|
135
|
-
<svg class="w-4 h-4 text-accent shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
136
|
-
<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" /><circle cx="12" cy="10" r="3" />
|
|
137
|
-
</svg>
|
|
138
|
-
<span class="truncate">{neighborhood}</span>
|
|
76
|
+
{priceLabel && (
|
|
77
|
+
<div class="flex flex-col gap-2 text-sm text-muted-foreground mb-4">
|
|
78
|
+
<span class="inline-flex items-center gap-1.5">
|
|
79
|
+
<Icon name="euro" class="w-3.5 h-3.5 text-accent shrink-0" />
|
|
80
|
+
<span>{priceLabel}</span>
|
|
139
81
|
</span>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
140
84
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
85
|
+
{tagLabels.length > 0 && (
|
|
86
|
+
<div class="flex flex-wrap gap-1.5 mb-3">
|
|
87
|
+
{tagLabels.slice(0, 3).map((label) => (
|
|
88
|
+
<Badge tone="primary" size="sm">{label}</Badge>
|
|
89
|
+
))}
|
|
144
90
|
</div>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
<span slot="footer-meta" class="inline-flex items-center gap-1.5 text-sm text-muted-foreground font-medium">
|
|
94
|
+
<Icon name="map-pin" class="w-4 h-4 text-accent shrink-0" />
|
|
95
|
+
<span class="truncate">{neighborhood}</span>
|
|
96
|
+
</span>
|
|
97
|
+
|
|
98
|
+
<ArrowLabel slot="footer-cta" class="text-sm font-medium text-accent-strong group-hover:text-accent transition-colors">
|
|
99
|
+
{ctaLabel}
|
|
100
|
+
</ArrowLabel>
|
|
101
|
+
</EntityCard>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Layers: image 0, gradient 10, title and meta 20, badge 30, attractions 40.
|
|
7
7
|
*/
|
|
8
8
|
import type { ImageMetadata } from 'astro';
|
|
9
|
-
import { Badge, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
|
+
import { Badge, Icon, ResponsivePicture } from '@sarimarcus/content-sites-ui/primitives';
|
|
10
10
|
|
|
11
11
|
export type NeighborhoodBadgeTone = 'primary' | 'accent' | 'secondary' | 'overlay';
|
|
12
12
|
|
|
@@ -154,22 +154,13 @@ const cardHeight = 'h-72 sm:h-80';
|
|
|
154
154
|
)}
|
|
155
155
|
{counts.restaurants && (
|
|
156
156
|
<span class="inline-flex items-center gap-1.5 text-xs text-overlay-foreground/80">
|
|
157
|
-
<
|
|
158
|
-
<path d="M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2" />
|
|
159
|
-
<path d="M7 2v20" />
|
|
160
|
-
<path d="M21 15V2v0a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7" />
|
|
161
|
-
</svg>
|
|
157
|
+
<Icon name="utensils" class="w-3.5 h-3.5 text-accent" />
|
|
162
158
|
{counts.restaurants}
|
|
163
159
|
</span>
|
|
164
160
|
)}
|
|
165
161
|
{counts.hotels && (
|
|
166
162
|
<span class="inline-flex items-center gap-1.5 text-xs text-overlay-foreground/80">
|
|
167
|
-
<
|
|
168
|
-
<path d="M2 4v16" />
|
|
169
|
-
<path d="M2 8h18a2 2 0 0 1 2 2v10" />
|
|
170
|
-
<path d="M2 17h20" />
|
|
171
|
-
<path d="M6 8v9" />
|
|
172
|
-
</svg>
|
|
163
|
+
<Icon name="bed" class="w-3.5 h-3.5 text-secondary-soft" />
|
|
173
164
|
{counts.hotels}
|
|
174
165
|
</span>
|
|
175
166
|
)}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* RestaurantCard — restaurant teaser for listings, facets and related rails
|
|
4
|
-
* placeholder, badge decisions and every visible string; the card
|
|
3
|
+
* RestaurantCard — restaurant teaser for listings, facets and related rails, on the ui EntityCard frame (media
|
|
4
|
+
* variant). The site adapter resolves the image, href, placeholder, badge decisions and every visible string; the card
|
|
5
|
+
* only lays them out.
|
|
5
6
|
* The cuisine pill shows only the first segment of a prose-capped field, so it must stay under the 48-char badge
|
|
6
7
|
* overflow ceiling. The price pill renders only when the value is label-length; a prose-length price stays in the
|
|
7
8
|
* inline price row.
|
|
8
9
|
*/
|
|
9
10
|
import type { ImageMetadata } from 'astro';
|
|
10
|
-
import { Badge, isBadgeLength, PRICE_LABEL_MAX
|
|
11
|
+
import { ArrowLabel, Badge, Icon, RatingStars, isBadgeLength, PRICE_LABEL_MAX } from '@sarimarcus/content-sites-ui/primitives';
|
|
12
|
+
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
11
13
|
|
|
12
14
|
export interface CardRating {
|
|
13
15
|
value: number;
|
|
@@ -68,144 +70,90 @@ const {
|
|
|
68
70
|
priority = false,
|
|
69
71
|
class: className,
|
|
70
72
|
} = Astro.props;
|
|
71
|
-
|
|
72
|
-
const fetchPriority = priority || index === 0 ? "high" : "auto";
|
|
73
|
-
const loadingStrategy = index < eager ? "eager" : "lazy";
|
|
74
73
|
---
|
|
75
74
|
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
<div class="
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
src={image}
|
|
82
|
-
alt={imageAlt}
|
|
83
|
-
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
84
|
-
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
85
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
86
|
-
loading={loadingStrategy}
|
|
87
|
-
fetchpriority={fetchPriority}
|
|
88
|
-
decoding="async"
|
|
89
|
-
/>
|
|
90
|
-
) : (
|
|
91
|
-
<img
|
|
92
|
-
src={fallbackSrc}
|
|
93
|
-
alt={imageAlt}
|
|
94
|
-
width="320"
|
|
95
|
-
height="192"
|
|
96
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
97
|
-
loading={loadingStrategy}
|
|
98
|
-
fetchpriority={fetchPriority}
|
|
99
|
-
decoding="async"
|
|
100
|
-
/>
|
|
101
|
-
)}
|
|
75
|
+
<EntityCard href={href} image={image} fallbackSrc={fallbackSrc} imageAlt={imageAlt} index={index} eager={eager} priority={priority} class:list={['hover:bg-primary/5', className]}>
|
|
76
|
+
<Fragment slot="overlay">
|
|
77
|
+
<div class="absolute top-3 left-3 max-w-[70%]">
|
|
78
|
+
<Badge tone="custom" toneClass="bg-accent-strong text-overlay-foreground" size="lg" lines={2}>{cuisineLabel}</Badge>
|
|
79
|
+
</div>
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
{budgetBadge && (
|
|
82
|
+
<div class="absolute top-3 right-3">
|
|
83
|
+
<Badge tone="custom" toneClass="bg-secondary text-overlay-foreground" size="sm" lines={0} class="!py-1 !gap-1">
|
|
84
|
+
<Icon name="circle-dollar-sign" class="w-3 h-3" strokeWidth={2.5} />
|
|
85
|
+
{budgetBadge}
|
|
86
|
+
</Badge>
|
|
105
87
|
</div>
|
|
88
|
+
)}
|
|
106
89
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</div>
|
|
116
|
-
)}
|
|
117
|
-
|
|
118
|
-
{isBadgeLength(priceLabel, PRICE_LABEL_MAX) && (
|
|
119
|
-
<div class="absolute bottom-3 left-3 max-w-[calc(100%-1.5rem)]">
|
|
120
|
-
<Badge tone="onImage" size="lg" lines={0} class="!px-2 !py-1 shadow-sm">
|
|
121
|
-
<svg class="w-3 h-3 text-accent shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
122
|
-
<path d="M4 10h12"/><path d="M4 14h9"/><path d="M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2"/>
|
|
123
|
-
</svg>{priceLabel}
|
|
124
|
-
</Badge>
|
|
125
|
-
</div>
|
|
126
|
-
)}
|
|
127
|
-
</div>
|
|
90
|
+
{isBadgeLength(priceLabel, PRICE_LABEL_MAX) && (
|
|
91
|
+
<div class="absolute bottom-3 left-3 max-w-[calc(100%-1.5rem)]">
|
|
92
|
+
<Badge tone="onImage" size="lg" lines={0} class="!px-2 !py-1 shadow-sm">
|
|
93
|
+
<Icon name="euro" class="w-3 h-3 text-accent shrink-0" />{priceLabel}
|
|
94
|
+
</Badge>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
</Fragment>
|
|
128
98
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
class={`w-3.5 h-3.5 ${star <= Math.round(rating.value) ? 'text-accent fill-current' : 'text-muted fill-current'}`}
|
|
143
|
-
aria-hidden="true"
|
|
144
|
-
viewBox="0 0 24 24"
|
|
145
|
-
>
|
|
146
|
-
<path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z" />
|
|
147
|
-
</svg>
|
|
148
|
-
))}
|
|
149
|
-
</div>
|
|
150
|
-
<span class="text-sm text-muted-foreground">{rating.text}</span>
|
|
151
|
-
</div>
|
|
152
|
-
)}
|
|
153
|
-
</div>
|
|
99
|
+
<div class="flex items-start justify-between gap-2 mb-2">
|
|
100
|
+
<h3
|
|
101
|
+
class="text-lg sm:text-xl font-semibold text-card-foreground leading-tight font-display"
|
|
102
|
+
>
|
|
103
|
+
{name}
|
|
104
|
+
</h3>
|
|
105
|
+
{rating && (
|
|
106
|
+
<div class="flex items-center gap-1.5 shrink-0">
|
|
107
|
+
<RatingStars value={rating.value} ariaLabel={rating.ariaLabel} />
|
|
108
|
+
<span class="text-sm text-muted-foreground">{rating.text}</span>
|
|
109
|
+
</div>
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
154
112
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
113
|
+
<p class="text-base text-muted-foreground line-clamp-2 mb-3">
|
|
114
|
+
{description}
|
|
115
|
+
</p>
|
|
158
116
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
117
|
+
<p class="text-sm text-muted-foreground mb-3">
|
|
118
|
+
<span class="font-medium text-card-foreground">{priceLabel}</span> {priceSuffix}
|
|
119
|
+
</p>
|
|
162
120
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
</span>
|
|
169
|
-
))}
|
|
170
|
-
{specialtiesMoreLabel && (
|
|
171
|
-
<span class="px-2 py-0.5 text-xs bg-muted text-muted-foreground/70 rounded italic">
|
|
172
|
-
{specialtiesMoreLabel}
|
|
173
|
-
</span>
|
|
174
|
-
)}
|
|
175
|
-
{vegetarianLabel && (
|
|
176
|
-
<span class="inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-secondary/10 text-secondary rounded">
|
|
177
|
-
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
178
|
-
<path d="M7 20h10" /><path d="M10 20c5.5-2.5.8-6.4 3-10" /><path d="M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z" />
|
|
179
|
-
</svg>
|
|
180
|
-
{vegetarianLabel}
|
|
181
|
-
</span>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
)}
|
|
185
|
-
{tagLabels.length > 0 && (
|
|
186
|
-
<div class="flex flex-wrap gap-1.5 mb-3">
|
|
187
|
-
{tagLabels.map((label) => (
|
|
188
|
-
<Badge tone="primary" size="sm">{label}</Badge>
|
|
189
|
-
))}
|
|
190
|
-
</div>
|
|
191
|
-
)}
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
<div class="flex items-center justify-between pt-3 border-t border-border">
|
|
195
|
-
<span class="inline-flex items-center gap-1.5 text-sm text-muted-foreground">
|
|
196
|
-
<svg class="w-3.5 h-3.5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
197
|
-
<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" /><circle cx="12" cy="10" r="3" />
|
|
198
|
-
</svg>
|
|
199
|
-
{neighborhood}
|
|
121
|
+
{specialties.length > 0 && (
|
|
122
|
+
<div class="flex flex-wrap gap-1.5 mb-4">
|
|
123
|
+
{specialties.slice(0, 4).map((specialty) => (
|
|
124
|
+
<span class="px-2 py-0.5 text-xs bg-muted text-muted-foreground rounded">
|
|
125
|
+
{specialty}
|
|
200
126
|
</span>
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
127
|
+
))}
|
|
128
|
+
{specialtiesMoreLabel && (
|
|
129
|
+
<span class="px-2 py-0.5 text-xs bg-muted text-muted-foreground/70 rounded italic">
|
|
130
|
+
{specialtiesMoreLabel}
|
|
131
|
+
</span>
|
|
132
|
+
)}
|
|
133
|
+
{vegetarianLabel && (
|
|
134
|
+
<span class="inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-secondary/10 text-secondary rounded">
|
|
135
|
+
<svg class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
136
|
+
<path d="M7 20h10" /><path d="M10 20c5.5-2.5.8-6.4 3-10" /><path d="M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z" />
|
|
206
137
|
</svg>
|
|
138
|
+
{vegetarianLabel}
|
|
207
139
|
</span>
|
|
208
|
-
|
|
140
|
+
)}
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
{tagLabels.length > 0 && (
|
|
144
|
+
<div class="flex flex-wrap gap-1.5 mb-3">
|
|
145
|
+
{tagLabels.map((label) => (
|
|
146
|
+
<Badge tone="primary" size="sm">{label}</Badge>
|
|
147
|
+
))}
|
|
209
148
|
</div>
|
|
210
|
-
|
|
211
|
-
|
|
149
|
+
)}
|
|
150
|
+
|
|
151
|
+
<span slot="footer-meta" class="inline-flex items-center gap-1.5 text-sm text-muted-foreground">
|
|
152
|
+
<Icon name="map-pin" class="w-3.5 h-3.5" />
|
|
153
|
+
{neighborhood}
|
|
154
|
+
</span>
|
|
155
|
+
|
|
156
|
+
<ArrowLabel slot="footer-cta" class="text-sm font-medium text-primary group-hover:text-primary-strong transition-colors">
|
|
157
|
+
{ctaLabel}
|
|
158
|
+
</ArrowLabel>
|
|
159
|
+
</EntityCard>
|
package/src/cards/WalkCard.astro
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
/**
|
|
3
|
-
* WalkCard — walking-route teaser. Theme and difficulty keys pick the badge
|
|
4
|
-
* visible string come from the site adapter. Without an image the card shows a
|
|
3
|
+
* WalkCard — walking-route teaser on the ui EntityCard frame (poster variant). Theme and difficulty keys pick the badge
|
|
4
|
+
* colours; their labels and every other visible string come from the site adapter. Without an image the card shows a
|
|
5
|
+
* footsteps placeholder.
|
|
5
6
|
*/
|
|
6
7
|
import type { ImageMetadata } from 'astro';
|
|
7
|
-
import { ArrowLabel, Badge, Icon
|
|
8
|
+
import { ArrowLabel, Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
9
|
+
import { EntityCard } from '@sarimarcus/content-sites-ui/composed';
|
|
8
10
|
|
|
9
11
|
export interface WalkCardStrings {
|
|
10
12
|
/** Screen-reader labels before each meta value. */
|
|
@@ -69,73 +71,55 @@ const difficultyColors: Record<string, string> = {
|
|
|
69
71
|
const difficultyColor = difficultyColors[difficulty] || 'bg-muted text-muted-foreground';
|
|
70
72
|
---
|
|
71
73
|
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
alt={imageAlt}
|
|
79
|
-
sizes="(max-width: 639px) 100vw, (max-width: 1023px) 50vw, 33vw"
|
|
80
|
-
pictureAttributes={{ class: 'block w-full h-full' }}
|
|
81
|
-
class="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"
|
|
82
|
-
loading={index < 3 ? "eager" : "lazy"}
|
|
83
|
-
decoding="async"
|
|
84
|
-
/>
|
|
85
|
-
) : (
|
|
86
|
-
<div class="w-full h-full bg-muted flex items-center justify-center">
|
|
87
|
-
<svg class="w-12 h-12 text-muted-foreground/30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">
|
|
88
|
-
<path d="M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5 10 7.89 9 10.38 9 13v3M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 2.39 1 4.88 1 7.5v3" />
|
|
89
|
-
</svg>
|
|
90
|
-
</div>
|
|
91
|
-
)}
|
|
74
|
+
<EntityCard variant="poster" footerJustify="end" href={href} image={image} imageAlt={imageAlt} index={index} class={className}>
|
|
75
|
+
<div slot="fallback" class="w-full h-full bg-muted flex items-center justify-center">
|
|
76
|
+
<svg class="w-12 h-12 text-muted-foreground/30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">
|
|
77
|
+
<path d="M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5 10 7.89 9 10.38 9 13v3M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 2.39 1 4.88 1 7.5v3" />
|
|
78
|
+
</svg>
|
|
79
|
+
</div>
|
|
92
80
|
|
|
93
|
-
|
|
81
|
+
<Fragment slot="overlay">
|
|
82
|
+
<div class="absolute inset-0 bg-gradient-to-t from-overlay/95 via-overlay/20 to-transparent"></div>
|
|
94
83
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
84
|
+
<div class="absolute top-3 right-3 flex flex-wrap gap-2">
|
|
85
|
+
<Badge tone="custom" toneClass={themeColor} size="sm" lines={0} class="!py-1">
|
|
86
|
+
{themeLabel}
|
|
87
|
+
</Badge>
|
|
88
|
+
<Badge tone="custom" toneClass={difficultyColor} size="sm" lines={0} class="!py-1">
|
|
89
|
+
{difficultyLabel}
|
|
90
|
+
</Badge>
|
|
91
|
+
</div>
|
|
103
92
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</div>
|
|
93
|
+
<div class="absolute bottom-0 left-0 right-0 p-4">
|
|
94
|
+
<h3 class="text-xl sm:text-2xl font-semibold text-overlay-foreground leading-tight font-display">
|
|
95
|
+
{name}
|
|
96
|
+
</h3>
|
|
109
97
|
</div>
|
|
98
|
+
</Fragment>
|
|
110
99
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
</p>
|
|
100
|
+
<p class="text-base text-muted-foreground line-clamp-2 mb-4">
|
|
101
|
+
{description}
|
|
102
|
+
</p>
|
|
115
103
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
104
|
+
<div class="flex flex-wrap gap-3 text-sm text-muted-foreground mb-4">
|
|
105
|
+
<span class="inline-flex items-center gap-1.5">
|
|
106
|
+
<Icon name="clock" class="w-3.5 h-3.5 text-primary" />
|
|
107
|
+
<span class="sr-only">{strings.duration}</span>
|
|
108
|
+
<span>{duration}</span>
|
|
109
|
+
</span>
|
|
110
|
+
<span class="inline-flex items-center gap-1.5">
|
|
111
|
+
<Icon name="route" class="w-3.5 h-3.5 text-primary" />
|
|
112
|
+
<span class="sr-only">{strings.distance}</span>
|
|
113
|
+
<span>{distance}</span>
|
|
114
|
+
</span>
|
|
115
|
+
<span class="inline-flex items-center gap-1.5">
|
|
116
|
+
<Icon name="map-pin" class="w-3.5 h-3.5 text-accent" />
|
|
117
|
+
<span class="sr-only">{strings.stops}</span>
|
|
118
|
+
<span>{stopsLabel}</span>
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
133
121
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</a>
|
|
141
|
-
</article>
|
|
122
|
+
<ArrowLabel slot="footer-cta" class="text-sm font-medium text-accent-strong group-hover:text-accent transition-colors">
|
|
123
|
+
{strings.cta}
|
|
124
|
+
</ArrowLabel>
|
|
125
|
+
</EntityCard>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* an Icon name (`icon`) or, without it, the `icon` slot.
|
|
5
5
|
*/
|
|
6
6
|
import { Badge, Icon } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
-
import { Container } from '@sarimarcus/content-sites-ui/layout';
|
|
7
|
+
import { BreadcrumbBand, Container } from '@sarimarcus/content-sites-ui/layout';
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
/** Hero background classes, e.g. a full `bg-gradient-to-b from-… to-…` string. */
|
|
@@ -20,11 +20,7 @@ interface Props {
|
|
|
20
20
|
const { bgClass, badgeToneClass, badgeLabel, heading, lede, icon } = Astro.props;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<
|
|
24
|
-
<Container class="py-3">
|
|
25
|
-
<slot name="breadcrumb" />
|
|
26
|
-
</Container>
|
|
27
|
-
</div>
|
|
23
|
+
<BreadcrumbBand ignore={false}><slot name="breadcrumb" /></BreadcrumbBand>
|
|
28
24
|
|
|
29
25
|
<section class={`relative py-16 lg:py-24 ${bgClass} text-overlay-foreground overflow-hidden`}>
|
|
30
26
|
<Container class="relative">
|