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.
Files changed (183) hide show
  1. package/package.json +1 -1
  2. package/src/blocks/Banner1.astro +35 -0
  3. package/src/blocks/Contact1.astro +92 -0
  4. package/src/blocks/Cta1.astro +72 -0
  5. package/src/blocks/Feature1.astro +67 -0
  6. package/src/blocks/Footer.astro +47 -54
  7. package/src/blocks/Header1.astro +192 -0
  8. package/src/blocks/Hero1.astro +74 -0
  9. package/src/blocks/Intro1.astro +56 -0
  10. package/src/blocks/Products1.astro +90 -0
  11. package/src/blocks/{Hero.astro → _Hero.astro} +7 -6
  12. package/src/components/Badge.astro +10 -18
  13. package/src/components/Banner.astro +26 -0
  14. package/src/components/Block.astro +49 -0
  15. package/src/components/Blocks.astro +26 -0
  16. package/src/components/Button.astro +10 -23
  17. package/src/components/Card.astro +8 -150
  18. package/src/components/Cart.astro +1 -0
  19. package/src/components/CartSummary.astro +3 -3
  20. package/src/components/Channel.astro +5 -14
  21. package/src/components/Container.astro +25 -0
  22. package/src/components/Drawer.astro +57 -118
  23. package/src/components/DrawerOld.astro +143 -0
  24. package/src/components/Element.astro +2 -0
  25. package/src/components/Form.astro +5 -3
  26. package/src/components/Head.astro +18 -32
  27. package/src/components/Header.astro +8 -105
  28. package/src/components/Heading.astro +29 -70
  29. package/src/components/Icon.astro +6 -4
  30. package/src/components/Link.astro +12 -18
  31. package/src/components/Logo.astro +31 -18
  32. package/src/components/Navigation.astro +39 -0
  33. package/src/components/Panel.astro +25 -0
  34. package/src/components/Paragraph.astro +24 -7
  35. package/src/components/Price.astro +4 -4
  36. package/src/components/Prose.astro +41 -132
  37. package/src/components/Rating.astro +24 -75
  38. package/src/components/Search.astro +4 -3
  39. package/src/components/Section.astro +20 -29
  40. package/src/components/Sidebar.astro +44 -64
  41. package/src/components/Social.astro +9 -2
  42. package/src/components/Tagline.astro +21 -31
  43. package/src/components/Toc.astro +12 -3
  44. package/src/components/_Author.astro +90 -0
  45. package/src/components/_Header.astro +129 -0
  46. package/src/components/_Prose copy.astro +172 -0
  47. package/src/components/_Sidebar copy.astro +87 -0
  48. package/src/content/categories/category.md +7 -0
  49. package/src/content/config.ts +7 -8
  50. package/src/content/docs/components/text.mdx +47 -0
  51. package/src/content/docs/components.mdx +1 -4
  52. package/src/content/docs/index.mdx +1 -4
  53. package/src/content/layouts/base.yml +41 -80
  54. package/src/content/layouts/docs.yml +2 -70
  55. package/src/content/pages/index.mdx +17 -25
  56. package/src/content/{categories/mugs.md → posts/post.md} +1 -1
  57. package/src/content/products/product.md +3 -3
  58. package/src/css/theme.css +2 -0
  59. package/src/images/favicon/android-chrome-192x192.png +0 -0
  60. package/src/images/favicon/android-chrome-512x512.png +0 -0
  61. package/src/images/favicon/apple-touch-icon.png +0 -0
  62. package/src/images/favicon/browserconfig.xml +9 -0
  63. package/src/images/favicon/favicon-16x16.png +0 -0
  64. package/src/images/favicon/favicon-32x32.png +0 -0
  65. package/src/images/favicon/favicon-48x48.png +0 -0
  66. package/src/images/favicon/favicon.ico +0 -0
  67. package/src/images/favicon/favicon.svg +16 -0
  68. package/src/images/favicon/manifest.webmanifest +30 -0
  69. package/src/images/favicon/mstile-150x150.png +0 -0
  70. package/src/images/favicon/safari-pinned-tab.svg +16 -0
  71. package/src/images/favicon/yandex-browser-50x50.png +0 -0
  72. package/src/images/favicon/yandex-browser-manifest.json +9 -0
  73. package/src/integration/index.ts +10 -1
  74. package/src/layouts/CategoryLayout.astro +16 -9
  75. package/src/layouts/DocLayout.astro +49 -7
  76. package/src/layouts/Layout.astro +55 -27
  77. package/src/layouts/PageLayout.astro +12 -5
  78. package/src/layouts/PostLayout.astro +7 -5
  79. package/src/layouts/ProductLayout.astro +12 -7
  80. package/src/pages/test.astro +7 -1
  81. package/src/schemas/blocks/banner.ts +10 -0
  82. package/src/schemas/blocks/categories.ts +14 -0
  83. package/src/schemas/blocks/contact.ts +18 -0
  84. package/src/schemas/blocks/cta.ts +18 -0
  85. package/src/schemas/blocks/feature.ts +18 -0
  86. package/src/schemas/blocks/hero.ts +20 -0
  87. package/src/schemas/blocks/intro.ts +16 -0
  88. package/src/schemas/blocks/products.ts +14 -0
  89. package/src/schemas/categorySchema.ts +8 -8
  90. package/src/schemas/components/avatar.ts +4 -1
  91. package/src/schemas/components/badge.ts +16 -11
  92. package/src/schemas/components/block.ts +18 -0
  93. package/src/schemas/components/button.ts +13 -19
  94. package/src/schemas/components/channel.ts +15 -9
  95. package/src/schemas/components/footer.ts +15 -14
  96. package/src/schemas/components/head.ts +17 -0
  97. package/src/schemas/components/header.ts +19 -16
  98. package/src/schemas/components/heading.ts +7 -1
  99. package/src/schemas/components/icon.ts +7 -1
  100. package/src/schemas/components/image.ts +17 -14
  101. package/src/schemas/components/link.ts +10 -16
  102. package/src/schemas/components/logo.ts +12 -2
  103. package/src/schemas/components/menu.ts +11 -13
  104. package/src/schemas/components/navigation.ts +10 -0
  105. package/src/schemas/components/paragraph.ts +9 -0
  106. package/src/schemas/components/price.ts +9 -0
  107. package/src/schemas/components/rating.ts +8 -13
  108. package/src/schemas/components/sidebar.ts +14 -12
  109. package/src/schemas/components/social.ts +16 -1
  110. package/src/schemas/components/tagline.ts +7 -1
  111. package/src/schemas/docSchema.ts +6 -2
  112. package/src/schemas/imageSchema.ts +30 -1
  113. package/src/schemas/layoutSchema.ts +14 -20
  114. package/src/schemas/pageSchema.ts +9 -12
  115. package/src/schemas/postSchema.ts +6 -8
  116. package/src/schemas/productSchema.ts +18 -18
  117. package/src/types/global-props.ts +0 -9
  118. package/src/types/{virtual-modules.d.ts → virtual.d.ts} +1 -1
  119. package/src/utils/getHref.ts +3 -2
  120. package/tsconfig.json +1 -3
  121. package/example.svelte +0 -0
  122. package/parent.svelte +0 -0
  123. package/src/App.svelte +0 -0
  124. package/src/blocks/Banner.astro +0 -35
  125. package/src/blocks/Categories.astro +0 -12
  126. package/src/blocks/Colleagues.astro +0 -12
  127. package/src/blocks/Contact.astro +0 -117
  128. package/src/blocks/Content.astro +0 -130
  129. package/src/blocks/Cta.astro +0 -13
  130. package/src/blocks/Excerpt.astro +0 -12
  131. package/src/blocks/Features.astro +0 -11
  132. package/src/blocks/Header.astro +0 -7
  133. package/src/blocks/Intro.astro +0 -101
  134. package/src/blocks/Jobs.astro +0 -12
  135. package/src/blocks/Posts.astro +0 -11
  136. package/src/blocks/Prices.astro +0 -24
  137. package/src/blocks/Product.astro +0 -89
  138. package/src/blocks/Products.astro +0 -101
  139. package/src/blocks/Reviews.astro +0 -12
  140. package/src/blocks/_Contact.astro +0 -112
  141. package/src/components/CartForm.astro +0 -120
  142. package/src/components/CartList.astro +0 -122
  143. package/src/components/Lead.astro +0 -46
  144. package/src/components/ProductCard.astro +0 -52
  145. package/src/components/Text.astro +0 -43
  146. package/src/components/Writeup.astro +0 -108
  147. package/src/components/_CartList backup.astro +0 -125
  148. package/src/components/_CartList copy.astro +0 -213
  149. package/src/components/_CartListSimple.astro +0 -148
  150. package/src/components/sections.astro +0 -28
  151. package/src/content/docs/components/lead.mdx +0 -49
  152. package/src/content/docs/components/paragraph.mdx +0 -49
  153. package/src/loaders/imageLoader.ts +0 -26
  154. package/src/schemas/archive/_pageSchema.ts +0 -94
  155. package/src/schemas/components/avatars.ts +0 -4
  156. package/src/schemas/components/banner.ts +0 -3
  157. package/src/schemas/components/buttons.ts +0 -4
  158. package/src/schemas/components/card.ts +0 -43
  159. package/src/schemas/components/cards.ts +0 -4
  160. package/src/schemas/components/channels.ts +0 -4
  161. package/src/schemas/components/global.ts +0 -16
  162. package/src/schemas/components/links.ts +0 -4
  163. package/src/schemas/components/list.ts +0 -3
  164. package/src/schemas/components/section.ts +0 -17
  165. package/src/schemas/components/sections.ts +0 -3
  166. package/src/schemas/components/socials.ts +0 -4
  167. package/src/schemas/components/subheader.ts +0 -10
  168. package/src/schemas/components/text.ts +0 -3
  169. package/src/schemas/components/themer.ts +0 -3
  170. package/src/schemas/components/toc.ts +0 -3
  171. package/src/schemas/components/writeup.ts +0 -20
  172. package/src/schemas/fields/categories.ts +0 -3
  173. package/src/schemas/fields/description.ts +0 -3
  174. package/src/schemas/fields/href.ts +0 -3
  175. package/src/schemas/fields/image.ts +0 -24
  176. package/src/schemas/fields/images.ts +0 -4
  177. package/src/schemas/fields/order.ts +0 -3
  178. package/src/schemas/fields/price.ts +0 -3
  179. package/src/schemas/fields/products.ts +0 -5
  180. package/src/schemas/fields/seo.ts +0 -12
  181. package/src/schemas/fields/soldout.ts +0 -3
  182. package/src/schemas/fields/title.ts +0 -3
  183. 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 Products from 'fulldev-ui/blocks/Products.astro'
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 { render } = Astro.props
18
- const { title, price, images, description, soldout, categories, variants } =
19
- Astro.props.data
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 {...Astro.props}>
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
- level={2}
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
- <Products
73
+ <Products1
69
74
  heading="Gerelateerde producten"
