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,62 +1,48 @@
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
20
- reverse?: boolean | undefined
13
+ for?: HTMLAttributes<'label'>['for']
21
14
  }
22
15
 
23
16
  const {
24
- slug,
25
- href = slug === 'index' ? '/' : slug ? `/${slug}/` : undefined,
26
- text = slug ? (await getEntry('pages', slug)).data.title : undefined,
17
+ href,
27
18
  as = href ? 'a' : 'button',
28
- type = as === 'button' ? 'button' : undefined,
29
- target = href?.startsWith('http') ? '_blank' : undefined,
30
19
  variant = 'primary',
31
20
  size = 'md',
21
+ text,
32
22
  icon,
33
- reverse,
34
23
  ...rest
35
24
  } = Astro.props
36
25
  ---
37
26
 
38
27
  <Element
39
28
  class:list={['button']}
40
- {href}
41
29
  {as}
42
- {type}
43
- {target}
30
+ {href}
44
31
  {variant}
45
32
  {size}
46
- {reverse}
47
33
  {...rest}
48
34
  >
49
- <Icon name={icon} />
50
35
  <Element as="span">
51
36
  <Fragment set:html={text} />
52
37
  <slot />
53
38
  </Element>
39
+ <Icon name={icon} />
54
40
  </Element>
55
41
 
56
42
  <style is:global>
