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.
Files changed (183) hide show
  1. package/package.json +1 -1
  2. package/src/blocks/Banner1.astro +35 -0
  3. package/src/blocks/Contact1.astro +92 -0
  4. package/src/blocks/Cta1.astro +72 -0
  5. package/src/blocks/Feature1.astro +67 -0
  6. package/src/blocks/Footer.astro +47 -54
  7. package/src/blocks/Header1.astro +192 -0
  8. package/src/blocks/Hero1.astro +74 -0
  9. package/src/blocks/Intro1.astro +56 -0
  10. package/src/blocks/Products1.astro +90 -0
  11. package/src/blocks/{Hero.astro → _Hero.astro} +7 -6
  12. package/src/components/Badge.astro +10 -18
  13. package/src/components/Banner.astro +26 -0
  14. package/src/components/Block.astro +49 -0
  15. package/src/components/Blocks.astro +26 -0
  16. package/src/components/Button.astro +10 -23
  17. package/src/components/Card.astro +8 -150
  18. package/src/components/Cart.astro +1 -0
  19. package/src/components/CartSummary.astro +3 -3
  20. package/src/components/Channel.astro +5 -14
  21. package/src/components/Container.astro +25 -0
  22. package/src/components/Drawer.astro +57 -118
  23. package/src/components/DrawerOld.astro +143 -0
  24. package/src/components/Element.astro +2 -0
  25. package/src/components/Form.astro +5 -3
  26. package/src/components/Head.astro +18 -32
  27. package/src/components/Header.astro +8 -105
  28. package/src/components/Heading.astro +29 -70
  29. package/src/components/Icon.astro +6 -4
  30. package/src/components/Link.astro +12 -18
  31. package/src/components/Logo.astro +31 -18
  32. package/src/components/Navigation.astro +39 -0
  33. package/src/components/Panel.astro +25 -0
  34. package/src/components/Paragraph.astro +24 -7
  35. package/src/components/Price.astro +4 -4
  36. package/src/components/Prose.astro +41 -132
  37. package/src/components/Rating.astro +24 -75
  38. package/src/components/Search.astro +4 -3
  39. package/src/components/Section.astro +20 -29
  40. package/src/components/Sidebar.astro +44 -64
  41. package/src/components/Social.astro +9 -2
  42. package/src/components/Tagline.astro +21 -31
  43. package/src/components/Toc.astro +12 -3
  44. package/src/components/_Author.astro +90 -0
  45. package/src/components/_Header.astro +129 -0
  46. package/src/components/_Prose copy.astro +172 -0
  47. package/src/components/_Sidebar copy.astro +87 -0
  48. package/src/content/categories/category.md +7 -0
  49. package/src/content/config.ts +7 -8
  50. package/src/content/docs/components/text.mdx +47 -0
  51. package/src/content/docs/components.mdx +1 -4
  52. package/src/content/docs/index.mdx +1 -4
  53. package/src/content/layouts/base.yml +41 -80
  54. package/src/content/layouts/docs.yml +2 -70
  55. package/src/content/pages/index.mdx +17 -25
  56. package/src/content/{categories/mugs.md → posts/post.md} +1 -1
  57. package/src/content/products/product.md +3 -3
  58. package/src/css/theme.css +2 -0
  59. package/src/images/favicon/android-chrome-192x192.png +0 -0
  60. package/src/images/favicon/android-chrome-512x512.png +0 -0
  61. package/src/images/favicon/apple-touch-icon.png +0 -0
  62. package/src/images/favicon/browserconfig.xml +9 -0
  63. package/src/images/favicon/favicon-16x16.png +0 -0
  64. package/src/images/favicon/favicon-32x32.png +0 -0
  65. package/src/images/favicon/favicon-48x48.png +0 -0
  66. package/src/images/favicon/favicon.ico +0 -0
  67. package/src/images/favicon/favicon.svg +16 -0
  68. package/src/images/favicon/manifest.webmanifest +30 -0
  69. package/src/images/favicon/mstile-150x150.png +0 -0
  70. package/src/images/favicon/safari-pinned-tab.svg +16 -0
  71. package/src/images/favicon/yandex-browser-50x50.png +0 -0
  72. package/src/images/favicon/yandex-browser-manifest.json +9 -0
  73. package/src/integration/index.ts +10 -1
  74. package/src/layouts/CategoryLayout.astro +16 -9
  75. package/src/layouts/DocLayout.astro +49 -7
  76. package/src/layouts/Layout.astro +55 -27
  77. package/src/layouts/PageLayout.astro +12 -5
  78. package/src/layouts/PostLayout.astro +7 -5
  79. package/src/layouts/ProductLayout.astro +12 -7
  80. package/src/pages/test.astro +7 -1
  81. package/src/schemas/blocks/banner.ts +10 -0
  82. package/src/schemas/blocks/categories.ts +14 -0
  83. package/src/schemas/blocks/contact.ts +18 -0
  84. package/src/schemas/blocks/cta.ts +18 -0
  85. package/src/schemas/blocks/feature.ts +18 -0
  86. package/src/schemas/blocks/hero.ts +20 -0
  87. package/src/schemas/blocks/intro.ts +16 -0
  88. package/src/schemas/blocks/products.ts +14 -0
  89. package/src/schemas/categorySchema.ts +8 -8
  90. package/src/schemas/components/avatar.ts +4 -1
  91. package/src/schemas/components/badge.ts +16 -11
  92. package/src/schemas/components/block.ts +18 -0
  93. package/src/schemas/components/button.ts +13 -19
  94. package/src/schemas/components/channel.ts +15 -9
  95. package/src/schemas/components/footer.ts +15 -14
  96. package/src/schemas/components/head.ts +17 -0
  97. package/src/schemas/components/header.ts +19 -16
  98. package/src/schemas/components/heading.ts +7 -1
  99. package/src/schemas/components/icon.ts +7 -1
  100. package/src/schemas/components/image.ts +17 -14
  101. package/src/schemas/components/link.ts +10 -16
  102. package/src/schemas/components/logo.ts +12 -2
  103. package/src/schemas/components/menu.ts +11 -13
  104. package/src/schemas/components/navigation.ts +10 -0
  105. package/src/schemas/components/paragraph.ts +9 -0
  106. package/src/schemas/components/price.ts +9 -0
  107. package/src/schemas/components/rating.ts +8 -13
  108. package/src/schemas/components/sidebar.ts +14 -12
  109. package/src/schemas/components/social.ts +16 -1
  110. package/src/schemas/components/tagline.ts +7 -1
  111. package/src/schemas/docSchema.ts +6 -2
  112. package/src/schemas/imageSchema.ts +30 -1
  113. package/src/schemas/layoutSchema.ts +14 -20
  114. package/src/schemas/pageSchema.ts +9 -12
  115. package/src/schemas/postSchema.ts +6 -8
  116. package/src/schemas/productSchema.ts +18 -18
  117. package/src/types/global-props.ts +0 -9
  118. package/src/types/{virtual-modules.d.ts → virtual.d.ts} +1 -1
  119. package/src/utils/getHref.ts +3 -2
  120. package/tsconfig.json +1 -3
  121. package/example.svelte +0 -0
  122. package/parent.svelte +0 -0
  123. package/src/App.svelte +0 -0
  124. package/src/blocks/Banner.astro +0 -35
  125. package/src/blocks/Categories.astro +0 -12
  126. package/src/blocks/Colleagues.astro +0 -12
  127. package/src/blocks/Contact.astro +0 -117
  128. package/src/blocks/Content.astro +0 -130
  129. package/src/blocks/Cta.astro +0 -13
  130. package/src/blocks/Excerpt.astro +0 -12
  131. package/src/blocks/Features.astro +0 -11
  132. package/src/blocks/Header.astro +0 -7
  133. package/src/blocks/Intro.astro +0 -101
  134. package/src/blocks/Jobs.astro +0 -12
  135. package/src/blocks/Posts.astro +0 -11
  136. package/src/blocks/Prices.astro +0 -24
  137. package/src/blocks/Product.astro +0 -89
  138. package/src/blocks/Products.astro +0 -101
  139. package/src/blocks/Reviews.astro +0 -12
  140. package/src/blocks/_Contact.astro +0 -112
  141. package/src/components/CartForm.astro +0 -120
  142. package/src/components/CartList.astro +0 -122
  143. package/src/components/Lead.astro +0 -46
  144. package/src/components/ProductCard.astro +0 -52
  145. package/src/components/Text.astro +0 -43
  146. package/src/components/Writeup.astro +0 -108
  147. package/src/components/_CartList backup.astro +0 -125
  148. package/src/components/_CartList copy.astro +0 -213
  149. package/src/components/_CartListSimple.astro +0 -148
  150. package/src/components/sections.astro +0 -28
  151. package/src/content/docs/components/lead.mdx +0 -49
  152. package/src/content/docs/components/paragraph.mdx +0 -49
  153. package/src/loaders/imageLoader.ts +0 -26
  154. package/src/schemas/archive/_pageSchema.ts +0 -94
  155. package/src/schemas/components/avatars.ts +0 -4
  156. package/src/schemas/components/banner.ts +0 -3
  157. package/src/schemas/components/buttons.ts +0 -4
  158. package/src/schemas/components/card.ts +0 -43
  159. package/src/schemas/components/cards.ts +0 -4
  160. package/src/schemas/components/channels.ts +0 -4
  161. package/src/schemas/components/global.ts +0 -16
  162. package/src/schemas/components/links.ts +0 -4
  163. package/src/schemas/components/list.ts +0 -3
  164. package/src/schemas/components/section.ts +0 -17
  165. package/src/schemas/components/sections.ts +0 -3
  166. package/src/schemas/components/socials.ts +0 -4
  167. package/src/schemas/components/subheader.ts +0 -10
  168. package/src/schemas/components/text.ts +0 -3
  169. package/src/schemas/components/themer.ts +0 -3
  170. package/src/schemas/components/toc.ts +0 -3
  171. package/src/schemas/components/writeup.ts +0 -20
  172. package/src/schemas/fields/categories.ts +0 -3
  173. package/src/schemas/fields/description.ts +0 -3
  174. package/src/schemas/fields/href.ts +0 -3
  175. package/src/schemas/fields/image.ts +0 -24
  176. package/src/schemas/fields/images.ts +0 -4
  177. package/src/schemas/fields/order.ts +0 -3
  178. package/src/schemas/fields/price.ts +0 -3
  179. package/src/schemas/fields/products.ts +0 -5
  180. package/src/schemas/fields/seo.ts +0 -12
  181. package/src/schemas/fields/soldout.ts +0 -3
  182. package/src/schemas/fields/title.ts +0 -3
  183. package/src/schemas/fields/variants.ts +0 -3
