fulldev-ui 0.5.0-beta.0 → 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.
@@ -12,11 +12,19 @@ interface Props extends GlobalProps, HTMLAttributes<'aside'> {
12
12
  size?: 'sm' | 'md' | 'lg' | undefined
13
13
  search?: boolean | undefined
14
14
  logo?: string | undefined
15
+ company?: string | undefined
15
16
  buttons?: any[] | undefined
16
17
  open?: boolean | undefined
17
18
  }
18
19
 
19
- const { size = 'sm', open = false, logo, buttons, search } = Astro.props
20
+ const {
21
+ size = 'sm',
22
+ open = false,
23
+ logo,
24
+ company,
25
+ buttons,
26
+ search,
27
+ } = Astro.props
20
28
  ---
21
29
 
22
30
  <input
@@ -31,7 +39,10 @@ const { size = 'sm', open = false, logo, buttons, search } = Astro.props
31
39
  {size}
32
40
  {open}
33
41
  >
34
- <Logo {logo} />
42
+ <Logo
43
+ src={logo}
44
+ company={company}
45
+ />
35
46
  {search && <Search />}
36
47
  <Element class:list="buttons">
37
48
  {
@@ -6,7 +6,7 @@ import { pascal } from 'radash'
6
6
  const slug = Astro.url.pathname.replace(/\/$/, '').split('/').pop() || ''
7
7
  const componentName = pascal(slug)
8
8
 
9
- const allComponents = import.meta.glob('src/**/*.astro', { eager: true })
9
+ const allComponents = import.meta.glob('/src/**/*.astro', { eager: true })
10
10
  const foundComponent = Object.entries(allComponents).find(
11
11
  ([key]) => key.split('/').pop() === `${componentName}.astro`
12
12
  )?.[1] as any
@@ -13,7 +13,7 @@ toc: false
13
13
  themeselect: true
14
14
 
15
15
  header:
16
- logo: Fulldev UI
16
+ company: Fulldev UI
17
17
  buttons:
18
18
  - text: Docs
19
19
  href: /overview/introduction
@@ -5,7 +5,7 @@ header: false
5
5
  banner: false
6
6
 
7
7
  navigation:
8
- logo: Fulldev UI
8
+ company: Fulldev UI
9
9
  buttons:
10
10
  - heading: Get Started
11
11
  buttons:
@@ -1,5 +1,7 @@
1
1
  import viteYaml from '@rollup/plugin-yaml'
2
2
  import type { AstroIntegration } from 'astro'
3
+ import favicons from 'astro-favicons'
4
+ import type { CollectionEntry } from 'astro:content'
3
5
  import merge from 'deepmerge'
4
6
  import fs from 'fs/promises'
5
7
  import yaml from 'js-yaml'
@@ -14,9 +16,11 @@ type Color = {
14
16
  }
15
17
 
16
18
  interface Config {
19
+ favicon?: string
20
+ company?: string
17
21
  css?: string
22
+ basePreset?: CollectionEntry<'presets'>['id']
18
23
  injectRoutes?: boolean
19
- overrideComponents?: boolean
20
24
  generateImageEntries?: boolean
21
25
  colors: {
22
26
  theme: 'light' | 'dark'
@@ -52,6 +56,21 @@ export default function fulldevIntegration(
52
56
  injectRoute,
53
57
  }) => {
54
58
  // ----------------------
59
+ // Inject favicon integration
60
+ // ----------------------
61
+ config.favicon &&
62
+ config.company &&
63
+ updateConfig({
64
+ integrations: [
65
+ favicons({
66
+ path: 'favicon',
67
+ masterPicture: config.favicon,
68
+ appName: config.company,
69
+ appShortName: config.company,
70
+ }),
71
+ ],
72
+ })
73
+ // ----------------------
55
74
  // Inject css
56
75
  // ----------------------
57
76
  config?.css && injectScript('page-ssr', `import "${config?.css}";`)
@@ -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(),
package/.astro/assets.mjs DELETED
@@ -1 +0,0 @@
1
- export default new Map();