fulldev-ui 0.6.0-beta.2 → 0.6.0-beta.6

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 (257) hide show
  1. package/astro.config.ts +1 -7
  2. package/cloudcannon.config.yml +269 -0
  3. package/package.json +1 -1
  4. package/src/blocks/Banner.astro +13 -15
  5. package/src/blocks/Colleagues1.astro +73 -0
  6. package/src/blocks/Contact1.astro +100 -0
  7. package/src/blocks/Content1.astro +79 -0
  8. package/src/blocks/Content2.astro +94 -0
  9. package/src/blocks/Content3.astro +70 -0
  10. package/src/blocks/Content4.astro +75 -0
  11. package/src/blocks/Cta1.astro +73 -0
  12. package/src/blocks/Feature1.astro +61 -0
  13. package/src/blocks/Features1.astro +66 -0
  14. package/src/blocks/Footer.astro +36 -68
  15. package/src/blocks/Header.astro +150 -3
  16. package/src/blocks/Hero1.astro +74 -0
  17. package/src/blocks/Intro1.astro +70 -0
  18. package/src/blocks/Jobs1.astro +73 -0
  19. package/src/blocks/Logos1.astro +55 -0
  20. package/src/blocks/Products1.astro +90 -0
  21. package/src/blocks/Reviews1.astro +79 -0
  22. package/src/blocks/{Hero.astro → _Hero.astro} +7 -6
  23. package/src/components/Badge.astro +10 -18
  24. package/src/components/Badges.astro +12 -35
  25. package/src/components/Block.astro +30 -0
  26. package/src/components/Blocks.astro +26 -0
  27. package/src/components/Button.astro +11 -25
  28. package/src/components/Buttons.astro +12 -43
  29. package/src/components/Card.astro +8 -150
  30. package/src/components/Cart.astro +6 -11
  31. package/src/components/CartSummary.astro +3 -3
  32. package/src/components/Channel.astro +5 -14
  33. package/src/components/Container.astro +25 -0
  34. package/src/components/Drawer.astro +55 -117
  35. package/src/components/DrawerOld.astro +143 -0
  36. package/src/components/Element.astro +2 -0
  37. package/src/components/Form.astro +3 -1
  38. package/src/components/Grid.astro +39 -0
  39. package/src/components/Group.astro +25 -0
  40. package/src/components/Head.astro +18 -32
  41. package/src/components/Header.astro +8 -105
  42. package/src/components/Heading.astro +34 -71
  43. package/src/components/Icon.astro +5 -4
  44. package/src/components/Image.astro +15 -50
  45. package/src/components/Layout.astro +35 -0
  46. package/src/components/Link.astro +12 -18
  47. package/src/components/Links.astro +14 -35
  48. package/src/components/Logo.astro +26 -15
  49. package/src/components/Masonry.astro +42 -0
  50. package/src/components/Menu.astro +17 -38
  51. package/src/components/Menus.astro +20 -0
  52. package/src/components/Navigation.astro +39 -0
  53. package/src/components/Panel.astro +25 -0
  54. package/src/components/Paragraph.astro +24 -7
  55. package/src/components/Price.astro +4 -4
  56. package/src/components/Prose.astro +47 -130
  57. package/src/components/Rating.astro +24 -75
  58. package/src/components/Search.astro +5 -4
  59. package/src/components/Section.astro +20 -29
  60. package/src/components/Sidebar.astro +18 -69
  61. package/src/components/Social.astro +9 -2
  62. package/src/components/Stack.astro +25 -0
  63. package/src/components/Tagline.astro +21 -31
  64. package/src/components/Toc.astro +22 -21
  65. package/src/components/Writeup.astro +33 -82
  66. package/src/components/_Author.astro +90 -0
  67. package/src/components/_Header.astro +129 -0
  68. package/src/components/_Image.astro +79 -0
  69. package/src/components/_Prose copy.astro +172 -0
  70. package/src/components/_Sidebar copy.astro +87 -0
  71. package/src/content/config.ts +2 -29
  72. package/src/content/layouts/base.yml +42 -80
  73. package/src/content/pages/categories/category.md +7 -0
  74. package/src/content/{docs → pages/docs}/_internationalization.mdx +1 -0
  75. package/src/content/{docs → pages/docs}/_using-blocks.mdx +1 -0
  76. package/src/content/{docs → pages/docs}/_using-presets.mdx +1 -0
  77. package/src/content/{docs → pages/docs}/blocks.mdx +1 -0
  78. package/src/content/{docs → pages/docs}/collections/images.mdx +1 -0
  79. package/src/content/{docs → pages/docs}/collections/pages.mdx +1 -0
  80. package/src/content/{docs → pages/docs}/collections/presets.mdx +1 -0
  81. package/src/content/{docs → pages/docs}/collections.mdx +1 -0
  82. package/src/content/{docs → pages/docs}/components/_card.mdx +1 -0
  83. package/src/content/{docs → pages/docs}/components/_dialog.mdx +1 -0
  84. package/src/content/{docs → pages/docs}/components/_drawer.mdx +1 -0
  85. package/src/content/{docs → pages/docs}/components/_localeswitcher.mdx +1 -0
  86. package/src/content/{docs → pages/docs}/components/_switch.mdx +1 -0
  87. package/src/content/{docs → pages/docs}/components/_tagline.mdx +1 -0
  88. package/src/content/{docs → pages/docs}/components/_toggle.mdx +1 -0
  89. package/src/content/{docs → pages/docs}/components/avatar.mdx +1 -0
  90. package/src/content/{docs → pages/docs}/components/badge.mdx +1 -0
  91. package/src/content/{docs → pages/docs}/components/badges.mdx +1 -0
  92. package/src/content/{docs → pages/docs}/components/button.mdx +1 -0
  93. package/src/content/{docs → pages/docs}/components/buttons.mdx +1 -0
  94. package/src/content/{docs → pages/docs}/components/channel.mdx +1 -0
  95. package/src/content/{docs → pages/docs}/components/channels.mdx +1 -0
  96. package/src/content/{docs → pages/docs}/components/checkbox.mdx +1 -0
  97. package/src/content/{docs → pages/docs}/components/code.mdx +1 -0
  98. package/src/content/{docs → pages/docs}/components/heading.mdx +1 -0
  99. package/src/content/{docs → pages/docs}/components/icon.mdx +1 -0
  100. package/src/content/{docs → pages/docs}/components/image.mdx +1 -0
  101. package/src/content/{docs → pages/docs}/components/input.mdx +1 -0
  102. package/src/content/{docs → pages/docs}/components/label.mdx +1 -0
  103. package/src/content/{docs → pages/docs}/components/link.mdx +1 -0
  104. package/src/content/{docs → pages/docs}/components/links.mdx +1 -0
  105. package/src/content/{docs → pages/docs}/components/list.mdx +1 -0
  106. package/src/content/{docs → pages/docs}/components/logo.mdx +1 -0
  107. package/src/content/{docs → pages/docs}/components/menu.mdx +1 -0
  108. package/src/content/{docs → pages/docs}/components/prose.mdx +1 -0
  109. package/src/content/{docs → pages/docs}/components/rating.mdx +1 -0
  110. package/src/content/{docs → pages/docs}/components/section.mdx +1 -0
  111. package/src/content/{docs → pages/docs}/components/select.mdx +1 -0
  112. package/src/content/{docs → pages/docs}/components/social.mdx +1 -0
  113. package/src/content/{docs → pages/docs}/components/socials.mdx +1 -0
  114. package/src/content/{docs → pages/docs}/components/switch.mdx +1 -0
  115. package/src/content/{docs → pages/docs}/components/table.mdx +1 -0
  116. package/src/content/{docs → pages/docs}/components/tagline.mdx +1 -0
  117. package/src/content/pages/docs/components/text.mdx +48 -0
  118. package/src/content/{docs → pages/docs}/components/textarea.mdx +1 -0
  119. package/src/content/{docs → pages/docs}/components/themer.mdx +1 -0
  120. package/src/content/{docs → pages/docs}/components.mdx +2 -4
  121. package/src/content/{docs → pages/docs}/customization.mdx +1 -0
  122. package/src/content/{docs → pages/docs}/frameworks.mdx +1 -0
  123. package/src/content/{docs → pages/docs}/generating-pages.mdx +1 -0
  124. package/src/content/{docs → pages/docs}/index.mdx +2 -4
  125. package/src/content/{docs → pages/docs}/installation.mdx +1 -0
  126. package/src/content/{docs → pages/docs}/layouts.mdx +1 -0
  127. package/src/content/pages/index.mdx +20 -28
  128. package/src/content/{categories/mugs.md → pages/posts/post.md} +1 -1
  129. package/src/content/{products → pages/products}/product.md +4 -4
  130. package/src/css/theme.css +2 -0
  131. package/src/images/favicon/android-chrome-192x192.png +0 -0
  132. package/src/images/favicon/android-chrome-512x512.png +0 -0
  133. package/src/images/favicon/apple-touch-icon.png +0 -0
  134. package/src/images/favicon/browserconfig.xml +9 -0
  135. package/src/images/favicon/favicon-16x16.png +0 -0
  136. package/src/images/favicon/favicon-32x32.png +0 -0
  137. package/src/images/favicon/favicon-48x48.png +0 -0
  138. package/src/images/favicon/favicon.ico +0 -0
  139. package/src/images/favicon/favicon.svg +16 -0
  140. package/src/images/favicon/manifest.webmanifest +30 -0
  141. package/src/images/favicon/mstile-150x150.png +0 -0
  142. package/src/images/favicon/safari-pinned-tab.svg +16 -0
  143. package/src/images/favicon/yandex-browser-50x50.png +0 -0
  144. package/src/images/favicon/yandex-browser-manifest.json +9 -0
  145. package/src/integration/index.ts +48 -17
  146. package/src/layouts/{CategoryLayout.astro → Category.astro} +21 -15
  147. package/src/layouts/Doc.astro +70 -0
  148. package/src/layouts/Job.astro +62 -0
  149. package/src/layouts/Jobs.astro +72 -0
  150. package/src/layouts/Page.astro +29 -0
  151. package/src/layouts/Post.astro +52 -0
  152. package/src/layouts/{ProductLayout.astro → Product.astro} +25 -11
  153. package/src/pages/[...page].astro +36 -4
  154. package/src/pages/test.astro +32 -2
  155. package/src/schemas/components/avatar.ts +4 -1
  156. package/src/schemas/components/badge.ts +16 -11
  157. package/src/schemas/components/block.ts +61 -0
  158. package/src/schemas/components/button.ts +14 -19
  159. package/src/schemas/components/channel.ts +15 -9
  160. package/src/schemas/components/footer.ts +15 -14
  161. package/src/schemas/components/head.ts +17 -0
  162. package/src/schemas/components/header.ts +19 -16
  163. package/src/schemas/components/heading.ts +7 -1
  164. package/src/schemas/components/icon.ts +7 -1
  165. package/src/schemas/components/image.ts +38 -21
  166. package/src/schemas/components/link.ts +10 -16
  167. package/src/schemas/components/logo.ts +12 -2
  168. package/src/schemas/components/menu.ts +12 -13
  169. package/src/schemas/components/navigation.ts +10 -0
  170. package/src/schemas/components/paragraph.ts +9 -0
  171. package/src/schemas/components/price.ts +9 -0
  172. package/src/schemas/components/rating.ts +8 -13
  173. package/src/schemas/components/sidebar.ts +14 -12
  174. package/src/schemas/components/social.ts +16 -1
  175. package/src/schemas/components/tagline.ts +7 -1
  176. package/src/schemas/imageSchema.ts +33 -4
  177. package/src/schemas/page.ts +40 -0
  178. package/src/types/global-props.ts +0 -9
  179. package/src/types/{virtual-modules.d.ts → virtual.d.ts} +1 -1
  180. package/src/utils/getHref.ts +4 -20
  181. package/tailwind.config.ts +4 -0
  182. package/tsconfig.json +1 -3
  183. package/example.svelte +0 -0
  184. package/parent.svelte +0 -0
  185. package/src/App.svelte +0 -0
  186. package/src/blocks/Categories.astro +0 -12
  187. package/src/blocks/Colleagues.astro +0 -12
  188. package/src/blocks/Contact.astro +0 -117
  189. package/src/blocks/Content.astro +0 -130
  190. package/src/blocks/Cta.astro +0 -13
  191. package/src/blocks/Excerpt.astro +0 -12
  192. package/src/blocks/Features.astro +0 -11
  193. package/src/blocks/Intro.astro +0 -101
  194. package/src/blocks/Jobs.astro +0 -12
  195. package/src/blocks/Posts.astro +0 -11
  196. package/src/blocks/Prices.astro +0 -24
  197. package/src/blocks/Product.astro +0 -89
  198. package/src/blocks/Products.astro +0 -101
  199. package/src/blocks/Reviews.astro +0 -12
  200. package/src/blocks/_Contact.astro +0 -112
  201. package/src/components/CartForm.astro +0 -120
  202. package/src/components/CartList.astro +0 -122
  203. package/src/components/Lead.astro +0 -46
  204. package/src/components/ProductCard.astro +0 -52
  205. package/src/components/Text.astro +0 -43
  206. package/src/components/_CartList backup.astro +0 -125
  207. package/src/components/_CartList copy.astro +0 -213
  208. package/src/components/_CartListSimple.astro +0 -148
  209. package/src/components/sections.astro +0 -28
  210. package/src/content/docs/components/lead.mdx +0 -49
  211. package/src/content/docs/components/paragraph.mdx +0 -49
  212. package/src/content/layouts/docs.yml +0 -70
  213. package/src/layouts/DocLayout.astro +0 -17
  214. package/src/layouts/Layout.astro +0 -79
  215. package/src/layouts/PageLayout.astro +0 -20
  216. package/src/layouts/PostLayout.astro +0 -20
  217. package/src/loaders/imageLoader.ts +0 -26
  218. package/src/pages/[...category].astro +0 -17
  219. package/src/pages/[...doc].astro +0 -17
  220. package/src/pages/[...post].astro +0 -17
  221. package/src/pages/[...product].astro +0 -17
  222. package/src/schemas/archive/_pageSchema.ts +0 -94
  223. package/src/schemas/categorySchema.ts +0 -16
  224. package/src/schemas/components/avatars.ts +0 -4
  225. package/src/schemas/components/banner.ts +0 -3
  226. package/src/schemas/components/buttons.ts +0 -4
  227. package/src/schemas/components/card.ts +0 -43
  228. package/src/schemas/components/cards.ts +0 -4
  229. package/src/schemas/components/channels.ts +0 -4
  230. package/src/schemas/components/global.ts +0 -16
  231. package/src/schemas/components/links.ts +0 -4
  232. package/src/schemas/components/list.ts +0 -3
  233. package/src/schemas/components/section.ts +0 -17
  234. package/src/schemas/components/sections.ts +0 -3
  235. package/src/schemas/components/socials.ts +0 -4
  236. package/src/schemas/components/subheader.ts +0 -10
  237. package/src/schemas/components/text.ts +0 -3
  238. package/src/schemas/components/themer.ts +0 -3
  239. package/src/schemas/components/toc.ts +0 -3
  240. package/src/schemas/components/writeup.ts +0 -20
  241. package/src/schemas/docSchema.ts +0 -10
  242. package/src/schemas/fields/categories.ts +0 -3
  243. package/src/schemas/fields/description.ts +0 -3
  244. package/src/schemas/fields/href.ts +0 -3
  245. package/src/schemas/fields/image.ts +0 -24
  246. package/src/schemas/fields/images.ts +0 -4
  247. package/src/schemas/fields/order.ts +0 -3
  248. package/src/schemas/fields/price.ts +0 -3
  249. package/src/schemas/fields/products.ts +0 -5
  250. package/src/schemas/fields/seo.ts +0 -12
  251. package/src/schemas/fields/soldout.ts +0 -3
  252. package/src/schemas/fields/title.ts +0 -3
  253. package/src/schemas/fields/variants.ts +0 -3
  254. package/src/schemas/layoutSchema.ts +0 -28
  255. package/src/schemas/pageSchema.ts +0 -20
  256. package/src/schemas/postSchema.ts +0 -16
  257. package/src/schemas/productSchema.ts +0 -22
