fulldev-ui 0.6.0-beta.2 → 0.6.0-beta.3
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 +1 -1
- package/src/blocks/Banner1.astro +35 -0
- package/src/blocks/Contact1.astro +92 -0
- package/src/blocks/Cta1.astro +72 -0
- package/src/blocks/Feature1.astro +67 -0
- package/src/blocks/Footer.astro +47 -54
- package/src/blocks/Header1.astro +192 -0
- package/src/blocks/Hero1.astro +74 -0
- package/src/blocks/Intro1.astro +56 -0
- package/src/blocks/Products1.astro +90 -0
- package/src/blocks/{Hero.astro → _Hero.astro} +7 -6
- package/src/components/Badge.astro +10 -18
- package/src/components/Banner.astro +26 -0
- package/src/components/Block.astro +49 -0
- package/src/components/Blocks.astro +26 -0
- package/src/components/Button.astro +10 -23
- package/src/components/Card.astro +8 -150
- package/src/components/Cart.astro +1 -0
- package/src/components/CartSummary.astro +3 -3
- package/src/components/Channel.astro +5 -14
- package/src/components/Container.astro +25 -0
- package/src/components/Drawer.astro +57 -118
- package/src/components/DrawerOld.astro +143 -0
- package/src/components/Element.astro +2 -0
- package/src/components/Form.astro +5 -3
- package/src/components/Head.astro +18 -32
- package/src/components/Header.astro +8 -105
- package/src/components/Heading.astro +29 -70
- package/src/components/Icon.astro +6 -4
- package/src/components/Link.astro +12 -18
- package/src/components/Logo.astro +31 -18
- package/src/components/Navigation.astro +39 -0
- package/src/components/Panel.astro +25 -0
- package/src/components/Paragraph.astro +24 -7
- package/src/components/Price.astro +4 -4
- package/src/components/Prose.astro +41 -132
- package/src/components/Rating.astro +24 -75
- package/src/components/Search.astro +4 -3
- package/src/components/Section.astro +20 -29
- package/src/components/Sidebar.astro +44 -64
- package/src/components/Social.astro +9 -2
- package/src/components/Tagline.astro +21 -31
- package/src/components/Toc.astro +12 -3
- package/src/components/_Author.astro +90 -0
- package/src/components/_Header.astro +129 -0
- package/src/components/_Prose copy.astro +172 -0
- package/src/components/_Sidebar copy.astro +87 -0
- package/src/content/categories/category.md +7 -0
- package/src/content/config.ts +7 -8
- package/src/content/docs/components/text.mdx +47 -0
- package/src/content/docs/components.mdx +1 -4
- package/src/content/docs/index.mdx +1 -4
- package/src/content/layouts/base.yml +41 -80
- package/src/content/layouts/docs.yml +2 -70
- package/src/content/pages/index.mdx +17 -25
- package/src/content/{categories/mugs.md → posts/post.md} +1 -1
- package/src/content/products/product.md +3 -3
- package/src/css/theme.css +2 -0
- package/src/images/favicon/android-chrome-192x192.png +0 -0
- package/src/images/favicon/android-chrome-512x512.png +0 -0
- package/src/images/favicon/apple-touch-icon.png +0 -0
- package/src/images/favicon/browserconfig.xml +9 -0
- package/src/images/favicon/favicon-16x16.png +0 -0
- package/src/images/favicon/favicon-32x32.png +0 -0
- package/src/images/favicon/favicon-48x48.png +0 -0
- package/src/images/favicon/favicon.ico +0 -0
- package/src/images/favicon/favicon.svg +16 -0
- package/src/images/favicon/manifest.webmanifest +30 -0
- package/src/images/favicon/mstile-150x150.png +0 -0
- package/src/images/favicon/safari-pinned-tab.svg +16 -0
- package/src/images/favicon/yandex-browser-50x50.png +0 -0
- package/src/images/favicon/yandex-browser-manifest.json +9 -0
- package/src/integration/index.ts +10 -1
- package/src/layouts/CategoryLayout.astro +16 -9
- package/src/layouts/DocLayout.astro +49 -7
- package/src/layouts/Layout.astro +55 -27
- package/src/layouts/PageLayout.astro +12 -5
- package/src/layouts/PostLayout.astro +7 -5
- package/src/layouts/ProductLayout.astro +12 -7
- package/src/pages/test.astro +7 -1
- package/src/schemas/blocks/banner.ts +10 -0
- package/src/schemas/blocks/categories.ts +14 -0
- package/src/schemas/blocks/contact.ts +18 -0
- package/src/schemas/blocks/cta.ts +18 -0
- package/src/schemas/blocks/feature.ts +18 -0
- package/src/schemas/blocks/hero.ts +20 -0
- package/src/schemas/blocks/intro.ts +16 -0
- package/src/schemas/blocks/products.ts +14 -0
- package/src/schemas/categorySchema.ts +8 -8
- package/src/schemas/components/avatar.ts +4 -1
- package/src/schemas/components/badge.ts +16 -11
- package/src/schemas/components/block.ts +18 -0
- package/src/schemas/components/button.ts +13 -19
- package/src/schemas/components/channel.ts +15 -9
- package/src/schemas/components/footer.ts +15 -14
- package/src/schemas/components/head.ts +17 -0
- package/src/schemas/components/header.ts +19 -16
- package/src/schemas/components/heading.ts +7 -1
- package/src/schemas/components/icon.ts +7 -1
- package/src/schemas/components/image.ts +17 -14
- package/src/schemas/components/link.ts +10 -16
- package/src/schemas/components/logo.ts +12 -2
- package/src/schemas/components/menu.ts +11 -13
- package/src/schemas/components/navigation.ts +10 -0
- package/src/schemas/components/paragraph.ts +9 -0
- package/src/schemas/components/price.ts +9 -0
- package/src/schemas/components/rating.ts +8 -13
- package/src/schemas/components/sidebar.ts +14 -12
- package/src/schemas/components/social.ts +16 -1
- package/src/schemas/components/tagline.ts +7 -1
- package/src/schemas/docSchema.ts +6 -2
- package/src/schemas/imageSchema.ts +30 -1
- package/src/schemas/layoutSchema.ts +14 -20
- package/src/schemas/pageSchema.ts +9 -12
- package/src/schemas/postSchema.ts +6 -8
- package/src/schemas/productSchema.ts +18 -18
- package/src/types/global-props.ts +0 -9
- package/src/types/{virtual-modules.d.ts → virtual.d.ts} +1 -1
- package/src/utils/getHref.ts +3 -2
- package/tsconfig.json +1 -3
- package/example.svelte +0 -0
- package/parent.svelte +0 -0
- package/src/App.svelte +0 -0
- package/src/blocks/Banner.astro +0 -35
- package/src/blocks/Categories.astro +0 -12
- package/src/blocks/Colleagues.astro +0 -12
- package/src/blocks/Contact.astro +0 -117
- package/src/blocks/Content.astro +0 -130
- package/src/blocks/Cta.astro +0 -13
- package/src/blocks/Excerpt.astro +0 -12
- package/src/blocks/Features.astro +0 -11
- package/src/blocks/Header.astro +0 -7
- package/src/blocks/Intro.astro +0 -101
- package/src/blocks/Jobs.astro +0 -12
- package/src/blocks/Posts.astro +0 -11
- package/src/blocks/Prices.astro +0 -24
- package/src/blocks/Product.astro +0 -89
- package/src/blocks/Products.astro +0 -101
- package/src/blocks/Reviews.astro +0 -12
- package/src/blocks/_Contact.astro +0 -112
- package/src/components/CartForm.astro +0 -120
- package/src/components/CartList.astro +0 -122
- package/src/components/Lead.astro +0 -46
- package/src/components/ProductCard.astro +0 -52
- package/src/components/Text.astro +0 -43
- package/src/components/Writeup.astro +0 -108
- package/src/components/_CartList backup.astro +0 -125
- package/src/components/_CartList copy.astro +0 -213
- package/src/components/_CartListSimple.astro +0 -148
- package/src/components/sections.astro +0 -28
- package/src/content/docs/components/lead.mdx +0 -49
- package/src/content/docs/components/paragraph.mdx +0 -49
- package/src/loaders/imageLoader.ts +0 -26
- package/src/schemas/archive/_pageSchema.ts +0 -94
- package/src/schemas/components/avatars.ts +0 -4
- package/src/schemas/components/banner.ts +0 -3
- package/src/schemas/components/buttons.ts +0 -4
- package/src/schemas/components/card.ts +0 -43
- package/src/schemas/components/cards.ts +0 -4
- package/src/schemas/components/channels.ts +0 -4
- package/src/schemas/components/global.ts +0 -16
- package/src/schemas/components/links.ts +0 -4
- package/src/schemas/components/list.ts +0 -3
- package/src/schemas/components/section.ts +0 -17
- package/src/schemas/components/sections.ts +0 -3
- package/src/schemas/components/socials.ts +0 -4
- package/src/schemas/components/subheader.ts +0 -10
- package/src/schemas/components/text.ts +0 -3
- package/src/schemas/components/themer.ts +0 -3
- package/src/schemas/components/toc.ts +0 -3
- package/src/schemas/components/writeup.ts +0 -20
- package/src/schemas/fields/categories.ts +0 -3
- package/src/schemas/fields/description.ts +0 -3
- package/src/schemas/fields/href.ts +0 -3
- package/src/schemas/fields/image.ts +0 -24
- package/src/schemas/fields/images.ts +0 -4
- package/src/schemas/fields/order.ts +0 -3
- package/src/schemas/fields/price.ts +0 -3
- package/src/schemas/fields/products.ts +0 -5
- package/src/schemas/fields/seo.ts +0 -12
- package/src/schemas/fields/soldout.ts +0 -3
- package/src/schemas/fields/title.ts +0 -3
- package/src/schemas/fields/variants.ts +0 -3
|
@@ -2,30 +2,15 @@
|
|
|
2
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
3
3
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
4
|
import Icon from 'fulldev-ui/components/Icon.astro'
|
|
5
|
-
import type {
|
|
6
|
-
import Avatars from './Avatars.astro'
|
|
5
|
+
import type { RatingSchema } from 'fulldev-ui/schemas/components/rating'
|
|
7
6
|
|
|
8
|
-
interface Props extends
|
|
9
|
-
align?: 'start' | 'center' | 'end' | undefined
|
|
10
|
-
value?: number | undefined
|
|
11
|
-
text?: string | undefined
|
|
12
|
-
avatars?: any
|
|
13
|
-
avatar?: any
|
|
14
|
-
}
|
|
7
|
+
interface Props extends HTMLAttributes<'div'>, RatingSchema {}
|
|
15
8
|
|
|
16
|
-
const {
|
|
17
|
-
size = 'md',
|
|
18
|
-
value,
|
|
19
|
-
text,
|
|
20
|
-
avatars,
|
|
21
|
-
avatar,
|
|
22
|
-
align,
|
|
23
|
-
...rest
|
|
24
|
-
} = Astro.props
|
|
9
|
+
const { size = 'md', score, ...rest } = Astro.props
|
|
25
10
|
|
|
26
11
|
const getIcon = (count: number) => {
|
|
27
|
-
if (!
|
|
28
|
-
const difference =
|
|
12
|
+
if (!score) return
|
|
13
|
+
const difference = score - count
|
|
29
14
|
if (difference >= -0.25) return 'star-filled'
|
|
30
15
|
if (difference >= -0.75) return 'star-half-filled'
|
|
31
16
|
return 'star'
|
|
@@ -34,71 +19,35 @@ const getIcon = (count: number) => {
|
|
|
34
19
|
|
|
35
20
|
<Element
|
|
36
21
|
class:list="rating"
|
|
37
|
-
{size}
|
|
38
22
|
{...rest}
|
|
39
23
|
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
>
|
|
50
|
-
{
|
|
51
|
-
value &&
|
|
52
|
-
[1, 2, 3, 4, 5].map((_, i) => (
|
|
53
|
-
<Icon
|
|
54
|
-
{size}
|
|
55
|
-
name={getIcon(i + 1)}
|
|
56
|
-
class:list={'rating-icon-solid'}
|
|
57
|
-
/>
|
|
58
|
-
))
|
|
59
|
-
}
|
|
60
|
-
</Element>
|
|
61
|
-
<Fragment set:html={text} />
|
|
62
|
-
<slot />
|
|
63
|
-
</Element>
|
|
24
|
+
{
|
|
25
|
+
score &&
|
|
26
|
+
[1, 2, 3, 4, 5].map((count) => (
|
|
27
|
+
<Icon
|
|
28
|
+
name={getIcon(count)}
|
|
29
|
+
{size}
|
|
30
|
+
/>
|
|
31
|
+
))
|
|
32
|
+
}
|
|
64
33
|
</Element>
|
|
65
34
|
|
|
66
35
|
<style is:global>
|
|
67
36
|
@layer fulldev {
|
|
68
37
|
.rating {
|
|
69
|
-
@apply flex
|
|
70
|
-
|
|
71
|
-
.rating-content {
|
|
72
|
-
@apply flex flex-col gap-1 text-muted-foreground;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.rating-stars {
|
|
76
|
-
@apply flex gap-1 text-primary;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&.size-sm {
|
|
80
|
-
@apply gap-2;
|
|
81
|
-
|
|
82
|
-
.rating-content {
|
|
83
|
-
@apply text-xs leading-none;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
&.size-md {
|
|
88
|
-
@apply gap-2.5;
|
|
38
|
+
@apply flex gap-1 text-primary;
|
|
39
|
+
}
|
|
89
40
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
41
|
+
&.size-sm {
|
|
42
|
+
@apply text-xs;
|
|
43
|
+
}
|
|
94
44
|
|
|
95
|
-
|
|
96
|
-
|
|
45
|
+
&.size-md {
|
|
46
|
+
@apply text-sm;
|
|
47
|
+
}
|
|
97
48
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
}
|
|
49
|
+
&.size-lg {
|
|
50
|
+
@apply text-base;
|
|
102
51
|
}
|
|
103
52
|
}
|
|
104
53
|
</style>
|
|
@@ -40,7 +40,7 @@ const entries = [...pages, ...categories, ...products, ...posts, ...docs]
|
|
|
40
40
|
|
|
41
41
|
<Button
|
|
42
42
|
class:list="search-button"
|
|
43
|
-
variant=
|
|
43
|
+
variant={Astro.props.variant}
|
|
44
44
|
size="sm"
|
|
45
45
|
icon="search"
|
|
46
46
|
onclick={`document.getElementById('search').showModal()`}
|
|
@@ -55,8 +55,8 @@ const entries = [...pages, ...categories, ...products, ...posts, ...docs]
|
|
|
55
55
|
<Element class:list="search-content">
|
|
56
56
|
<Input
|
|
57
57
|
class:list="search-input"
|
|
58
|
-
icon="search"
|
|
59
58
|
placeholder="Search"
|
|
59
|
+
icon="search"
|
|
60
60
|
/>
|
|
61
61
|
<Element class:list="search-list">
|
|
62
62
|
{
|
|
@@ -68,7 +68,8 @@ const entries = [...pages, ...categories, ...products, ...posts, ...docs]
|
|
|
68
68
|
>
|
|
69
69
|
<Heading
|
|
70
70
|
text={data.title}
|
|
71
|
-
|
|
71
|
+
as="h6"
|
|
72
|
+
size="md"
|
|
72
73
|
/>
|
|
73
74
|
<Paragraph
|
|
74
75
|
set:text={'description' in data ? data.description : undefined}
|
|
@@ -1,35 +1,26 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import type { HTMLAttributes, HTMLTag } from 'astro/types'
|
|
3
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
3
4
|
|
|
4
|
-
interface Props {
|
|
5
|
-
|
|
6
|
-
[key: string]: any
|
|
5
|
+
interface Props extends HTMLAttributes<'section'> {
|
|
6
|
+
as?: HTMLTag
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
products = products && (await getEntries(products))
|
|
12
|
-
categories = categories && (await getEntries(categories))
|
|
13
|
-
|
|
14
|
-
const allComponents = {
|
|
15
|
-
...import.meta.glob('/src/**/*.astro'),
|
|
16
|
-
...import.meta.glob('../../**/*.astro'),
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const componentPath = Object.keys(allComponents).find(
|
|
20
|
-
(path) => path.split('/').pop()?.split('.')[0] === component
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
const Component =
|
|
24
|
-
componentPath && (await (allComponents[componentPath] as any)()).default
|
|
9
|
+
const { as = 'section', ...rest } = Astro.props
|
|
25
10
|
---
|
|
26
11
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
<Element
|
|
13
|
+
class:list="section"
|
|
14
|
+
{as}
|
|
15
|
+
{...rest}
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</Element>
|
|
19
|
+
|
|
20
|
+
<style is:global>
|
|
21
|
+
@layer fulldev {
|
|
22
|
+
.section {
|
|
23
|
+
@apply relative w-full bg-background py-16 first:py-8;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -1,93 +1,73 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
3
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import Themer from 'fulldev-ui/components/Themer.astro'
|
|
7
|
-
import type { GlobalProps } from 'fulldev-ui/types/global-props'
|
|
4
|
+
import type { SidebarSchema } from 'fulldev-ui/schemas/components/sidebar'
|
|
5
|
+
import Container from './Container.astro'
|
|
8
6
|
import Heading from './Heading.astro'
|
|
9
|
-
import
|
|
7
|
+
import Link from './Link.astro'
|
|
10
8
|
|
|
11
|
-
interface Props extends
|
|
12
|
-
menu?: ComponentProps<typeof Menu>['groups']
|
|
13
|
-
heading?: ComponentProps<typeof Heading>['text']
|
|
14
|
-
render?: ComponentProps<typeof Toc>['render']
|
|
15
|
-
logo?: ComponentProps<typeof Logo>
|
|
16
|
-
toc?: ComponentProps<typeof Toc>['heading']
|
|
17
|
-
company?: ComponentProps<typeof Logo>['company']
|
|
18
|
-
themer?: boolean | undefined
|
|
19
|
-
size?: 'sm' | 'md' | 'lg' | undefined
|
|
20
|
-
}
|
|
9
|
+
interface Props extends HTMLAttributes<'aside'>, SidebarSchema {}
|
|
21
10
|
|
|
22
|
-
const {
|
|
23
|
-
size = 'sm',
|
|
24
|
-
logo,
|
|
25
|
-
company,
|
|
26
|
-
render,
|
|
27
|
-
menu,
|
|
28
|
-
toc,
|
|
29
|
-
heading,
|
|
30
|
-
themer,
|
|
31
|
-
...rest
|
|
32
|
-
} = Astro.props
|
|
11
|
+
const { company, logo, menus, links, heading, themer, ...rest } = Astro.props
|
|
33
12
|
---
|
|
34
13
|
|
|
35
14
|
<Element
|
|
36
15
|
class:list="sidebar"
|
|
37
16
|
as="aside"
|
|
38
|
-
{size}
|
|
39
17
|
{...rest}
|
|
40
18
|
>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{size}
|
|
64
|
-
/>
|
|
65
|
-
<slot />
|
|
66
|
-
</Element>
|
|
19
|
+
<Container>
|
|
20
|
+
{
|
|
21
|
+
menus?.map(({ heading, links }) => (
|
|
22
|
+
<Element class:list="sidebar-menu">
|
|
23
|
+
<Heading
|
|
24
|
+
text={heading}
|
|
25
|
+
size="sm"
|
|
26
|
+
as="h6"
|
|
27
|
+
/>
|
|
28
|
+
<Element class:list="sidebar-links">
|
|
29
|
+
{links?.map((link) => (
|
|
30
|
+
<Link
|
|
31
|
+
size="sm"
|
|
32
|
+
variant="muted"
|
|
33
|
+
{...link}
|
|
34
|
+
/>
|
|
35
|
+
))}
|
|
36
|
+
</Element>
|
|
37
|
+
</Element>
|
|
38
|
+
))
|
|
39
|
+
}
|
|
40
|
+
</Container>
|
|
67
41
|
</Element>
|
|
68
42
|
|
|
69
43
|
<style is:global>
|
|
70
44
|
@layer fulldev {
|
|
71
45
|
.sidebar {
|
|
72
|
-
@apply sticky bottom-0
|
|
46
|
+
@apply sticky bottom-0 left-0 hidden w-64 max-w-[75vw] border-r bg-background py-8 lg:flex;
|
|
73
47
|
|
|
74
|
-
--
|
|
75
|
-
top: var(--
|
|
48
|
+
--headers: calc(var(--header-height, 0px) + var(--subheader-height, 0px));
|
|
49
|
+
top: var(--headers);
|
|
76
50
|
width: var(--sidebar-width);
|
|
77
|
-
max-height: calc(100vh - var(--
|
|
51
|
+
max-height: calc(100vh - var(--headers));
|
|
78
52
|
|
|
79
53
|
&,
|
|
80
54
|
& ~ * {
|
|
81
|
-
|
|
55
|
+
@media (min-width: 1024px) {
|
|
56
|
+
--sidebar-width: 16rem;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.container {
|
|
61
|
+
@apply flex h-full w-full grow flex-col items-start gap-8 overflow-y-auto;
|
|
62
|
+
/* @apply scrollbar scrollbar-track-transparent scrollbar-thumb-accent scrollbar-thumb-rounded-full scrollbar-w-2 hover:scrollbar-thumb-accent-hover; */
|
|
82
63
|
}
|
|
83
64
|
|
|
84
|
-
.sidebar-
|
|
85
|
-
@apply
|
|
65
|
+
.sidebar-menu {
|
|
66
|
+
@apply flex flex-col gap-3;
|
|
86
67
|
}
|
|
87
68
|
|
|
88
|
-
.sidebar-
|
|
89
|
-
@apply flex
|
|
90
|
-
@apply scrollbar scrollbar-track-transparent scrollbar-thumb-accent scrollbar-thumb-rounded-full scrollbar-w-2 hover:scrollbar-thumb-accent-hover;
|
|
69
|
+
.sidebar-links {
|
|
70
|
+
@apply flex flex-col gap-2;
|
|
91
71
|
}
|
|
92
72
|
}
|
|
93
73
|
}
|
|
@@ -4,7 +4,13 @@ import Button from 'fulldev-ui/components/Button.astro'
|
|
|
4
4
|
|
|
5
5
|
interface Props extends ComponentProps<typeof Button> {}
|
|
6
6
|
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
variant = 'secondary',
|
|
9
|
+
target = '_blank',
|
|
10
|
+
icon,
|
|
11
|
+
href,
|
|
12
|
+
...rest
|
|
13
|
+
} = Astro.props
|
|
8
14
|
|
|
9
15
|
const platform = () => {
|
|
10
16
|
if (typeof href !== 'string') return
|
|
@@ -22,9 +28,10 @@ const platform = () => {
|
|
|
22
28
|
---
|
|
23
29
|
|
|
24
30
|
<Button
|
|
25
|
-
class:list=
|
|
31
|
+
class:list="social"
|
|
26
32
|
icon={icon ?? platform()}
|
|
27
33
|
{variant}
|
|
28
34
|
{href}
|
|
35
|
+
{target}
|
|
29
36
|
{...rest}
|
|
30
37
|
/>
|
|
@@ -1,60 +1,50 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
3
|
-
import type { CollectionEntry } from 'astro:content'
|
|
4
|
-
import { getEntry } from 'astro:content'
|
|
5
|
-
import Avatar from 'fulldev-ui/components/Avatar.astro'
|
|
2
|
+
import type { HTMLAttributes, HTMLTag } from 'astro/types'
|
|
6
3
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
7
|
-
import
|
|
8
|
-
import type { GlobalProps } from 'fulldev-ui/types/global-props'
|
|
4
|
+
import type { TaglineSchema } from 'fulldev-ui/schemas/components/tagline'
|
|
9
5
|
|
|
10
|
-
interface Props
|
|
11
|
-
extends GlobalProps,
|
|
12
|
-
HTMLAttributes<'span'>,
|
|
13
|
-
HTMLAttributes<'a'> {
|
|
6
|
+
interface Props extends HTMLAttributes<'p'>, TaglineSchema {
|
|
14
7
|
as?: HTMLTag
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
slug?: CollectionEntry<'pages'>['slug'] | undefined
|
|
18
|
-
size?: 'sm' | 'md' | 'lg' | undefined
|
|
19
|
-
text?: string | undefined
|
|
20
|
-
variant?: 'secondary' | 'outline' | 'link' | undefined
|
|
8
|
+
muted?: boolean | undefined
|
|
9
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined
|
|
21
10
|
}
|
|
22
11
|
|
|
23
|
-
const {
|
|
24
|
-
slug,
|
|
25
|
-
href = slug === 'index' ? '/' : slug ? `/${slug}/` : undefined,
|
|
26
|
-
text = slug ? (await getEntry('pages', slug)).data.title : undefined,
|
|
27
|
-
as = href ? 'a' : 'a',
|
|
28
|
-
target = href?.toString().startsWith('http') ? '_blank' : undefined,
|
|
29
|
-
icon,
|
|
30
|
-
...rest
|
|
31
|
-
} = Astro.props
|
|
12
|
+
const { as = 'p', text, ...rest } = Astro.props
|
|
32
13
|
---
|
|
33
14
|
|
|
34
15
|
<Element
|
|
35
|
-
class:list=
|
|
36
|
-
{href}
|
|
16
|
+
class:list="text"
|
|
37
17
|
{as}
|
|
38
|
-
{target}
|
|
39
18
|
{...rest}
|
|
40
19
|
>
|
|
41
|
-
<slot />
|
|
42
|
-
<Icon name={icon} />
|
|
43
20
|
<Fragment set:html={text} />
|
|
21
|
+
<slot />
|
|
44
22
|
</Element>
|
|
45
23
|
|
|
46
24
|
<style is:global>
|
|
47
25
|
@layer fulldev {
|
|
48
26
|
.tagline {
|
|
49
|
-
@apply text-primary
|
|
27
|
+
@apply font-semibold leading-tight text-primary;
|
|
28
|
+
|
|
29
|
+
&.size-xs {
|
|
30
|
+
@apply text-xs;
|
|
31
|
+
}
|
|
50
32
|
|
|
51
33
|
&.size-sm {
|
|
52
34
|
@apply text-sm;
|
|
53
35
|
}
|
|
54
36
|
|
|
37
|
+
&.size-md {
|
|
38
|
+
@apply text-base;
|
|
39
|
+
}
|
|
40
|
+
|
|
55
41
|
&.size-lg {
|
|
56
42
|
@apply text-lg;
|
|
57
43
|
}
|
|
44
|
+
|
|
45
|
+
&.size-xl {
|
|
46
|
+
@apply text-xl;
|
|
47
|
+
}
|
|
58
48
|
}
|
|
59
49
|
}
|
|
60
50
|
</style>
|
package/src/components/Toc.astro
CHANGED
|
@@ -45,11 +45,20 @@ const links = filteredHeadings?.map((button: any) => ({
|
|
|
45
45
|
<style is:global>
|
|
46
46
|
@layer fulldev {
|
|
47
47
|
.toc {
|
|
48
|
-
@apply sticky bottom-0 z-10
|
|
48
|
+
@apply sticky bottom-0 z-10 hidden shrink-0 flex-col items-start justify-start gap-3 overflow-y-auto py-8 md:flex;
|
|
49
49
|
@apply scrollbar scrollbar-track-transparent scrollbar-thumb-accent scrollbar-thumb-rounded-full scrollbar-w-2 hover:scrollbar-thumb-accent-hover;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
--headers: calc(var(--header-height, 0px) + var(--subheader-height, 0px));
|
|
52
|
+
top: var(--headers);
|
|
53
|
+
width: var(--toc-width);
|
|
54
|
+
max-height: calc(100vh - var(--headers));
|
|
55
|
+
|
|
56
|
+
&,
|
|
57
|
+
& ~ * {
|
|
58
|
+
@media (min-width: 768px) {
|
|
59
|
+
--toc-width: 12rem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
53
62
|
|
|
54
63
|
.depth-3 {
|
|
55
64
|
@apply pl-3;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!-- ---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
|
+
import Icon from 'fulldev-ui/components/Icon.astro'
|
|
5
|
+
import type { RatingSchema } from 'fulldev-ui/schemas/components/rating'
|
|
6
|
+
import Avatar from './Avatar.astro'
|
|
7
|
+
|
|
8
|
+
interface Props extends HTMLAttributes<'div'>, RatingSchema {}
|
|
9
|
+
|
|
10
|
+
const { size = 'md', score, text, avatars, avatar, ...rest } = Astro.props
|
|
11
|
+
|
|
12
|
+
const getIcon = (count: number) => {
|
|
13
|
+
if (!score) return
|
|
14
|
+
const difference = score - count
|
|
15
|
+
if (difference >= -0.25) return 'star-filled'
|
|
16
|
+
if (difference >= -0.75) return 'star-half-filled'
|
|
17
|
+
return 'star'
|
|
18
|
+
}
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<Element
|
|
22
|
+
class:list="author"
|
|
23
|
+
{size}
|
|
24
|
+
{...rest}
|
|
25
|
+
>
|
|
26
|
+
<Avatar {...avatar} />
|
|
27
|
+
{avatars?.map((avatar) => <Avatar {...avatar} />)}
|
|
28
|
+
<Element class:list="rating-content">
|
|
29
|
+
<Element
|
|
30
|
+
class:list="rating-stars"
|
|
31
|
+
{...rest}
|
|
32
|
+
>
|
|
33
|
+
{
|
|
34
|
+
score &&
|
|
35
|
+
[1, 2, 3, 4, 5].map((count) => (
|
|
36
|
+
<Icon
|
|
37
|
+
name={getIcon(count)}
|
|
38
|
+
{size}
|
|
39
|
+
/>
|
|
40
|
+
))
|
|
41
|
+
}
|
|
42
|
+
</Element>
|
|
43
|
+
<Fragment set:html={text} />
|
|
44
|
+
<slot />
|
|
45
|
+
</Element>
|
|
46
|
+
</Element>
|
|
47
|
+
|
|
48
|
+
<style is:global>
|
|
49
|
+
@layer fulldev {
|
|
50
|
+
.rating {
|
|
51
|
+
@apply flex items-center gap-3;
|
|
52
|
+
|
|
53
|
+
.avatar + .avatar {
|
|
54
|
+
@apply -ml-3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.rating-content {
|
|
58
|
+
@apply flex flex-col gap-1 text-muted-foreground;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.rating-stars {
|
|
62
|
+
@apply flex gap-1 text-primary;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.size-sm {
|
|
66
|
+
@apply gap-2;
|
|
67
|
+
|
|
68
|
+
.rating-content {
|
|
69
|
+
@apply text-xs leading-none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.size-md {
|
|
74
|
+
@apply gap-2.5;
|
|
75
|
+
|
|
76
|
+
.rating-content {
|
|
77
|
+
@apply text-sm leading-none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.size-lg {
|
|
82
|
+
@apply gap-3;
|
|
83
|
+
|
|
84
|
+
.rating-content {
|
|
85
|
+
@apply text-base leading-none;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</style> -->
|