fulldev-ui 0.5.0-beta.8 → 0.6.0-beta.0

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 (236) hide show
  1. package/.env.example +3 -0
  2. package/.prettierrc.yaml +1 -0
  3. package/astro.config.ts +6 -32
  4. package/package.json +21 -30
  5. package/pnpm-lock.yaml +696 -2176
  6. package/public/favicon/android-chrome-192x192.png +0 -0
  7. package/public/favicon/android-chrome-512x512.png +0 -0
  8. package/public/favicon/apple-touch-icon.png +0 -0
  9. package/public/favicon/manifest.webmanifest +7 -3
  10. package/public/favicon/mstile-150x150.png +0 -0
  11. package/src/blocks/Banner.astro +6 -19
  12. package/src/blocks/Colleagues.astro +0 -1
  13. package/src/blocks/Contact.astro +75 -74
  14. package/src/blocks/Content.astro +124 -6
  15. package/src/blocks/Cta.astro +0 -2
  16. package/src/blocks/Excerpt.astro +0 -2
  17. package/src/blocks/Footer.astro +107 -3
  18. package/src/blocks/Hero.astro +238 -9
  19. package/src/blocks/Intro.astro +89 -11
  20. package/src/blocks/Prices.astro +1 -1
  21. package/src/blocks/Product.astro +51 -68
  22. package/src/blocks/Products.astro +114 -5
  23. package/src/blocks/Reviews.astro +0 -1
  24. package/src/blocks/_Contact.astro +112 -0
  25. package/src/components/Avatar.astro +28 -9
  26. package/src/components/Avatars.astro +36 -0
  27. package/src/components/Badge.astro +73 -26
  28. package/src/components/Badges.astro +16 -23
  29. package/src/components/Breadcrumb.astro +58 -0
  30. package/src/components/Button.astro +56 -112
  31. package/src/components/Buttons.astro +23 -13
  32. package/src/components/Card.astro +129 -115
  33. package/src/components/Cards.astro +33 -35
  34. package/src/components/Carousel.astro +106 -0
  35. package/src/components/Cart.astro +1 -1
  36. package/src/components/CartForm.astro +9 -9
  37. package/src/components/CartList.astro +11 -28
  38. package/src/components/CartSummary.astro +11 -13
  39. package/src/components/Channel.astro +40 -22
  40. package/src/components/Channels.astro +20 -6
  41. package/src/components/Checkbox.astro +52 -27
  42. package/src/components/Code.astro +52 -0
  43. package/src/components/Dialog.astro +2 -2
  44. package/src/components/Drawer.astro +34 -64
  45. package/src/components/Element.astro +16 -8
  46. package/src/components/Form.astro +14 -13
  47. package/src/components/Gallery.astro +172 -0
  48. package/src/components/Head.astro +52 -1
  49. package/src/components/Header.astro +73 -83
  50. package/src/components/Heading.astro +74 -30
  51. package/src/components/Icon.astro +25 -30
  52. package/src/components/Image.astro +23 -38
  53. package/src/components/Input.astro +59 -53
  54. package/src/components/Label.astro +20 -15
  55. package/src/components/Lead.astro +46 -0
  56. package/src/components/Link.astro +51 -26
  57. package/src/components/Links.astro +42 -0
  58. package/src/components/List.astro +41 -16
  59. package/src/components/LocaleSwitcher.astro +2 -2
  60. package/src/components/Logo.astro +45 -0
  61. package/src/components/Menu.astro +21 -17
  62. package/src/components/Paragraph.astro +38 -0
  63. package/src/components/Price.astro +1 -1
  64. package/src/components/Prose.astro +169 -0
  65. package/src/components/Rating.astro +50 -38
  66. package/src/components/Search.astro +1 -1
  67. package/src/components/Section.astro +196 -158
  68. package/src/components/Select.astro +44 -55
  69. package/src/components/Sidebar.astro +31 -38
  70. package/src/components/Social.astro +3 -8
  71. package/src/components/Socials.astro +9 -5
  72. package/src/components/Subheader.astro +59 -0
  73. package/src/components/Switch.astro +72 -29
  74. package/src/components/Table.astro +1 -1
  75. package/src/components/Tagline.astro +40 -12
  76. package/src/components/Text.astro +4 -4
  77. package/src/components/Textarea.astro +40 -50
  78. package/src/components/Themer.astro +76 -0
  79. package/src/components/Toc.astro +24 -32
  80. package/src/components/Writeup.astro +26 -8
  81. package/src/components/docs/PropsTable.astro +38 -264
  82. package/src/components/experimental/Window.astro +5 -57
  83. package/src/components/sections.astro +1 -1
  84. package/src/content/pages/blocks/_categories.mdx +1 -1
  85. package/src/content/pages/blocks/_footer.mdx +1 -1
  86. package/src/content/pages/blocks/_header.mdx +1 -3
  87. package/src/content/pages/blocks/_jobs.mdx +1 -1
  88. package/src/content/pages/blocks/_prices.mdx +1 -1
  89. package/src/content/pages/blocks/_product.mdx +1 -1
  90. package/src/content/pages/blocks/_products.mdx +1 -1
  91. package/src/content/pages/blocks/_stats.mdx +1 -1
  92. package/src/content/pages/blocks/banner.mdx +1 -1
  93. package/src/content/pages/blocks/colleagues.mdx +1 -2
  94. package/src/content/pages/blocks/contact.mdx +1 -1
  95. package/src/content/pages/blocks/content.mdx +1 -5
  96. package/src/content/pages/blocks/cta.mdx +1 -9
  97. package/src/content/pages/blocks/features.mdx +1 -4
  98. package/src/content/pages/blocks/hero.mdx +1 -4
  99. package/src/content/pages/blocks/intro.mdx +1 -4
  100. package/src/content/pages/blocks/posts.mdx +1 -1
  101. package/src/content/pages/blocks/reviews.mdx +1 -2
  102. package/src/content/pages/docs/_internationalization.mdx +55 -0
  103. package/src/content/pages/docs/_using-blocks.mdx +33 -0
  104. package/src/content/pages/docs/_using-presets.mdx +49 -0
  105. package/src/content/pages/docs/blocks.mdx +33 -0
  106. package/src/content/pages/docs/collections/images.mdx +100 -0
  107. package/src/content/pages/docs/collections/pages.mdx +119 -0
  108. package/src/content/pages/docs/collections/presets.mdx +60 -0
  109. package/src/content/pages/docs/collections.mdx +42 -0
  110. package/src/content/pages/{base/card.mdx → docs/components/_card.mdx} +1 -3
  111. package/src/content/pages/{base → docs/components}/_switch.mdx +2 -2
  112. package/src/content/pages/{typography → docs/components}/_tagline.mdx +2 -2
  113. package/src/content/pages/docs/components/_toggle.mdx +31 -0
  114. package/src/content/pages/docs/components/avatar.mdx +35 -0
  115. package/src/content/pages/{base → docs/components}/badge.mdx +27 -8
  116. package/src/content/pages/docs/components/badges.mdx +47 -0
  117. package/src/content/pages/{base → docs/components}/button.mdx +29 -10
  118. package/src/content/pages/docs/components/buttons.mdx +52 -0
  119. package/src/content/pages/docs/components/channel.mdx +92 -0
  120. package/src/content/pages/docs/components/channels.mdx +90 -0
  121. package/src/content/pages/{base → docs/components}/checkbox.mdx +10 -17
  122. package/src/content/pages/docs/components/code.mdx +46 -0
  123. package/src/content/pages/docs/components/heading.mdx +60 -0
  124. package/src/content/pages/docs/components/icon.mdx +49 -0
  125. package/src/content/pages/docs/components/image.mdx +26 -0
  126. package/src/content/pages/docs/components/input.mdx +41 -0
  127. package/src/content/pages/{typography → docs/components}/label.mdx +8 -4
  128. package/src/content/pages/docs/components/lead.mdx +51 -0
  129. package/src/content/pages/{typography → docs/components}/link.mdx +23 -8
  130. package/src/content/pages/docs/components/links.mdx +100 -0
  131. package/src/content/pages/docs/components/list.mdx +45 -0
  132. package/src/content/pages/docs/components/logo.mdx +37 -0
  133. package/src/content/pages/docs/components/menu.mdx +90 -0
  134. package/src/content/pages/docs/components/paragraph.mdx +51 -0
  135. package/src/content/pages/docs/components/prose.mdx +37 -0
  136. package/src/content/pages/docs/components/rating.mdx +77 -0
  137. package/src/content/pages/{base → docs/components}/section.mdx +1 -1
  138. package/src/content/pages/{base → docs/components}/select.mdx +0 -9
  139. package/src/content/pages/docs/components/social.mdx +95 -0
  140. package/src/content/pages/docs/components/socials.mdx +103 -0
  141. package/src/content/pages/docs/components/switch.mdx +35 -0
  142. package/src/content/pages/{base → docs/components}/table.mdx +0 -2
  143. package/src/content/pages/docs/components/tagline.mdx +47 -0
  144. package/src/content/pages/docs/components/textarea.mdx +35 -0
  145. package/src/content/pages/docs/components/themer.mdx +50 -0
  146. package/src/content/pages/docs/components.mdx +40 -0
  147. package/src/content/pages/docs/customization.mdx +151 -0
  148. package/src/content/pages/docs/frameworks.mdx +29 -0
  149. package/src/content/pages/docs/generating-pages.mdx +129 -0
  150. package/src/content/pages/docs/index.mdx +23 -0
  151. package/src/content/pages/docs/installation.mdx +50 -0
  152. package/src/content/pages/docs/layouts.mdx +33 -0
  153. package/src/content/pages/index.mdx +11 -9
  154. package/src/content/pages/showcase.mdx +4 -2
  155. package/src/content/presets/base.yml +80 -63
  156. package/src/content/presets/docs.yml +2 -2
  157. package/src/css/color.css +0 -10
  158. package/src/css/custom.css +10 -12
  159. package/src/css/size.css +2 -11
  160. package/src/css/theme.css +93 -0
  161. package/src/images/logo-1.svg +11 -0
  162. package/src/images/logo-2.svg +13 -0
  163. package/src/images/logo-basic.svg +10 -0
  164. package/src/images/logo-simple.svg +13 -0
  165. package/src/images/logo-thin.svg +15 -0
  166. package/src/images/logo.svg +14 -0
  167. package/src/images/logofat.svg +11 -0
  168. package/src/integration/index.ts +71 -144
  169. package/src/layouts/CategoryLayout.astro +135 -0
  170. package/src/layouts/Layout.astro +62 -117
  171. package/src/layouts/PageLayout.astro +26 -0
  172. package/src/layouts/PostLayout.astro +13 -8
  173. package/src/layouts/ProductLayout.astro +94 -10
  174. package/src/pages/[...page].astro +14 -22
  175. package/src/pages/test.astro +20 -0
  176. package/src/schemas/components/button.ts +21 -13
  177. package/src/schemas/components/card.ts +36 -18
  178. package/src/schemas/components/footer.ts +2 -10
  179. package/src/schemas/components/global.ts +16 -0
  180. package/src/schemas/components/header.ts +8 -0
  181. package/src/schemas/components/image.ts +8 -3
  182. package/src/schemas/components/link.ts +16 -0
  183. package/src/schemas/components/links.ts +4 -0
  184. package/src/schemas/components/menu.ts +2 -0
  185. package/src/schemas/components/sidebar.ts +2 -2
  186. package/src/schemas/components/subheader.ts +9 -0
  187. package/src/schemas/components/themer.ts +3 -0
  188. package/src/schemas/pageSchema.ts +14 -21
  189. package/src/utils/cart.ts +1 -10
  190. package/src/utils/getDeepReferenceChildren.ts +14 -0
  191. package/src/utils/getReferenceChildren.ts +1 -1
  192. package/src/utils/setTheme.ts +18 -0
  193. package/src/utils/slugify.ts +6 -0
  194. package/tailwind.config.ts +67 -0
  195. package/src/blocks/Article.astro +0 -40
  196. package/src/components/Footer.astro +0 -193
  197. package/src/components/ThemeSelect.astro +0 -41
  198. package/src/components/experimental/Form.astro +0 -53
  199. package/src/components/experimental/Gallery.astro +0 -104
  200. package/src/components/experimental/Logo.astro +0 -38
  201. package/src/components/experimental/Prose.astro +0 -192
  202. package/src/content/pages/base/icon.mdx +0 -55
  203. package/src/content/pages/base/image.mdx +0 -42
  204. package/src/content/pages/base/input.mdx +0 -56
  205. package/src/content/pages/base/rating.mdx +0 -55
  206. package/src/content/pages/base/textarea.mdx +0 -58
  207. package/src/content/pages/base/theme-select.mdx +0 -15
  208. package/src/content/pages/layouts/_layout.mdx +0 -14
  209. package/src/content/pages/layouts/docslayout.mdx +0 -14
  210. package/src/content/pages/overview/components.mdx +0 -75
  211. package/src/content/pages/overview/content-collections.mdx +0 -139
  212. package/src/content/pages/overview/frameworks.mdx +0 -198
  213. package/src/content/pages/overview/installation.mdx +0 -53
  214. package/src/content/pages/overview/introduction.mdx +0 -30
  215. package/src/content/pages/overview/theming.mdx +0 -69
  216. package/src/content/pages/schemas/page.mdx +0 -17
  217. package/src/content/pages/schemas/preset.mdx +0 -9
  218. package/src/content/pages/showcase/record.md +0 -3
  219. package/src/content/pages/typography/heading.mdx +0 -73
  220. package/src/content/pages/typography/list.mdx +0 -51
  221. package/src/content/pages/typography/text.mdx +0 -61
  222. package/src/content/presets/blocks.yml +0 -1
  223. package/src/css/space.css +0 -77
  224. package/src/css/styles.css +0 -0
  225. package/src/images/avatar-1.yml +0 -1
  226. package/src/integration/generate-colors.ts +0 -639
  227. package/src/integration/tailwind-plugin.ts +0 -80
  228. package/src/integration/unocss-preset.ts +0 -84
  229. package/src/layouts/BlockLayout.astro +0 -19
  230. package/src/layouts/ContactLayout.astro +0 -21
  231. package/src/layouts/DocsLayout.astro +0 -73
  232. package/src/layouts/OverviewLayout.astro +0 -42
  233. /package/src/content/pages/{base → docs/components}/_dialog.mdx +0 -0
  234. /package/src/content/pages/{base → docs/components}/_drawer.mdx +0 -0
  235. /package/src/content/pages/{base → docs/components}/_localeswitcher.mdx +0 -0
  236. /package/src/schemas/utils/{parents.ts → categories.ts} +0 -0
