feat: HeroSplit section
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
fragment BuilderSections on GroupAbstractBuilder_Fields {
|
||||
sections {
|
||||
__typename
|
||||
... on GroupAbstractBuilderSectionsTextBlockLayout {
|
||||
... SectionTextBlock
|
||||
}
|
||||
... on GroupAbstractBuilderSectionsHeroSplitLayout { ... SectionHeroSplit }
|
||||
... on GroupAbstractBuilderSectionsTextBlockLayout { ... SectionTextBlock }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
fragment SectionHeroSplit on GroupAbstractBuilderSectionsHeroSplitLayout {
|
||||
content
|
||||
reverse
|
||||
...AcfMedia
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { tv, type VariantProps } from "tailwind-variants";
|
||||
import type { SectionHeroSplitFragment } from "#graphql/operations";
|
||||
|
||||
const tvSectionHeroSplit = tv({
|
||||
slots: {
|
||||
base: "py-6",
|
||||
container: "container flex flex-col gap-6 items-center",
|
||||
content: "flex-1",
|
||||
media: "w-full basis-1/2",
|
||||
},
|
||||
variants: {
|
||||
reverse: {
|
||||
false: {
|
||||
container: "lg:flex-row",
|
||||
},
|
||||
true: {
|
||||
container: "lg:flex-row-reverse",
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
reverse: false,
|
||||
},
|
||||
});
|
||||
|
||||
const props = defineProps<SectionHeroSplitFragment>();
|
||||
const classes = tvSectionHeroSplit({
|
||||
reverse: props.reverse,
|
||||
} as VariantProps<typeof tvSectionHeroSplit>);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section :class="classes.base()">
|
||||
<div :class="classes.container()">
|
||||
<UiProse :content="content" :class="classes.content()" />
|
||||
<AcfMedia :media="$props" :class="classes.media()" />
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
@@ -4727,6 +4727,9 @@ type MediaItem implements ContentNode & DatabaseIdentifier & HierarchicalContent
|
||||
"""
|
||||
modifiedGmt: String
|
||||
|
||||
"""CSS object-position value from Media Focus Point plugin"""
|
||||
objectPosition: String
|
||||
|
||||
"""The parent of the node. The parent object can be of various types"""
|
||||
parent: HierarchicalContentNodeToParentContentNodeConnectionEdge
|
||||
|
||||
|
||||
Reference in New Issue
Block a user