fulldev-ui 0.6.0-beta.2 → 0.6.0-beta.3
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/package.json +1 -1
- package/src/blocks/Banner1.astro +35 -0
- package/src/blocks/Contact1.astro +92 -0
- package/src/blocks/Cta1.astro +72 -0
- package/src/blocks/Feature1.astro +67 -0
- package/src/blocks/Footer.astro +47 -54
- package/src/blocks/Header1.astro +192 -0
- package/src/blocks/Hero1.astro +74 -0
- package/src/blocks/Intro1.astro +56 -0
- package/src/blocks/Products1.astro +90 -0
- package/src/blocks/{Hero.astro → _Hero.astro} +7 -6
- package/src/components/Badge.astro +10 -18
- package/src/components/Banner.astro +26 -0
- package/src/components/Block.astro +49 -0
- package/src/components/Blocks.astro +26 -0
- package/src/components/Button.astro +10 -23
- package/src/components/Card.astro +8 -150
- package/src/components/Cart.astro +1 -0
- package/src/components/CartSummary.astro +3 -3
- package/src/components/Channel.astro +5 -14
- package/src/components/Container.astro +25 -0
- package/src/components/Drawer.astro +57 -118
- package/src/components/DrawerOld.astro +143 -0
- package/src/components/Element.astro +2 -0
- package/src/components/Form.astro +5 -3
- package/src/components/Head.astro +18 -32
- package/src/components/Header.astro +8 -105
- package/src/components/Heading.astro +29 -70
- package/src/components/Icon.astro +6 -4
- package/src/components/Link.astro +12 -18
- package/src/components/Logo.astro +31 -18
- package/src/components/Navigation.astro +39 -0
- package/src/components/Panel.astro +25 -0
- package/src/components/Paragraph.astro +24 -7
- package/src/components/Price.astro +4 -4
- package/src/components/Prose.astro +41 -132
- package/src/components/Rating.astro +24 -75
- package/src/components/Search.astro +4 -3
- package/src/components/Section.astro +20 -29
- package/src/components/Sidebar.astro +44 -64
- package/src/components/Social.astro +9 -2
- package/src/components/Tagline.astro +21 -31
- package/src/components/Toc.astro +12 -3
- package/src/components/_Author.astro +90 -0
- package/src/components/_Header.astro +129 -0
- package/src/components/_Prose copy.astro +172 -0
- package/src/components/_Sidebar copy.astro +87 -0
- package/src/content/categories/category.md +7 -0
- package/src/content/config.ts +7 -8
- package/src/content/docs/components/text.mdx +47 -0
- package/src/content/docs/components.mdx +1 -4
- package/src/content/docs/index.mdx +1 -4
- package/src/content/layouts/base.yml +41 -80
- package/src/content/layouts/docs.yml +2 -70
- package/src/content/pages/index.mdx +17 -25
- package/src/content/{categories/mugs.md → posts/post.md} +1 -1
- package/src/content/products/product.md +3 -3
- package/src/css/theme.css +2 -0
- package/src/images/favicon/android-chrome-192x192.png +0 -0
- package/src/images/favicon/android-chrome-512x512.png +0 -0
- package/src/images/favicon/apple-touch-icon.png +0 -0
- package/src/images/favicon/browserconfig.xml +9 -0
- package/src/images/favicon/favicon-16x16.png +0 -0
- package/src/images/favicon/favicon-32x32.png +0 -0
- package/src/images/favicon/favicon-48x48.png +0 -0
- package/src/images/favicon/favicon.ico +0 -0
- package/src/images/favicon/favicon.svg +16 -0
- package/src/images/favicon/manifest.webmanifest +30 -0
- package/src/images/favicon/mstile-150x150.png +0 -0
- package/src/images/favicon/safari-pinned-tab.svg +16 -0
- package/src/images/favicon/yandex-browser-50x50.png +0 -0
- package/src/images/favicon/yandex-browser-manifest.json +9 -0
- package/src/integration/index.ts +10 -1
- package/src/layouts/CategoryLayout.astro +16 -9
- package/src/layouts/DocLayout.astro +49 -7
- package/src/layouts/Layout.astro +55 -27
- package/src/layouts/PageLayout.astro +12 -5
- package/src/layouts/PostLayout.astro +7 -5
- package/src/layouts/ProductLayout.astro +12 -7
- package/src/pages/test.astro +7 -1
- package/src/schemas/blocks/banner.ts +10 -0
- package/src/schemas/blocks/categories.ts +14 -0
- package/src/schemas/blocks/contact.ts +18 -0
- package/src/schemas/blocks/cta.ts +18 -0
- package/src/schemas/blocks/feature.ts +18 -0
- package/src/schemas/blocks/hero.ts +20 -0
- package/src/schemas/blocks/intro.ts +16 -0
- package/src/schemas/blocks/products.ts +14 -0
- package/src/schemas/categorySchema.ts +8 -8
- package/src/schemas/components/avatar.ts +4 -1
- package/src/schemas/components/badge.ts +16 -11
- package/src/schemas/components/block.ts +18 -0
- package/src/schemas/components/button.ts +13 -19
- package/src/schemas/components/channel.ts +15 -9
- package/src/schemas/components/footer.ts +15 -14
- package/src/schemas/components/head.ts +17 -0
- package/src/schemas/components/header.ts +19 -16
- package/src/schemas/components/heading.ts +7 -1
- package/src/schemas/components/icon.ts +7 -1
- package/src/schemas/components/image.ts +17 -14
- package/src/schemas/components/link.ts +10 -16
- package/src/schemas/components/logo.ts +12 -2
- package/src/schemas/components/menu.ts +11 -13
- package/src/schemas/components/navigation.ts +10 -0
- package/src/schemas/components/paragraph.ts +9 -0
- package/src/schemas/components/price.ts +9 -0
- package/src/schemas/components/rating.ts +8 -13
- package/src/schemas/components/sidebar.ts +14 -12
- package/src/schemas/components/social.ts +16 -1
- package/src/schemas/components/tagline.ts +7 -1
- package/src/schemas/docSchema.ts +6 -2
- package/src/schemas/imageSchema.ts +30 -1
- package/src/schemas/layoutSchema.ts +14 -20
- package/src/schemas/pageSchema.ts +9 -12
- package/src/schemas/postSchema.ts +6 -8
- package/src/schemas/productSchema.ts +18 -18
- package/src/types/global-props.ts +0 -9
- package/src/types/{virtual-modules.d.ts → virtual.d.ts} +1 -1
- package/src/utils/getHref.ts +3 -2
- package/tsconfig.json +1 -3
- package/example.svelte +0 -0
- package/parent.svelte +0 -0
- package/src/App.svelte +0 -0
- package/src/blocks/Banner.astro +0 -35
- package/src/blocks/Categories.astro +0 -12
- package/src/blocks/Colleagues.astro +0 -12
- package/src/blocks/Contact.astro +0 -117
- package/src/blocks/Content.astro +0 -130
- package/src/blocks/Cta.astro +0 -13
- package/src/blocks/Excerpt.astro +0 -12
- package/src/blocks/Features.astro +0 -11
- package/src/blocks/Header.astro +0 -7
- package/src/blocks/Intro.astro +0 -101
- package/src/blocks/Jobs.astro +0 -12
- package/src/blocks/Posts.astro +0 -11
- package/src/blocks/Prices.astro +0 -24
- package/src/blocks/Product.astro +0 -89
- package/src/blocks/Products.astro +0 -101
- package/src/blocks/Reviews.astro +0 -12
- package/src/blocks/_Contact.astro +0 -112
- package/src/components/CartForm.astro +0 -120
- package/src/components/CartList.astro +0 -122
- package/src/components/Lead.astro +0 -46
- package/src/components/ProductCard.astro +0 -52
- package/src/components/Text.astro +0 -43
- package/src/components/Writeup.astro +0 -108
- package/src/components/_CartList backup.astro +0 -125
- package/src/components/_CartList copy.astro +0 -213
- package/src/components/_CartListSimple.astro +0 -148
- package/src/components/sections.astro +0 -28
- package/src/content/docs/components/lead.mdx +0 -49
- package/src/content/docs/components/paragraph.mdx +0 -49
- package/src/loaders/imageLoader.ts +0 -26
- package/src/schemas/archive/_pageSchema.ts +0 -94
- package/src/schemas/components/avatars.ts +0 -4
- package/src/schemas/components/banner.ts +0 -3
- package/src/schemas/components/buttons.ts +0 -4
- package/src/schemas/components/card.ts +0 -43
- package/src/schemas/components/cards.ts +0 -4
- package/src/schemas/components/channels.ts +0 -4
- package/src/schemas/components/global.ts +0 -16
- package/src/schemas/components/links.ts +0 -4
- package/src/schemas/components/list.ts +0 -3
- package/src/schemas/components/section.ts +0 -17
- package/src/schemas/components/sections.ts +0 -3
- package/src/schemas/components/socials.ts +0 -4
- package/src/schemas/components/subheader.ts +0 -10
- package/src/schemas/components/text.ts +0 -3
- package/src/schemas/components/themer.ts +0 -3
- package/src/schemas/components/toc.ts +0 -3
- package/src/schemas/components/writeup.ts +0 -20
- package/src/schemas/fields/categories.ts +0 -3
- package/src/schemas/fields/description.ts +0 -3
- package/src/schemas/fields/href.ts +0 -3
- package/src/schemas/fields/image.ts +0 -24
- package/src/schemas/fields/images.ts +0 -4
- package/src/schemas/fields/order.ts +0 -3
- package/src/schemas/fields/price.ts +0 -3
- package/src/schemas/fields/products.ts +0 -5
- package/src/schemas/fields/seo.ts +0 -12
- package/src/schemas/fields/soldout.ts +0 -3
- package/src/schemas/fields/title.ts +0 -3
- package/src/schemas/fields/variants.ts +0 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { getImage } from 'astro:assets'
|
|
3
3
|
import type { CollectionEntry } from 'astro:content'
|
|
4
4
|
import { getCollection, getEntry } from 'astro:content'
|
|
5
|
-
import
|
|
5
|
+
import Products1 from 'fulldev-ui/blocks/Products1.astro'
|
|
6
6
|
import CartForm from 'fulldev-ui/components/CartForm.svelte'
|
|
7
7
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
8
8
|
import Gallery from 'fulldev-ui/components/Gallery.astro'
|
|
@@ -11,12 +11,17 @@ import List from 'fulldev-ui/components/List.astro'
|
|
|
11
11
|
import Paragraph from 'fulldev-ui/components/Paragraph.astro'
|
|
12
12
|
import Prose from 'fulldev-ui/components/Prose.astro'
|
|
13
13
|
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
14
|
+
import { mergeDeep } from 'remeda'
|
|
14
15
|
|
|
15
16
|
type Props = CollectionEntry<'products'>
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const layout = await getEntry('layouts', 'products')
|
|
19
|
+
const merged = mergeDeep(layout || {}, Astro.props)
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
render,
|
|
23
|
+
data: { title, price, images, description, soldout, categories, variants },
|
|
24
|
+
} = merged
|
|
20
25
|
|
|
21
26
|
const slug = Astro.url.pathname.replace(/^\/|\/$/g, '') || 'index'
|
|
22
27
|
const imageId = images?.[0]?.id
|
|
@@ -35,7 +40,7 @@ const relatedProducts = await getCollection('products', (product) =>
|
|
|
35
40
|
const baseLayout = await getEntry('layouts', 'base')
|
|
36
41
|
---
|
|
37
42
|
|
|
38
|
-
<Layout {...
|
|
43
|
+
<Layout {...merged}>
|
|
39
44
|
<Element
|
|
40
45
|
class:list="product"
|
|
41
46
|
as="section"
|
|
@@ -49,7 +54,7 @@ const baseLayout = await getEntry('layouts', 'base')
|
|
|
49
54
|
<Element class:list="product-content">
|
|
50
55
|
<Heading
|
|
51
56
|
as="h1"
|
|
52
|
-
|
|
57
|
+
size="3xl"
|
|
53
58
|
text={title}
|
|
54
59
|
/>
|
|
55
60
|
<Paragraph text={description} />
|
|
@@ -65,7 +70,7 @@ const baseLayout = await getEntry('layouts', 'base')
|
|
|
65
70
|
</Element>
|
|
66
71
|
</Element>
|
|
67
72
|
</Element>
|
|
68
|
-
<
|
|
73
|
+
<Products1
|
|
69
74
|
heading="Gerelateerde producten"
|
|
70
75
|
products={[...relatedProducts].sort(() => Math.random() - 0.5).slice(0, 6)}
|
|
71
76
|
/>
|
package/src/pages/test.astro
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
|
|
3
|
+
export const bannerSchema = z.preprocess(
|
|
4
|
+
(data: unknown) => (typeof data === 'string' ? { text: data } : data),
|
|
5
|
+
z.object({
|
|
6
|
+
text: z.string().optional(),
|
|
7
|
+
})
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
export type BannerSchema = z.infer<typeof bannerSchema>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
3
|
+
import { headingSchema } from '../components/heading'
|
|
4
|
+
import pathSchema from '../utils/pathSchema'
|
|
5
|
+
|
|
6
|
+
export const categoriesSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
heading: headingSchema.shape.text,
|
|
9
|
+
button: buttonSchema.optional(),
|
|
10
|
+
categories: pathSchema('categories').array().optional(),
|
|
11
|
+
})
|
|
12
|
+
.strict()
|
|
13
|
+
|
|
14
|
+
export type CategoriesSchema = z.infer<typeof categoriesSchema>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { headingSchema } from 'fulldev-ui/schemas/components/heading'
|
|
3
|
+
import { taglineSchema } from 'fulldev-ui/schemas/components/tagline'
|
|
4
|
+
import { channelSchema } from '../components/channel'
|
|
5
|
+
import { paragraphSchema } from '../components/paragraph'
|
|
6
|
+
import { socialSchema } from '../components/social'
|
|
7
|
+
|
|
8
|
+
export const contactSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
tagline: taglineSchema.shape.text,
|
|
11
|
+
heading: headingSchema.shape.text,
|
|
12
|
+
paragraph: paragraphSchema.shape.text,
|
|
13
|
+
channels: channelSchema.array().optional(),
|
|
14
|
+
socials: socialSchema.shape.href.array().optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict()
|
|
17
|
+
|
|
18
|
+
export type ContactSchema = z.infer<typeof contactSchema>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
3
|
+
import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
|
|
4
|
+
import { headingSchema } from '../components/heading'
|
|
5
|
+
import { paragraphSchema } from '../components/paragraph'
|
|
6
|
+
import { taglineSchema } from '../components/tagline'
|
|
7
|
+
|
|
8
|
+
export const ctaSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
tagline: taglineSchema.shape.text,
|
|
11
|
+
heading: headingSchema.shape.text,
|
|
12
|
+
paragraph: paragraphSchema.shape.text,
|
|
13
|
+
buttons: buttonSchema.array().optional(),
|
|
14
|
+
image: imageSchema.optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict()
|
|
17
|
+
|
|
18
|
+
export type CtaSchema = z.infer<typeof ctaSchema>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
3
|
+
import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
|
|
4
|
+
import { headingSchema } from '../components/heading'
|
|
5
|
+
import { paragraphSchema } from '../components/paragraph'
|
|
6
|
+
import { taglineSchema } from '../components/tagline'
|
|
7
|
+
|
|
8
|
+
export const featureSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
tagline: taglineSchema.shape.text,
|
|
11
|
+
heading: headingSchema.shape.text,
|
|
12
|
+
paragraph: paragraphSchema.shape.text,
|
|
13
|
+
buttons: buttonSchema.array().optional(),
|
|
14
|
+
image: imageSchema.optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict()
|
|
17
|
+
|
|
18
|
+
export type FeatureSchema = z.infer<typeof featureSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { badgeSchema } from 'fulldev-ui/schemas/components/badge.ts'
|
|
3
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
4
|
+
import { headingSchema } from 'fulldev-ui/schemas/components/heading'
|
|
5
|
+
import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
|
|
6
|
+
import { taglineSchema } from 'fulldev-ui/schemas/components/tagline'
|
|
7
|
+
import { paragraphSchema } from '../components/paragraph'
|
|
8
|
+
|
|
9
|
+
export const heroSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
badge: badgeSchema.optional(),
|
|
12
|
+
tagline: taglineSchema.shape.text,
|
|
13
|
+
heading: headingSchema.shape.text,
|
|
14
|
+
paragraph: paragraphSchema.shape.text,
|
|
15
|
+
buttons: buttonSchema.array().optional(),
|
|
16
|
+
image: imageSchema.optional(),
|
|
17
|
+
})
|
|
18
|
+
.strict()
|
|
19
|
+
|
|
20
|
+
export type HeroSchema = z.infer<typeof heroSchema>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
3
|
+
import { headingSchema } from 'fulldev-ui/schemas/components/heading'
|
|
4
|
+
import { taglineSchema } from 'fulldev-ui/schemas/components/tagline'
|
|
5
|
+
import { paragraphSchema } from '../components/paragraph'
|
|
6
|
+
|
|
7
|
+
export const introSchema = z
|
|
8
|
+
.object({
|
|
9
|
+
tagline: taglineSchema.shape.text,
|
|
10
|
+
heading: headingSchema.shape.text,
|
|
11
|
+
paragraph: paragraphSchema.shape.text,
|
|
12
|
+
buttons: buttonSchema.array().optional(),
|
|
13
|
+
})
|
|
14
|
+
.strict()
|
|
15
|
+
|
|
16
|
+
export type IntroSchema = z.infer<typeof introSchema>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
3
|
+
import { headingSchema } from 'fulldev-ui/schemas/components/heading'
|
|
4
|
+
import pathSchema from '../utils/pathSchema'
|
|
5
|
+
|
|
6
|
+
export const productsSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
heading: headingSchema.shape.text,
|
|
9
|
+
button: buttonSchema.optional(),
|
|
10
|
+
products: pathSchema('products').array().optional(),
|
|
11
|
+
})
|
|
12
|
+
.strict()
|
|
13
|
+
|
|
14
|
+
export type ProductsSchema = z.infer<typeof productsSchema>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import title from 'fulldev-ui/schemas/fields/title'
|
|
2
|
+
import { headSchema } from 'fulldev-ui/schemas/components/head.ts'
|
|
3
|
+
import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
|
|
4
|
+
import pathSchema from 'fulldev-ui/schemas/utils/pathSchema.ts'
|
|
6
5
|
|
|
7
6
|
export const categorySchema = z
|
|
8
7
|
.object({
|
|
9
|
-
title,
|
|
10
|
-
description,
|
|
11
|
-
image,
|
|
12
|
-
categories,
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
description: z.string().optional(),
|
|
10
|
+
image: imageSchema.optional(),
|
|
11
|
+
categories: pathSchema('categories').array().optional(),
|
|
12
|
+
head: headSchema.optional(),
|
|
13
13
|
})
|
|
14
14
|
.strict()
|
|
15
15
|
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
2
|
+
import { iconSchema } from './icon'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
4
|
+
export const badgeSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
icon: iconSchema.shape.name,
|
|
7
|
+
text: z.string().optional(),
|
|
8
|
+
href: z.string().optional(),
|
|
9
|
+
target: z.literal('_blank').optional(),
|
|
10
|
+
size: z.enum(['sm', 'md', 'lg']).default('md').optional(),
|
|
11
|
+
variant: z
|
|
12
|
+
.enum(['primary', 'secondary', 'outline', 'ghost'])
|
|
13
|
+
.default('outline')
|
|
14
|
+
.optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict()
|
|
17
|
+
|
|
18
|
+
export type BadgeSchema = z.infer<typeof badgeSchema>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { categoriesSchema } from 'fulldev-ui/schemas/blocks/categories'
|
|
3
|
+
import { ctaSchema } from 'fulldev-ui/schemas/blocks/cta'
|
|
4
|
+
import { featureSchema } from 'fulldev-ui/schemas/blocks/feature'
|
|
5
|
+
import { heroSchema } from 'fulldev-ui/schemas/blocks/hero'
|
|
6
|
+
import { productsSchema } from 'fulldev-ui/schemas/blocks/products'
|
|
7
|
+
import { headerSchema } from './header'
|
|
8
|
+
|
|
9
|
+
const _block = { _block: z.string() }
|
|
10
|
+
|
|
11
|
+
export const blockSchema = z.union([
|
|
12
|
+
heroSchema.extend(_block),
|
|
13
|
+
ctaSchema.extend(_block),
|
|
14
|
+
featureSchema.extend(_block),
|
|
15
|
+
productsSchema.extend(_block),
|
|
16
|
+
categoriesSchema.extend(_block),
|
|
17
|
+
headerSchema.extend(_block),
|
|
18
|
+
])
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
3
|
-
import globalSchema from './global'
|
|
2
|
+
import { iconSchema } from './icon'
|
|
4
3
|
|
|
5
4
|
export const buttonSchema = z
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.passthrough()
|
|
19
|
-
.merge(globalSchema)
|
|
20
|
-
)
|
|
5
|
+
.object({
|
|
6
|
+
icon: iconSchema.shape.name,
|
|
7
|
+
text: z.string().optional(),
|
|
8
|
+
href: z.string().optional(),
|
|
9
|
+
target: z.literal('_blank').optional(),
|
|
10
|
+
size: z.enum(['sm', 'md', 'lg']).default('md').optional(),
|
|
11
|
+
variant: z
|
|
12
|
+
.enum(['primary', 'secondary', 'outline', 'ghost'])
|
|
13
|
+
.default('primary')
|
|
14
|
+
.optional(),
|
|
15
|
+
})
|
|
16
|
+
.strict()
|
|
21
17
|
|
|
22
18
|
export type ButtonSchema = z.infer<typeof buttonSchema>
|
|
23
|
-
|
|
24
|
-
export default buttonSchema
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import text from './text'
|
|
2
|
+
import { headingSchema } from './heading'
|
|
3
|
+
import { iconSchema } from './icon'
|
|
5
4
|
|
|
6
|
-
export
|
|
5
|
+
export const channelSchema = z
|
|
7
6
|
.object({
|
|
8
|
-
|
|
9
|
-
text,
|
|
10
|
-
|
|
11
|
-
href: z.string(),
|
|
7
|
+
icon: iconSchema.shape.name,
|
|
8
|
+
heading: headingSchema.shape.text,
|
|
9
|
+
text: z.string().optional(),
|
|
10
|
+
href: z.string().optional(),
|
|
11
|
+
size: z.enum(['sm', 'md', 'lg']).default('md').optional(),
|
|
12
|
+
variant: z
|
|
13
|
+
.enum(['primary', 'secondary', 'outline', 'ghost'])
|
|
14
|
+
.default('secondary')
|
|
15
|
+
.optional(),
|
|
12
16
|
})
|
|
13
|
-
.
|
|
17
|
+
.strict()
|
|
18
|
+
|
|
19
|
+
export type ChannelSchema = z.infer<typeof channelSchema>
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { channelSchema } from 'fulldev-ui/schemas/components/channel.ts'
|
|
3
|
+
import { logoSchema } from 'fulldev-ui/schemas/components/logo.ts'
|
|
4
|
+
import { menuSchema } from 'fulldev-ui/schemas/components/menu.ts'
|
|
5
|
+
import { headingSchema } from './heading'
|
|
6
|
+
import { paragraphSchema } from './paragraph'
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const footerSchema = z
|
|
9
9
|
.object({
|
|
10
|
-
logo,
|
|
11
|
-
text,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
logo: logoSchema.optional(),
|
|
11
|
+
heading: headingSchema.shape.text,
|
|
12
|
+
paragraph: paragraphSchema.shape.text,
|
|
13
|
+
socials: z.string().url().array().optional(),
|
|
14
|
+
channels: channelSchema.array().optional(),
|
|
15
|
+
menus: menuSchema.array().optional(),
|
|
15
16
|
})
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
.strict()
|
|
18
|
+
|
|
19
|
+
export type FooterSchema = z.infer<typeof footerSchema>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
|
|
3
|
+
|
|
4
|
+
export const headSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
title: z.string().optional(),
|
|
7
|
+
description: z.string().optional(),
|
|
8
|
+
image: imageSchema.optional(),
|
|
9
|
+
theme: z.enum(['light', 'dark', 'system']).default('light').optional(),
|
|
10
|
+
favicon: z.string().optional(),
|
|
11
|
+
company: z.string().optional(),
|
|
12
|
+
scripts: z.string().array().optional(),
|
|
13
|
+
code: z.string().optional(),
|
|
14
|
+
})
|
|
15
|
+
.strict()
|
|
16
|
+
|
|
17
|
+
export type HeadSchema = z.infer<typeof headSchema>
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/components/button.ts'
|
|
3
|
+
import { linkSchema } from 'fulldev-ui/schemas/components/link.ts'
|
|
4
|
+
import { logoSchema } from 'fulldev-ui/schemas/components/logo.ts'
|
|
5
|
+
import { menuSchema } from 'fulldev-ui/schemas/components/menu.ts'
|
|
6
|
+
import { headingSchema } from './heading'
|
|
7
|
+
import { socialSchema } from './social'
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const headerSchema = z
|
|
10
10
|
.object({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
logo: logoSchema.optional(),
|
|
12
|
+
heading: headingSchema.shape.text,
|
|
13
|
+
links: linkSchema.array().optional(),
|
|
14
|
+
socials: socialSchema.shape.href.array().optional(),
|
|
15
|
+
buttons: buttonSchema.array().optional(),
|
|
16
|
+
menus: menuSchema.array().optional(),
|
|
17
|
+
themer: z.boolean().optional(),
|
|
18
|
+
cart: z.boolean().optional(),
|
|
19
|
+
search: z.boolean().optional(),
|
|
17
20
|
})
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
.strict()
|
|
22
|
+
|
|
23
|
+
export type HeaderSchema = z.infer<typeof headerSchema>
|
|
@@ -7,17 +7,20 @@ const imagePath = z.preprocess((data: unknown) => {
|
|
|
7
7
|
return data
|
|
8
8
|
}, reference('images'))
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
z
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)
|
|
10
|
+
export const imageSchema = z
|
|
11
|
+
.union([imagePath, z.object({}).passthrough()])
|
|
12
|
+
.pipe(
|
|
13
|
+
z
|
|
14
|
+
.object({
|
|
15
|
+
id: z
|
|
16
|
+
.string()
|
|
17
|
+
.refine(async (data) => await reference('images').parseAsync(data)),
|
|
18
|
+
src: z.string(),
|
|
19
|
+
alt: z.string(),
|
|
20
|
+
width: z.number(),
|
|
21
|
+
height: z.number(),
|
|
22
|
+
})
|
|
23
|
+
.partial()
|
|
24
|
+
.passthrough()
|
|
25
|
+
)
|
|
26
|
+
.optional()
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
// z
|
|
5
|
-
// .object({
|
|
6
|
-
// slug: z
|
|
7
|
-
// .string()
|
|
8
|
-
// .refine(async (data) => await pathSchema('pages').parseAsync(data)),
|
|
9
|
-
// text: z.string(),
|
|
10
|
-
// href: z.string(),
|
|
11
|
-
// icon: z.string(),
|
|
12
|
-
// })
|
|
13
|
-
// .partial()
|
|
14
|
-
// .passthrough()
|
|
15
|
-
// )
|
|
16
|
-
|
|
17
|
-
export default z
|
|
3
|
+
export const linkSchema = z
|
|
18
4
|
.object({
|
|
19
5
|
text: z.string().optional(),
|
|
20
6
|
href: z.string().optional(),
|
|
7
|
+
icon: z.string().optional(),
|
|
8
|
+
target: z.literal('_blank').optional(),
|
|
9
|
+
size: z.enum(['sm', 'md', 'lg']).default('md').optional(),
|
|
10
|
+
variant: z
|
|
11
|
+
.enum(['primary', 'underline', 'muted'])
|
|
12
|
+
.default('primary')
|
|
13
|
+
.optional(),
|
|
21
14
|
})
|
|
22
15
|
.strict()
|
|
23
|
-
|
|
16
|
+
|
|
17
|
+
export type LinkSchema = z.infer<typeof linkSchema>
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
+
export const logoSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
image: imageSchema,
|
|
7
|
+
text: z.string().optional(),
|
|
8
|
+
href: z.string().optional(),
|
|
9
|
+
size: z.enum(['sm', 'md', 'lg']).default('md').optional(),
|
|
10
|
+
})
|
|
11
|
+
.strict()
|
|
12
|
+
|
|
13
|
+
export type LogoSchema = z.infer<typeof logoSchema>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import links from './links'
|
|
2
|
+
import { linkSchema } from 'fulldev-ui/schemas/components/link.ts'
|
|
3
|
+
import { headingSchema } from './heading'
|
|
5
4
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
)
|
|
5
|
+
export const menuSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
heading: headingSchema.shape.text,
|
|
8
|
+
href: z.string().optional(),
|
|
9
|
+
links: linkSchema.array().optional(),
|
|
10
|
+
})
|
|
11
|
+
.strict()
|
|
12
|
+
|
|
13
|
+
export type MenuSchema = z.infer<typeof menuSchema>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
2
|
+
import { headerSchema } from './header'
|
|
3
|
+
import { sidebarSchema } from './sidebar'
|
|
4
|
+
|
|
5
|
+
export const navigationSchema = headerSchema.merge(sidebarSchema).extend({
|
|
6
|
+
header: z.boolean().optional(),
|
|
7
|
+
sidebar: z.boolean().optional(),
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export type NavigationSchema = z.infer<typeof navigationSchema>
|