@@ -1,72 +1,116 @@
1
1
  ---
2
- import type { HTMLAttributes } from 'astro/types'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
3
  import Element from 'fulldev-ui/components/Element.astro'
4
4
  import type { GlobalProps } from 'fulldev-ui/types/global-props'
5
+ import { slugify } from 'fulldev-ui/utils/slugify'
5
6
 
6
- interface Props
7
- extends GlobalProps,
8
- HTMLAttributes<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'> {
7
+ interface Props extends GlobalProps, HTMLAttributes<'h2'> {
8
+ as?: HTMLTag
9
9
  level?: 1 | 2 | 3 | 4 | 5 | 6 | undefined
10
10
  text?: string | undefined
11
11
  }
12
12
 
13
13
  const {
14
- contrast = true,
15
- color = 'base',
16
- level = 2,
17
14
  text,
15
+ id = text ? slugify(text) : undefined,
16
+ size = 'md',
17
+ level = 2,
18
+ as = `h${level}`,
18
19
  ...rest
19
20
  } = Astro.props
20
21
  ---
21
22
 
22
23
  <Element
23
24
  class:list="heading"
24
- as=`h${level}`
25
- {contrast}
26
- {color}
25
+ {id}
26
+ {as}
27
27
  {level}
28
+ {size}
28
29
  {...rest}
