fulldev-ui 0.5.0-beta.4 → 0.5.0-beta.5

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 (40) hide show
  1. package/package.json +1 -1
  2. package/src/blocks/Excerpt.astro +14 -0
  3. package/src/blocks/Product.astro +42 -3
  4. package/src/components/Drawer.astro +97 -54
  5. package/src/components/Footer.astro +4 -0
  6. package/src/components/Header.astro +19 -10
  7. package/src/components/Menu.astro +56 -0
  8. package/src/components/Section.astro +2 -0
  9. package/src/components/Sidebar.astro +61 -111
  10. package/src/components/ThemeSelect.astro +3 -0
  11. package/src/components/Toc.astro +36 -94
  12. package/src/components/experimental/Gallery.astro +50 -126
  13. package/src/components/experimental/Prose.astro +32 -0
  14. package/src/content/config.ts +1 -2
  15. package/src/content/pages/blocks/_product.mdx +73 -2
  16. package/src/content/pages/index.mdx +0 -2
  17. package/src/content/pages/layouts/_layout.mdx +8 -15
  18. package/src/content/pages/layouts/docslayout.mdx +10 -1
  19. package/src/content/pages/overview/components.mdx +5 -0
  20. package/src/content/pages/overview/content-collections.mdx +139 -0
  21. package/src/content/pages/overview/installation.mdx +25 -26
  22. package/src/content/pages/overview/introduction.mdx +16 -10
  23. package/src/content/pages/overview/theming.mdx +69 -0
  24. package/src/content/pages/schemas/page.mdx +6 -0
  25. package/src/content/presets/base.yml +57 -43
  26. package/src/content/presets/blocks.yml +0 -3
  27. package/src/content/presets/docs.yml +2 -61
  28. package/src/layouts/Layout.astro +24 -14
  29. package/src/layouts/PostLayout.astro +24 -0
  30. package/src/layouts/ProductLayout.astro +5 -2
  31. package/src/schemas/components/header.ts +7 -9
  32. package/src/schemas/components/menu.ts +13 -0
  33. package/src/schemas/components/sidebar.ts +15 -0
  34. package/src/schemas/components/toc.ts +3 -0
  35. package/src/schemas/pageSchema.ts +5 -6
  36. package/src/schemas/utils/navigation.ts +3 -53
  37. package/src/components/experimental/GalleryVertical.astro +0 -161
  38. package/src/content/pages/overview/content-layer.mdx +0 -128
  39. package/src/content/pages/overview/customization.mdx +0 -83
  40. package/src/schemas/presetSchema.ts +0 -33