@@ -1,22 +1,23 @@
1
1
  ---
2
- import type { ComponentProps, HTMLAttributes } from 'astro/types'
3
- import type { CollectionEntry } from 'astro:content'
2
+ import type { MarkdownHeading } from 'astro'
3
+ import type { HTMLAttributes } from 'astro/types'
4
4
  import Element from 'fulldev-ui/components/Element.astro'
5
5
  import Heading from 'fulldev-ui/components/Heading.astro'
6
6
  import type { GlobalProps } from 'fulldev-ui/types/global-props'
7
- import Links from './Links.astro'
7
+ import Link from './Link.astro'
8
8
 
9
9
  interface Props extends GlobalProps, HTMLAttributes<'div'> {
10
- heading?: ComponentProps<typeof Heading>['text']
11
- render?: CollectionEntry<'pages'>['render'] | undefined
10
+ headings?: MarkdownHeading[] | undefined
12
11
  }
13
12
 
14
- const { size = 'sm', heading = 'On this page', render, ...rest } = Astro.props
13
+ const { headings, ...rest } = Astro.props
15
14
 
16
- const headings = render ? (await render())?.headings : []
17
15
  const filteredHeadings = headings?.filter(
18
16
  (heading: any) => heading.depth >= 2 && heading.depth <= 4
19
17
  )