29
30
  >
31
+ <Fragment set:html={text} />
30
32
  <slot />
31
- <Fragment set:text={text} />
32
33
  </Element>
33
34
 
34
- <style is:global lang="scss">
35
- @layer fulldev {
36
- .heading {
37
- margin: 0;
38
- max-width: calc(var(--space-4) * 44);
39
- scroll-margin: var(--space-5);
40
- color: var(--color-11);
41
- font-weight: 700;
42
- line-height: 1.1;
43
- letter-spacing: -0.025em;
44
- text-align: inherit;
45
- text-decoration: none;
35
+ <style is:global>
36
+ .heading {
37
+ @apply scroll-mt-20 font-bold tracking-tight text-foreground;
38
+
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
+ }
63
+ }
64
+
65
+ &.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
+ }
81
+
82
+ &.level-5 {
83
+ @apply text-lg;
84
+ }
85
+
86
+ &.level-6 {
87
+ @apply text-base;
88
+ }
89
+ }
46
90
 
91
+ &.size-lg {
47
92
  &.level-1 {
48
- font-size: var(--text-8);
49
- text-wrap: balance;
93
+ @apply text-5xl lg:text-6xl;
50
94
  }
51
95
 
52
96
  &.level-2 {
53
- font-size: var(--text-7);
97
+ @apply text-4xl;
54
98
  }
55
99
 
56
100
  &.level-3 {
57
- font-size: var(--text-6);
101
+ @apply text-3xl;
58
102
  }
59
103
 
60
104
  &.level-4 {
61
- font-size: var(--text-5);
105
+ @apply text-2xl;
62
106
  }
63
107
 
64
108
  &.level-5 {
65
- font-size: var(--text-4);
109
+ @apply text-xl;
66
110
  }
67
111
 
68
112
  &.level-6 {
69
- font-size: var(--text-3);
113
+ @apply text-lg;
70
114
  }
71
115
  }
