@contentrain/astro-kit 0.47.1 → 0.48.1
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/catalog.json
CHANGED
|
@@ -5362,6 +5362,23 @@
|
|
|
5362
5362
|
"content": false,
|
|
5363
5363
|
"description": "Text of the archive link."
|
|
5364
5364
|
},
|
|
5365
|
+
"readMoreLabel": {
|
|
5366
|
+
"type": "string",
|
|
5367
|
+
"content": false,
|
|
5368
|
+
"description": "The source's own read-more words under each card's excerpt (READ ARTICLE), passed to every card; absent, none."
|
|
5369
|
+
},
|
|
5370
|
+
"dateStyle": {
|
|
5371
|
+
"type": "select",
|
|
5372
|
+
"options": [
|
|
5373
|
+
"full",
|
|
5374
|
+
"long",
|
|
5375
|
+
"medium",
|
|
5376
|
+
"short"
|
|
5377
|
+
],
|
|
5378
|
+
"default": "long",
|
|
5379
|
+
"content": false,
|
|
5380
|
+
"description": "How the cards write their date (Intl dateStyle), as the source does; absent, long."
|
|
5381
|
+
},
|
|
5365
5382
|
"tone": {
|
|
5366
5383
|
"type": "string",
|
|
5367
5384
|
"content": false,
|
|
@@ -18,7 +18,7 @@ const card = tv({
|
|
|
18
18
|
meta: 'flex flex-wrap items-center gap-x-2 text-sm text-ink-muted',
|
|
19
19
|
title: 'leading-snug [font-weight:var(--font-weight-heading,600)] text-balance text-ink',
|
|
20
20
|
// At most ~75 characters a line, however wide the card (a one-column list at 1280).
|
|
21
|
-
excerpt: 'max-w-[
|
|
21
|
+
excerpt: 'max-w-[62ch] text-ink-muted',
|
|
22
22
|
},
|
|
23
23
|
variants: {
|
|
24
24
|
layout: {
|
|
@@ -70,6 +70,10 @@ interface Props {
|
|
|
70
70
|
/** Where the full archive lives; with `moreLabel` a link follows the list. */
|
|
71
71
|
moreHref?: string | undefined
|
|
72
72
|
moreLabel?: string | undefined
|
|
73
|
+
/** The source's own read-more words under each card's excerpt ("READ ARTICLE"), passed to every card; absent, none. */
|
|
74
|
+
readMoreLabel?: string | undefined
|
|
75
|
+
/** How the cards write their date (`Intl.DateTimeFormat` `dateStyle`), as the source does; absent, long. */
|
|
76
|
+
dateStyle?: 'full' | 'long' | 'medium' | 'short' | undefined
|
|
73
77
|
tone?: 'default' | 'muted' | 'inverse' | 'accent' | undefined
|
|
74
78
|
/** The source section's measured style (`MeasuredStyle`): frame, padding, fill, background image, columns per width, gap. Absent, the site's tokens; present, it wins over tone and columns. */
|
|
75
79
|
measured?: MeasuredStyle | undefined
|
|
@@ -78,7 +82,7 @@ interface Props {
|
|
|
78
82
|
entry?: string | undefined
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
const { heading, intro, posts, layout = 'grid', columns, showImage = true, showExcerpt = true, showAuthor = true, showCategory = true, excerptLines, locale, timeZone, surface, moreHref, moreLabel, tone, measured, id: givenId } = Astro.props
|
|
85
|
+
const { heading, intro, posts, layout = 'grid', columns, showImage = true, showExcerpt = true, showAuthor = true, showCategory = true, excerptLines, locale, timeZone, surface, moreHref, moreLabel, readMoreLabel, dateStyle, tone, measured, id: givenId } = Astro.props
|
|
82
86
|
// Two on one page never share an id: their labels and controls would point into each other.
|
|
83
87
|
const id = instanceId(Astro.locals, givenId, 'posts')
|
|
84
88
|
const s = list({ layout, columns })
|
|
@@ -115,6 +119,8 @@ const cardLayout = (i: number) => layout === 'compact' ? 'minimal' : layout ===
|
|
|
115
119
|
surface={surface}
|
|
116
120
|
excerptLines={excerptLines}
|
|
117
121
|
sizes={sizes}
|
|
122
|
+
moreLabel={readMoreLabel}
|
|
123
|
+
dateStyle={dateStyle}
|
|
118
124
|
/>
|
|
119
125
|
</li>
|
|
120
126
|
))}
|
|
@@ -163,6 +163,18 @@
|
|
|
163
163
|
"content": false,
|
|
164
164
|
"description": "Text of the archive link."
|
|
165
165
|
},
|
|
166
|
+
"readMoreLabel": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"content": false,
|
|
169
|
+
"description": "The source's own read-more words under each card's excerpt (READ ARTICLE), passed to every card; absent, none."
|
|
170
|
+
},
|
|
171
|
+
"dateStyle": {
|
|
172
|
+
"type": "select",
|
|
173
|
+
"options": ["full", "long", "medium", "short"],
|
|
174
|
+
"default": "long",
|
|
175
|
+
"content": false,
|
|
176
|
+
"description": "How the cards write their date (Intl dateStyle), as the source does; absent, long."
|
|
177
|
+
},
|
|
166
178
|
"tone": {
|
|
167
179
|
"type": "string",
|
|
168
180
|
"content": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/astro-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Copy-in Astro components for Contentrain sites (shadcn model): typed props, tailwind-variants, zero JavaScript by default — with a machine-readable catalog",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"mapping"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@contentrain/types": "1.
|
|
45
|
+
"@contentrain/types": "1.73.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.10.0",
|