70
75
  products={[...relatedProducts].sort(() => Math.random() - 0.5).slice(0, 6)}
71
76
  />
@@ -1,5 +1,11 @@
1
1
  ---
2
+ import Hero1 from 'fulldev-ui/blocks/Hero1.astro'
2
3
  import Layout from 'fulldev-ui/layouts/Layout.astro'
3
4
  ---
4
5
 
5
- <Layout />
6
+ <Layout>
7
+ <Hero1
8
+ heading="hello world"
9
+ class="hoi"
10
+ />
11
+ </Layout>
@@ -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 categories from 'fulldev-ui/schemas/fields/categories'
3
- import description from 'fulldev-ui/schemas/fields/description'
4
- import image from 'fulldev-ui/schemas/fields/image'
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,3 +1,6 @@
1
1
  import { z } from 'astro:content'
2
+ import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
2
3
 
3
- export default z.string()
4
+ export const avatarSchema = imageSchema
5
+
6
+ export type AvatarSchema = z.infer<typeof avatarSchema>
@@ -1,13 +1,18 @@
1
1
  import { z } from 'astro:content'
2
- import pathSchema from '../utils/pathSchema'
2
+ import { iconSchema } from './icon'
3
3
 
4
- export default pathSchema('pages').or(
5
- z
6
- .object({
7
- text: z.string(),
8
- href: z.string(),
9
- icon: z.string(),
10
- })
11
- .partial()
12
- .passthrough()
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 pathSchema from '../utils/pathSchema'
3
- import globalSchema from './global'
2
+ import { iconSchema } from './icon'
4
3
 
5
4
  export const buttonSchema = z
6
- .union([pathSchema('pages'), z.object({}).passthrough()])
7
- .pipe(
8
- globalSchema
9
- .extend({
10
- slug: z
11
- .string()
12
- .refine(async (data) => await pathSchema('pages').parseAsync(data)),
13
- text: z.string(),
14
- href: z.string(),
15
- icon: z.string(),
16
- })
17
- .partial()
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 heading from './heading'
3
- import icon from './icon'
4
- import text from './text'
2
+ import { headingSchema } from './heading'
3
+ import { iconSchema } from './icon'
5
4
 
6
- export default z
5
+ export const channelSchema = z
7
6
  .object({
8
- heading,
9
- text,
10
- icon,
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
- .partial()
17
+ .strict()
18
+
19
+ export type ChannelSchema = z.infer<typeof channelSchema>
@@ -1,18 +1,19 @@
1
1
  import { z } from 'astro:content'
2
- import channels from './channels'
3
- import logo from './logo'
4
- import menu from './menu'
5
- import socials from './socials'
6
- import text from './text'
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 default z
8
+ export const footerSchema = z
9
9
  .object({
10
- logo,
11
- text,
12
- socials,
13
- channels,
14
- menu,
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
- .partial()
17
- .passthrough()
18
- .optional()
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 buttons from './buttons'
3
- import links from './links'
4
- import logo from './logo'
5
- import menu from './menu'
6
- import subheader from './subheader'
7
- import themer from './themer'
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 default z
9
+ export const headerSchema = z
10
10
  .object({
11
- themer,
12
- subheader,
13
- logo,
14
- buttons,
15
- links,
16
- menu,
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
- .partial()
19
- .passthrough()
20
- .optional()
21
+ .strict()
22
+
23
+ export type HeaderSchema = z.infer<typeof headerSchema>
@@ -1,3 +1,9 @@
1
1
  import { z } from 'astro:content'
2
2
 
3
- export default z.string()
3
+ export const headingSchema = z
4
+ .object({
5
+ text: z.string().optional(),
6
+ })
7
+ .strict()
8
+
9
+ export type HeadingSchema = z.infer<typeof headingSchema>
@@ -1,3 +1,9 @@
1
1
  import { z } from 'astro:content'
2
2
 
3
- export default z.string()
3
+ export const iconSchema = z
4
+ .object({
5
+ name: z.string().optional(),
6
+ })
7
+ .strict()
8
+
9
+ export type IconSchema = z.infer<typeof iconSchema>
@@ -7,17 +7,20 @@ const imagePath = z.preprocess((data: unknown) => {
7
7
  return data
8
8
  }, reference('images'))
9
9
 
10
- export default z.union([imagePath, z.object({}).passthrough()]).pipe(
11
- z
12
- .object({
13
- id: z
14
- .string()
15
- .refine(async (data) => await reference('images').parseAsync(data)),
16
- src: z.string(),
17
- alt: z.string(),
18
- width: z.number(),
19
- height: z.number(),
20
- })
21
- .partial()
22
- .passthrough()
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
- // export default z.union([pathSchema('pages'), z.object({}).passthrough()]).pipe(
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
- .optional()
16
+
17
+ export type LinkSchema = z.infer<typeof linkSchema>
@@ -1,3 +1,13 @@
1
- import image from './image'
1
+ import { z } from 'astro:content'
2
+ import { imageSchema } from 'fulldev-ui/schemas/components/image.ts'
2
3
 
3
- export default image
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 buttons from './buttons'
3
- import heading from './heading'
4
- import links from './links'
2
+ import { linkSchema } from 'fulldev-ui/schemas/components/link.ts'
3
+ import { headingSchema } from './heading'
5
4
 
6
- export default z.array(
7
- z
8
- .object({
9
- heading,
10
- buttons,
11
- links,
12
- })
13
- .partial()
14
- .passthrough()
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>
@@ -0,0 +1,9 @@
1
+ import { z } from 'astro:content'
2
+
3
+ export const paragraphSchema = z
4
+ .object({
5
+ text: z.string().optional(),
6
+ })
7
+ .strict()
8
+
9
+ export type ParagraphSchema = z.infer<typeof paragraphSchema>
@@ -0,0 +1,9 @@
1
+ import { z } from 'astro:content'
2
+
3
+ export const priceSchema = z
4
+ .object({
5
+ amount: z.number().optional(),
6
+ })
7
+ .strict()
8
+
9
+ export type PriceSchema = z.infer<typeof priceSchema>