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
@@ -0,0 +1,56 @@
1
+ ---
2
+ import Buttons from 'fulldev-ui/components/Buttons.astro'
3
+ import Container from 'fulldev-ui/components/Container.astro'
4
+ import Element from 'fulldev-ui/components/Element.astro'
5
+ import Heading from 'fulldev-ui/components/Heading.astro'
6
+ import Paragraph from 'fulldev-ui/components/Paragraph.astro'
7
+ import Section from 'fulldev-ui/components/Section.astro'
8
+ import Tagline from 'fulldev-ui/components/Tagline.astro'
9
+ import type { IntroSchema } from 'fulldev-ui/schemas/blocks/intro.ts'
10
+ import type { ComponentProps } from 'svelte'
11
+
12
+ interface Props extends ComponentProps<typeof Section>, IntroSchema {}
13
+
14
+ const { tagline, heading, paragraph, buttons, ...rest } = Astro.props
15
+ ---
16
+
17
+ <Section
18
+ class:list="intro-1"
19
+ {...rest}
20
+ >
21
+ <Container>
22
+ <Element class="intro-1-content">
23
+ <Tagline
24
+ size="sm"
25
+ text={tagline}
26
+ />
27
+ <Heading
28
+ as="h1"
29
+ size="3xl"
30
+ text={heading}
31
+ />
32
+ <Paragraph
33
+ size="md"
34
+ text={paragraph}
35
+ />
36
+ </Element>
37
+ <Buttons
38
+ size="sm"
39
+ {buttons}
40
+ />
41
+ </Container>
42
+ </Section>
43
+
44
+ <style is:global>
45
+ @layer fulldev {
46
+ .intro-1 {
47
+ .container {
48
+ @apply flex flex-col items-center gap-8 text-center;
49
+ }
50
+
51
+ .intro-1-content {
52
+ @apply flex max-w-screen-md flex-col items-center gap-4 text-center;
53
+ }
54
+ }
55
+ }
56
+ </style>
@@ -0,0 +1,90 @@
1
+ ---
2
+ import type { ComponentProps } from 'astro/types'
3
+ import { getEntries } from 'astro:content'
4
+ import Button from 'fulldev-ui/components/Button.astro'
5
+ import Card from 'fulldev-ui/components/Card.astro'
6
+ import Container from 'fulldev-ui/components/Container.astro'
7
+ import Element from 'fulldev-ui/components/Element.astro'
8
+ import Heading from 'fulldev-ui/components/Heading.astro'
9
+ import Image from 'fulldev-ui/components/Image.astro'
10
+ import Price from 'fulldev-ui/components/Price.astro'
11
+ import Section from 'fulldev-ui/components/Section.astro'
12
+ import type { ProductsSchema } from 'fulldev-ui/schemas/blocks/products'
13
+ import { getHref } from 'fulldev-ui/utils/getHref'
14
+
15
+ interface Props extends ComponentProps<typeof Section>, ProductsSchema {}
16
+
17
+ const { heading, button, products, ...rest } = Astro.props
18
+
19
+ const entries = products && (await getEntries(products))
20
+ ---
21
+
22
+ <Section
23
+ class:list="products-1"
24
+ {...rest}
25
+ >
26
+ <Container>
27
+ <Element class:list="products-1-segment">
28
+ <Heading
29
+ size="2xl"
30
+ text={heading}
31
+ />
32
+ <Button
33
+ variant="ghost"
34
+ size="sm"
35
+ {...button}
36
+ />
37
+ </Element>
38
+ <Element class:list="products-1-cards">
39
+ {
40
+ entries?.map(({ collection, slug, data: { images, title, price } }) => (
41
+ <Card href={getHref(collection, slug)}>
42
+ <Image {...images?.[0]} />
43
+ <Element class:list="products-1-card-content">
44
+ <Heading
45
+ as="h3"
46
+ size="md"
47
+ text={title}
48
+ />
49
+ <Price amount={price} />
50
+ </Element>
51
+ </Card>
52
+ ))
53
+ }
54
+ </Element>
55
+ </Container>
56
+ </Section>
57
+
58
+ <style is:global>
59
+ @layer fulldev {
60
+ .products-1 {
61
+ .container {
62
+ @apply flex flex-col gap-8;
63
+ }
64
+
65
+ .products-1-segment {
66
+ @apply flex items-center justify-between gap-8;
67
+ }
68
+
69
+ .products-1-cards {
70
+ @apply grid grid-cols-2 items-start gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6;
71
+ }
72
+
73
+ .card {
74
+ @apply relative flex flex-col gap-3;
75
+
76
+ &:hover > .image {
77
+ @apply opacity-75 transition-opacity;
78
+ }
79
+
80
+ .image {
81
+ @apply rounded-md border;
82
+ }
83
+ }
84
+
85
+ .products-1-card-content {
86
+ @apply flex h-full flex-col gap-2;
87
+ }
88
+ }
89
+ }
90
+ </style>
@@ -1,12 +1,13 @@
1
- ---
2
- import type { ComponentProps, HTMLAttributes, HTMLTag } from 'astro/types'
1
+ <!-- ---
2
+ import type { ComponentProps,HTMLAttributes,HTMLTag } from 'astro/types'
3
3
  import Badge from 'fulldev-ui/components/Badge.astro'
