fulldev-ui 0.5.0-beta.1 → 0.5.0-beta.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fulldev-ui",
3
- "version": "0.5.0-beta.1",
3
+ "version": "0.5.0-beta.2",
4
4
  "description": "A component library built for Astro",
5
5
  "homepage": "https://ui.full.dev",
6
6
  "bugs": "https://github.com/fulldotdev/ui/issues",
@@ -42,6 +42,7 @@
42
42
  "@astrolib/seo": "1.0.0-beta.8",
43
43
  "@iconify-json/tabler": "^1.2.5",
44
44
  "@radix-ui/colors": "^3.0.0",
45
+ "@rollup/plugin-yaml": "^4.1.2",
45
46
  "@types/js-yaml": "^4.0.9",
46
47
  "@unocss/reset": "^0.63.4",
47
48
  "astro": "^4.16.6",
@@ -66,8 +67,7 @@
66
67
  "url": "^0.11.4",
67
68
  "vite-plugin-virtual": "^0.3.0",
68
69
  "zod": "^3.23.8",
69
- "zod-to-ts": "^1.2.0",
70
- "@rollup/plugin-yaml": "^4.1.2"
70
+ "zod-to-ts": "^1.2.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@astrojs/check": "^0.9.4",
@@ -1,6 +1,7 @@
1
1
  import viteYaml from '@rollup/plugin-yaml'
2
2
  import type { AstroIntegration } from 'astro'
3
3
  import favicons from 'astro-favicons'
4
+ import type { CollectionEntry } from 'astro:content'
4
5
  import merge from 'deepmerge'
5
6
  import fs from 'fs/promises'
6
7
  import yaml from 'js-yaml'
@@ -18,8 +19,8 @@ interface Config {
18
19
  favicon?: string
19
20
  company?: string
20
21
  css?: string
22
+ basePreset?: CollectionEntry<'presets'>['id']
21
23
  injectRoutes?: boolean
22
- overrideComponents?: boolean
23
24
  generateImageEntries?: boolean
24
25
  colors: {
25
26
  theme: 'light' | 'dark'
@@ -11,7 +11,7 @@ import { getChildPages } from 'fulldev-ui/utils/getChildPages.ts'
11
11
 
12
12
  type Props = ComponentProps<typeof Layout>
13
13
 
14
- const { slug, render, sections, children, ...rest } = Astro.props
14
+ const { slug, sections, title, description } = Astro.props
15
15
 
16
16
  const childPages = await getChildPages(slug)
17
17
  const categoryPages = await getCategoryPages(slug)
@@ -19,14 +19,17 @@ const categoryPages = await getCategoryPages(slug)
19
19
  ---
20
20
 
21
21
  <Layout {...Astro.props}>
22
- <Intro {...rest} />
22
+ <Intro
23
+ heading={title}
24
+ text={description}
25
+ />
23
26
  <Categories
24
- pages={childPages}
27
+ cards={childPages}
25
28
  structure="grid"
26
29
  panel
27
30
  />
28
31
  <Products
29
- pages={categoryPages}
32
+ cards={categoryPages}
30
33
  structure="grid"
31
34
  />
32
35
  <Article style={{ '--screen': '768px' }} />
@@ -1,6 +1,8 @@
1
1
  import { getEntries, getEntry, z } from 'astro:content'
2
2
  import { assign } from 'radash'
3
+ import fulldevConfig from 'virtual:fulldev-ui/config'
3
4
  import image from './components/image'
5
+ import images from './components/images'
4
6
  import sections from './components/sections'
5
7
  import categories from './utils/categories'
6
8
  import component from './utils/component'
@@ -25,12 +27,20 @@ const presets = z
25
27
  })
26
28
  .passthrough()
27
29
  .transform(async ({ presets, ...rest }) => {
28
- if (!presets) return rest
29
- const entries = await getEntries(presets)
30
30
  let mergedData = {}
31
- entries.forEach(
32
- (preset: any) => (mergedData = assign(mergedData, preset.data))
33
- )
31
+
32
+ if (fulldevConfig.basePreset) {
33
+ const baseEntry = await getEntry('presets', fulldevConfig.basePreset)
34
+ mergedData = assign(mergedData, baseEntry?.data || {})
35
+ }
36
+
37
+ if (presets) {
38
+ const entries = await getEntries(presets)
39
+ entries.forEach(
40
+ (preset: any) => (mergedData = assign(mergedData, preset.data))
41
+ )
42
+ }
43
+
34
44
  mergedData = assign(mergedData, rest)
35
45
  return mergedData as typeof rest
36
46
  })
@@ -51,6 +61,7 @@ export default i18n.pipe(presets).pipe(
51
61
  title: z.string(),
52
62
  description: z.string().optional(),
53
63
  image,
64
+ images,
54
65
  sections,
55
66
  header: z.any(),
56
67
  footer: z.any(),