@@ -6,26 +6,22 @@ import { slugify } from 'fulldev-ui/utils/slugify'
6
6
 
7
7
  interface Props extends GlobalProps, HTMLAttributes<'h2'> {
8
8
  as?: HTMLTag
9
- level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined
10
9
  text?: string | undefined
10
+ muted?: boolean | undefined
11
11
  }
12
12
 
13
13
  const {
14
+ as = 'h2',
14
15
  text,
15
16
  id = text ? slugify(text) : undefined,
16
- size = 'md',
17
- level = 2,
18
- as = `h${level}`,
19
17
  ...rest
20
18
  } = Astro.props
21
19
  ---
22
20
 
23
21
  <Element
24
22
  class:list="heading"
25
- {id}
26
23
  {as}
27
- {level}
28
- {size}
24
+ {id}
29
25
  {...rest}
30
26
  >
31
27
  <Fragment set:html={text} />
@@ -36,82 +32,45 @@ const {
36
32
  .heading {
37
33
  @apply scroll-mt-20 font-bold tracking-tight text-foreground;
38
34
 
39
- &.size-sm {
40
- &.level-1 {
41
- @apply text-3xl;
42
- }
43
-
44
- &.level-2 {
45
- @apply text-2xl;
46
- }
47
-
48
- &.level-3 {
49
- @apply text-xl;
50
- }
51
-
52
- &.level-4 {
53
- @apply text-lg;
54
- }
55
-
56
- &.level-5 {
57
- @apply text-base;
58
- }
59
-
60
- &.level-6 {
61
- @apply text-sm;
62
- }
35
+ &.muted {
36
+ @apply text-muted-foreground;
63
37
  }
64
38
 
39
+ &,
65
40
  &.size-md {
66
- &.level-1 {
67
- @apply text-4xl;
68
- }
69
-
70
- &.level-2 {
71
- @apply text-3xl;
72
- }
73
-
74
- &.level-3 {
75
- @apply text-2xl;
76
- }
77
-
78
- &.level-4 {
79
- @apply text-xl;
80
- }
41
+ @apply text-base;
42
+ }
81
43
 
82
- &.level-5 {
83
- @apply text-lg;
84
- }
44
+ &.size-xs {
45
+ @apply text-xs;
46
+ }
85
47
 
86
- &.level-6 {
87
- @apply text-base;
88
- }
48
+ &.size-sm {
49
+ @apply text-sm;
89
50
  }
90
51
 
91
52
  &.size-lg {
92
- &.level-1 {
93
- @apply text-5xl lg:text-6xl;
94
- }
53
+ @apply text-lg;
54
+ }
95
55
 
96
- &.level-2 {
97
- @apply text-4xl;
98
- }
56
+ &.size-xl {
57
+ @apply text-xl;
58
+ }
99
59
 
100
- &.level-3 {
101
- @apply text-3xl;
102
- }
60
+ &.size-2xl {
61
+ @apply text-2xl;
62
+ }
103
63
 
104
- &.level-4 {
105
- @apply text-2xl;
106
- }
64
+ &.size-3xl {
65
+ @apply text-3xl;
66
+ }
107
67
 
108
- &.level-5 {
109
- @apply text-xl;
110
- }
68
+ &.size-4xl {
69
+ @apply text-4xl;
70
+ }
111
71
 
112
- &.level-6 {
113
- @apply text-lg;
114
- }
72
+ &.size-5xl {
73
+ @apply text-5xl lg:text-6xl;
115
74
  }
116
75
  }
117
76
  </style>
@@ -2,15 +2,17 @@
2
2
  import tablerIcons from '@iconify-json/tabler/icons.json'
3
3
  import type { HTMLAttributes } from 'astro/types'
4
4
  import Element from 'fulldev-ui/components/Element.astro'
5
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
5
+ import type { IconSchema } from 'fulldev-ui/schemas/components/icon'
6
6
 
7
- interface Props extends GlobalProps, HTMLAttributes<'i'> {
8
- name?: keyof typeof tablerIcons.icons | undefined
7
+ interface Props extends Omit<HTMLAttributes<'svg'>, 'name'>, IconSchema {
8
+ // name?: keyof typeof tablerIcons.icons | undefined
9
+ size?: 'sm' | 'md' | 'lg' | undefined
9
10
  }
10
11
 
11
12
  const { size = 'md', name, ...rest } = Astro.props
12
13
 
13
- const trimmedName = name?.trim() as string | undefined
14
+ console.log(name)
15
+ const trimmedName = name?.trim()
14
16
  const icon = trimmedName
15
17
  ? (tablerIcons as any)?.icons[trimmedName]?.body
16
18
  : undefined
@@ -1,29 +1,21 @@
1
1
  ---
2
- import type { ComponentProps, HTMLAttributes, HTMLTag } from 'astro/types'
3
- import type { CollectionEntry } from 'astro:content'
4
- import { getEntry } from 'astro:content'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
5
3
  import Element from 'fulldev-ui/components/Element.astro'
6
4
  import Icon from 'fulldev-ui/components/Icon.astro'
7
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
5
+ import type { LinkSchema } from 'fulldev-ui/schemas/components/link'
8
6
 
9
- interface Props extends GlobalProps, HTMLAttributes<'a'> {
7
+ interface Props
8
+ extends Omit<HTMLAttributes<'a'>, 'href' | 'target'>,
9
+ LinkSchema {
10
10
  as?: HTMLTag
11
- href?: string | null | undefined
12
- slug?: CollectionEntry<'pages'>['slug'] | undefined
13
- icon?: ComponentProps<typeof Icon>['name']
14
- variant?: 'primary' | 'muted' | undefined
15
- text?: string | undefined
16
11
  current?: boolean | undefined
17
12
  }
18
13
 
19
14
  const {
20
- slug,
21
- href = slug === 'index' ? '/' : slug ? `/${slug}/` : undefined,
22
- text = slug ? (await getEntry('pages', slug)).data.title : undefined,
23
- target = href?.startsWith('http') ? '_blank' : undefined,
24
- current = Astro.url.pathname === href,
25
15
  as = 'a',
26
16
  variant = 'primary',
17
+ size = 'md',
18
+ text,
27
19
  icon,
28
20
  ...rest
29
21
  } = Astro.props
@@ -31,11 +23,9 @@ const {
31
23
 
32
24
  <Element
33
25
  class:list="link"
34
- {href}
35
26
  {as}
36
- {target}
37
27
  {variant}
38
- {current}
28
+ {size}
39
29
  {...rest}
40
30
  >
41
31
  <Fragment set:html={text} />
@@ -54,6 +44,10 @@ const {
54
44
  @apply text-primary underline underline-offset-4;
55
45
  }
56
46
 
47
+ &.variant-underline {
48
+ @apply underline underline-offset-4;
49
+ }
50
+
57
51
  &.variant-muted {
58
52
  @apply text-muted-foreground hover:text-foreground;
59
53
 
@@ -1,44 +1,57 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
3
- import Element from 'fulldev-ui/components/Element.astro'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
4
3
  import Image from 'fulldev-ui/components/Image.astro'
5
-
6
- interface Props extends ComponentProps<typeof Image> {
7
- company?: string | undefined
4
+ import type { LogoSchema } from 'fulldev-ui/schemas/components/logo'
5
+ import Element from './Element.astro'
6
+
7
+ interface Props
8
+ extends Omit<HTMLAttributes<'a'>, 'href'>,
9
+ HTMLAttributes<'div'>,
10
+ LogoSchema {
11
+ as?: HTMLTag
8
12
  }
9
13
 
10
- const { size = 'md', company, ...rest } = Astro.props as Props
14
+ const {
15
+ href = '/',
16
+ as = href ? 'a' : 'div',
17
+ size = 'md',
18
+ image,
19
+ text,
20
+ ...rest
21
+ } = Astro.props as Props
11
22
  ---
12
23
 
13
24
  <Element
14
25
  class:list="logo"
15
- as="a"
16
- href="/"
26
+ {href}
27
+ {as}
17
28
  {size}
18
29
  >
19
- <Image {...rest} />
20
- <Fragment set:html={company} />
30
+ <Image {...image} />
31
+ <Fragment set:html={text} />
21
32
  </Element>
22
33
 
34
+ <Image
35
+ class:list="logo"
36
+ {size}
37
+ {...rest}
38
+ />
39
+
23
40
  <style is:global>
24
41
  @layer fulldev {
25
42
  .logo {
26
- @apply inline-flex grow-0 items-center justify-start font-semibold;
27
-
28
- .image {
29
- @apply block h-full w-auto object-contain;
30
- }
43
+ @apply flex w-auto items-center object-contain text-base font-bold leading-none text-foreground;
31
44
 
32
45
  &.size-sm {
33
- @apply h-6 gap-2 text-base;
46
+ @apply h-6;
34
47
  }
35
48
 
36
49
  &.size-md {
37
- @apply h-7 gap-2.5 text-lg;
50
+ @apply h-7;
38
51
  }
39
52
 
40
53
  &.size-lg {
41
- @apply h-8 gap-3 text-xl;
54
+ @apply h-8;
42
55
  }
43
56
  }
44
57
  }
@@ -0,0 +1,39 @@
1
+ ---
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
+ import Element from 'fulldev-ui/components/Element.astro'
4
+
5
+ interface Props extends HTMLAttributes<'header'> {
6
+ as?: HTMLTag
7
+ }
8
+
9
+ const { as = 'header', ...rest } = Astro.props
10
+ ---
11
+
12
+ <Element
13
+ class:list="navigation"
14
+ {as}
15
+ {...rest}
16
+ >
17
+ <header>header</header>
18
+ <aside>sidebar</aside>
19
+ </Element>
20
+
21
+ <style is:global>
22
+ @layer fulldev {
23
+ .navigation {
24
+ @apply flex h-screen flex-col;
25
+
26
+ grid-row-start: 1;
27
+ grid-row-end: 2;
28
+ grid-column-start: 1;
29
+
30
+ header {
31
+ @apply h-12 w-full border-b;
32
+ }
33
+
34
+ aside {
35
+ @apply h-full w-64 grow border-r p-6;
36
+ }
37
+ }
38
+ }
39
+ </style>
@@ -0,0 +1,25 @@
1
+ ---
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
+ import Element from 'fulldev-ui/components/Element.astro'
4
+
5
+ interface Props extends HTMLAttributes<'div'> {
6
+ as?: HTMLTag
7
+ }
8
+
9
+ const { ...rest } = Astro.props
10
+ ---
11
+
12
+ <Element
13
+ class:list="panel"
14
+ {...rest}
15
+ >
16
+ <slot />
17
+ </Element>
18
+
19
+ <style is:global>
20
+ @layer fulldev {
21
+ .panel {
22
+ @apply w-full gap-x-gutter rounded-lg border bg-card px-gutter py-16 text-card-foreground lg:px-16;
23
+ }
24
+ }
25
+ </style>
@@ -1,38 +1,55 @@
1
1
  ---
2
2
  import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
3
  import Element from 'fulldev-ui/components/Element.astro'
4
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
4
+ import type { ParagraphSchema } from 'fulldev-ui/schemas/components/paragraph.ts'
5
5
 
6
- interface Props extends GlobalProps, HTMLAttributes<'p'> {
6
+ interface Props extends HTMLAttributes<'p'>, ParagraphSchema {
7
7
  as?: HTMLTag
8
- text?: string | undefined
8
+ muted?: boolean | undefined
9
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined
9
10
  }
10
11
 
11
12
  const { as = 'p', text, ...rest } = Astro.props
12
13
  ---
13
14
 
14
15
  <Element
15
- class:list="paragraph"
16
+ class:list="text"
16
17
  {as}
17
18
  {...rest}
18
19
  >
19
- <slot />
20
20
  <Fragment set:html={text} />
21
+ <slot />
21
22
  </Element>
22
23
 
23
24
  <style is:global>
24
25
  @layer fulldev {
25
- .paragraph,
26
+ .text,
26
27
  .prose-content p {
27
- @apply leading-7 text-foreground;
28
+ @apply leading-relaxed text-foreground;
29
+
30
+ &.muted {
31
+ @apply text-muted-foreground;
32
+ }
33
+
34
+ &.size-xs {
35
+ @apply text-xs;
36
+ }
28
37
 
29
38
  &.size-sm {
30
39
  @apply text-sm;
31
40
  }
32
41
 
42
+ &.size-md {
43
+ @apply text-base;
44
+ }
45
+
33
46
  &.size-lg {
34
47
  @apply text-lg;
35
48
  }
49
+
50
+ &.size-xl {
51
+ @apply text-xl;
52
+ }
36
53
  }
37
54
  }
38
55
  </style>
@@ -8,20 +8,20 @@ interface Props extends GlobalProps, HTMLAttributes<'div'> {
8
8
  size?: 'sm' | 'md' | 'lg' | undefined
9
9
  color?: 'base' | 'brand' | undefined
10
10
  contrast?: boolean | undefined
11
- value?: number | undefined
11
+ amount?: number | undefined
12
12
  }
13
13
 
14
- const { value, ...rest } = Astro.props
14
+ const { amount, ...rest } = Astro.props
15
15
  ---
16
16
 
17
17
  <Element
18
18
  class:list="price"
19
19
  {...rest}
20
20
  >
21
- {value && <Fragment set:html={formatPrice(value)} />}
21
+ {amount && <Fragment set:html={formatPrice(amount)} />}
22
22
  </Element>
23
23
 
24
- <style is:global >
24
+ <style is:global>
25
25
  @layer fulldev {
26
26
  .price {
27
27
  margin: 0;
@@ -1,168 +1,77 @@
1
1
  ---
2
- import type { ComponentProps, HTMLAttributes, HTMLTag } from 'astro/types'
3
- import type { CollectionEntry } from 'astro:content'
4
- import Button from 'fulldev-ui/components/Button.astro'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
5
3
  import Element from 'fulldev-ui/components/Element.astro'
6
- import Heading from 'fulldev-ui/components/Heading.astro'
7
- import Image from 'fulldev-ui/components/Image.astro'
8
- import Lead from 'fulldev-ui/components/Lead.astro'
9
- import Tagline from 'fulldev-ui/components/Tagline.astro'
10
- import Toc from 'fulldev-ui/components/Toc.astro'
11
- import { crush } from 'radash'
12
- import type Sidebar from './Sidebar.astro'
13
4
 
14
5
  interface Props extends HTMLAttributes<'div'> {
15
- as?: HTMLTag | undefined
16
- render?: any
17
- sidebar?: ComponentProps<typeof Sidebar> | undefined
18
- slug?: CollectionEntry<'pages'>['slug'] | undefined
19
- toc?: boolean | ComponentProps<typeof Toc>['heading'] | undefined
20
- tagline?: ComponentProps<typeof Tagline>['text'] | undefined
21
- heading?: ComponentProps<typeof Heading>['text'] | undefined
22
- image?: ComponentProps<typeof Image> | undefined
23
- lead?: ComponentProps<typeof Lead>['text'] | undefined
6
+ as?: HTMLTag
24
7
  }
25
8
 
26
- const {
27
- toc = false,
28
- slug,
29
- sidebar,
30
- render,
31
- tagline,
32
- heading,
33
- lead,
34
- image,
35
- ...rest
36
- } = Astro.props
37
-
38
- const Content = render && (await render())?.Content
39
-
40
- const flatMenu = crush(sidebar?.menu ?? {})
41
- const slugs = Object.entries(flatMenu)
42
- .map(([key, value]) => (key.endsWith('.slug') ? value : null))
43
- .filter(Boolean)
44
- const slugIndex = slugs.findIndex((val) => val === slug)
45
-
46
- const prevSlug = slugs[slugIndex - 1]
47
- const nextSlug = slugs[slugIndex + 1]
9
+ const { ...rest } = Astro.props
48
10
  ---
49
11
 
50
12
  <Element
51
13
  class:list="prose"
52
14
  {...rest}
53
15
  >
54
- <Element class:list="prose-container">
55
- <Element class:list="prose-content">
56
- <Tagline text={tagline} />
57
- <Heading
58
- as="h1"
59
- level={2}
60
- text={heading}
61
- />
62
- <Lead text={lead} />
63
- <Image {...image} />
64
- {Content && <Content />}
65
- <slot />
66
- <Element class:list="prose-footer">
67
- <Button
68
- class:list="prose-prev"
69
- icon={prevSlug && 'arrow-left'}
70
- slug={prevSlug}
71
- variant="secondary"
72
- />
73
- <Button
74
- class:list="prose-next"
75
- icon={nextSlug && 'arrow-right'}
76
- slug={nextSlug}
77
- variant="secondary"
78
- reverse
79
- />
80
- </Element>
81
- </Element>
82
- <Toc
83
- if={toc}
84
- heading={typeof toc === 'string' ? toc : undefined}
85
- {render}
86
- />
87
- </Element>
16
+ <slot />
88
17
  </Element>
89
18
 
90
19
  <style is:global>
91
20
  @layer fulldev {
92
21
  .prose {
93
- @apply relative items-start py-28 first:pt-14;
22
+ @apply relative w-full max-w-screen-md py-8;
94
23
 
95
- .prose-container {
96
- @apply container flex h-full w-full flex-grow items-start justify-evenly gap-14 gap-x-gutter;
24
+ > * {
25
+ @apply mt-6 first:mt-0;
97
26
  }
98
27
 
99
- .prose-content {
100
- @apply w-full max-w-screen-md;
101
-
102
- > * {
103
- @apply mt-6 first:mt-0;
104
- }
105
-
106
- p {
107
- @apply mt-4 first:mt-0;
108
- }
109
-
110
- code:not(.astro-code code) {
111
- @apply rounded bg-muted px-1.5 py-0.5 font-mono text-sm font-medium;
112
- }
113
-
114
- h1,
115
- h2,
116
- h3,
117
- h4,
118
- h5,
119
- h6 {
120
- @apply mt-8 scroll-m-20 font-semibold first:mt-0;
121
-
122
- code {
123
- font-size: inherit !important;
124
- }
125
- }
28
+ p {
29
+ @apply mt-4 first:mt-0;
30
+ }
126
31
 
127
- > h1 {
128
- @apply text-4xl font-extrabold;
129
- }
32
+ code:not(.astro-code code) {
33
+ @apply rounded bg-muted px-1.5 py-0.5 font-mono text-sm font-medium;
34
+ }
130
35
 
131
- > h2 {
132
- @apply text-2xl;
133
- }
36
+ h1,
37
+ h2,
38
+ h3,
39
+ h4,
40
+ h5,
41
+ h6 {
42
+ @apply mt-8 scroll-m-20 font-bold first:mt-0;
134
43
 
135
- > h3 {
136
- @apply text-xl;
44
+ code {
45
+ font-size: inherit !important;
137
46
  }
47
+ }
138
48
 
139
- > h4 {
140
- @apply text-lg;
141
- }
49
+ > h1 {
50
+ @apply text-4xl;
51
+ }
142
52
 
143
- > h5 {
144
- @apply text-base;
145
- }
53
+ > h2 {
54
+ @apply text-2xl;
55
+ }
146
56
 
147
- > h6 {
148
- @apply text-sm;
149
- }
57
+ > h3 {
58
+ @apply text-xl;
59
+ }
150
60
 
151
- > aside {
152
- @apply mt-6 rounded-md border border-destructive p-4 text-destructive first:mt-0;
153
- }
61
+ > h4 {
62
+ @apply text-lg;
154
63
  }
155
64
 
156
- .prose-footer {
157
- @apply mt-14 flex items-center;
65
+ > h5 {
66
+ @apply text-base;
67
+ }
158
68
 
159
- .prose-next {
160
- @apply ml-auto;
161
- }
69
+ > h6 {
70
+ @apply text-sm;
162
71
  }
163
72
 
164
- .toc {
165
- @apply order-last;
73
+ > aside {
74
+ @apply mt-6 rounded-md border border-destructive p-4 text-destructive first:mt-0;
166
75
  }
167
76
  }
168
77
  }