72
116
  }
@@ -5,10 +5,10 @@ import Element from 'fulldev-ui/components/Element.astro'
5
5
  import type { GlobalProps } from 'fulldev-ui/types/global-props'
6
6
 
7
7
  interface Props extends GlobalProps, HTMLAttributes<'i'> {
8
- name?: string | undefined
8
+ name?: keyof typeof tablerIcons.icons | undefined
9
9
  }
10
10
 
11
- const { name, ...rest } = Astro.props
11
+ const { size = 'md', name, ...rest } = Astro.props
12
12
 
13
13
  const trimmedName = name?.trim() as string | undefined
14
14
  const icon = trimmedName
@@ -18,38 +18,33 @@ const icon = trimmedName
18
18
 
19
19
  <Element
20
20
  class:list="icon"
21
- if={icon}
22
- as="i"
21
+ xmlns="http://www.w3.org/2000/svg"
22
+ viewBox="0 0 24 24"
23
+ as="svg"
24
+ {size}
23
25
  {...rest}
24
26
  >
25
- {
26
- icon && (
27
- <svg
28
- xmlns="http://www.w3.org/2000/svg"
29
- viewBox="0 0 24 24"
30
- set:html={icon}
31
- />
32
- )
33
- }
27
+ <Fragment set:html={icon} />
34
28
  </Element>
