@contentrain/astro-kit 0.19.0 → 0.20.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/catalog.json
CHANGED
|
@@ -1154,6 +1154,22 @@
|
|
|
1154
1154
|
],
|
|
1155
1155
|
"default": "start",
|
|
1156
1156
|
"description": "start: brand and links to the sides (left-aligned on phones). center: everything centred in one column, as themes with a centred footer print it."
|
|
1157
|
+
},
|
|
1158
|
+
"pack": {
|
|
1159
|
+
"options": [
|
|
1160
|
+
"spread",
|
|
1161
|
+
"end"
|
|
1162
|
+
],
|
|
1163
|
+
"default": "spread",
|
|
1164
|
+
"description": "columns layout only. spread: the link columns share the footer's width after the brand column. end: they are packed at the end edge at their own width, as a theme whose footer is the brand left and its menus on the right."
|
|
1165
|
+
},
|
|
1166
|
+
"narrow": {
|
|
1167
|
+
"options": [
|
|
1168
|
+
"stack",
|
|
1169
|
+
"row"
|
|
1170
|
+
],
|
|
1171
|
+
"default": "stack",
|
|
1172
|
+
"description": "Packed columns only, below the md breakpoint. stack: one column. row: still side by side from the start edge, under the brand."
|
|
1157
1173
|
}
|
|
1158
1174
|
},
|
|
1159
1175
|
"props": {
|
|
@@ -1250,6 +1266,18 @@
|
|
|
1250
1266
|
"navLabel": {
|
|
1251
1267
|
"type": "string",
|
|
1252
1268
|
"description": "Accessible name of the footer navigation (ui-strings nav.footer)."
|
|
1269
|
+
},
|
|
1270
|
+
"packGap": {
|
|
1271
|
+
"type": "string",
|
|
1272
|
+
"description": "Packed columns only: the space between columns, a CSS length such as 98px."
|
|
1273
|
+
},
|
|
1274
|
+
"packGapNarrow": {
|
|
1275
|
+
"type": "string",
|
|
1276
|
+
"description": "Packed columns in a row only: the space between them below the md breakpoint, a CSS length."
|
|
1277
|
+
},
|
|
1278
|
+
"linkSize": {
|
|
1279
|
+
"type": "string",
|
|
1280
|
+
"description": "Font size of the footer's links, a CSS length such as 17.88px; absent, the footer's own."
|
|
1253
1281
|
}
|
|
1254
1282
|
},
|
|
1255
1283
|
"slots": {},
|
|
@@ -22,11 +22,18 @@ const footer = tv({
|
|
|
22
22
|
inverse: { root: 'bg-ink text-surface' },
|
|
23
23
|
},
|
|
24
24
|
align: { start: {}, center: { inner: 'items-center justify-items-center text-center md:items-center [&_ul]:justify-center' } },
|
|
25
|
+
// The `columns` layout's link columns: spread from the brand column over the footer's width, or packed at the end
|
|
26
|
+
// edge at their own width (a theme whose footer is the brand left and its menus on the right).
|
|
27
|
+
pack: { spread: {}, end: {} },
|
|
28
|
+
// Packed columns below `md`: stacked, or still side by side from the start edge under the brand.
|
|
29
|
+
narrow: { stack: {}, row: { inner: 'grid-cols-[repeat(var(--footer-columns),auto)] justify-start gap-x-[var(--footer-gap-narrow,1.5rem)]' } },
|
|
25
30
|
},
|
|
26
31
|
compoundVariants: [
|
|
27
32
|
{ layout: 'simple', align: 'center', class: { inner: 'md:flex-col md:justify-center' } },
|
|
33
|
+
{ layout: 'columns', pack: 'end', class: { inner: 'md:grid-cols-[1fr_repeat(var(--footer-columns),auto)] md:gap-x-[var(--footer-gap,2.5rem)] md:[&>div:first-child]:col-span-1' } },
|
|
34
|
+
{ layout: 'columns', pack: 'end', narrow: 'row', class: { inner: '[&>div:first-child]:col-span-full' } },
|
|
28
35
|
],
|
|
29
|
-
defaultVariants: { layout: 'simple', tone: 'default', align: 'start' },
|
|
36
|
+
defaultVariants: { layout: 'simple', tone: 'default', align: 'start', pack: 'spread', narrow: 'stack' },
|
|
30
37
|
})
|
|
31
38
|
|
|
32
39
|
interface Props {
|
|
@@ -48,10 +55,22 @@ interface Props {
|
|
|
48
55
|
layout?: 'simple' | 'columns' | undefined
|
|
49
56
|
tone?: 'default' | 'muted' | 'inverse' | undefined
|
|
50
57
|
align?: 'start' | 'center' | undefined
|
|
58
|
+
/** `columns` layout only: `end` packs the link columns at the end edge, right-aligned, instead of spreading them. */
|
|
59
|
+
pack?: 'spread' | 'end' | undefined
|
|
60
|
+
/** Packed columns only: the space between columns, a CSS length (`98px`). */
|
|
61
|
+
packGap?: string | undefined
|
|
62
|
+
/** Packed columns only: below `md`, `stack` (one column) or `row` (still side by side from the start edge, under the brand). */
|
|
63
|
+
narrow?: 'stack' | 'row' | undefined
|
|
64
|
+
/** Packed columns in a `row` only: the space between them below `md`, a CSS length. */
|
|
65
|
+
packGapNarrow?: string | undefined
|
|
66
|
+
/** The links' font size, a CSS length (`17.88px`); absent, the footer's own. */
|
|
67
|
+
linkSize?: string | undefined
|
|
51
68
|
}
|
|
52
69
|
|
|
53
|
-
const { siteName, tagline, columns = [], links = [], social = [], contact, copyright, consentLabel, navLabel = 'Footer', layout = 'simple', tone, align } = Astro.props
|
|
54
|
-
const { root, inner, muted, link } = footer({ layout, tone, align })
|
|
70
|
+
const { siteName, tagline, columns = [], links = [], social = [], contact, copyright, consentLabel, navLabel = 'Footer', layout = 'simple', tone, align, pack, packGap, narrow, packGapNarrow, linkSize } = Astro.props
|
|
71
|
+
const { root, inner, muted, link } = footer({ layout, tone, align, pack: layout === 'columns' ? pack : undefined, narrow: layout === 'columns' && pack === 'end' ? narrow : undefined })
|
|
72
|
+
// Custom properties the packed columns and sized links read; none when none is set.
|
|
73
|
+
const vars = [layout === 'columns' ? `--footer-columns: ${Math.max(columns.length, 1)}` : '', layout === 'columns' && pack === 'end' && packGap ? `--footer-gap: ${packGap}` : '', layout === 'columns' && pack === 'end' && narrow === 'row' && packGapNarrow ? `--footer-gap-narrow: ${packGapNarrow}` : '', linkSize ? `--footer-link-size: ${linkSize}` : ''].filter(Boolean).join('; ')
|
|
55
74
|
const year = String(new Date().getFullYear())
|
|
56
75
|
const phoneHref = contact?.phone?.replace(/[^\d+]/g, '')
|
|
57
76
|
const hasContact = Boolean(contact?.address || contact?.phone || contact?.email)
|
|
@@ -59,7 +78,7 @@ const line = copyright?.replaceAll('{year}', year) ?? `© ${year} ${siteName}`
|
|
|
59
78
|
---
|
|
60
79
|
<!-- The cookie settings control is a button, not a link: the Consent component's listener reopens its bar on any [data-kit-consent-open]. -->
|
|
61
80
|
<footer class={root()}>
|
|
62
|
-
<div class={inner()} data-kit-footer style={
|
|
81
|
+
<div class:list={[inner(), linkSize && '[&_nav_a]:text-[length:var(--footer-link-size)]']} data-kit-footer style={vars || undefined}>
|
|
63
82
|
<div class="flex flex-col gap-3">
|
|
64
83
|
<p class="text-base font-semibold" data-kit-brand>{siteName}</p>
|
|
65
84
|
{tagline && <p class={muted()} data-kit-tagline>{tagline}</p>}
|
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
{ "name": "columns-inverse", "props": { "siteName": "Northwind Studio", "tagline": "Calm, fast websites for teams who write.", "layout": "columns", "tone": "inverse", "copyright": "© 2026 Northwind Studio", "columns": [{ "title": "Studio", "links": [{ "label": "About", "href": "/about/" }, { "label": "Team", "href": "/about/team/" }] }, { "title": "Journal", "links": [{ "label": "Guides", "href": "/category/guides/" }, { "label": "News", "href": "/category/news/" }] }, { "title": "Contact", "links": [{ "label": "Email", "href": "mailto:hello@example.com" }] }], "social": [{ "label": "GitHub", "href": "https://github.com/contentrain" }, { "label": "Mastodon", "href": "https://mastodon.social/@contentrain" }] } },
|
|
4
4
|
{ "name": "muted", "props": { "siteName": "Northwind", "tone": "muted", "copyright": "© 2026 Northwind", "links": [{ "label": "Imprint", "href": "/imprint/" }] } },
|
|
5
5
|
{ "name": "centered", "props": { "siteName": "Golden Agency", "tagline": "Websites for makers", "align": "center", "copyright": "© 2026 Golden Agency", "links": [{ "label": "Services", "href": "/services/" }, { "label": "Contact", "href": "/contact/" }], "social": [{ "label": "Instagram", "href": "https://instagram.com/" }] } },
|
|
6
|
-
{ "name": "consent-settings", "props": { "siteName": "Golden Agency", "copyright": "© 2026 Golden Agency", "consentLabel": "Cookie settings", "links": [{ "label": "Privacy", "href": "/privacy/" }] } }
|
|
6
|
+
{ "name": "consent-settings", "props": { "siteName": "Golden Agency", "copyright": "© 2026 Golden Agency", "consentLabel": "Cookie settings", "links": [{ "label": "Privacy", "href": "/privacy/" }] } },
|
|
7
|
+
{ "name": "columns-end", "props": { "siteName": "Golden Works", "tagline": "Websites for makers", "layout": "columns", "pack": "end", "packGap": "128px", "linkSize": "17.88px", "copyright": "© 2026 Golden Works", "columns": [{ "label": "Studio", "links": [{ "label": "About", "href": "/about/" }, { "label": "Work", "href": "/work/" }] }, { "label": "Contact", "links": [{ "label": "Email", "href": "mailto:hello@example.com" }, { "label": "Press", "href": "/press/" }] }] } },
|
|
8
|
+
{ "name": "columns-end-row", "props": { "siteName": "Golden Works", "layout": "columns", "pack": "end", "narrow": "row", "packGap": "128px", "packGapNarrow": "48px", "linkSize": "17.88px", "copyright": "© 2026 Golden Works", "columns": [{ "label": "Studio", "links": [{ "label": "About", "href": "/about/" }, { "label": "Work", "href": "/work/" }] }, { "label": "Contact", "links": [{ "label": "Email", "href": "mailto:hello@example.com" }] }] } }
|
|
7
9
|
]
|
|
@@ -32,6 +32,22 @@
|
|
|
32
32
|
],
|
|
33
33
|
"default": "start",
|
|
34
34
|
"description": "start: brand and links to the sides (left-aligned on phones). center: everything centred in one column, as themes with a centred footer print it."
|
|
35
|
+
},
|
|
36
|
+
"pack": {
|
|
37
|
+
"options": [
|
|
38
|
+
"spread",
|
|
39
|
+
"end"
|
|
40
|
+
],
|
|
41
|
+
"default": "spread",
|
|
42
|
+
"description": "columns layout only. spread: the link columns share the footer's width after the brand column. end: they are packed at the end edge at their own width, as a theme whose footer is the brand left and its menus on the right."
|
|
43
|
+
},
|
|
44
|
+
"narrow": {
|
|
45
|
+
"options": [
|
|
46
|
+
"stack",
|
|
47
|
+
"row"
|
|
48
|
+
],
|
|
49
|
+
"default": "stack",
|
|
50
|
+
"description": "Packed columns only, below the md breakpoint. stack: one column. row: still side by side from the start edge, under the brand."
|
|
35
51
|
}
|
|
36
52
|
},
|
|
37
53
|
"props": {
|
|
@@ -119,6 +135,18 @@
|
|
|
119
135
|
"navLabel": {
|
|
120
136
|
"type": "string",
|
|
121
137
|
"description": "Accessible name of the footer navigation (ui-strings nav.footer)."
|
|
138
|
+
},
|
|
139
|
+
"packGap": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"description": "Packed columns only: the space between columns, a CSS length such as 98px."
|
|
142
|
+
},
|
|
143
|
+
"packGapNarrow": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"description": "Packed columns in a row only: the space between them below the md breakpoint, a CSS length."
|
|
146
|
+
},
|
|
147
|
+
"linkSize": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"description": "Font size of the footer's links, a CSS length such as 17.88px; absent, the footer's own."
|
|
122
150
|
}
|
|
123
151
|
},
|
|
124
152
|
"slots": {},
|
package/mapping/gutenberg.json
CHANGED
|
@@ -552,7 +552,11 @@
|
|
|
552
552
|
},
|
|
553
553
|
"when": {
|
|
554
554
|
"position": "first",
|
|
555
|
-
"columns": 1
|
|
555
|
+
"columns": 1,
|
|
556
|
+
"order": [
|
|
557
|
+
"title",
|
|
558
|
+
"media"
|
|
559
|
+
]
|
|
556
560
|
},
|
|
557
561
|
"slots": {
|
|
558
562
|
"title": {
|
|
@@ -567,11 +571,16 @@
|
|
|
567
571
|
"button": {
|
|
568
572
|
"match": "core/button",
|
|
569
573
|
"max": 2
|
|
574
|
+
},
|
|
575
|
+
"media": {
|
|
576
|
+
"match": "core/image",
|
|
577
|
+
"max": 1
|
|
570
578
|
}
|
|
571
579
|
},
|
|
572
580
|
"props": {
|
|
573
581
|
"heading": "@title dom:",
|
|
574
|
-
"lead": "@lead dom:"
|
|
582
|
+
"lead": "@lead dom:",
|
|
583
|
+
"image": "@media img:img"
|
|
575
584
|
},
|
|
576
585
|
"into": "actions",
|
|
577
586
|
"each": "@button",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/astro-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
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.38.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.10.0",
|