18
+
19
+ const h1 = headings?.find((heading: any) => heading.depth === 1)
20
+
20
21
  const links = filteredHeadings?.map((button: any) => ({
21
22
  text: button.text,
22
23
  href: `#${button.slug}`,
@@ -25,32 +26,32 @@ const links = filteredHeadings?.map((button: any) => ({
25
26
  ---
26
27
 
27
28
  <Element
28
- if={filteredHeadings?.length > 1}
29
29
  class:list="toc"
30
- {size}
30
+ if={filteredHeadings?.length}
31
31
  {...rest}
32
32
  >
33
33
  <Heading
34
- level={5}
35
- text={heading}
36
- {size}
37
- />
38
- <Links
39
- direction="column"
40
- {links}
41
- {size}
34
+ as="a"
35
+ href="#"
36
+ {...h1}
42
37
  />
38
+ {
39
+ links?.map((link) => (
40
+ <Link
41
+ variant="muted"
42
+ size="sm"
43
+ {...link}
44
+ />
45
+ ))
46
+ }
43
47
  </Element>
44
48
 
45
49
  <style is:global>
46
50
  @layer fulldev {
47
51
  .toc {
48
- @apply sticky bottom-0 z-10 -mt-14 hidden w-52 shrink-0 flex-col items-start justify-start gap-3 overflow-y-auto py-14 md:flex;
52
+ @apply lg:top-sticky-16 sticky bottom-0 z-10 hidden w-48 shrink-0 flex-col items-start justify-start gap-3 overflow-y-auto md:flex;
49
53
  @apply scrollbar scrollbar-track-transparent scrollbar-thumb-accent scrollbar-thumb-rounded-full scrollbar-w-2 hover:scrollbar-thumb-accent-hover;
50
54
 
51
- top: var(--header-height, 0px);
52
- max-height: calc(100vh - var(--header-height, 0px));
53
-
54
55
  .depth-3 {
55
56
  @apply pl-3;
56
57
  }
@@ -1,107 +1,58 @@
1
1
  ---
2
- import type { ComponentProps, HTMLAttributes } from 'astro/types'
3
- import Badge from 'fulldev-ui/components/Badge.astro'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
4
3
  import Element from 'fulldev-ui/components/Element.astro'
5
- import Heading from 'fulldev-ui/components/Heading.astro'
6
- import List from 'fulldev-ui/components/List.astro'
7
- import Price from 'fulldev-ui/components/Price.astro'
8
- import Rating from 'fulldev-ui/components/Rating.astro'
9
- import Tagline from 'fulldev-ui/components/Tagline.astro'
10
- import Text from 'fulldev-ui/components/Text.astro'
11
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
12
- import Lead from './Lead.astro'
13
- import Paragraph from './Paragraph.astro'
14
4
 
15
- interface Props extends GlobalProps, HTMLAttributes<'div'> {
16
- level?: ComponentProps<typeof Heading>['level']
17
- badge?: ComponentProps<typeof Badge> | undefined
18
- tagline?: ComponentProps<typeof Tagline>['text']
19
- heading?: ComponentProps<typeof Heading>['text']
20
- lead?: ComponentProps<typeof Lead>['text']
21
- paragraph?: ComponentProps<typeof Paragraph>['text']
22
- text?: ComponentProps<typeof Text>['text']
23
- list?: ComponentProps<typeof List>['items']
24
- align?: 'start' | 'center' | 'end' | undefined
25
- price?: ComponentProps<typeof Price>['value']
26
- rating?:
27
- | ComponentProps<typeof Rating>
28
- | ComponentProps<typeof Rating>['value']
5
+ interface Props extends HTMLAttributes<'div'> {
6
+ as?: HTMLTag
7
+ align?: 'left' | 'center' | 'right'
29
8
  }
30
9
 
31
- const {
32
- level = 2,
33
- rating,
34
- badge,
35
- tagline,
36
- heading,
37
- lead,
38
- paragraph,
39
- text,
40
- list,
41
- price,
42
- size,
43
- ...rest
44
- } = Astro.props
10
+ const { align = 'start', ...rest } = Astro.props
45
11
  ---
46
12
 
47
13
  <Element
48
14
  class:list="writeup"
49
- {size}
15
+ {align}
50
16
  {...rest}
51
17
  >
52
- <slot>
53
- <Rating
54
- {size}
55
- {...typeof rating === 'number' ? { value: rating } : rating}
56
- />
57
- <Tagline text={tagline} />
58
- <Badge
59
- {size}
60
- {...badge}
61
- />
62
- <Heading
63
- {size}
64
- {level}
65
- text={heading}
66
- />
67
- <Lead
68
- {size}
69
- text={lead}
70
- />
71
- <Paragraph
72
- {size}
73
- text={paragraph}
74
- />
75
- <List
76
- items={list}
77
- {size}
78
- />
79
- <Price value={price} />
80
- </slot>
18
+ <slot />
81
19
  </Element>
82
20
 
83
21
  <style is:global>
84
22
  @layer fulldev {
85
23
  .writeup {
86
- display: flex;
87
- position: relative;
88
- flex-direction: column;
89
- align-items: inherit;
90
- text-align: inherit;
24
+ @apply relative w-full;
91
25
 
92
- &.align-start {
93
- align-items: flex-start;
94
- text-align: left;
26
+ &.align-left {
27
+ @apply mr-auto flex flex-col items-start text-left;
95
28
  }
96
29
 
97
30
  &.align-center {
98
- align-items: center;
99
- text-align: center;
31
+ @apply mx-auto flex flex-col items-center text-center;
100
32
  }
101
33
 
102
- &.align-end {
103
- align-items: flex-end;
104
- text-align: right;
34
+ &.align-right {
35
+ @apply ml-auto flex flex-col items-end text-right;
36
+ }
37
+
38
+ .heading {
39
+ @apply max-w-screen-lg text-balance;
40
+ }
41
+
42
+ .paragraph {
43
+ @apply max-w-screen-md text-balance;
44
+ }
45
+
46
+ > * {
47
+ & + * {
48
+ @apply mt-4;
49
+ }
50
+
51
+ & + .group,
52
+ & + .button,
53
+ & + .buttons {
54
+ @apply mt-8;
55
+ }
105
56
  }
106
57
  }
107
58
  }
@@ -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> -->
@@ -0,0 +1,129 @@
1
+ <!-- ---
2
+ import type { ComponentProps,HTMLAttributes } from 'astro/types'
3
+ import Buttons from 'fulldev-ui/components/Buttons.astro'
4
+ import Cart from 'fulldev-ui/components/Cart.astro'
5
+ import Drawer from 'fulldev-ui/components/Drawer.astro'
6
+ import Element from 'fulldev-ui/components/Element.astro'
7
+ import Links from 'fulldev-ui/components/Links.astro'
8
+ import Logo from 'fulldev-ui/components/Logo.astro'
9
+ import Menu from 'fulldev-ui/components/Menu.astro'
10
+ import Socials from 'fulldev-ui/components/Socials.astro'
11
+ import Themer from 'fulldev-ui/components/Themer.astro'
12
+ import type { GlobalProps } from 'fulldev-ui/types/global-props'
13
+ import Search from './Search.astro'
14
+
15
+ interface Props extends GlobalProps, HTMLAttributes<'header'> {
16
+ logo?: ComponentProps<typeof Logo>
17
+ company?: ComponentProps<typeof Logo>['company']
18
+ buttons?: ComponentProps<typeof Buttons>['buttons']
19
+ links?: ComponentProps<typeof Links>['links']
20
+ menu?: ComponentProps<typeof Menu>['groups']
21
+ panel?: boolean | undefined
22
+ search?: boolean | undefined
23
+ open?: boolean | undefined
24
+ cart?: string | undefined
25
+ socials?: ComponentProps<typeof Socials>['socials']
26
+ themer?: boolean | undefined
27
+ size?: 'sm' | 'md' | 'lg' | undefined
28
+ }
29
+
30
+ const {
31
+ size = 'sm',
32
+ open,
33
+ logo,
34
+ company,
35
+ buttons,
36
+ links,
37
+ search,
38
+ panel,
39
+ socials,
40
+ menu,
41
+ cart,
42
+ themer,
43
+ ...rest
44
+ } = Astro.props
45
+ ---
46
+
47
+ <Element
48
+ class:list="header"
49
+ as="header"
50
+ {size}
51
+ {open}
52
+ {...rest}
53
+ >
54
+ <Element class:list="header-container">
55
+ <Logo
56
+ {company}
57
+ {size}
58
+ {...typeof logo === 'string' ? { src: logo } : logo}
59
+ />
60
+ <Links
61
+ class:list="header-links"
62
+ {size}
63
+ {links}
64
+ />
65
+ <Socials
66
+ {size}
67
+ variant="ghost"
68
+ {socials}
69
+ />
70
+ <Buttons
71
+ class:list="header-buttons"
72
+ {size}
73
+ {buttons}
74
+ >
75
+ <Search size="sm" />
76
+ <Themer
77
+ if={themer}
78
+ {size}
79
+ />
80
+ <Cart
81
+ if={cart}
82
+ variant="secondary"
83
+ heading={cart}
84
+ {size}
85
+ />
86
+ <Drawer
87
+ class:list={['header-button']}
88
+ icon="menu-2"
89
+ id="menu"
90
+ variant="secondary"
91
+ {logo}
92
+ {company}
93
+ {buttons}
94
+ {links}
95
+ {menu}
96
+ {size}
97
+ />
98
+ </Buttons>
99
+ </Element>
100
+ </Element>
101
+
102
+ <style is:global>
103
+ @layer fulldev {
104
+ .header {
105
+ @apply sticky left-0 top-0 z-20 flex h-14 items-center overflow-hidden border-b bg-background;
106
+
107
+ .header-container {
108
+ @apply container flex w-full items-center justify-between gap-6;
109
+ }
110
+
111
+ &,
112
+ & ~ * {
113
+ --header-height: 3.5rem;
114
+ }
115
+
116
+ .header-links {
117
+ @apply mr-auto max-lg:hidden;
118
+ }
119
+
120
+ .header-socials {
121
+ @apply ml-auto max-lg:hidden;
122
+ }
123
+
124
+ .menu-button {
125
+ @apply lg:hidden;
126
+ }
127
+ }
128
+ }
129
+ </style> -->
@@ -0,0 +1,79 @@
1
+ ---
2
+ // @ts-nocheck
3
+ import type { ImageMetadata } from 'astro'
4
+ import type { HTMLAttributes } from 'astro/types'
5
+ import { Image as AstroImage } from 'astro:assets'
6
+ import { getEntry } from 'astro:content'
7
+
8
+ interface Props extends GlobalProps, HTMLAttributes<'img'> {
9
+ id?: any
10
+ size?: 'sm' | 'md' | 'lg' | undefined
11
+ position?: 'background' | 'cover' | 'inset' | undefined
12
+ }
13
+
14
+ const { id } = Astro.props
15
+ const entry = id ? (await getEntry('images', id))?.data : {}
16
+
17
+ const {
18
+ width = 1920,
19
+ height = 1920,
20
+ position,
21
+ src,
22
+ alt,
23
+ size,
24
+ ...rest
25
+ } = {
26
+ ...entry,
27
+ ...Astro.props,
28
+ }
29
+
30
+ function getAltBySrc() {
31
+ if (!src) return
32
+ const filename = src?.split('/').pop()
33
+ const slug = filename && filename.split('.')[0]
34
+ const unslugged = slug?.replace(/-/g, ' ')
35
+ return unslugged || ''
36
+ }
37
+
38
+ const images = import.meta.glob<{ default: ImageMetadata }>('/src/images/*')
39
+ const image = images[src as keyof typeof images]
40
+ ---
41
+
42
+ {
43
+ (image || src) && (
44
+ <AstroImage
45
+ class:list={[
46
+ 'image',
47
+ {
48
+ [`size-${size}`]: size,
49
+ [`position-${position}`]: position,
50
+ },
51
+ ]}
52
+ alt={alt || getAltBySrc()}
53
+ src={image ? image() : src}
54
+ width={width ? Number(width) : undefined}
55
+ height={height ? Number(height) : undefined}
56
+ {...rest}
57
+ />
58
+ )
59
+ }
60
+
61
+ <style is:global>
62
+ @layer fulldev {
63
+ .image {
64
+ @apply block;
65
+
66
+ &.position-contain {
67
+ @apply h-auto w-full object-contain;
68
+ }
69
+
70
+ &.position-cover {
71
+ @apply h-full w-full object-cover;
72
+ }
73
+
74
+ &.position-background {
75
+ @apply absolute inset-0 h-full max-h-none w-full max-w-none object-cover opacity-30;
76
+ }
77
+ }
78
+ }
79
+ </style>
@@ -0,0 +1,172 @@
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'
5
+ 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 {
9
+ default as Lead,
10
+ default as Paragraph,
11
+ } from 'fulldev-ui/components/Paragraph.astro'
12
+ import Tagline from 'fulldev-ui/components/Tagline.astro'
13
+ import Toc from 'fulldev-ui/components/Toc.astro'
14
+ import { crush } from 'radash'
15
+ import type Sidebar from './Sidebar.astro'
16
+
17
+ interface Props extends HTMLAttributes<'div'> {
18
+ as?: HTMLTag | undefined
19
+ render?: any
20
+ sidebar?: ComponentProps<typeof Sidebar> | undefined
21
+ slug?: CollectionEntry<'pages'>['slug'] | undefined
22
+ toc?: boolean | ComponentProps<typeof Toc>['heading'] | undefined
23
+ tagline?: ComponentProps<typeof Tagline>['text'] | undefined
24
+ heading?: ComponentProps<typeof Heading>['text'] | undefined
25
+ image?: ComponentProps<typeof Image> | undefined
26
+ lead?: ComponentProps<typeof Lead>['text'] | undefined
27
+ }
28
+
29
+ const {
30
+ toc = false,
31
+ slug,
32
+ sidebar,
33
+ render,
34
+ tagline,
35
+ heading,
36
+ lead,
37
+ image,
38
+ ...rest
39
+ } = Astro.props
40
+
41
+ const Content = render && (await render())?.Content
42
+
43
+ const flatMenu = crush(sidebar?.menu ?? {})
44
+ const slugs = Object.entries(flatMenu)
45
+ .map(([key, value]) => (key.endsWith('.slug') ? value : null))
46
+ .filter(Boolean)
47
+ const slugIndex = slugs.findIndex((val) => val === slug)
48
+
49
+ const prevSlug = slugs[slugIndex - 1]
50
+ const nextSlug = slugs[slugIndex + 1]
51
+ ---
52
+
53
+ <Element
54
+ class:list="prose"
55
+ {...rest}
56
+ >
57
+ <Element class:list="prose-container">
58
+ <Element class:list="prose-content">
59
+ <Tagline text={tagline} />
60
+ <Heading
61
+ as="h1"
62
+ level={2}
63
+ text={heading}
64
+ />
65
+ <Paragraph text={lead} />
66
+ <Image {...image} />
67
+ {Content && <Content />}
68
+ <slot />
69
+ <Element class:list="prose-footer">
70
+ <Button
71
+ class:list="prose-prev"
72
+ icon={prevSlug && 'arrow-left'}
73
+ slug={prevSlug}
74
+ variant="secondary"
75
+ />
76
+ <Button
77
+ class:list="prose-next"
78
+ icon={nextSlug && 'arrow-right'}
79
+ slug={nextSlug}
80
+ variant="secondary"
81
+ reverse
82
+ />
83
+ </Element>
84
+ </Element>
85
+ <Toc
86
+ if={toc}
87
+ heading={typeof toc === 'string' ? toc : undefined}
88
+ {render}
89
+ />
90
+ </Element>
91
+ </Element>
92
+
93
+ <style is:global>
94
+ @layer fulldev {
95
+ .prose {
96
+ @apply relative items-start py-28 first:pt-14;
97
+
98
+ .prose-container {
99
+ @apply container flex h-full w-full flex-grow items-start justify-evenly gap-14 gap-x-gutter;
100
+ }
101
+
102
+ .prose-content {
103
+ @apply w-full max-w-screen-md;
104
+
105
+ > * {
106
+ @apply mt-6 first:mt-0;
107
+ }
108
+
109
+ p {
110
+ @apply mt-4 first:mt-0;
111
+ }
112
+
113
+ code:not(.astro-code code) {
114
+ @apply rounded bg-muted px-1.5 py-0.5 font-mono text-sm font-medium;
115
+ }
116
+
117
+ h1,
118
+ h2,
119
+ h3,
120
+ h4,
121
+ h5,
122
+ h6 {
123
+ @apply mt-8 scroll-m-20 font-semibold first:mt-0;
124
+
125
+ code {
126
+ font-size: inherit !important;
127
+ }
128
+ }
129
+
130
+ > h1 {
131
+ @apply text-4xl font-extrabold;
132
+ }
133
+
134
+ > h2 {
135
+ @apply text-2xl;
136
+ }
137
+
138
+ > h3 {
139
+ @apply text-xl;
140
+ }
141
+
142
+ > h4 {
143
+ @apply text-lg;
144
+ }
145
+
146
+ > h5 {
147
+ @apply text-base;
148
+ }
149
+
150
+ > h6 {
151
+ @apply text-sm;
152
+ }
153
+
154
+ > aside {
155
+ @apply mt-6 rounded-md border border-destructive p-4 text-destructive first:mt-0;
156
+ }
157
+ }
158
+
159
+ .prose-footer {
160
+ @apply mt-14 flex items-center;
161
+
162
+ .prose-next {
163
+ @apply ml-auto;
164
+ }
165
+ }
166
+
167
+ .toc {
168
+ @apply order-last;
169
+ }
170
+ }
171
+ }
172
+ </style>