@contentrain/astro-kit 0.37.0 → 0.38.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
|
@@ -1315,6 +1315,7 @@
|
|
|
1315
1315
|
"embed"
|
|
1316
1316
|
],
|
|
1317
1317
|
"shared": [
|
|
1318
|
+
"KitImage.astro",
|
|
1318
1319
|
"Section.astro",
|
|
1319
1320
|
"measured.ts",
|
|
1320
1321
|
"safe-url.ts",
|
|
@@ -1416,6 +1417,11 @@
|
|
|
1416
1417
|
"type": "url",
|
|
1417
1418
|
"label": "Link",
|
|
1418
1419
|
"description": "A tel:, mailto: or map link for it."
|
|
1420
|
+
},
|
|
1421
|
+
"iconImage": {
|
|
1422
|
+
"type": "image",
|
|
1423
|
+
"label": "Icon image",
|
|
1424
|
+
"description": "The detail's own icon as an image file (the old site's map marker or phone, moved as an svg), drawn before it."
|
|
1419
1425
|
}
|
|
1420
1426
|
}
|
|
1421
1427
|
},
|
|
@@ -1617,6 +1623,7 @@
|
|
|
1617
1623
|
"details[].label": "details[].label",
|
|
1618
1624
|
"details[].value": "details[].value",
|
|
1619
1625
|
"details[].href": "details[].href",
|
|
1626
|
+
"details[].iconImage": "details[].icon_image",
|
|
1620
1627
|
"hours": "hours",
|
|
1621
1628
|
"socials": "socials",
|
|
1622
1629
|
"socials[].label": "socials[].label",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
// that posts to their form service, an address to write to, or a link to the
|
|
11
11
|
// form on WordPress.
|
|
12
12
|
import { tv } from 'tailwind-variants'
|
|
13
|
+
import KitImage from '../_shared/KitImage.astro'
|
|
13
14
|
import Section from '../_shared/Section.astro'
|
|
14
15
|
import type { MeasuredStyle } from '../_shared/types'
|
|
15
16
|
import Embed from '../embed/Embed.astro'
|
|
@@ -24,6 +25,8 @@ export interface ContactDetail {
|
|
|
24
25
|
value: string
|
|
25
26
|
/** `mailto:`, `tel:` or a map link. */
|
|
26
27
|
href?: string | undefined
|
|
28
|
+
/** The detail's own icon as an image file (the old site's map marker or phone, moved as an svg), drawn before it. */
|
|
29
|
+
iconImage?: string | undefined
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
const contact = tv({
|
|
@@ -35,6 +38,7 @@ const contact = tv({
|
|
|
35
38
|
details: 'mt-2 flex flex-col gap-4',
|
|
36
39
|
term: 'text-sm font-semibold opacity-75',
|
|
37
40
|
value: 'text-current',
|
|
41
|
+
mark: 'mr-2 inline-flex size-5 shrink-0 align-[-0.25em]',
|
|
38
42
|
formColumn: 'flex flex-col gap-4',
|
|
39
43
|
formHeading: 'text-xl [font-weight:var(--font-weight-heading,700)] tracking-tight text-balance md:text-2xl',
|
|
40
44
|
form: 'rounded-card',
|
|
@@ -128,7 +132,7 @@ const FormHeading = heading ? 'h3' : 'h2'
|
|
|
128
132
|
{details.map(detail => (
|
|
129
133
|
<div class={detailsStyle === 'cards' ? s.card() : undefined}>
|
|
130
134
|
<dt class={s.term()}>{detail.label}</dt>
|
|
131
|
-
<dd class={s.value()}>{detail.href ? <a href={safeHref(detail.href)} class={LINK}>{detail.value}</a> : detail.value}</dd>
|
|
135
|
+
<dd class={s.value()}>{detail.iconImage && <span class={s.mark()} aria-hidden="true"><KitImage image={{ src: detail.iconImage, alt: '' }} class="size-5 object-contain" /></span>}{detail.href ? <a href={safeHref(detail.href)} class={LINK}>{detail.value}</a> : detail.value}</dd>
|
|
132
136
|
</div>
|
|
133
137
|
))}
|
|
134
138
|
</dl>
|
|
@@ -137,6 +141,7 @@ const FormHeading = heading ? 'h3' : 'h2'
|
|
|
137
141
|
<ul class={s.details()}>
|
|
138
142
|
{details.map(detail => (
|
|
139
143
|
<li class={s.value({ class: detailsStyle === 'cards' ? s.card() : undefined })}>
|
|
144
|
+
{detail.iconImage && <span class={s.mark()} aria-hidden="true"><KitImage image={{ src: detail.iconImage, alt: '' }} class="size-5 object-contain" /></span>}
|
|
140
145
|
{detail.label && <span class={s.term()}>{detail.label}: </span>}
|
|
141
146
|
{detail.href ? <a href={safeHref(detail.href)} class={LINK}>{detail.value}</a> : detail.value}
|
|
142
147
|
</li>
|
|
@@ -177,5 +177,30 @@
|
|
|
177
177
|
"title": "Our studio"
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "detail-icon-images",
|
|
183
|
+
"props": {
|
|
184
|
+
"model": "contact-submissions",
|
|
185
|
+
"heading": "Contact",
|
|
186
|
+
"intro": "Tell us what you make and when you want to launch.",
|
|
187
|
+
"layout": "stacked",
|
|
188
|
+
"align": "start",
|
|
189
|
+
"details": [
|
|
190
|
+
{
|
|
191
|
+
"value": "Studio 4, Harbour Lane",
|
|
192
|
+
"iconImage": "/kit-fixtures/icon-1.svg"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"value": "hello@northwind.example",
|
|
196
|
+
"href": "mailto:hello@northwind.example",
|
|
197
|
+
"iconImage": "/kit-fixtures/icon-1.svg"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"value": "+351 21 000 0000",
|
|
201
|
+
"href": "tel:+351210000000"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
180
205
|
}
|
|
181
206
|
]
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"embed"
|
|
8
8
|
],
|
|
9
9
|
"shared": [
|
|
10
|
+
"KitImage.astro",
|
|
10
11
|
"Section.astro",
|
|
11
12
|
"measured.ts",
|
|
12
13
|
"safe-url.ts",
|
|
@@ -108,6 +109,11 @@
|
|
|
108
109
|
"type": "url",
|
|
109
110
|
"label": "Link",
|
|
110
111
|
"description": "A tel:, mailto: or map link for it."
|
|
112
|
+
},
|
|
113
|
+
"iconImage": {
|
|
114
|
+
"type": "image",
|
|
115
|
+
"label": "Icon image",
|
|
116
|
+
"description": "The detail's own icon as an image file (the old site's map marker or phone, moved as an svg), drawn before it."
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentrain/astro-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.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",
|