4
4
  import Buttons from 'fulldev-ui/components/Buttons.astro'
5
5
  import Element from 'fulldev-ui/components/Element.astro'
6
6
  import Heading from 'fulldev-ui/components/Heading.astro'
7
7
  import Image from 'fulldev-ui/components/Image.astro'
8
- import Lead from 'fulldev-ui/components/Lead.astro'
9
- import Paragraph from 'fulldev-ui/components/Paragraph.astro'
8
+ import Paragraph,{
9
+ default as Lead,
10
+ } from 'fulldev-ui/components/Paragraph.astro'
10
11
  import Rating from 'fulldev-ui/components/Rating.astro'
11
12
  import Tagline from 'fulldev-ui/components/Tagline.astro'
12
13
 
@@ -69,7 +70,7 @@ const {
69
70
  {level}
70
71
  {size}
71
72
  />
72
- <Lead
73
+ <Paragraph
73
74
  text={lead}
74
75
  {size}
75
76
  />
@@ -241,4 +242,4 @@ const {
241
242
  }
242
243
  }
243
244
  }
244
- </style>
245
+ </style> -->
@@ -1,31 +1,24 @@
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 { BadgeSchema } from 'fulldev-ui/schemas/components/badge'
8
6
 
9
7
  interface Props
10
- extends GlobalProps,
11
- HTMLAttributes<'div'>,
12
- HTMLAttributes<'a'> {
8
+ extends HTMLAttributes<'button'>,
9
+ Omit<HTMLAttributes<'a'>, 'href' | 'target'>,
10
+ BadgeSchema {
13
11
  as?: HTMLTag
14
- href?: string | null | undefined
15
- icon?: ComponentProps<typeof Icon>['name']
16
- slug?: CollectionEntry<'pages'>['slug'] | undefined
17
- variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | undefined
18
- text?: string | undefined
12
+ type?: HTMLAttributes<'button'>['type'] & HTMLAttributes<'a'>['type']
13
+ reverse?: boolean | undefined
19
14
  }
20
15
 
21
16
  const {
22
- slug,
23
- href = slug === 'index' ? '/' : slug ? `/${slug}/` : undefined,
24
- text = slug ? (await getEntry('pages', slug)).data.title : undefined,
25
- as = href ? 'a' : 'div',
26
- target = href?.startsWith('http') ? '_blank' : undefined,
17
+ href,
18
+ as = href ? 'a' : 'button',
27
19
  variant = 'outline',
28
20
  size = 'md',
21
+ text,
29
22
  icon,
30
23
  ...rest
31
24
  } = Astro.props
@@ -35,7 +28,6 @@ const {
35
28
  class:list="badge"
36
29
  {as}
37
30
  {href}
38
- {target}
39
31
  {variant}
40
32
  {size}
41
33
  {...rest}
@@ -0,0 +1,26 @@
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="banner"
14
+ {as}
15
+ {...rest}
16
+ >
17
+ <slot />
18
+ </Element>
19
+
20
+ <style is:global>
21
+ @layer fulldev {
22
+ .banner {
23
+ @apply relative flex w-full items-center bg-primary py-3;
24
+ }
25
+ }
26
+ </style>
@@ -0,0 +1,49 @@
1
+ ---
2
+ import { getEntries } from 'astro:content'
3
+ import type { BannerSchema } from 'fulldev-ui/schemas/blocks/banner'
4
+ import type { CategoriesSchema } from 'fulldev-ui/schemas/blocks/categories'
5
+ import type { CtaSchema } from 'fulldev-ui/schemas/blocks/cta'
6
+ import type { FeatureSchema } from 'fulldev-ui/schemas/blocks/feature'
7
+ import type { HeroSchema } from 'fulldev-ui/schemas/blocks/hero'
8
+ import type { ProductsSchema } from 'fulldev-ui/schemas/blocks/products'
9
+ import type { FooterSchema } from 'fulldev-ui/schemas/components/footer'
10
+ import type { HeaderSchema } from 'fulldev-ui/schemas/components/header'
11
+
12
+ interface Props
13
+ extends HeroSchema,
14
+ CtaSchema,
15
+ FeatureSchema,
16
+ CategoriesSchema,
17
+ ProductsSchema,
18
+ HeaderSchema,
19
+ FooterSchema,
20
+ BannerSchema {
21
+ _block: string
22
+ }
23
+
24
+ let { _block, products, categories, ...rest } = Astro.props
25
+
26
+ products = products && (await getEntries(products))
27
+ categories = categories && (await getEntries(categories))
28
+
29
+ const blocks = {
30
+ ...import.meta.glob('/src/blocks/**/*.astro'),
31
+ ...import.meta.glob('../blocks/**/*.astro'),
32
+ }
33
+
34
+ const path = Object.keys(blocks).find(
35
+ (path) => path.split('/').pop()?.split('.')[0] === _block
36
+ )
37
+
38
+ const BlockComponent = path && (await (blocks[path] as any)()).default
39
+ ---
40
+
41
+ {
42
+ BlockComponent && (
43
+ <BlockComponent
44
+ {products}
45
+ {categories}
46
+ {...rest}
47
+ />
48
+ )
49
+ }
@@ -0,0 +1,26 @@
1
+ ---
2
+ import type { ComponentProps, HTMLAttributes } from 'astro/types'
3
+ import Block from 'fulldev-ui/components/Block.astro'
4
+ import Element from 'fulldev-ui/components/Element.astro'
5
+
6
+ interface Props extends HTMLAttributes<'div'> {
7
+ blocks?: ComponentProps<typeof Block>[] | undefined
8
+ }
9
+
10
+ const { blocks, ...rest } = Astro.props
11
+ ---
12
+
13
+ <Element
14
+ class:list="blocks"
15
+ {...rest}
16
+ >
17
+ {blocks?.map((block) => <Block {...block} />)}
18
+ </Element>
19
+
20
+ <style is:global>
21
+ @layer fulldev {
22
+ .blocks {
23
+ @apply flex flex-col;
24
+ }
25
+ }
26
+ </style>
@@ -1,49 +1,36 @@
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 { ButtonSchema } from 'fulldev-ui/schemas/components/button'
8
6
 
9
7
  interface Props
10
- extends GlobalProps,
11
- HTMLAttributes<'button'>,
12
- HTMLAttributes<'a'> {
8
+ extends HTMLAttributes<'button'>,
9
+ Omit<HTMLAttributes<'a'>, 'href' | 'target'>,
10
+ ButtonSchema {
13
11
  as?: HTMLTag
14
- href?: string | null | undefined
15
12
  type?: HTMLAttributes<'button'>['type'] & HTMLAttributes<'a'>['type']
16
- icon?: ComponentProps<typeof Icon>['name']
17
- slug?: CollectionEntry<'pages'>['slug'] | undefined
18
- variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | undefined
19
- text?: string | undefined
13
+ for?: HTMLAttributes<'label'>['for']
20
14
  reverse?: boolean | undefined
21
15
  }
22
16
 
23
17
  const {
24
- slug,
25
- href = slug === 'index' ? '/' : slug ? `/${slug}/` : undefined,
26
- text = slug ? (await getEntry('pages', slug)).data.title : undefined,
18
+ href,
27
19
  as = href ? 'a' : 'button',
28
- type = as === 'button' ? 'button' : undefined,
29
- target = href?.startsWith('http') ? '_blank' : undefined,
30
20
  variant = 'primary',
31
21
  size = 'md',
22
+ text,
32
23
  icon,
33
- reverse,
34
24
  ...rest
35
25
  } = Astro.props
36
26
  ---
37
27
 
38
28
  <Element
39
29
  class:list={['button']}
40
- {href}
41
30
  {as}
42
- {type}
43
- {target}
31
+ {href}
44
32
  {variant}
45
33
  {size}
46
- {reverse}
47
34
  {...rest}
48
35
  >
49
36
  <Icon name={icon} />
@@ -56,7 +43,7 @@ const {
56
43
  <style is:global>
57
44
  @layer fulldev {
58
45
  .button {
59
- @apply inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium leading-none ring-offset-background transition-colors;
46
+ @apply inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium leading-none ring-offset-background transition-colors;
60
47
  @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
61
48
  @apply disabled:pointer-events-none disabled:opacity-50;
62
49
 
@@ -1,172 +1,30 @@
1
1
  ---
2
- import { getEntry } from 'astro:content'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
3
  import Element from 'fulldev-ui/components/Element.astro'
4
- import Icon from 'fulldev-ui/components/Icon.astro'
5
- import Image from 'fulldev-ui/components/Image.astro'
6
- import Price from 'fulldev-ui/components/Price.astro'
7
- import Heading from './Heading.astro'
8
- import Lead from './Lead.astro'
9
- import Paragraph from './Paragraph.astro'
10
- import Rating from './Rating.astro'
11
4
 
12
- // interface Props
13
- // extends GlobalProps,
14
- // ComponentProps<typeof Writeup>,
15
- // Omit<HTMLAttributes<'a'>, 'title'> {
16
- // image?: ComponentProps<typeof Image>
17
- // images?: ComponentProps<typeof Image>[]
18
- // position?: ComponentProps<typeof Image>['position']
19
- // buttons?: ComponentProps<typeof Buttons>['buttons']
20
- // button?: ComponentProps<typeof Button> | undefined
21
- // variant?: ComponentProps<typeof Button>['variant']
22
- // align?: ComponentProps<typeof Writeup>['align']
23
- // icon?: ComponentProps<typeof Icon>['name']
24
- // price?: ComponentProps<typeof Price>['value']
25
- // slug?: CollectionEntry<'pages'>['slug'] | undefined
26
- // id?: any
27
- // panel?: boolean | undefined
28
- // title?: ComponentProps<typeof Writeup>['heading']
29
- // }
30
-
31
- const { slug, ...props } = Astro.props
32
- const page = slug && (await getEntry('pages', slug))
33
-
34
- const merged = {
35
- ...props,
36
- ...page?.data,
5
+ interface Props extends HTMLAttributes<'a'>, HTMLAttributes<'div'> {
6
+ as?: HTMLTag
37
7
  }
38
8
 
39
- const {
40
- href = slug === 'index' ? undefined : `/${slug}/`,
41
- as = href ? 'a' : 'div',
42
- heading = page?.data.title || props.title,
43
- image = page?.data.images?.[0] || props.images?.[0],
44
- size = 'md',
45
- panel = true,
46
- inset = panel,
47
- level = 3,
48
- lead,
49
- paragraph,
50
- rating,
51
- price,
52
- icon,
53
- position,
54
- ...rest
55
- } = merged
9
+ const { href, as = href ? 'a' : 'div', ...rest } = Astro.props
56
10
  ---
57
11
 
58
12
  <Element
59
13
  class:list="card"
60
- as={href ? 'a' : 'div'}
14
+ {as}
61
15
  {href}
62
- {panel}
63
- {inset}
64
- {size}
65
16
  {...rest}
66
17
  >
67
- <Image
68
- position={panel ? position : undefined}
69
- {...image}
70
- />
71
- <Element class:list="card-content">
72
- <Icon name={icon} />
73
- <Rating
74
- {size}
75
- value={rating}
76
- />
77
- <Heading
78
- {size}
79
- {level}
80
- text={heading}
81
- />
82
- <Lead
83
- {size}
84
- text={lead}
85
- />
86
- <Paragraph
87
- {size}
88
- text={paragraph}
89
- />
90
- <Price value={price} />
91
- </Element>
92
18
  <slot />
93
19
  </Element>
94
20
 
95
21
  <style is:global>
96
22
  @layer fulldev {
97
23
  .card {
98
- @apply relative flex flex-col items-start;
99
-
100
- &:is(a[href]):hover > .image {
101
- @apply opacity-50 transition;
102
- }
103
-
104
- .card-content {
105
- @apply flex flex-col;
106
- }
107
-
108
- &.panel {
109
- @apply overflow-hidden rounded-md border bg-card;
110
- }
111
-
112
- &.size-sm {
113
- @apply gap-4;
114
-
115
- .card-content {
116
- @apply gap-2;
117
- }
118
-
119
- &.panel {
120
- @apply p-4;
121
- }
122
-
123
- &.inset {
124
- @apply gap-0 p-0;
125
-
126
- .card-content {
127
- @apply p-4;
128
- }
129
- }
130
- }
131
-
132
- &.size-md {
133
- @apply gap-5;
134
-
135
- .card-content {
136
- @apply gap-2.5;
137
- }
138
-
139
- &.panel {
140
- @apply p-5;
141
- }
142
-
143
- &.inset {
144
- @apply gap-0 p-0;
145
-
146
- .card-content {
147
- @apply p-5;
148
- }
149
- }
150
- }
151
-
152
- &.size-lg {
153
- @apply gap-6;
154
-
155
- .card-content {
156
- @apply gap-3;
157
- }
158
-
159
- &.panel {
160
- @apply p-6;
161
- }
162
-
163
- &.inset {
164
- @apply gap-0 p-0;
24
+ @apply w-full rounded-lg border bg-card p-4 text-card-foreground;
165
25
 
166
- .card-content {
167
- @apply p-6;
168
- }
169
- }
26
+ &:is(a[href]) {
27
+ @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
170
28
  }
171
29
  }
172
30
  }
@@ -27,6 +27,7 @@ const {
27
27
  <Drawer
28
28
  if={ifProp}
29
29
  class:list="cart"
30
+ variant="secondary"
30
31
  {icon}
31
32
  {color}
32
33
  {id}
@@ -3,7 +3,7 @@ import { STRIPE_RESTRICTED_KEY, URL } from 'astro:env/client'
3
3
  import CartCheckout from './CartCheckout.svelte'
4
4
  import CartTotal from './CartTotal.svelte'
5
5
  import Element from './Element.astro'
6
- import Text from './Text.astro'
6
+ import Paragraph from './Paragraph.astro'
7
7
 
8
8
  interface Props {}
9
9
 
@@ -18,14 +18,14 @@ const { ...rest } = Astro.props
18
18
  class="row"
19
19
  {...rest}
20
20
  >
21
- <Text
21
+ <Paragraph
22
22
  class:list="total"
23
23
  text="Totaal"
24
24
  contrast
25
25
  />
26
26
  <CartTotal client:load />
27
27
  </div>
28
- <Text
28
+ <Paragraph
29
29
  class:list="shipping"
30
30
  text="Verzendkosten worden berekend bij het afrekenen."
31
31
  />
@@ -1,20 +1,11 @@
1
1
  ---
2
- import type { ComponentProps } from 'astro/types'
2
+ import type { HTMLAttributes } from 'astro/types'
3
3
  import Button from 'fulldev-ui/components/Button.astro'
4
4
  import Element from 'fulldev-ui/components/Element.astro'
5
5
  import Heading from 'fulldev-ui/components/Heading.astro'
6
- import Text from 'fulldev-ui/components/Text.astro'
7
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
6
+ import type { ChannelSchema } from 'fulldev-ui/schemas/components/channel'
8
7
 
9
- interface Props extends GlobalProps, ComponentProps<typeof Button> {
10
- variant?: ComponentProps<typeof Button>['variant']
11
- icon?: ComponentProps<typeof Button>['icon']
12
- href?: ComponentProps<typeof Button>['href']
13
- heading?: ComponentProps<typeof Heading>['text']
14
- text?: ComponentProps<typeof Text>['text']
15
- structure?: 'row' | 'column' | undefined
16
- align?: 'start' | 'center' | undefined
17
- }
8
+ interface Props extends HTMLAttributes<'div'>, ChannelSchema {}
18
9
 
19
10
  const {
20
11
  variant = 'secondary',
@@ -40,9 +31,9 @@ const {
40
31
  />
41
32
  <Element class:list="channel-content">
42
33
  <Heading
43
- level={6}
34
+ as="h6"
35
+ size="sm"
44
36
  text={heading}
45
- {size}
46
37
  />
47
38
  <Fragment set:html={text} />
48
39
  <slot />
@@ -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="container"
14
+ {...rest}
15
+ >
16
+ <slot />
17
+ </Element>
18
+
19
+ <style is:global>
20
+ @layer fulldev {
21
+ .container {
22
+ @apply mx-auto w-full max-w-screen-2xl px-gutter;
23
+ }
24
+ }
25
+ </style>