@@ -0,0 +1,139 @@
1
+ ---
2
+ presets: [docs]
3
+ title: Content Collections
4
+ ---
5
+
6
+ import Link from 'fulldev-ui/components/Link.astro'
7
+
8
+ # Content Collections
9
+
10
+ We utilize <Link href="https://docs.astro.build/docs/guides/content-collections/">Astro's Content Layer</Link> to create entire websites using just content files and our components.
11
+
12
+ ## Starter Template
13
+
14
+ This is the recommended way to get started with our content layer integration. We've created a <Link href="https://github.com/fulldotdev/starter/tree/main">starter template</Link> with examples of everything you need to get started.
15
+
16
+ ```bash
17
+ pnpm create astro@latest -- --template fulldotdev/starter
18
+ ```
19
+
20
+ ## Manual Setup
21
+
22
+ To get started with the manual setup, you need to install the <Link href="/overview/installation/">integration</Link> and add `injectRoutes: true` to your `astro.config.ts` file, see <Link href="#type-safe-frontmatter">frontmatter</Link> below for more information on how this generates a site using content files.
23
+
24
+ ```ts
25
+ import { defineConfig } from 'astro/config'
26
+ import fulldev from 'fulldev-ui/integration'
27
+
28
+ // https://astro.build/config
29
+ export default defineConfig({
30
+ integrations: [
31
+ fulldev({
32
+ // other options
33
+ injectRoutes: true,
34
+ }),
35
+ ],
36
+ })
37
+ ```
38
+
39
+ ## Type-safe frontmatter
40
+
41
+ Each file has a few frontmatter objects that are important to know about. Seo has priority over title and description, however title and description is used in multiple places like a card.
42
+
43
+ ```yml
44
+ ---
45
+ preset: [docs] # Applies the configuration from src/content/presets/docs.yml
46
+ component: DocsLayout
47
+
48
+ seo:
49
+ title: Page Title
50
+ description: This is my page description
51
+ image: /image.jpg # Open Graph Image
52
+
53
+ # Information on the page, this is used in places like card, sidebar, etc.
54
+ title: Page Title
55
+ description: This is my page description
56
+
57
+ sections: # Here you generate the page by adding a component and passing props
58
+ - component: Hero
59
+ heading: Page Title
60
+ text: This is my page description
61
+ buttons:
62
+ - text: Button
63
+ color: brand
64
+ href: /
65
+ - text: Button
66
+ href: /
67
+ ---
68
+ # This is the prose, you can use markdown here
69
+ ```
70
+
71
+ For all objects avaliable in the Content Layer, see the <Link href="https://ui.full.dev/schemas/page/">schemas</Link>.
72
+
73
+ ### Presets
74
+
75
+ Presets are configuration files that can be used to set the default values for a page. They are located in the **src/content/presets** directory and you can use them by adding the `preset` property to the frontmatter of a page or add a `basePreset` to the integration setup in the `astro.config.ts` file.
76
+
77
+ ```ts
78
+ import { defineConfig } from 'astro/config'
79
+ import fulldev from 'fulldev-ui/integration'
80
+
81
+ // https://astro.build/config
82
+ export default defineConfig({
83
+ integrations: [
84
+ fulldev({
85
+ // other options
86
+ basePreset: 'base', // Applies the configuration from src/content/presets/base.yml to every page
87
+ }),
88
+ ],
89
+ })
90
+ ```
91
+
92
+ ## i18n
93
+
94
+ Getting started with i18n is easy, you can easily add additional languages by creating a new folder named after a language code in the **content/pages** directory and adding your content files in the new language.
95
+
96
+ These pages are just as static as the others however you can merge them with the default language by adding the `i18n` key to the frontmatter.
97
+
98
+ By merging pages you only need to specify the content that is different for the new language. Things like images do not need to be repeated in these new files. See example:
99
+
100
+ content/pages/index.md:
101
+
102
+ ```md
103
+ ---
104
+ sections:
105
+ - component: Hero
106
+ image: /image.webp
107
+ heading: Page Title
108
+ text: This is my page description
109
+ ---
110
+ ```
111
+
112
+ content/pages/nl/index.md:
113
+
114
+ ```md
115
+ ---
116
+ i18n: index
117
+
118
+ sections:
119
+ - component: Hero
120
+ heading: Page Title
121
+ text: This is my page description
122
+ ---
123
+ ```
124
+
125
+ These return the same results
126
+
127
+ ### Example structure
128
+
129
+ ```bash
130
+ .
131
+ ├── src/
132
+ │ ├── content/
133
+ │ │ ├── pages/
134
+ │ │ │ ├── index.md
135
+ │ │ │ ├── nl/
136
+ │ │ │ │ └── index.md
137
+ │ │ │ └── de/
138
+ │ │ │ │ └── index.md
139
+ ```
@@ -7,7 +7,21 @@ import Link from 'fulldev-ui/components/Link.astro'
7
7
 
8
8
  # Installation
9
9
 
10
- Install fulldev-ui with your favorite package manager and you are ready to go.
10
+ You can add fulldev-ui to your project, or use the starter template.
11
+
12
+ ## Add to existing project
13
+
14
+ ### Automatic setup
15
+
16
+ Use the astro add command to automatically install the dependencies and add the integration.
17
+
18
+ ```bash
19
+ npx astro add fulldev-ui
20
+ ```
21
+
22
+ ## Manual installation
23
+
24
+ Install fulldev-ui with your favorite package manager.
11
25
 
12
26
  ```bash
13
27
  pnpm i fulldev-ui
@@ -19,36 +33,21 @@ yarn add fulldev-ui
19
33
  npm i fulldev-ui
20
34
  ```
21
35
 
