fulldev-ui 0.5.0-beta.6 → 0.5.0-beta.8
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/astro.config.ts +2 -1
- package/package.json +1 -1
- package/src/blocks/Article.astro +31 -12
- package/src/blocks/Product.astro +1 -1
- package/src/components/Cart.astro +2 -0
- package/src/components/Drawer.astro +10 -1
- package/src/components/Footer.astro +0 -1
- package/src/components/Header.astro +6 -2
- package/src/components/Image.astro +0 -1
- package/src/components/Section.astro +0 -1
- package/src/components/Sidebar.astro +1 -1
- package/src/components/Toc.astro +3 -6
- package/src/components/docs/PropsTable.astro +1 -1
- package/src/content/presets/base.yml +1 -2
- package/src/content/presets/docs.yml +4 -3
- package/src/layouts/DocsLayout.astro +23 -35
- package/src/layouts/Layout.astro +8 -16
- package/src/layouts/OverviewLayout.astro +5 -2
- package/src/layouts/PostLayout.astro +7 -10
- package/src/schemas/pageSchema.ts +2 -2
- package/src/schemas/utils/navigation.ts +5 -1
package/astro.config.ts
CHANGED
|
@@ -25,6 +25,8 @@ export default defineConfig({
|
|
|
25
25
|
company: 'Fulldev UI',
|
|
26
26
|
favicon: 'src/images/favicon.svg',
|
|
27
27
|
css: '/src/css/custom.css',
|
|
28
|
+
basePreset: 'base',
|
|
29
|
+
injectRoutes: true,
|
|
28
30
|
colors: {
|
|
29
31
|
theme: 'dark',
|
|
30
32
|
light: {
|
|
@@ -38,7 +40,6 @@ export default defineConfig({
|
|
|
38
40
|
brand: '#F50',
|
|
39
41
|
},
|
|
40
42
|
},
|
|
41
|
-
injectRoutes: true,
|
|
42
43
|
}),
|
|
43
44
|
],
|
|
44
45
|
redirects: {
|
package/package.json
CHANGED
package/src/blocks/Article.astro
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { getEntry } from 'astro:content'
|
|
3
2
|
import Prose from 'fulldev-ui/components/experimental/Prose.astro'
|
|
4
3
|
import Section from 'fulldev-ui/components/Section.astro'
|
|
4
|
+
import Toc from 'fulldev-ui/components/Toc.astro'
|
|
5
5
|
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
const slug = Astro.url.pathname.replace(/^\/|\/$/g, '') || 'index'
|
|
9
|
-
const currentEntry = await getEntry('pages', slug)
|
|
10
|
-
const render = currentEntry && (await currentEntry.render())
|
|
11
|
-
const { Content } = render || {}
|
|
6
|
+
const { toc = 'Op deze pagina', render } = Astro.props
|
|
7
|
+
const { Content } = (render && (await render())) || {}
|
|
12
8
|
---
|
|
13
9
|
|
|
14
|
-
<Section
|
|
15
|
-
|
|
16
|
-
{...rest}
|
|
17
|
-
>
|
|
18
|
-
<Prose id="prose">
|
|
10
|
+
<Section class:list="article">
|
|
11
|
+
<Prose>
|
|
19
12
|
{Content && <Content />}
|
|
13
|
+
<slot />
|
|
20
14
|
</Prose>
|
|
15
|
+
<Toc
|
|
16
|
+
{render}
|
|
17
|
+
heading={toc}
|
|
18
|
+
/>
|
|
21
19
|
</Section>
|
|
20
|
+
|
|
21
|
+
<style is:global lang="scss">
|
|
22
|
+
.article {
|
|
23
|
+
display: flex;
|
|
24
|
+
position: relative;
|
|
25
|
+
flex-grow: 1;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: start;
|
|
28
|
+
height: 100%;
|
|
29
|
+
|
|
30
|
+
&:first-child {
|
|
31
|
+
padding-top: var(--space-6);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.prose {
|
|
35
|
+
margin-right: auto;
|
|
36
|
+
margin-left: auto;
|
|
37
|
+
max-width: 768px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</style>
|
package/src/blocks/Product.astro
CHANGED
|
@@ -5,6 +5,7 @@ import Element from 'fulldev-ui/components/Element.astro'
|
|
|
5
5
|
import Logo from 'fulldev-ui/components/experimental/Logo.astro'
|
|
6
6
|
import Menu from 'fulldev-ui/components/Menu.astro'
|
|
7
7
|
import type { GlobalProps } from 'fulldev-ui/types/global-props'
|
|
8
|
+
import Buttons from './Buttons.astro'
|
|
8
9
|
import Heading from './Heading.astro'
|
|
9
10
|
|
|
10
11
|
interface Props extends GlobalProps, HTMLAttributes<'aside'> {
|
|
@@ -15,6 +16,7 @@ interface Props extends GlobalProps, HTMLAttributes<'aside'> {
|
|
|
15
16
|
logo?: ComponentProps<typeof Logo> | undefined
|
|
16
17
|
company?: ComponentProps<typeof Logo>['company']
|
|
17
18
|
menu?: ComponentProps<typeof Menu>['groups']
|
|
19
|
+
buttons?: ComponentProps<typeof Buttons>['buttons']
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const {
|
|
@@ -24,15 +26,21 @@ const {
|
|
|
24
26
|
color,
|
|
25
27
|
variant,
|
|
26
28
|
text,
|
|
29
|
+
buttons,
|
|
27
30
|
heading,
|
|
28
31
|
logo,
|
|
29
32
|
company,
|
|
30
33
|
menu,
|
|
34
|
+
if: ifProp,
|
|
31
35
|
...rest
|
|
32
36
|
} = Astro.props
|
|
37
|
+
|
|
38
|
+
const buttonsGroup = { heading: '', buttons: buttons }
|
|
39
|
+
const mergedMenu = [buttonsGroup, ...(menu || [])] as typeof menu
|
|
33
40
|
---
|
|
34
41
|
|
|
35
42
|
<Button
|
|
43
|
+
if={ifProp}
|
|
36
44
|
variant="secondary"
|
|
37
45
|
class:list={['drawer-button', `${id}-button`]}
|
|
38
46
|
onclick={`document.getElementById('${id}').showModal()`}
|
|
@@ -43,6 +51,7 @@ const {
|
|
|
43
51
|
/>
|
|
44
52
|
|
|
45
53
|
<Element
|
|
54
|
+
if={ifProp}
|
|
46
55
|
onclick={`event.target === this && this.close()`}
|
|
47
56
|
class:list="drawer"
|
|
48
57
|
as="dialog"
|
|
@@ -72,7 +81,7 @@ const {
|
|
|
72
81
|
<slot name="header" />
|
|
73
82
|
</Element>
|
|
74
83
|
<Element class:list="drawer-content">
|
|
75
|
-
<Menu groups={
|
|
84
|
+
<Menu groups={mergedMenu} />
|
|
76
85
|
<slot />
|
|
77
86
|
</Element>
|
|
78
87
|
<Element
|
package/src/components/Toc.astro
CHANGED
|
@@ -20,7 +20,7 @@ const filteredHeadings = headings?.filter(
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
<Element
|
|
23
|
-
if={filteredHeadings?.length >
|
|
23
|
+
if={filteredHeadings?.length > 1}
|
|
24
24
|
class:list="toc"
|
|
25
25
|
{size}
|
|
26
26
|
{...rest}
|
|
@@ -49,17 +49,14 @@ const filteredHeadings = headings?.filter(
|
|
|
49
49
|
@media (min-width: 1024px) {
|
|
50
50
|
display: flex;
|
|
51
51
|
position: sticky;
|
|
52
|
-
top: var(--header-height, 0px);
|
|
52
|
+
top: calc(var(--header-height, 0px) + var(--space-6));
|
|
53
53
|
bottom: 0;
|
|
54
54
|
flex-shrink: 0;
|
|
55
55
|
flex-direction: column;
|
|
56
56
|
justify-content: flex-start;
|
|
57
57
|
gap: var(--space-4);
|
|
58
58
|
z-index: 10;
|
|
59
|
-
|
|
60
|
-
width: calc(var(--space-7) * 4);
|
|
61
|
-
height: calc(100vh - var(--header-height, 0px));
|
|
62
|
-
overflow-y: auto;
|
|
59
|
+
min-width: calc(var(--space-7) * 3);
|
|
63
60
|
|
|
64
61
|
.depth-3 {
|
|
65
62
|
padding-left: var(--space-4);
|
|
@@ -3,7 +3,7 @@ import Table from 'fulldev-ui/components/Table.astro'
|
|
|
3
3
|
import { readFileSync } from 'node:fs'
|
|
4
4
|
import { pascal } from 'radash'
|
|
5
5
|
|
|
6
|
-
const slug = Astro.
|
|
6
|
+
const slug = Astro.params.page || 'index'
|
|
7
7
|
const componentName = pascal(slug)
|
|
8
8
|
|
|
9
9
|
const allComponents = import.meta.glob('/src/**/*.astro', { eager: true })
|
|
@@ -10,9 +10,8 @@ code:
|
|
|
10
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
|
|
11
11
|
})
|
|
12
12
|
</script>
|
|
13
|
-
header: true
|
|
14
13
|
navigation:
|
|
15
|
-
|
|
14
|
+
header: true
|
|
16
15
|
company: Fulldev UI
|
|
17
16
|
buttons:
|
|
18
17
|
- text: Docs
|
|
@@ -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
|
@@ -10,7 +10,6 @@ import Header from 'fulldev-ui/components/Header.astro'
|
|
|
10
10
|
import Section from 'fulldev-ui/components/Section.astro'
|
|
11
11
|
import Sections from 'fulldev-ui/components/sections.astro'
|
|
12
12
|
import Sidebar from 'fulldev-ui/components/Sidebar.astro'
|
|
13
|
-
import Toc from 'fulldev-ui/components/Toc.astro'
|
|
14
13
|
import type { GlobalProps } from 'fulldev-ui/types/global-props'
|
|
15
14
|
|
|
16
15
|
type Props = GlobalProps &
|
|
@@ -69,19 +68,20 @@ const {
|
|
|
69
68
|
</slot>
|
|
70
69
|
<slot name="header">
|
|
71
70
|
<Header
|
|
72
|
-
|
|
73
|
-
'for-sidebar': sidebar,
|
|
74
|
-
}}
|
|
75
|
-
if={navigation || header}
|
|
76
|
-
{...navigation}
|
|
71
|
+
{...navigation?.header === true ? navigation : {}}
|
|
77
72
|
{...header}
|
|
78
73
|
/>
|
|
79
74
|
</slot>
|
|
80
75
|
<div class="core">
|
|
81
76
|
<slot name="sidebar">
|
|
82
77
|
<Sidebar
|
|
83
|
-
|
|
84
|
-
{
|
|
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}
|
|
85
85
|
{...sidebar}
|
|
86
86
|
/>
|
|
87
87
|
</slot>
|
|
@@ -92,12 +92,6 @@ const {
|
|
|
92
92
|
<Sections {sections} />
|
|
93
93
|
</slot>
|
|
94
94
|
</main>
|
|
95
|
-
<slot name="toc">
|
|
96
|
-
<Toc
|
|
97
|
-
heading={toc}
|
|
98
|
-
{render}
|
|
99
|
-
/>
|
|
100
|
-
</slot>
|
|
101
95
|
</div>
|
|
102
96
|
<slot name="footer">
|
|
103
97
|
<Footer {...footer} />
|
|
@@ -116,7 +110,6 @@ const {
|
|
|
116
110
|
}
|
|
117
111
|
|
|
118
112
|
body {
|
|
119
|
-
--screen: 100vw;
|
|
120
113
|
display: flex;
|
|
121
114
|
flex-direction: column;
|
|
122
115
|
background-color: var(--base-background);
|
|
@@ -148,7 +141,6 @@ const {
|
|
|
148
141
|
background-color: var(--color-background);
|
|
149
142
|
width: 100%;
|
|
150
143
|
max-width: 100vw;
|
|
151
|
-
overflow-x: hidden;
|
|
152
144
|
}
|
|
153
145
|
}
|
|
154
146
|
}
|
|
@@ -11,7 +11,7 @@ import { getReferenceChildren } from 'fulldev-ui/utils/getReferenceChildren'
|
|
|
11
11
|
|
|
12
12
|
type Props = ComponentProps<typeof Layout>
|
|
13
13
|
|
|
14
|
-
const { slug, sections, title, description } = Astro.props
|
|
14
|
+
const { slug, sections, title, description, render } = Astro.props
|
|
15
15
|
|
|
16
16
|
const folderChildren = await getFolderChildren(slug)
|
|
17
17
|
const referenceChildren = await getReferenceChildren(slug)
|
|
@@ -33,7 +33,10 @@ const referenceChildren = await getReferenceChildren(slug)
|
|
|
33
33
|
cards={referenceChildren}
|
|
34
34
|
structure="grid"
|
|
35
35
|
/>
|
|
36
|
-
<Article
|
|
36
|
+
<Article
|
|
37
|
+
{render}
|
|
38
|
+
toc={false}
|
|
39
|
+
/>
|
|
37
40
|
<Sections {sections} />
|
|
38
41
|
<slot />
|
|
39
42
|
</Layout>
|
|
@@ -3,22 +3,19 @@ import type { ComponentProps } from 'astro/types'
|
|
|
3
3
|
import Article from 'fulldev-ui/blocks/Article.astro'
|
|
4
4
|
import Sections from 'fulldev-ui/components/sections.astro'
|
|
5
5
|
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
6
|
-
import Excerpt from '../blocks/Excerpt.astro'
|
|
7
6
|
|
|
8
7
|
type Props = ComponentProps<typeof Layout>
|
|
9
8
|
|
|
10
|
-
const { sections,
|
|
9
|
+
const { sections, render, toc } = Astro.props
|
|
11
10
|
---
|
|
12
11
|
|
|
13
12
|
<Layout {...Astro.props}>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/>
|
|
21
|
-
<Article />
|
|
13
|
+
<Article
|
|
14
|
+
{render}
|
|
15
|
+
{toc}
|
|
16
|
+
>
|
|
17
|
+
<slot name="prose" />
|
|
18
|
+
</Article>
|
|
22
19
|
<Sections {sections} />
|
|
23
20
|
<slot />
|
|
24
21
|
</Layout>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { z } from 'astro:content'
|
|
1
2
|
import header from '../components/header'
|
|
2
3
|
import sidebar from '../components/sidebar'
|
|
3
4
|
|
|
4
|
-
export default sidebar.merge(header)
|
|
5
|
+
export default sidebar.merge(header).extend({
|
|
6
|
+
header: z.boolean().optional(),
|
|
7
|
+
sidebar: z.boolean().optional(),
|
|
8
|
+
})
|