fulldev-ui 0.5.0-beta.1 → 0.5.0-beta.11
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/.env.example +3 -0
- package/CONTRIBUTING.md +10 -4
- package/astro.config.ts +2 -13
- package/package.json +8 -4
- package/pnpm-lock.yaml +82 -130
- package/src/blocks/Article.astro +31 -12
- package/src/blocks/Banner.astro +2 -1
- package/src/blocks/Contact.astro +7 -30
- package/src/blocks/Excerpt.astro +14 -0
- package/src/blocks/Intro.astro +3 -1
- package/src/blocks/Product.astro +55 -22
- package/src/components/Card.astro +11 -5
- package/src/components/Cart.astro +38 -0
- package/src/components/CartForm.astro +121 -0
- package/src/components/CartList.astro +134 -0
- package/src/components/CartSummary.astro +147 -0
- package/src/components/Drawer.astro +128 -52
- package/src/components/Footer.astro +6 -3
- package/src/components/Form.astro +49 -0
- package/src/components/Header.astro +19 -14
- package/src/components/Image.astro +0 -1
- package/src/components/Input.astro +6 -0
- package/src/components/Menu.astro +56 -0
- package/src/components/Price.astro +7 -11
- package/src/components/Search.astro +1 -4
- package/src/components/Section.astro +2 -1
- package/src/components/Sidebar.astro +61 -111
- package/src/components/Social.astro +7 -0
- package/src/components/ThemeSelect.astro +3 -0
- package/src/components/Toc.astro +33 -94
- package/src/components/docs/PropsTable.astro +1 -1
- package/src/components/experimental/Form.astro +31 -5
- package/src/components/experimental/Gallery.astro +50 -126
- package/src/components/experimental/Prose.astro +32 -0
- package/src/content/pages/base/select.mdx +0 -8
- package/src/content/pages/base/textarea.mdx +0 -5
- package/src/content/pages/blocks/_product.mdx +73 -2
- package/src/content/pages/index.mdx +0 -3
- package/src/content/pages/layouts/_layout.mdx +14 -0
- package/src/content/pages/layouts/docslayout.mdx +10 -1
- package/src/content/pages/overview/components.mdx +5 -0
- package/src/content/pages/overview/content-collections.mdx +139 -0
- package/src/content/pages/overview/installation.mdx +25 -26
- package/src/content/pages/overview/introduction.mdx +16 -10
- package/src/content/pages/overview/theming.mdx +69 -0
- package/src/content/pages/schemas/page.mdx +6 -0
- package/src/content/presets/base.yml +56 -43
- package/src/content/presets/blocks.yml +0 -3
- package/src/content/presets/docs.yml +3 -62
- package/src/env.d.ts +1 -1
- package/src/integration/index.ts +63 -34
- package/src/layouts/DocsLayout.astro +23 -35
- package/src/layouts/Layout.astro +37 -21
- package/src/layouts/OverviewLayout.astro +17 -10
- package/src/layouts/PostLayout.astro +7 -7
- package/src/layouts/ProductLayout.astro +5 -2
- package/src/schemas/components/footer.ts +1 -0
- package/src/schemas/components/header.ts +1 -0
- package/src/schemas/components/menu.ts +13 -0
- package/src/schemas/components/sidebar.ts +15 -0
- package/src/schemas/components/toc.ts +3 -0
- package/src/schemas/pageSchema.ts +72 -34
- package/src/schemas/presetSchema.ts +2 -28
- package/src/schemas/utils/navigation.ts +6 -51
- package/src/stores/cart.ts +23 -0
- package/src/utils/cart.ts +32 -0
- package/src/utils/{getChildPages.ts → getFolderChildren.ts} +3 -1
- package/src/utils/{getCategoryPages.ts → getReferenceChildren.ts} +6 -3
- package/tsconfig.json +1 -3
- package/src/components/experimental/GalleryVertical.astro +0 -161
- package/src/content/pages/layouts/layout.mdx +0 -21
- package/src/content/pages/layouts/pagelayout.mdx +0 -21
- package/src/content/pages/overview/content-layer.mdx +0 -128
- package/src/content/pages/overview/customization.mdx +0 -83
- package/src/layouts/ContentLayout.astro +0 -16
- package/src/layouts/PageLayout.astro +0 -15
- /package/src/schemas/utils/{categories.ts → parents.ts} +0 -0
- /package/src/types/{global-props.d.ts → global-props.ts} +0 -0
|
@@ -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,8 @@ 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
|
-
|
|
12
|
-
|
|
13
|
-
themeselect: true
|
|
14
|
-
|
|
15
|
-
header:
|
|
13
|
+
navigation:
|
|
14
|
+
header: true
|
|
16
15
|
company: Fulldev UI
|
|
17
16
|
buttons:
|
|
18
17
|
- text: Docs
|
|
@@ -30,41 +29,55 @@ header:
|
|
|
30
29
|
target: _blank
|
|
31
30
|
icon: brand-discord
|
|
32
31
|
variant: secondary
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
32
|
+
menu:
|
|
33
|
+
- heading: Get Started
|
|
34
|
+
buttons:
|
|
35
|
+
- overview/introduction
|
|
36
|
+
- overview/installation
|
|
37
|
+
- overview/theming
|
|
38
|
+
- overview/frameworks
|
|
39
|
+
- overview/components
|
|
40
|
+
- overview/content-collections
|
|
41
|
+
- heading: Typography
|
|
42
|
+
buttons:
|
|
43
|
+
- typography/heading
|
|
44
|
+
- typography/label
|
|
45
|
+
- typography/link
|
|
46
|
+
- typography/list
|
|
47
|
+
- typography/text
|
|
48
|
+
- heading: Base
|
|
49
|
+
buttons:
|
|
50
|
+
- base/badge
|
|
51
|
+
- base/button
|
|
52
|
+
- base/card
|
|
53
|
+
- base/checkbox
|
|
54
|
+
- base/icon
|
|
55
|
+
- base/input
|
|
56
|
+
- base/rating
|
|
57
|
+
- base/section
|
|
58
|
+
- base/select
|
|
59
|
+
- base/table
|
|
60
|
+
- base/textarea
|
|
61
|
+
- base/theme-select
|
|
62
|
+
- base/image
|
|
63
|
+
- heading: Blocks
|
|
64
|
+
buttons:
|
|
65
|
+
- blocks/banner
|
|
66
|
+
- blocks/colleagues
|
|
67
|
+
- blocks/contact
|
|
68
|
+
- blocks/content
|
|
69
|
+
- blocks/cta
|
|
70
|
+
- blocks/features
|
|
71
|
+
- blocks/hero
|
|
72
|
+
- blocks/intro
|
|
73
|
+
- blocks/posts
|
|
74
|
+
- blocks/reviews
|
|
75
|
+
- heading: Schemas
|
|
76
|
+
buttons:
|
|
77
|
+
- schemas/page
|
|
78
|
+
- schemas/preset
|
|
79
|
+
- heading: More
|
|
80
|
+
buttons:
|
|
81
|
+
- showcase
|
|
82
|
+
- text: Changelog
|
|
83
|
+
href: https://github.com/fulldotdev/ui/releases
|
|
@@ -1,65 +1,6 @@
|
|
|
1
1
|
component: DocsLayout
|
|
2
2
|
|
|
3
|
-
sidebar: true
|
|
4
|
-
header: false
|
|
5
|
-
banner: false
|
|
6
|
-
|
|
7
3
|
navigation:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
buttons:
|
|
12
|
-
- overview/introduction
|
|
13
|
-
- overview/installation
|
|
14
|
-
- overview/customization
|
|
15
|
-
- overview/frameworks
|
|
16
|
-
- overview/components
|
|
17
|
-
- overview/content-layer
|
|
18
|
-
- heading: Typography
|
|
19
|
-
buttons:
|
|
20
|
-
- typography/heading
|
|
21
|
-
- typography/label
|
|
22
|
-
- typography/link
|
|
23
|
-
- typography/list
|
|
24
|
-
- typography/text
|
|
25
|
-
- heading: Base
|
|
26
|
-
buttons:
|
|
27
|
-
- base/badge
|
|
28
|
-
- base/button
|
|
29
|
-
- base/card
|
|
30
|
-
- base/checkbox
|
|
31
|
-
- base/icon
|
|
32
|
-
- base/input
|
|
33
|
-
- base/rating
|
|
34
|
-
- base/section
|
|
35
|
-
- base/select
|
|
36
|
-
- base/table
|
|
37
|
-
- base/textarea
|
|
38
|
-
- base/theme-select
|
|
39
|
-
- base/image
|
|
40
|
-
- heading: Blocks
|
|
41
|
-
buttons:
|
|
42
|
-
- blocks/banner
|
|
43
|
-
- blocks/colleagues
|
|
44
|
-
- blocks/contact
|
|
45
|
-
- blocks/content
|
|
46
|
-
- blocks/cta
|
|
47
|
-
- blocks/features
|
|
48
|
-
- blocks/hero
|
|
49
|
-
- blocks/intro
|
|
50
|
-
- blocks/posts
|
|
51
|
-
- blocks/reviews
|
|
52
|
-
- heading: Layouts
|
|
53
|
-
buttons:
|
|
54
|
-
- layouts/layout
|
|
55
|
-
- layouts/pagelayout
|
|
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
|
|
4
|
+
sidebar: true
|
|
5
|
+
header: false
|
|
6
|
+
toc: 'On this page'
|
package/src/env.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="astro/client" />
|
|
2
|
-
/// <reference path="../.astro/types.d.ts" />
|
|
2
|
+
/// <reference path="../.astro/types.d.ts" />
|
package/src/integration/index.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import mdx from '@astrojs/mdx'
|
|
2
|
+
import sitemap from '@astrojs/sitemap'
|
|
1
3
|
import viteYaml from '@rollup/plugin-yaml'
|
|
2
4
|
import type { AstroIntegration } from 'astro'
|
|
3
5
|
import favicons from 'astro-favicons'
|
|
6
|
+
import robotsTxt from 'astro-robots-txt'
|
|
7
|
+
import { envField } from 'astro/config'
|
|
8
|
+
import type { CollectionEntry } from 'astro:content'
|
|
4
9
|
import merge from 'deepmerge'
|
|
5
|
-
import
|
|
6
|
-
import yaml from 'js-yaml'
|
|
7
|
-
import path from 'path'
|
|
10
|
+
import { loadEnv } from 'vite'
|
|
8
11
|
import virtual from 'vite-plugin-virtual'
|
|
9
12
|
import { generateRadixColors } from './generate-colors'
|
|
10
13
|
|
|
@@ -18,9 +21,9 @@ interface Config {
|
|
|
18
21
|
favicon?: string
|
|
19
22
|
company?: string
|
|
20
23
|
css?: string
|
|
24
|
+
basePreset?: CollectionEntry<'presets'>['id']
|
|
21
25
|
injectRoutes?: boolean
|
|
22
|
-
|
|
23
|
-
generateImageEntries?: boolean
|
|
26
|
+
// generateImageEntries?: boolean
|
|
24
27
|
colors: {
|
|
25
28
|
theme: 'light' | 'dark'
|
|
26
29
|
light?: Color | undefined
|
|
@@ -37,7 +40,6 @@ const defaultConfig: Config = {
|
|
|
37
40
|
brand: '#000',
|
|
38
41
|
},
|
|
39
42
|
},
|
|
40
|
-
generateImageEntries: false,
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export default function fulldevIntegration(
|
|
@@ -55,12 +57,39 @@ export default function fulldevIntegration(
|
|
|
55
57
|
injectRoute,
|
|
56
58
|
}) => {
|
|
57
59
|
// ----------------------
|
|
58
|
-
//
|
|
60
|
+
// Update config
|
|
59
61
|
// ----------------------
|
|
60
62
|
config.favicon &&
|
|
61
63
|
config.company &&
|
|
62
64
|
updateConfig({
|
|
65
|
+
experimental: {
|
|
66
|
+
contentLayer: true,
|
|
67
|
+
env: {
|
|
68
|
+
schema: {
|
|
69
|
+
SITE_URL: envField.string({
|
|
70
|
+
context: 'client',
|
|
71
|
+
access: 'public',
|
|
72
|
+
}),
|
|
73
|
+
STRIPE_RESTRICTED_KEY: envField.string({
|
|
74
|
+
context: 'client',
|
|
75
|
+
access: 'public',
|
|
76
|
+
optional: true,
|
|
77
|
+
}),
|
|
78
|
+
STRIPE_SECRET_KEY: envField.string({
|
|
79
|
+
context: 'server',
|
|
80
|
+
access: 'secret',
|
|
81
|
+
optional: true,
|
|
82
|
+
}),
|
|
83
|
+
},
|
|
84
|
+
validateSecrets: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
site: loadEnv(process.env.NODE_ENV as any, process.cwd(), '')
|
|
88
|
+
.SITE_URL,
|
|
63
89
|
integrations: [
|
|
90
|
+
sitemap(),
|
|
91
|
+
mdx(),
|
|
92
|
+
robotsTxt(),
|
|
64
93
|
favicons({
|
|
65
94
|
path: 'favicon',
|
|
66
95
|
masterPicture: config.favicon,
|
|
@@ -173,33 +202,33 @@ export default function fulldevIntegration(
|
|
|
173
202
|
// ----------------------
|
|
174
203
|
// Generate image YAML files
|
|
175
204
|
// ----------------------
|
|
176
|
-
if (config.generateImageEntries) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
205
|
+
// if (config.generateImageEntries) {
|
|
206
|
+
// const srcDir = path.join(process.cwd(), 'src')
|
|
207
|
+
// const filesDir = path.join(srcDir, 'images')
|
|
208
|
+
// const entriesDir = path.join(srcDir, 'content', 'images')
|
|
209
|
+
|
|
210
|
+
// try {
|
|
211
|
+
// await fs.mkdir(filesDir, { recursive: true })
|
|
212
|
+
// await fs.mkdir(entriesDir, { recursive: true })
|
|
213
|
+
|
|
214
|
+
// const files = await fs.readdir(filesDir)
|
|
215
|
+
// files.forEach(async (file) => {
|
|
216
|
+
// const filename = path.parse(file).name
|
|
217
|
+
// const yamlPath = path.join(entriesDir, `${filename}.yml`)
|
|
218
|
+
|
|
219
|
+
// try {
|
|
220
|
+
// await fs.access(yamlPath)
|
|
221
|
+
// } catch {
|
|
222
|
+
// const yamlContent = yaml.dump({
|
|
223
|
+
// alt: '',
|
|
224
|
+
// })
|
|
225
|
+
// await fs.writeFile(yamlPath, yamlContent, 'utf8')
|
|
226
|
+
// }
|
|
227
|
+
// })
|
|
228
|
+
// } catch (error) {
|
|
229
|
+
// console.error('Error generating image YAML files:', error)
|
|
230
|
+
// }
|
|
231
|
+
// }
|
|
203
232
|
|
|
204
233
|
// ----------------------
|
|
205
234
|
// Inject routes
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import type { ComponentProps } from 'astro/types'
|
|
3
3
|
import Button from 'fulldev-ui/components/Button.astro'
|
|
4
4
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
5
|
-
import Prose from 'fulldev-ui/components/experimental/Prose.astro'
|
|
6
5
|
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
7
6
|
import { crush } from 'radash'
|
|
7
|
+
import PostLayout from './PostLayout.astro'
|
|
8
8
|
|
|
9
9
|
type Props = ComponentProps<typeof Layout>
|
|
10
10
|
|
|
11
|
-
const {
|
|
12
|
-
const { Content } = await render()
|
|
11
|
+
const { slug, navigation } = Astro.props
|
|
13
12
|
|
|
14
13
|
const flatButtons = crush((navigation as any)?.buttons ?? {})
|
|
15
14
|
const slugs = Object.entries(flatButtons)
|
|
@@ -21,45 +20,34 @@ const prevSlug = slugs[slugIndex - 1]
|
|
|
21
20
|
const nextSlug = slugs[slugIndex + 1]
|
|
22
21
|
---
|
|
23
22
|
|
|
24
|
-
<
|
|
23
|
+
<PostLayout
|
|
25
24
|
class:list="docs-layout"
|
|
26
|
-
{
|
|
27
|
-
{slug}
|
|
28
|
-
{navigation}
|
|
29
|
-
{...rest}
|
|
25
|
+
{...Astro.props}
|
|
30
26
|
>
|
|
31
|
-
<
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</
|
|
49
|
-
</
|
|
27
|
+
<Element
|
|
28
|
+
class:list={['prev-next', { 'next-only': !prevSlug }]}
|
|
29
|
+
slot="prose"
|
|
30
|
+
>
|
|
31
|
+
<Button
|
|
32
|
+
if={prevSlug}
|
|
33
|
+
slug={prevSlug}
|
|
34
|
+
icon="arrow-left"
|
|
35
|
+
variant="secondary"
|
|
36
|
+
/>
|
|
37
|
+
<Button
|
|
38
|
+
if={nextSlug}
|
|
39
|
+
slug={nextSlug}
|
|
40
|
+
icon="arrow-right"
|
|
41
|
+
variant="secondary"
|
|
42
|
+
reverse={true}
|
|
43
|
+
/>
|
|
44
|
+
</Element>
|
|
45
|
+
</PostLayout>
|
|
50
46
|
|
|
51
47
|
<style lang="scss" is:global>
|
|
52
48
|
@layer fulldev {
|
|
53
49
|
.docs-layout {
|
|
54
50
|
.prose {
|
|
55
|
-
--screen: 768px;
|
|
56
|
-
padding: var(--space-6) var(--gutter);
|
|
57
|
-
color: var(--color-12);
|
|
58
|
-
|
|
59
|
-
> h1 + p {
|
|
60
|
-
color: var(--color-11);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
51
|
> a,
|
|
64
52
|
> p > a {
|
|
65
53
|
color: var(--brand-11);
|
package/src/layouts/Layout.astro
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
3
|
import type { CollectionEntry } from 'astro:content'
|
|
4
|
+
import Article from 'fulldev-ui/blocks/Article.astro'
|
|
4
5
|
import Banner from 'fulldev-ui/blocks/Banner.astro'
|
|
5
6
|
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
6
7
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
7
8
|
import Head from 'fulldev-ui/components/Head.astro'
|
|
8
9
|
import Header from 'fulldev-ui/components/Header.astro'
|
|
10
|
+
import Section from 'fulldev-ui/components/Section.astro'
|
|
9
11
|
import Sections from 'fulldev-ui/components/sections.astro'
|
|
10
12
|
import Sidebar from 'fulldev-ui/components/Sidebar.astro'
|
|
11
|
-
import Toc from 'fulldev-ui/components/Toc.astro'
|
|
12
13
|
import type { GlobalProps } from 'fulldev-ui/types/global-props'
|
|
13
14
|
|
|
14
15
|
type Props = GlobalProps &
|
|
@@ -18,6 +19,7 @@ type Props = GlobalProps &
|
|
|
18
19
|
header?: ComponentProps<typeof Header>
|
|
19
20
|
footer?: ComponentProps<typeof Footer>
|
|
20
21
|
sections?: ComponentProps<typeof Sections>['sections']
|
|
22
|
+
section?: ComponentProps<typeof Section> | undefined
|
|
21
23
|
banner?: any
|
|
22
24
|
toc?: any
|
|
23
25
|
sidebar?: any
|
|
@@ -46,6 +48,7 @@ const {
|
|
|
46
48
|
toc,
|
|
47
49
|
sections,
|
|
48
50
|
theme,
|
|
51
|
+
section,
|
|
49
52
|
banner,
|
|
50
53
|
code,
|
|
51
54
|
themeselect,
|
|
@@ -56,36 +59,39 @@ const {
|
|
|
56
59
|
<!doctype html>
|
|
57
60
|
<html {...rest}>
|
|
58
61
|
<Head {...Astro.props} />
|
|
59
|
-
<Element
|
|
62
|
+
<Element
|
|
63
|
+
as="body"
|
|
64
|
+
{theme}
|
|
65
|
+
>
|
|
60
66
|
<slot name="banner">
|
|
61
67
|
<Banner text={banner} />
|
|
62
68
|
</slot>
|
|
63
69
|
<slot name="header">
|
|
64
70
|
<Header
|
|
65
|
-
|
|
66
|
-
{...navigation}
|
|
67
|
-
{themeselect}
|
|
71
|
+
{...navigation?.header === true ? navigation : {}}
|
|
68
72
|
{...header}
|
|
69
73
|
/>
|
|
70
74
|
</slot>
|
|
71
75
|
<div class="core">
|
|
72
76
|
<slot name="sidebar">
|
|
73
77
|
<Sidebar
|
|
74
|
-
|
|
75
|
-
{
|
|
78
|
+
{...navigation?.sidebar === true ? navigation : {}}
|
|
79
|
+
logo={navigation?.sidebar?.header
|
|
80
|
+
? undefined
|
|
81
|
+
: navigation?.sidebar?.logo}
|
|
82
|
+
company={navigation?.sidebar?.header
|
|
83
|
+
? undefined
|
|
84
|
+
: navigation?.sidebar?.company}
|
|
76
85
|
{...sidebar}
|
|
77
86
|
/>
|
|
78
87
|
</slot>
|
|
79
88
|
<main data-pagefind-body>
|
|
80
|
-
<slot
|
|
81
|
-
|
|
89
|
+
<slot>
|
|
90
|
+
<Section {...section} />
|
|
91
|
+
<Article />
|
|
92
|
+
<Sections {sections} />
|
|
93
|
+
</slot>
|
|
82
94
|
</main>
|
|
83
|
-
<slot name="toc">
|
|
84
|
-
<Toc
|
|
85
|
-
{render}
|
|
86
|
-
{...toc}
|
|
87
|
-
/>
|
|
88
|
-
</slot>
|
|
89
95
|
</div>
|
|
90
96
|
<slot name="footer">
|
|
91
97
|
<Footer {...footer} />
|
|
@@ -104,27 +110,37 @@ const {
|
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
body {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
background-color: var(--base-
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
background-color: var(--base-background);
|
|
110
116
|
width: 100%;
|
|
117
|
+
min-height: 100vh;
|
|
111
118
|
color: var(--base-11);
|
|
112
119
|
|
|
120
|
+
.for-sidebar {
|
|
121
|
+
@media (min-width: 1024px) {
|
|
122
|
+
display: none;
|
|
123
|
+
|
|
124
|
+
~ * {
|
|
125
|
+
--header-height: 0px;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
113
130
|
.core {
|
|
114
131
|
display: flex;
|
|
115
132
|
position: relative;
|
|
133
|
+
flex-grow: 1;
|
|
134
|
+
height: 100%;
|
|
116
135
|
|
|
117
136
|
main {
|
|
118
137
|
--screen: 1280px;
|
|
119
|
-
|
|
120
138
|
display: flex;
|
|
121
139
|
flex: 1;
|
|
122
140
|
flex-direction: column;
|
|
123
141
|
background-color: var(--color-background);
|
|
124
142
|
width: 100%;
|
|
125
143
|
max-width: 100vw;
|
|
126
|
-
min-height: 100vh;
|
|
127
|
-
overflow-x: hidden;
|
|
128
144
|
}
|
|
129
145
|
}
|
|
130
146
|
}
|
|
@@ -6,30 +6,37 @@ import Intro from 'fulldev-ui/blocks/Intro.astro'
|
|
|
6
6
|
import Products from 'fulldev-ui/blocks/Products.astro'
|
|
7
7
|
import Sections from 'fulldev-ui/components/sections.astro'
|
|
8
8
|
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { getFolderChildren } from 'fulldev-ui/utils/getFolderChildren.ts'
|
|
10
|
+
import { getReferenceChildren } from 'fulldev-ui/utils/getReferenceChildren'
|
|
11
11
|
|
|
12
12
|
type Props = ComponentProps<typeof Layout>
|
|
13
13
|
|
|
14
|
-
const { slug,
|
|
14
|
+
const { slug, sections, title, description, render } = Astro.props
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
// const siblingPages = await getSiblingPages(slug)
|
|
16
|
+
const folderChildren = await getFolderChildren(slug)
|
|
17
|
+
const referenceChildren = await getReferenceChildren(slug)
|
|
19
18
|
---
|
|
20
19
|
|
|
21
20
|
<Layout {...Astro.props}>
|
|
22
|
-
<Intro
|
|
21
|
+
<Intro
|
|
22
|
+
heading={title}
|
|
23
|
+
text={description}
|
|
24
|
+
/>
|
|
23
25
|
<Categories
|
|
24
|
-
|
|
26
|
+
component="Categories"
|
|
27
|
+
cards={folderChildren}
|
|
25
28
|
structure="grid"
|
|
26
29
|
panel
|
|
27
30
|
/>
|
|
28
31
|
<Products
|
|
29
|
-
|
|
32
|
+
component="Products"
|
|
33
|
+
cards={referenceChildren}
|
|
30
34
|
structure="grid"
|
|
31
35
|
/>
|
|
32
|
-
<Article
|
|
36
|
+
<Article
|
|
37
|
+
{render}
|
|
38
|
+
toc={false}
|
|
39
|
+
/>
|
|
33
40
|
<Sections {sections} />
|
|
34
41
|
<slot />
|
|
35
42
|
</Layout>
|