22
- ## Integration
23
-
24
- To install the integration, import it in your `astro.config.ts` file.
25
- You can optionally add a custom css file and define custom colors and other theming options, see the <Link href="/overview/customization/">customization documentation</Link> for more information.
26
-
27
- To get started with the content layer, see the <Link href="/overview/content-layer/#manual-setup">content layer documentation</Link>.
36
+ Then setup the integration in your `astro.config.ts` file.
28
37
 
29
38
  ```ts
30
39
  import { defineConfig } from 'astro/config'
31
40
  import fulldev from 'fulldev-ui/integration'
32
41
 
33
- // https://astro.build/config
34
42
  export default defineConfig({
35
- integrations: [
36
- fulldev({
37
- css: '/src/css/custom.css',
38
- colors: {
39
- theme: 'dark',
40
- dark: {
41
- background: '#111110',
42
- base: '#6F6D66',
43
- brand: '#F50',
44
- },
45
- light: {
46
- background: '#EEEEEC',
47
- base: '#6F6D66',
48
- brand: '#F50',
49
- },
50
- },
51
- }),
52
- ],
43
+ integrations: [fulldev()],
53
44
  })
54
45
  ```
46
+
47
+ ## Using the starter template
48
+
49
+ The easiest way to get started is to use the [starter template](https://github.com/fulldotdev/starter).
50
+
51
+ ```bash
52
+ pnpm create astro@latest -- --template fulldotdev/starter
53
+ ```
@@ -5,20 +5,26 @@ title: Introduction
5
5
 
6
6
  # Introduction
7
7
 
8
- Fulldev UI focuses on content websites rather than applications.
8
+ **Fulldev UI** is a full-featured UI library and website theme built on the [Astro](https://astro.build/) framework. Whether starting a new project or enhancing an existing one, this guide will help you get set up. For installation details, see the [installation guide](/getting-started/installation).
9
9
 
10
- ##### Build entire websites with just components
10
+ ## Why we built it
11
11
 
12
- Fulldev UI is unique in that it introduces larger components to build entire pages, and even websites. Like a Section component that just works.
12
+ We built **Fulldev UI** after repeatedly encountering the same challenges in client projects, covering the core needs of content-focused websites. Initially created for [our own company](https://full.dev), we decided to open-source it for others to use.
13
13
 
14
- ##### Integrates with any JS / CSS framework
14
+ ## Some features
15
15
 
16
- Want to use Tailwind, or something else? You can overwrite all styles. Need an interactive framework component? Styles can be applied with one simple class.
16
+ - Vanilla HTML and CSS.
17
+ - Seamless integration with TailwindCSS and UnoCSS.
18
+ - Minimal JavaScript.
19
+ - Supports Astro's [Content Collections](https://docs.astro.build/en/guides/content-collections/).
20
+ - Customizable via CSS variables.
21
+ - Reusable components for pages and sections.
22
+ - Includes blocks like Hero, CTA, Features, etc.
23
+ - Page-building tools.
24
+ - And more...
17
25
 
18
- ##### Automated colors, spacing and sizes
26
+ ## A word of caution
19
27
 
20
- Everything is carefully designed to be fully responsive. Component adapt to their environment, like a Heading being different in a Section than in a Card. You can also customize via simple props.
28
+ **Fulldev UI** includes a wide range of features, some still experimental. While a narrower focus would improve stability, we built it for flexibility in our projects.
21
29
 
22
- ##### Content layer
23
-
24
- Build entire websites using just content files like Markdown using our components, blocks and layouts.
30
+ This isn't just a single-purpose library; it's a framework for building blog, marketing, and portfolio websites—similar to how [Starlight](https://starlight.astro.build/) serves documentation. As it evolves, its focus will sharpen. In the meantime, feel free to use it and share feedback on [Discord](https://discord.gg/fulldev)!
@@ -0,0 +1,69 @@
1
+ ---
2
+ presets: [docs]
3
+ title: Theming
4
+ ---
5
+
6
+ import Link from 'fulldev-ui/components/Link.astro'
7
+
8
+ # Theming
9
+
10
+ With the fulldev-ui integration you can easily set a theme and generate a palette based on <Link href="https://www.radix-ui.com/colors">Radix Colors.</Link>
11
+
12
+ ## Configuration
13
+
14
+ ### Generating a color palette
15
+
16
+ - **css** is the path to your custom css file that applies to all pages on your site.
17
+ - **colors** is an object that defines the colors for your site.
18
+ - **theme** is the default theme for your site.
19
+ - **dark** and **light** are objects that define the colors for the dark and light themes, these three properties are used to generate a color pallete using radix colors.
20
+
21
+ ```ts
22
+ import { defineConfig } from 'astro/config'
23
+ import fulldev from 'fulldev-ui/integration'
24
+
25
+ // https://astro.build/config
26
+ export default defineConfig({
27
+ integrations: [
28
+ fulldev({
29
+ css: '/src/css/custom.css',
30
+ colors: {
31
+ theme: 'dark',
32
+ dark: {
33
+ background: '#111110',
34
+ base: '#6F6D66',
35
+ brand: '#F50',
36
+ },
37
+ light: {
38
+ background: '#EEEEEC',
39
+ base: '#6F6D66',
40
+ brand: '#F50',
41
+ },
42
+ },
43
+ }),
44
+ ],
45
+ })
46
+ ```
47
+
48
+ ### Generating favicons
49
+
50
+ We've integrated <Link href="https://github.com/ACP-CODE/astro-favicons">astro-favicons</Link> into fulldev-ui to generate favicons from a svg file.
51
+
52
+ ```ts
53
+ import { defineConfig } from 'astro/config'
54
+ import fulldev from 'fulldev-ui/integration'
55
+
56
+ // https://astro.build/config
57
+ export default defineConfig({
58
+ integrations: [
59
+ fulldev({
60
+ favicon: 'src/images/favicon.svg', // can also be png, webp, jpg, etc.
61
+ // other options here
62
+ }),
63
+ ],
64
+ })
65
+ ```
66
+
67
+ ## Overwriting styles
68
+
69
+ Since Fulldev UI uses just regular CSS with low specificity, you can customize anything else using custom CSS.
@@ -9,3 +9,9 @@ title: page
9
9
  Objects in the page schema are used to define the structure of a page. They are used to define the information, content and components that are used to render the page.
10
10
 
11
11
  import { Code } from 'astro:components'
12
+ import { zodToTs, createTypeAlias, printNode } from 'zod-to-ts'
13
+ import pageSchema from 'fulldev-ui/schemas/pageSchema'
14
+
15
+ export const identifier = 'Page'
16
+ export const node = zodToTs(pageSchema, identifier)
17
+ export const typeAlias = createTypeAlias(node, identifier)
@@ -1,3 +1,5 @@
1
+ theme: dark
2
+
1
3
  seo:
2
4
  image: /images/og-image.png
3
5
 
@@ -8,11 +10,9 @@ code:
8
10
  posthog.init('phc_mVacbe8Xydu0UZlh4bNw5EGisvzyRcpqXEEuEEp5lOY',{api_host:'https://eu.i.posthog.com', person_profiles: 'identified_only' // or 'always' to create profiles for anonymous users as well
9
11
  })
10
12
  </script>
11
- sidebar: true
12
- toc: false
13
- themeselect: true
14
-
15
- header:
13
+ header: true
14
+ navigation:
15
+ cart: Winkelwagen
16
16
  company: Fulldev UI
17
17
  buttons:
18
18
  - text: Docs
@@ -30,41 +30,55 @@ header:
30
30
  target: _blank
31
31
  icon: brand-discord
32
32
  variant: secondary
33
- # footer:
34
- # logo: Fulldev UI
35
- # text: The Astro UI library to build content sites. Make websites with prebuilt components, blocks and layouts.
36
- # columns:
37
- # - heading: Pages
38
- # buttons:
39
- # - text: Docs
40
- # href: /overview/introduction
41
- # - text: Components
42
- # href: /typography/heading
43
- # - blocks
44
- # - showcase
45
- # socials:
46
- # - https://www.linkedin.com/in/silveltman/
47
- # - https://x.com/silveltm
48
- # - https://github.com/fulldotdev/ui
49
- # channels:
50
- # - heading: Phone
51
- # text: 123-456-7890
52
- # icon: phone
53
- # href: tel:123-456-7890
54
- # - heading: Email
55
- # text: contact@example.com
56
- # icon: mail
57
- # href: mailto:contact@example.com
58
- # - heading: Address
59
- # text: 1234 Main St, Springfield, IL 62701
60
- # icon: map-pin
61
- # hours:
62
- # heading: Openingstijden
63
- # days:
64
- # ma.: 09:00 - 17:00
65
- # di.: 09:00 - 17:00
66
- # wo.: 09:00 - 17:00
67
- # do.: 09:00 - 17:00
68
- # vr.: 09:00 - 17:00
69
- # za.: 09:00 - 17:00
70
- # zo.: 09:00 - 17:00
33
+ menu:
34
+ - heading: Get Started
35
+ buttons:
36
+ - overview/introduction
37
+ - overview/installation
38
+ - overview/theming
39
+ - overview/frameworks
40
+ - overview/components
41
+ - overview/content-collections
42
+ - heading: Typography
43
+ buttons:
44
+ - typography/heading
45
+ - typography/label
46
+ - typography/link
47
+ - typography/list
48
+ - typography/text
49
+ - heading: Base
50
+ buttons:
51
+ - base/badge
52
+ - base/button
53
+ - base/card
54
+ - base/checkbox
55
+ - base/icon
56
+ - base/input
57
+ - base/rating
58
+ - base/section
59
+ - base/select
60
+ - base/table
61
+ - base/textarea
62
+ - base/theme-select
63
+ - base/image
64
+ - heading: Blocks
65
+ buttons:
66
+ - blocks/banner
67
+ - blocks/colleagues
68
+ - blocks/contact
69
+ - blocks/content
70
+ - blocks/cta
71
+ - blocks/features
72
+ - blocks/hero
73
+ - blocks/intro
74
+ - blocks/posts
75
+ - blocks/reviews
76
+ - heading: Schemas
77
+ buttons:
78
+ - schemas/page
79
+ - schemas/preset
80
+ - heading: More
81
+ buttons:
82
+ - showcase
83
+ - text: Changelog
84
+ href: https://github.com/fulldotdev/ui/releases
@@ -1,4 +1 @@
1
1
  component: BlockLayout
2
-
3
- navigation:
4
- toc: false
@@ -1,65 +1,6 @@
1
1
  component: DocsLayout
2
+ presets: [base]
2
3
 
3
4
  sidebar: true
4
5
  header: false
5
- banner: false
6
- toc: true
7
-
8
- navigation:
9
- company: Fulldev UI
10
- buttons:
11
- - heading: Get Started
12
- buttons:
13
- - overview/introduction
14
- - overview/installation
15
- - overview/customization
16
- - overview/frameworks
17
- - overview/components
18
- - overview/content-layer
19
- - heading: Typography
20
- buttons:
21
- - typography/heading
22
- - typography/label
23
- - typography/link
24
- - typography/list
25
- - typography/text
26
- - heading: Base
27
- buttons:
28
- - base/badge
29
- - base/button
30
- - base/card
31
- - base/checkbox
32
- - base/icon
33
- - base/input
34
- - base/rating
35
- - base/section
36
- - base/select
37
- - base/table
38
- - base/textarea
39
- - base/theme-select
40
- - base/image
41
- - heading: Blocks
42
- buttons:
43
- - blocks/banner
44
- - blocks/colleagues
45
- - blocks/contact
46
- - blocks/content
47
- - blocks/cta
48
- - blocks/features
49
- - blocks/hero
50
- - blocks/intro
51
- - blocks/posts
52
- - blocks/reviews
53
- # - heading: Layouts
54
- # buttons:
55
- # - layouts/layout
56
- # - layouts/docslayout
57
- - heading: Schemas
58
- buttons:
59
- - schemas/page
60
- - schemas/preset
61
- - heading: More
62
- buttons:
63
- - showcase
64
- - text: Changelog
65
- href: https://github.com/fulldotdev/ui/releases
6
+ toc: 'On this page'
@@ -57,22 +57,27 @@ const {
57
57
  <!doctype html>
58
58
  <html {...rest}>
59
59
  <Head {...Astro.props} />
60
- <Element as="body">
60
+ <Element
61
+ as="body"
62
+ {theme}
63
+ >
61
64
  <slot name="banner">
62
65
  <Banner text={banner} />
63
66
  </slot>
64
67
  <slot name="header">
65
68
  <Header
66
- open={header}
69
+ class:list={{
70
+ 'for-sidebar': sidebar,
71
+ }}
72
+ if={navigation || header}
67
73
  {...navigation}
68
- {themeselect}
69
74
  {...header}
70
75
  />
71
76
  </slot>
72
77
  <div class="core">
73
78
  <slot name="sidebar">
74
79
  <Sidebar
75
- open={sidebar}
80
+ if={sidebar}
76
81
  {...navigation}
77
82
  {...sidebar}
78
83
  />
@@ -84,14 +89,10 @@ const {
84
89
  </slot>
85
90
  </main>
86
91
  <slot name="toc">
87
- {
88
- toc && (
89
- <Toc
90
- {render}
91
- {...toc}
92
- />
93
- )
94
- }
92
+ <Toc
93
+ heading={toc}
94
+ {render}
95
+ />
95
96
  </slot>
96
97
  </div>
97
98
  <slot name="footer">
@@ -114,12 +115,21 @@ const {
114
115
  --screen: 100vw;
115
116
  display: flex;
116
117
  flex-direction: column;
117
-
118
- background-color: var(--base-2);
118
+ background-color: var(--base-background);
119
119
  width: 100%;
120
120
  min-height: 100vh;
121
121
  color: var(--base-11);
122
122
 
123
+ .for-sidebar {
124
+ @media (min-width: 1024px) {
125
+ display: none;
126
+
127
+ ~ * {
128
+ --header-height: 0px;
129
+ }
130
+ }
131
+ }
132
+
123
133
  .core {
124
134
  display: flex;
125
135
  position: relative;
@@ -0,0 +1,24 @@
1
+ ---
2
+ import type { ComponentProps } from 'astro/types'
3
+ import Article from 'fulldev-ui/blocks/Article.astro'
4
+ import Sections from 'fulldev-ui/components/sections.astro'
5
+ import Layout from 'fulldev-ui/layouts/Layout.astro'
6
+ import Excerpt from '../blocks/Excerpt.astro'
7
+
8
+ type Props = ComponentProps<typeof Layout>
9
+
10
+ const { sections, title, description, ...rest } = Astro.props
11
+ ---
12
+
13
+ <Layout {...Astro.props}>
14
+ <Excerpt
15
+ heading={title}
16
+ align="start"
17
+ text={description}
18
+ style={{ '--screen': '768px' }}
19
+ {...rest}
20
+ />
21
+ <Article />
22
+ <Sections {sections} />
23
+ <slot />
24
+ </Layout>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import type { ComponentProps } from 'astro/types'
3
3
  import Article from 'fulldev-ui/blocks/Article.astro'
4
- import Product from 'fulldev-ui/blocks/Product.astro'
4
+ import Section from 'fulldev-ui/components/Section.astro'
5
5
  import Sections from 'fulldev-ui/components/sections.astro'
6
6
  import Layout from 'fulldev-ui/layouts/Layout.astro'
7
7
 
@@ -11,7 +11,10 @@ const { render, sections, ...rest } = Astro.props
11
11
  ---
12
12
 
13
13
  <Layout {...Astro.props}>
14
- <Product {...rest} />
14
+ <Section
15
+ component="Product"
16
+ {...rest as any}
17
+ />
15
18
  <Article />
16
19
  <Sections {sections} />
17
20
  <slot />
@@ -2,12 +2,10 @@ import { z } from 'astro:content'
2
2
  import buttons from './buttons'
3
3
  import logo from './logo'
4
4
 
5
- export default z.boolean().or(
6
- z
7
- .object({
8
- logo,
9
- buttons,
10
- })
11
- .partial()
12
- .passthrough()
13
- )
5
+ export default z
6
+ .object({
7
+ logo,
8
+ buttons,
9
+ })
10
+ .partial()
11
+ .passthrough()
@@ -0,0 +1,13 @@
1
+ import { z } from 'astro:content'
2
+ import buttons from './buttons'
3
+ import heading from './heading'
4
+
5
+ export default z.array(
6
+ z
7
+ .object({
8
+ heading,
9
+ buttons,
10
+ })
11
+ .partial()
12
+ .passthrough()
13
+ )