@sarimarcus/content-sites-ui 0.67.0 → 0.68.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,20 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.68.0 (2026-11-13)
|
|
6
|
+
|
|
7
|
+
Additive (SLA-4105).
|
|
8
|
+
|
|
9
|
+
- `AffiliateLink`: the trailing icon stays beside the last word when the label wraps. The anchor renders `display: inline` (overriding sites' `a:has(> svg)` flex rules) and the icon takes `ml-0.5 inline-block h-3 w-3 align-middle`.
|
|
10
|
+
- `CardCarousel`: new `staticFrom="base"` renders a static wrapping grid at every width (`data-carousel-static`, no arrows, dots or track tabindex; an empty header is not rendered). `staticFrom="sm"` and the default are unchanged.
|
|
11
|
+
|
|
12
|
+
### Intended output changes
|
|
13
|
+
|
|
14
|
+
- `css:added` — one added rule on every site, `.ml-0.5`, the AffiliateLink icon margin.
|
|
15
|
+
- `turism-granada-en=html:index.html` — AffiliateLink markup only.
|
|
16
|
+
- `turism-cordoba-en=html:index.html` — AffiliateLink markup only.
|
|
17
|
+
- `turism-cordoba-en=html:discover/cordoba-in-summer.html` — AffiliateLink markup only.
|
|
18
|
+
|
|
5
19
|
## 0.67.0 (2026-11-12)
|
|
6
20
|
|
|
7
21
|
- No changes (lockstep release).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"@lucide/astro": "^1.23.0",
|
|
52
52
|
"astro": "^7.0.6",
|
|
53
53
|
"tailwindcss": "^4.1.18",
|
|
54
|
-
"@sarimarcus/content-sites-core": "0.
|
|
54
|
+
"@sarimarcus/content-sites-core": "0.68.0"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* AffiliateLink — an inline affiliate text link with the external-link glyph. `href` arrives finished (tagged by the
|
|
4
4
|
* site); `rel` defaults to the sponsored relation every affiliate link must carry, so a caller passes another value
|
|
5
5
|
* only for a classified non-affiliate link. `productId` adds the product dimension when the site has one.
|
|
6
|
+
* Inline display overrides sites' generic a:has(> svg) flex rules, keeping the glyph beside the last wrapped word.
|
|
6
7
|
*/
|
|
7
8
|
interface Props {
|
|
8
9
|
href: string;
|
|
@@ -24,14 +25,14 @@ const { href, provider, placement, productId, rel = 'sponsored noopener', class:
|
|
|
24
25
|
data-track-affiliate-provider={provider}
|
|
25
26
|
data-track-affiliate-product-id={productId}
|
|
26
27
|
data-track-affiliate-placement={placement}
|
|
28
|
+
style="display: inline"
|
|
27
29
|
class:list={[
|
|
28
|
-
"
|
|
30
|
+
"underline decoration-dotted underline-offset-2 hover:decoration-solid transition-all",
|
|
29
31
|
className,
|
|
30
32
|
]}
|
|
31
33
|
>
|
|
32
|
-
<slot
|
|
33
|
-
|
|
34
|
-
class="w-3 h-3 inline-block"
|
|
34
|
+
<slot /><svg
|
|
35
|
+
class="ml-0.5 inline-block h-3 w-3 align-middle"
|
|
35
36
|
viewBox="0 0 24 24"
|
|
36
37
|
fill="none"
|
|
37
38
|
stroke="currentColor"
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
* `staticFrom="sm"` keeps the strip a carousel on phones only: from `sm` up the track stops scrolling and lays its
|
|
13
13
|
* cards out as `trackClass` says (e.g. `sm:grid sm:grid-cols-3`; give the cards `sm:w-auto`), and the controls
|
|
14
14
|
* stay hidden. A header with nothing in it is hidden from `sm` up too.
|
|
15
|
+
*
|
|
16
|
+
* `staticFrom="base"` is never a carousel: no arrows, no dots, no scroll, no focus stop, and ./carousel.ts skips it
|
|
17
|
+
* (it carries `data-carousel-static`, not `data-carousel`). The track is `trackClass` alone (default
|
|
18
|
+
* `flex flex-wrap gap-4`), so the cards drop their carousel widths. A header with nothing in it is not rendered.
|
|
15
19
|
*/
|
|
16
20
|
import Icon from '../primitives/Icon.astro';
|
|
17
21
|
import { deterministicId } from '@sarimarcus/content-sites-core/dom';
|
|
@@ -40,8 +44,8 @@ interface Props {
|
|
|
40
44
|
/** Accessible names of the arrows, given the carousel's name (undefined when it has none). */
|
|
41
45
|
previousLabel?: (name: string | undefined) => string;
|
|
42
46
|
nextLabel?: (name: string | undefined) => string;
|
|
43
|
-
/** From this breakpoint up the track stops scrolling and becomes a static layout (see the header comment). */
|
|
44
|
-
staticFrom?: 'sm';
|
|
47
|
+
/** From this breakpoint up the track stops scrolling and becomes a static layout; `base` = always (see the header comment). */
|
|
48
|
+
staticFrom?: 'sm' | 'base';
|
|
45
49
|
/** Extra classes on the track, e.g. the static layout's grid. */
|
|
46
50
|
trackClass?: string;
|
|
47
51
|
locale?: string;
|
|
@@ -80,9 +84,16 @@ const arrowClass =
|
|
|
80
84
|
const trackClass =
|
|
81
85
|
'-mx-4 flex gap-4 overflow-x-auto scroll-px-4 px-4 py-1.5 snap-x snap-mandatory sm:mx-0 sm:scroll-px-0 sm:px-0 scrollbar-hide focus-visible:rounded-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary';
|
|
82
86
|
const emptyHeader = !heading && !description && !viewAllHref && !Astro.slots.has('header-note');
|
|
87
|
+
const alwaysStatic = staticFrom === 'base';
|
|
83
88
|
---
|
|
84
89
|
|
|
85
|
-
<div
|
|
90
|
+
<div
|
|
91
|
+
id={id}
|
|
92
|
+
data-carousel={alwaysStatic ? undefined : containerId}
|
|
93
|
+
data-carousel-static={alwaysStatic ? containerId : undefined}
|
|
94
|
+
class:list={['scroll-mt-28', className]}
|
|
95
|
+
>
|
|
96
|
+
{!(alwaysStatic && emptyHeader) && (
|
|
86
97
|
<div class:list={['mb-5 flex items-end justify-between gap-4', staticFrom === 'sm' && emptyHeader && 'sm:hidden']}>
|
|
87
98
|
<div class="min-w-0 flex-1">
|
|
88
99
|
{heading && (
|
|
@@ -104,6 +115,7 @@ const emptyHeader = !heading && !description && !viewAllHref && !Astro.slots.has
|
|
|
104
115
|
<Icon name="arrow-right" class="h-4 w-4" aria-hidden="true" />
|
|
105
116
|
</a>
|
|
106
117
|
)}
|
|
118
|
+
{!alwaysStatic && (
|
|
107
119
|
<div data-carousel-arrows class="hidden gap-2">
|
|
108
120
|
<button
|
|
109
121
|
data-carousel-prev
|
|
@@ -123,19 +135,21 @@ const emptyHeader = !heading && !description && !viewAllHref && !Astro.slots.has
|
|
|
123
135
|
<Icon name="chevron-right" class="h-4 w-4" aria-hidden="true" />
|
|
124
136
|
</button>
|
|
125
137
|
</div>
|
|
138
|
+
)}
|
|
126
139
|
</div>
|
|
127
140
|
</div>
|
|
141
|
+
)}
|
|
128
142
|
<div
|
|
129
143
|
id={trackId}
|
|
130
144
|
data-carousel-track
|
|
131
|
-
class:list={[trackClass, staticFrom === 'sm' && 'sm:overflow-visible sm:snap-none sm:py-0', extraTrackClass]}
|
|
145
|
+
class:list={alwaysStatic ? [extraTrackClass ?? 'flex flex-wrap gap-4'] : [trackClass, staticFrom === 'sm' && 'sm:overflow-visible sm:snap-none sm:py-0', extraTrackClass]}
|
|
132
146
|
aria-label={ariaLabel ?? heading ?? regionLabel}
|
|
133
147
|
role="group"
|
|
134
|
-
tabindex=
|
|
148
|
+
tabindex={alwaysStatic ? undefined : '0'}
|
|
135
149
|
>
|
|
136
150
|
<slot />
|
|
137
151
|
</div>
|
|
138
|
-
<div data-carousel-dots class="mt-4 hidden justify-center"></div>
|
|
152
|
+
{!alwaysStatic && <div data-carousel-dots class="mt-4 hidden justify-center"></div>}
|
|
139
153
|
</div>
|
|
140
154
|
|
|
141
155
|
<script>
|