35
29
 
36
- <style is:global lang="scss">
37
- @layer fulldev {
38
- .icon {
39
- display: inline-flex;
40
- position: relative;
41
- justify-content: center;
42
- align-items: center;
43
- width: 1em;
44
- height: 1em;
45
- color: var(--color-11);
46
- font-size: inherit;
47
-
48
- svg {
49
- position: absolute;
50
- width: 120%;
51
- height: 120%;
52
- }
30
+ <style is:global>
31
+ .icon {
32
+ @apply inline-flex h-[1em] w-[1em];
33
+
34
+ * {
35
+ stroke-width: 1.6;
36
+ }
37
+
38
+ &.size-sm {
39
+ @apply text-lg;
40
+ }
41
+
42
+ &.size-md {
43
+ @apply text-xl;
44
+ }
45
+
46
+ &.size-lg {
47
+ @apply text-2xl;
53
48
  }
54
49
  }
55
50
  </style>
@@ -1,14 +1,14 @@
1
1
  ---
2
+ // @ts-nocheck
2
3
  import type { ImageMetadata } from 'astro'
3
4
  import type { HTMLAttributes } from 'astro/types'
4
5
  import { Image as AstroImage } from 'astro:assets'
5
- import type { CollectionEntry } from 'astro:content'
6
6
  import { getEntry } from 'astro:content'
7
7
 
8
8
  interface Props extends HTMLAttributes<'img'> {
9
- src?: string | undefined
9
+ size?: 'sm' | 'md' | 'lg' | undefined
10
+ id?: any
10
11
  position?: 'background' | 'cover' | 'inset' | undefined
11
- id?: CollectionEntry<'images'>['id'] | undefined
12
12
  }
13
13
 
14
14
  const { id } = Astro.props
@@ -20,10 +20,11 @@ const {
20
20
  position,
21
21
  src,
22
22
  alt,
23
+ size,
23
24
  ...rest
24
25
  } = {
25
- ...Astro.props,
26
26
  ...entry,
27
+ ...Astro.props,
27
28
  }
28
29
 
29
30
  function getAltBySrc() {
@@ -39,55 +40,39 @@ const image = images[src as keyof typeof images]
39
40
  ---
40
41
 
41
42
  {
42
- image && (
43
+ (image || src) && (
43
44
  <AstroImage
44
- class:list={['image', position && `position-${position}`]}
45
+ class:list={[
46
+ 'image',
47
+ {
48
+ [`size-${size}`]: size,
49
+ [`position-${position}`]: position,
50
+ },
51
+ ]}
45
52
  alt={alt || getAltBySrc()}
46
53
  src={image ? image() : src}
47
- width={width}
48
- height={height}
49
- {...(rest as any)}
54
+ width={width ? Number(width) : undefined}
55
+ height={height ? Number(height) : undefined}
56
+ {...rest}
50
57
  />
51
58
  )
52
59
  }
53
60
 
54
- <style is:global lang="scss">
61
+ <style is:global>
55
62
  @layer fulldev {
56
63
  .image {
57
- display: block;
58
- width: 100%;
59
- height: auto;
64
+ @apply block;
60
65
 
61
- &.position-background {
62
- position: absolute;
63
- top: 0;
64
- right: 0;
65
- bottom: 0;
66
- left: 0;
67
- margin: 0 !important;
68
- border-radius: 0;
69
- width: 100%;
70
- max-width: none;
71
- height: 100%;
72
- max-height: 100%;
73
- object-fit: cover;
66
+ &.position-contain {
67
+ @apply h-auto w-full object-contain;
74
68
  }
75
69
 
76
70
  &.position-cover {
77
- width: 100%;
78
- height: 100%;
79
- object-fit: cover;
71
+ @apply h-full w-full object-cover;
80
72
  }
81
73
 
82
- &.position-inset {
83
- margin-top: calc(var(--inset-top) * -1);
84
- margin-right: calc(var(--inset-right) * -1);
85
- margin-bottom: calc(var(--inset-bottom) * -1);
86
- margin-left: calc(var(--inset-left) * -1);
87
- width: calc(100% + var(--inset-left) + var(--inset-right));
88
- max-width: none;
89
- height: calc(100% + var(--inset-top) + var(--inset-bottom));
90
- object-fit: cover;
74
+ &.position-background {
75
+ @apply absolute inset-0 h-full max-h-none w-full max-w-none object-cover opacity-30;
91
76
  }
92
77
  }
93
78
  }
@@ -12,96 +12,102 @@ interface Props extends GlobalProps, HTMLAttributes<'input'> {
12
12
 
13
13
  const {
14
14
  label,
15
- icon,
16
- value,
17
- disabled,
18
- required,
19
15
  placeholder,
20
- readonly,
21
- name = placeholder,
16
+ name = label || placeholder,
17
+ id = name,
22
18
  type = 'text',
19
+ size = 'md',
20
+ icon,
23
21
  ...rest
24
22
  } = Astro.props
25
23
  ---
26
24
 
27
25
  <Element
28
26
  class:list="input"
29
- {...rest}
27
+ as="label"
28
+ for={id}
29
+ {size}
30
30
  >
31
31
  <Label
32
32
  for={name}
33
33
  text={label}
34
+ {size}
34
35
  />
36
+ <Icon name={icon} />
35
37
  <Element
38
+ class:list="input-input"
36
39
  as="input"
37
40
  if={name}
38
41
  id={name}
39
42
  {name}
40
43
  {placeholder}
41
44
  {type}
42
- {value}
43
- {disabled}
44
- {required}
45
- {readonly}
45
+ {...rest}
46
46
  />
47
- <Icon name={icon} />
48
47
  </Element>
49
48
 
50
- <style is:global lang="scss">
49
+ <style is:global>
51
50
  @layer fulldev {
52
51
  .input {
53
- display: flex;
54
- position: relative;
55
- flex-direction: column;
56
- gap: var(--space-1);
57
- width: 100%;
52
+ @apply relative flex flex-col gap-1.5;
58
53
 
59
54
  .icon {
60
- position: absolute;
61
- right: var(--space-4);
62
- bottom: var(--space-4);
63
- pointer-events: none;
55
+ @apply pointer-events-none absolute;
56
+ }
57
+
58
+ .input-input {
59
+ @apply flex w-full rounded-md border border-input bg-background text-sm ring-offset-background;
60
+ @apply file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground;
61
+ @apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
62
+ @apply disabled:pointer-events-none disabled:opacity-50;
63
+ @apply [&[readonly]]:pointer-events-none;
64
64
  }
65
65
 
66
- input {
67
- display: flex;
68
- position: relative;
69
- align-items: center;
70
- outline: none;
71
- border: 1px solid var(--color-6);
72
- border-radius: var(--radius-1);
73
- background-color: transparent;
74
- padding: var(--space-4);
75
- padding-right: calc(var(--text-2) + 2 * var(--space-4));
76
- width: 100%;
77
- min-width: var(--space-4);
78
- height: calc(var(--text-2) + 2 * var(--space-4));
79
- color: var(--text);
80
- font-size: var(--text-2);
81
- line-height: 1.25;
82
-
83
- &::placeholder {
84
- color: var(--color-11);
66
+ &.size-sm {
67
+ @apply gap-1;
68
+
69
+ .input-input {
70
+ @apply h-9 px-2.5 py-1.5 text-xs;
85
71
  }
86
72
 
87
- &:hover {
88
- outline: none;
73
+ .icon {
74
+ @apply bottom-2 right-2;
89
75
  }
90
76
 
91
- &:focus {
92
- outline: none;
93
- box-shadow: inset 0 0 0 2px var(--color-7);
94
- border-color: var(--color-7);
77
+ .icon + .input-input {
78
+ @apply pr-9;
79
+ }
80
+ }
81
+
82
+ &.size-md {
83
+ @apply gap-1.5;
84
+
85
+ .input-input {
86
+ @apply h-10 px-3 py-2 text-sm;
87
+ }
88
+
89
+ .icon {
90
+ @apply bottom-2.5 right-2.5;
91
+ }
92
+
93
+ .icon + .input-input {
94
+ @apply pr-10;
95
+ }
96
+ }
97
+
98
+ &.size-lg {
99
+ @apply gap-2;
100
+
101
+ .input-input {
102
+ @apply h-12 px-3.5 py-2.5 text-base;
95
103
  }
96
104
 
97
- &:disabled {
98
- opacity: 50%;
99
- cursor: not-allowed;
100
- pointer-events: none;
105
+ .icon {
106
+ @apply bottom-3.5 right-3.5;
101
107
  }
102
108
 
103
- &[readonly] {
104
- pointer-events: none;
109
+ .icon + .input-input {
110
+ @apply pr-11;
105
111
  }
106
112
  }
107
113
  }
@@ -1,37 +1,42 @@
1
1
  ---
2
- import type { HTMLAttributes } from 'astro/types'
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
3
  import Element from 'fulldev-ui/components/Element.astro'
4
4
  import type { GlobalProps } from 'fulldev-ui/types/global-props'
5
5
 
6
6
  interface Props extends GlobalProps, HTMLAttributes<'label'> {
7
- size?: 'sm' | 'md' | 'lg' | undefined
8
- color?: 'base' | 'brand' | undefined
9
- contrast?: boolean | undefined
7
+ as?: HTMLTag
10
8
  text?: string | undefined
11
9
  }
12
10
 
13
- const { text, ...rest } = Astro.props
11
+ const { as = 'label', size = 'md', text, ...rest } = Astro.props
14
12
  ---
15
13
 
16
14
  <Element
17
15
  class:list="label"
18
- as="label"
16
+ {as}
17
+ {size}
19
18
  {...rest}
20
19
  >
20
+ <Fragment set:html={text} />
21
21
  <slot />
22
- <Fragment set:text={text} />
23
22
  </Element>
24
23
 
25
- <style is:global lang="scss">
24
+ <style is:global>
26
25
  @layer fulldev {
27
26
  .label {
28
- display: flex;
29
- flex-direction: column;
30
- color: var(--color-11);
31
- font-size: var(--text-2);
32
- line-height: 1;
33
- text-align: left;
34
- white-space: nowrap;
27
+ @apply font-medium leading-none;
28
+
29
+ &.size-sm {
30
+ @apply text-xs;
31
+ }
32
+
33
+ &.size-md {
34
+ @apply text-sm;
35
+ }
36
+
37
+ &.size-lg {
38
+ @apply text-base;
39
+ }
35
40
  }
36
41
  }
37
42
  </style>
@@ -0,0 +1,46 @@
1
+ ---
2
+ import type { HTMLAttributes, HTMLTag } from 'astro/types'
3
+ import Element from 'fulldev-ui/components/Element.astro'
4
+ import type { GlobalProps } from 'fulldev-ui/types/global-props'
5
+
6
+ interface Props extends GlobalProps, HTMLAttributes<'p'> {
7
+ as?: HTMLTag
8
+ text?: string | undefined
9
+ }
10
+
11
+ const { as = 'p', text, ...rest } = Astro.props
12
+ ---
13
+
14
+ <Element
15
+ class:list="lead"
16
+ {as}
17
+ {...rest}
18
+ >
19
+ <slot />
20
+ <Fragment set:html={text} />
21
+ </Element>
22
+
23
+ <style is:global>
24
+ @layer fulldev {
25
+ .lead,
26
+ .prose-content h1 + p {
27
+ @apply text-muted-foreground;
28
+
29
+ &.size-sm {
30
+ @apply text-sm;
31
+ }
32
+
33
+ &.size-md {
34
+ @apply text-base;
35
+ }
36
+
37
+ &.size-lg {
38
+ @apply text-lg;
39
+
40
+ &:is(h1 + p) {
41
+ @apply text-xl;
42
+ }
43
+ }
44
+ }
45
+ }
46
+ </style>
@@ -1,52 +1,77 @@
1
1
  ---
2
- import type { HTMLAttributes } from 'astro/types'
2
+ import type { ComponentProps, HTMLAttributes, HTMLTag } from 'astro/types'
3
3
  import type { CollectionEntry } from 'astro:content'
4
4
  import { getEntry } from 'astro:content'
5
5
  import Element from 'fulldev-ui/components/Element.astro'
6
+ import Icon from 'fulldev-ui/components/Icon.astro'
6
7
  import type { GlobalProps } from 'fulldev-ui/types/global-props'
7
8
 
8
9
  interface Props extends GlobalProps, HTMLAttributes<'a'> {
10
+ as?: HTMLTag
11
+ href?: string | null | undefined
9
12
  slug?: CollectionEntry<'pages'>['slug'] | undefined
13
+ icon?: ComponentProps<typeof Icon>['name']
14
+ variant?: 'primary' | 'muted' | undefined
10
15
  text?: string | undefined
16
+ current?: boolean | undefined
11
17
  }
12
18
 
13
- const { slug, href, text, ...rest } = Astro.props
14
-
15
- const entry = slug && (await getEntry('pages', slug))
19
+ 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
+ as = 'a',
26
+ variant = 'primary',
27
+ icon,
28
+ ...rest
29
+ } = Astro.props
16
30
  ---
17
31
 
18
32
  <Element
19
33
  class:list="link"
20
- href={slug ? `/${slug}/` : href}
21
- as="a"
34
+ {href}
35
+ {as}
36
+ {target}
37
+ {variant}
38
+ {current}
22
39
  {...rest}
23
40
  >
41
+ <Fragment set:html={text} />
24
42
  <slot />
25
- <Fragment set:html={entry?.data?.title ?? text} />
43
+ <Icon name={icon} />
26
44
  </Element>
27
45
 
28
- <style is:global lang="scss">
46
+ <style is:global>
29
47
  @layer fulldev {
30
- .link {
31
- display: inline-flex;
32
- flex-wrap: wrap;
33
- align-items: center;
34
- gap: var(--space-2);
35
- cursor: pointer;
36
- border: none;
37
- background: none;
38
- color: var(--color-11);
39
- font-size: var(--text-3);
40
- text-decoration-color: var(--border); // FIXME, werkt niet
41
- text-decoration: none;
42
- white-space: nowrap;
43
-
44
- &:is(p > &) {
45
- text-decoration: underline;
48
+ .link,
49
+ .prose-content > *:not(.prose-footer) > a {
50
+ @apply ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
51
+
52
+ &.variant-primary,
53
+ &:is(.prose-content > *:not(.prose-footer) > a) {
54
+ @apply text-primary underline underline-offset-4;
55
+ }
56
+
57
+ &.variant-muted {
58
+ @apply text-muted-foreground hover:text-foreground;
59
+
60
+ &.current {
61
+ @apply text-foreground;
62
+ }
63
+ }
64
+
65
+ &.size-sm {
66
+ @apply text-sm;
67
+ }
68
+
69
+ &.size-lg {
70
+ @apply text-lg;
46
71
  }
47
72
 
48
- &:hover {
49
- color: var(--color-12);
73
+ .icon {
74
+ @apply mb-0.5;
50
75
  }
51
76
  }
52
77
  }