57
43
  @layer fulldev {
58
44
  .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;
45
+ @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
46
  @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
61
47
  @apply disabled:pointer-events-none disabled:opacity-50;
62
48
 
@@ -1,59 +1,28 @@
1
1
  ---
2
- import type { ComponentProps, HTMLAttributes } from 'astro/types'
2
+ import type { ComponentProps } from 'astro/types'
3
3
  import Button from 'fulldev-ui/components/Button.astro'
4
- import Element from 'fulldev-ui/components/Element.astro'
5
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
6
4
 
7
- interface Props extends GlobalProps, HTMLAttributes<'div'> {
8
- variant?: ComponentProps<typeof Button>['variant']
5
+ interface Props extends ComponentProps<typeof Button> {
9
6
  button?: ComponentProps<typeof Button> | undefined
10
7
  buttons?: ComponentProps<typeof Button>[] | undefined
11
- direction?: 'row' | 'column' | undefined
12
8
  }
13
9
 
14
- const {
15
- direction = 'row',
16
- variant = 'primary',
17
- buttons = [],
18
- button,
19
- size,
20
- ...rest
21
- } = Astro.props
10
+ const { variant = 'primary', button, buttons, ...rest } = Astro.props
22
11
 
23
12
  const buttonVariant = (i: number) => {
24
13
  if (variant === 'primary' && i === 0) return 'primary'
25
14
  else if (variant === 'primary' && i === 1) return 'secondary'
26
- else if (variant === 'primary' && i > 1) return 'ghost'
27
15
  else if (variant === 'secondary' && i === 0) return 'secondary'
28
16
  else return 'ghost'
29
17
  }
30
18
  ---
31
19
 
32
- <Element
33
- class:list="buttons"
34
- {direction}
35
- {...rest}
36
- >
37
- {
38
- [button, ...buttons].filter(Boolean).map((button, i) => (
39
- <Button
40
- variant={buttonVariant(i)}
41
- {size}
42
- {...button}
43
- />
44
- ))
45
- }
46
- <slot />
47
- </Element>
48
-
49
- <style is:global>
50
- @layer fulldev {
51
- .buttons {
52
- @apply inline-flex flex-wrap justify-stretch gap-2;
53
-
54
- &.direction-column {
55
- @apply flex-col items-start;
56
- }
57
- }
58
- }
59
- </style>
20
+ {
21
+ [button, ...(buttons || [])].filter(Boolean).map((button, i) => (
22
+ <Button
23
+ variant={buttonVariant(i)}
24
+ {...rest}
25
+ {...button}
26
+ />
27
+ ))
28
+ }
@@ -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
  }
@@ -8,15 +8,9 @@ import Icon from './Icon.astro'
8
8
  import Input from './Input.astro'
9
9
  import Select from './Select.astro'
10
10
 
11
- interface Props extends ComponentProps<typeof Drawer> {}
11
+ interface Props extends Omit<ComponentProps<typeof Drawer>, 'id' | 'icon'> {}
12
12
 
13
- const {
14
- icon = 'shopping-cart',
15
- color = 'brand',
16
- id = 'cart',
17
- if: ifProp,
18
- ...rest
19
- } = Astro.props
13
+ const { variant = 'ghost', size = 'md', ...rest } = Astro.props
20
14
  ---
21
15
 
22
16
  <Select if={false} />
@@ -25,11 +19,12 @@ const {
25
19
  <Icon if={false} />
26
20
 
27
21
  <Drawer
28
- if={ifProp}
29
22
  class:list="cart"
23
+ id="cart"
24
+ icon="shopping-cart"
25
+ {variant}
26
+ {size}
30
27
  {icon}
31
- {color}
32
- {id}
33
28
  {...rest}
34
29
  >
35
30
  <CartList client:load />
@@ -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>
@@ -1,142 +1,80 @@
1
1
  ---
2
2
  import type { ComponentProps, HTMLAttributes } from 'astro/types'
3
- import Button from 'fulldev-ui/components/Button.astro'
4
3
  import Element from 'fulldev-ui/components/Element.astro'
5
- import Logo from 'fulldev-ui/components/Logo.astro'
6
- import Menu from 'fulldev-ui/components/Menu.astro'
7
- import links from 'fulldev-ui/schemas/components/links'
8
- import type { GlobalProps } from 'fulldev-ui/types/global-props'
9
- import Buttons from './Buttons.astro'
10
- import Heading from './Heading.astro'
11
- import Links from './Links.astro'
4
+ import Button from './Button.astro'
12
5
 
13
- interface Props extends GlobalProps, HTMLAttributes<'aside'> {
14
- variant?: ComponentProps<typeof Button>['variant']
15
- text?: ComponentProps<typeof Button>['text']
16
- icon?: ComponentProps<typeof Button>['icon']
17
- heading?: ComponentProps<typeof Heading>['text']
18
- logo?: ComponentProps<typeof Logo> | undefined
19
- company?: ComponentProps<typeof Logo>['company']
20
- menu?: ComponentProps<typeof Menu>['groups']
21
- buttons?: ComponentProps<typeof Buttons>['buttons']
22
- links?: ComponentProps<typeof Links>['links']
23
- size?: 'sm' | 'md' | 'lg' | undefined
6
+ interface Props
7
+ extends HTMLAttributes<'aside'>,
8
+ Pick<ComponentProps<typeof Button>, 'variant' | 'size' | 'text' | 'icon'> {
9
+ id: string
10
+ icon: string
24
11
  }
25
12
 
26
- const {
27
- id = 'drawer',
28
- size = 'sm',
29
- icon = 'menu-2',
30
- color,
31
- variant,
32
- text,
33
- buttons,
34
- links,
35
- heading,
36
- logo,
37
- company,
38
- menu,
39
- if: ifProp,
40
- ...rest
41
- } = Astro.props
42
- ---
13
+ const { id, variant = 'ghost', size = 'md', icon, text, ...rest } = Astro.props
43
14
 
44
- <Button
45
- variant="secondary"
46
- class:list={['drawer-button', `${id}-button`]}
47
- onclick={`document.getElementById('${id}').showModal()`}
48
- {variant}
49
- {text}
50
- {icon}
51
- {color}
52
- {size}
53
- />
15
+ const slot = await Astro.slots.render('default')
16
+ const render = slot?.trim().length > 0
17
+ ---
54
18
 
55
- <Element
56
- onclick={`event.target === this && this.close()`}
57
- class:list="drawer"
58
- as="dialog"
59
- {id}
60
- {text}
61
- {size}
62
- {icon}
63
- {...rest}
64
- >
65
- <Element class:list="drawer-body">
66
- <button autofocus></button>
67
- <Element
68
- class:list="drawer-header"
69
- as="header"
70
- >
71
- <Logo
19
+ {
20
+ render && (
21
+ <Element class:list="drawer">
22
+ <Button
23
+ class="drawer-button"
24
+ as="label"
25
+ for={id}
26
+ {variant}
72
27
  {size}
73
- {company}
74
- {...logo}
28
+ {text}
29
+ {icon}
75
30
  />
76
- <Heading
77
- level={4}
78
- text={heading}
79
- />
80
- <Button
81
- variant="secondary"
82
- icon="x"
83
- onclick={`document.getElementById('${id}').close()`}
31
+
32
+ <input
33
+ type="checkbox"
34
+ class="drawer-checkbox"
35
+ name={id}
36
+ {id}
84
37
  />
85
- <slot name="header" />
86
- </Element>
87
- <Element class:list="drawer-content">
88
- <Links
89
- direction="column"
90
- {links}
38
+
39
+ <Element
40
+ class:list="drawer-body"
41
+ as="aside"
42
+ {...rest}
43
+ >
44
+ <Fragment set:html={slot} />
45
+ </Element>
46
+
47
+ <label
48
+ for={id}
49
+ class="drawer-backdrop"
91
50
  />
92
- <Menu groups={menu} />
93
- <slot />
94
- </Element>
95
- <Element
96
- class:list="drawer-footer"
97
- as="footer"
98
- >
99
- <slot name="footer" />
100
51
  </Element>
101
- </Element>
102
- </Element>
52
+ )
53
+ }
103
54
 
104
55
  <style is:global>
105
56
  @layer fulldev {
106
- body:has(dialog[open]) {
107
- @apply max-md:overflow-hidden;
108
- }
109
-
110
57
  .drawer {
111
- @apply inset-0 m-0 h-full max-h-full w-full max-w-full p-0 md:max-w-md;
112
-
113
- &::backdrop {
114
- @apply cursor-pointer bg-background/50;
115
- }
116
-
117
- .drawer-body {
118
- @apply flex h-full shrink flex-col overflow-auto bg-background;
58
+ @apply contents;
59
+ }
119
60
 
120
- .drawer-content {
121
- @apply flex flex-col gap-6 px-gutter py-12;
122
- }
61
+ .drawer-checkbox {
62
+ @apply invisible hidden;
63
+ }
123
64
 
124
- .drawer-header,
125
- .drawer-footer {
126
- @apply sticky z-10 flex shrink-0 bg-background;
127
- }
65
+ .drawer-backdrop {
66
+ @apply pointer-events-none invisible fixed left-0 top-0 z-30 h-full w-full bg-black opacity-0 transition-opacity;
128
67
 
129
- .drawer-header {
130
- @apply top-0 h-14 items-center px-gutter;
68
+ &:is(.drawer-checkbox:checked ~ &) {
69
+ @apply pointer-events-auto visible opacity-50;
70
+ }
71
+ }
131
72
 
132
- .button {
133
- @apply ml-auto;
134
- }
135
- }
73
+ .drawer-body {
74
+ @apply fixed bottom-0 left-0 top-0 z-40 h-full w-80 max-w-[75vw] -translate-x-full rounded-r-lg border border-l-0 bg-background shadow-2xl transition-transform;
136
75
 
137
- .drawer-footer {
138
- @apply bottom-0 mt-auto flex-col px-gutter py-8;
139
- }
76
+ &:is(.drawer-checkbox:checked ~ &) {
77
+ @apply translate-x-0;
140
78
  }
141
79
  }
142
80
  }