PreStyling Layouts & Components

This commit is contained in:
2026-09-24 09:58:25 +02:00
parent fc38a1aafe
commit 356ccedc01
39 changed files with 1212 additions and 96 deletions

View File

@@ -0,0 +1,36 @@
import { fields } from '@keystatic/core'
import { ASPECT_RATIOS, IMAGE_EFFECTS } from '@/lib/constants/figure'
import { assets } from '@/lib/images/storage'
export const imageFields = (collection: string, { required = false } = {}) => ({
image: fields.image({
label: 'Image',
...assets(collection),
validation: {
isRequired: required,
},
}),
alt: fields.text({
label: 'Alt text',
validation: {
isRequired: required,
},
}),
caption: fields.text({
label: 'Caption',
}),
credit: fields.text({
label: 'Credit',
}),
effect: fields.select({
label: 'Effect',
options: IMAGE_EFFECTS,
defaultValue: 'none',
}),
ratio: fields.select({
label: 'Crop',
options: ASPECT_RATIOS,
defaultValue: 'original',
}),
})