fulldev-ui 0.3.35 → 0.4.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 (287) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.yml +57 -0
  2. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.yml +39 -0
  4. package/.github/pull_request_template.md +23 -0
  5. package/.github/workflows/github-releases-to-discord.yml +21 -0
  6. package/.prettierignore +15 -0
  7. package/.prettierrc.yaml +34 -0
  8. package/.vscode/extensions.json +4 -0
  9. package/.vscode/launch.json +11 -0
  10. package/.vscode/settings.json +23 -0
  11. package/CHANGELOG.md +100 -0
  12. package/CONTRIBUTING.md +102 -0
  13. package/LICENCE +21 -0
  14. package/README.md +9 -6
  15. package/astro.config.ts +44 -0
  16. package/package.json +41 -27
  17. package/pnpm-lock.yaml +6229 -0
  18. package/public/favicon/android-chrome-192x192.png +0 -0
  19. package/public/favicon/android-chrome-512x512.png +0 -0
  20. package/public/favicon/apple-touch-icon.png +0 -0
  21. package/public/favicon/browserconfig.xml +9 -0
  22. package/public/favicon/favicon-16x16.png +0 -0
  23. package/public/favicon/favicon-32x32.png +0 -0
  24. package/public/favicon/favicon.ico +0 -0
  25. package/public/favicon/mstile-150x150.png +0 -0
  26. package/public/favicon/safari-pinned-tab.svg +17 -0
  27. package/public/favicon/site.webmanifest +19 -0
  28. package/public/images/avatar-placeholder.jpg +0 -0
  29. package/public/images/avatars/1.jpeg +0 -0
  30. package/public/images/avatars/2.jpeg +0 -0
  31. package/public/images/avatars/3.jpeg +0 -0
  32. package/public/images/avatars/300/1.jpeg +0 -0
  33. package/public/images/avatars/300/2.jpeg +0 -0
  34. package/public/images/avatars/300/3.jpeg +0 -0
  35. package/public/images/avatars/300/4.jpeg +0 -0
  36. package/public/images/avatars/4.jpeg +0 -0
  37. package/public/images/avatars/5.jpeg +0 -0
  38. package/public/images/avatars/500/1.jpeg +0 -0
  39. package/public/images/avatars/500/2.jpeg +0 -0
  40. package/public/images/avatars/500/3.jpeg +0 -0
  41. package/public/images/avatars/500/4.jpeg +0 -0
  42. package/public/images/avatars/6.jpeg +0 -0
  43. package/public/images/avatars/7.jpeg +0 -0
  44. package/public/images/avatars/8.jpeg +0 -0
  45. package/public/images/block-code.png +0 -0
  46. package/public/images/blocks/colleagues.png +0 -0
  47. package/public/images/blocks/content.png +0 -0
  48. package/public/images/blocks/cta.png +0 -0
  49. package/public/images/blocks/features.png +0 -0
  50. package/public/images/blocks/footer.png +0 -0
  51. package/public/images/blocks/header.png +0 -0
  52. package/public/images/blocks/hero.png +0 -0
  53. package/public/images/blocks/intro.png +0 -0
  54. package/public/images/blocks/posts.png +0 -0
  55. package/public/images/blocks/prices.png +0 -0
  56. package/public/images/blocks/reviews.png +0 -0
  57. package/public/images/component-code.png +0 -0
  58. package/public/images/logo-placeholder.svg +1 -0
  59. package/public/images/placeholder-center.webp +0 -0
  60. package/public/images/placeholder-landscape-dark.png +0 -0
  61. package/public/images/placeholder-landscape.webp +0 -0
  62. package/public/images/placeholder-portrait.webp +0 -0
  63. package/public/images/placeholder-right.webp +0 -0
  64. package/public/images/placeholder.webp +0 -0
  65. package/siteicon.png +0 -0
  66. package/src/blocks/Categories.astro +12 -0
  67. package/src/blocks/Colleagues.astro +12 -0
  68. package/src/blocks/Contact.astro +152 -0
  69. package/src/blocks/Content.astro +12 -0
  70. package/src/blocks/Cta.astro +14 -0
  71. package/src/blocks/Features.astro +11 -0
  72. package/src/blocks/Footer.astro +7 -0
  73. package/src/blocks/Header.astro +7 -0
  74. package/src/blocks/Hero.astro +16 -0
  75. package/src/blocks/Intro.astro +19 -0
  76. package/src/blocks/Jobs.astro +12 -0
  77. package/src/blocks/Posts.astro +11 -0
  78. package/src/blocks/Prices.astro +22 -0
  79. package/src/blocks/Product.astro +64 -0
  80. package/src/blocks/Products.astro +11 -0
  81. package/src/blocks/Reviews.astro +13 -0
  82. package/src/components/{base/Avatar.astro → Avatar.astro} +7 -11
  83. package/src/components/{base/Badge.astro → Badge.astro} +36 -22
  84. package/src/components/{structure/Bento.astro → Bento.astro} +6 -9
  85. package/src/components/Block.astro +157 -0
  86. package/src/components/Blocks.astro +5 -0
  87. package/src/components/Box.astro +60 -0
  88. package/src/components/Button.astro +140 -0
  89. package/src/components/Card.astro +212 -0
  90. package/src/components/{structure/Carousel.astro → Carousel.astro} +13 -16
  91. package/src/components/Checkbox.astro +63 -0
  92. package/src/components/{structure/Column.astro → Column.astro} +18 -9
  93. package/src/components/Dialog.astro +65 -0
  94. package/src/components/Drawer.astro +99 -0
  95. package/src/components/Footer.astro +144 -0
  96. package/src/components/{structure/Grid.astro → Grid.astro} +7 -10
  97. package/src/components/Head.astro +85 -0
  98. package/src/components/Header.astro +204 -0
  99. package/src/components/Heading.astro +79 -0
  100. package/src/components/{base/Icon.astro → Icon.astro} +7 -9
  101. package/src/components/{base/Image.astro → Image.astro} +32 -30
  102. package/src/components/Input.astro +119 -0
  103. package/src/components/{typography/Label.astro → Label.astro} +12 -12
  104. package/src/components/{typography/Link.astro → Link.astro} +15 -13
  105. package/src/components/List.astro +41 -0
  106. package/src/components/{structure/Masonry.astro → Masonry.astro} +9 -11
  107. package/src/components/Rating.astro +82 -0
  108. package/src/components/{_Component.astro → Root.astro} +9 -11
  109. package/src/components/{structure/Row.astro → Row.astro} +6 -9
  110. package/src/components/Search.astro +62 -0
  111. package/src/components/Section.astro +274 -0
  112. package/src/components/Select.astro +144 -0
  113. package/src/components/Sidebar.astro +71 -0
  114. package/src/components/{structure/Split.astro → Split.astro} +6 -9
  115. package/src/components/{structure/Spread.astro → Spread.astro} +6 -9
  116. package/src/components/Switch.astro +114 -0
  117. package/src/components/Table.astro +121 -0
  118. package/src/components/Tagline.astro +35 -0
  119. package/src/components/Text.astro +43 -0
  120. package/src/components/Textarea.astro +105 -0
  121. package/src/components/Toc.astro +52 -0
  122. package/src/components/{structure/Wrap.astro → Wrap.astro} +5 -10
  123. package/src/components/docs/DecorativeBox.astro +15 -0
  124. package/src/components/docs/PropsTable.astro +95 -0
  125. package/src/components/experimental/Channel.astro +15 -10
  126. package/src/components/experimental/Form.astro +34 -0
  127. package/src/components/experimental/Gallery.astro +180 -0
  128. package/src/components/experimental/GalleryVertical.astro +161 -0
  129. package/src/components/{base → experimental}/Logo.astro +3 -5
  130. package/src/components/experimental/Price.astro +17 -15
  131. package/src/components/experimental/Prose.astro +154 -0
  132. package/src/components/{base → experimental}/Video.astro +1 -1
  133. package/src/components/experimental/Window.astro +173 -0
  134. package/src/content/config.ts +16 -13
  135. package/src/content/pages/_changelog.mdx +10 -0
  136. package/src/content/pages/_segment/footer.mdx +244 -0
  137. package/src/content/pages/_segment/header.mdx +210 -0
  138. package/src/content/pages/base/_dialog.mdx +17 -0
  139. package/src/content/pages/base/_drawer.mdx +17 -0
  140. package/src/content/pages/base/_image.mdx +14 -0
  141. package/src/content/pages/base/_switch.mdx +33 -0
  142. package/src/content/pages/base/badge.mdx +70 -0
  143. package/src/content/pages/base/button.mdx +71 -0
  144. package/src/content/pages/base/card.mdx +114 -0
  145. package/src/content/pages/base/checkbox.mdx +43 -0
  146. package/src/content/pages/base/icon.mdx +54 -0
  147. package/src/content/pages/base/input.mdx +67 -0
  148. package/src/content/pages/base/rating.mdx +66 -0
  149. package/src/content/pages/base/section.mdx +79 -0
  150. package/src/content/pages/base/select.mdx +77 -0
  151. package/src/content/pages/base/table.mdx +133 -0
  152. package/src/content/pages/base/textarea.mdx +73 -0
  153. package/src/content/pages/blocks/_banner.mdx +13 -0
  154. package/src/content/pages/blocks/_categories.mdx +149 -0
  155. package/src/content/pages/blocks/_jobs.mdx +37 -0
  156. package/src/content/pages/blocks/_product.mdx +29 -0
  157. package/src/content/pages/blocks/_products.mdx +55 -0
  158. package/src/content/pages/blocks/_stats.mdx +34 -0
  159. package/src/content/pages/blocks/colleagues.mdx +42 -0
  160. package/src/content/pages/blocks/content.mdx +101 -0
  161. package/src/content/pages/blocks/cta.mdx +192 -0
  162. package/src/content/pages/blocks/features.mdx +134 -0
  163. package/src/content/pages/blocks/footer.mdx +71 -0
  164. package/src/content/pages/blocks/header.mdx +192 -0
  165. package/src/content/pages/blocks/hero.mdx +97 -0
  166. package/src/content/pages/blocks/intro.mdx +132 -0
  167. package/src/content/pages/blocks/posts.mdx +40 -0
  168. package/src/content/pages/blocks/prices.mdx +126 -0
  169. package/src/content/pages/blocks/reviews.mdx +249 -0
  170. package/src/content/pages/blocks.mdx +10 -0
  171. package/src/content/pages/index.mdx +65 -0
  172. package/src/content/pages/overview/frameworks.mdx +180 -0
  173. package/src/content/pages/overview/installation.mdx +20 -0
  174. package/src/content/pages/overview/integration.mdx +37 -0
  175. package/src/content/pages/overview/introduction.mdx +20 -0
  176. package/src/content/pages/overview/theming.mdx +83 -0
  177. package/src/content/pages/structure/_row.mdx +23 -0
  178. package/src/content/pages/structure/_wrap.mdx +25 -0
  179. package/src/content/pages/structure/carousel.mdx +31 -0
  180. package/src/content/pages/structure/column.mdx +21 -0
  181. package/src/content/pages/structure/grid.mdx +26 -0
  182. package/src/content/pages/structure/masonry.mdx +32 -0
  183. package/src/content/pages/structure/split.mdx +21 -0
  184. package/src/content/pages/structure/spread.mdx +21 -0
  185. package/src/content/pages/typography/_tagline.mdx +36 -0
  186. package/src/content/pages/typography/heading.mdx +74 -0
  187. package/src/content/pages/typography/label.mdx +42 -0
  188. package/src/content/pages/typography/link.mdx +63 -0
  189. package/src/content/pages/typography/list.mdx +52 -0
  190. package/src/content/pages/typography/text.mdx +62 -0
  191. package/src/content/records/record.yml +1 -0
  192. package/src/content/settings/base.yml +48 -0
  193. package/src/content/settings/components.yml +27 -0
  194. package/src/css/color.css +6 -67
  195. package/src/css/custom.css +59 -0
  196. package/src/css/size.css +130 -0
  197. package/src/css/space.css +47 -26
  198. package/src/css/styles.css +4 -2
  199. package/src/env.d.ts +1 -1
  200. package/src/integration/generate-colors.ts +637 -0
  201. package/src/integration/index.ts +158 -0
  202. package/src/integration/tailwind-plugin.ts +80 -0
  203. package/src/integration/unocss-preset.ts +84 -0
  204. package/src/layouts/BlockLayout.astro +24 -0
  205. package/src/layouts/BlockOverviewLayout.astro +39 -0
  206. package/src/layouts/ComponentLayout.astro +23 -0
  207. package/src/layouts/JobsLayout.astro +40 -0
  208. package/src/layouts/Layout.astro +168 -0
  209. package/src/layouts/OverviewLayout.astro +45 -0
  210. package/src/layouts/PageLayout.astro +32 -0
  211. package/src/layouts/PostLayout.astro +32 -0
  212. package/src/layouts/ProductLayout.astro +31 -0
  213. package/src/pages/[...page].astro +41 -0
  214. package/src/schemas/base.ts +81 -0
  215. package/src/schemas/block.ts +15 -0
  216. package/src/schemas/card.ts +3 -0
  217. package/src/schemas/page.ts +43 -0
  218. package/src/schemas/utils.ts +22 -0
  219. package/src/utils/mergeEntries.ts +28 -0
  220. package/tsconfig.json +10 -1
  221. package/.astro/settings.json +0 -5
  222. package/.astro/types.d.ts +0 -147
  223. package/.env +0 -1
  224. package/astro.config.mjs +0 -6
  225. package/src/components/_Block.astro +0 -20
  226. package/src/components/_Blocks.astro +0 -11
  227. package/src/components/_Children.astro +0 -31
  228. package/src/components/_archive/Body.astro +0 -37
  229. package/src/components/_archive/Main.astro +0 -28
  230. package/src/components/_archive/Nav.astro +0 -50
  231. package/src/components/_todo/Form.astro +0 -36
  232. package/src/components/_todo/Prose.astro +0 -139
  233. package/src/components/_todo/Writeup.astro +0 -24
  234. package/src/components/base/Button.astro +0 -123
  235. package/src/components/base/Rating.astro +0 -47
  236. package/src/components/base/checkbox/Checkbox.astro +0 -52
  237. package/src/components/base/checkbox/CheckboxElement.astro +0 -31
  238. package/src/components/base/input/Input.astro +0 -79
  239. package/src/components/base/input/InputElement.astro +0 -69
  240. package/src/components/base/radio/Radio.astro +0 -66
  241. package/src/components/base/radio/RadioElement.astro +0 -34
  242. package/src/components/base/select/Select.astro +0 -90
  243. package/src/components/base/select/SelectElement.astro +0 -56
  244. package/src/components/base/select/SelectOption.astro +0 -32
  245. package/src/components/base/switch/Switch.astro +0 -55
  246. package/src/components/base/switch/SwitchElement.astro +0 -84
  247. package/src/components/base/table/Table.astro +0 -57
  248. package/src/components/base/table/TableBody.astro +0 -38
  249. package/src/components/base/table/TableCell.astro +0 -30
  250. package/src/components/base/table/TableFooter.astro +0 -48
  251. package/src/components/base/table/TableHead.astro +0 -31
  252. package/src/components/base/table/TableHeader.astro +0 -44
  253. package/src/components/base/table/TableRow.astro +0 -46
  254. package/src/components/base/textarea/Textarea.astro +0 -79
  255. package/src/components/base/textarea/TextareaElement.astro +0 -68
  256. package/src/components/segment/Box.astro +0 -46
  257. package/src/components/segment/Card.astro +0 -114
  258. package/src/components/segment/Footer.astro +0 -94
  259. package/src/components/segment/Header.astro +0 -100
  260. package/src/components/segment/Section.astro +0 -103
  261. package/src/components/segment/_regels.md +0 -32
  262. package/src/components/typography/Heading.astro +0 -66
  263. package/src/components/typography/List.astro +0 -47
  264. package/src/components/typography/ListItem.astro +0 -36
  265. package/src/components/typography/Paragraph.astro +0 -36
  266. package/src/components/typography/Tagline.astro +0 -36
  267. package/src/components/typography/Text.astro +0 -37
  268. package/src/components/utility/Head.astro +0 -83
  269. package/src/components/utility/Layout.astro +0 -46
  270. package/src/content/pages/index.md +0 -2
  271. package/src/css/color.scss +0 -289
  272. package/src/css/size.scss +0 -296
  273. package/src/css/utils.scss +0 -16
  274. package/src/index.ts +0 -71
  275. package/src/integration/integration.ts +0 -88
  276. package/src/integration/tailwind.ts +0 -34
  277. package/src/integration/unocss.ts +0 -38
  278. /package/src/{_archive → utils/_archive}/Childmorphic.ts +0 -0
  279. /package/src/{_archive → utils/_archive}/getAllCollections.ts +0 -0
  280. /package/src/{_archive → utils/_archive}/getCollectionCascade.ts +0 -0
  281. /package/src/{_archive → utils/_archive}/getPathname.ts +0 -0
  282. /package/src/{_archive → utils/_archive}/staticPageSchema.ts +0 -0
  283. /package/src/{_archive → utils/_archive}/transform/transform.ts +0 -0
  284. /package/src/{_archive → utils/_archive}/transform/transformCasing.ts +0 -0
  285. /package/src/{_archive → utils/_archive}/transform/transformReferences.ts +0 -0
  286. /package/src/{_archive → utils/_archive}/transform/transformSelfs.ts +0 -0
  287. /package/src/{_archive → utils/_archive}/transform/transformUnderscores.ts +0 -0
@@ -0,0 +1,41 @@
1
+ ---
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
+ import Root from 'fulldev-ui/components/Root.astro'
4
+
5
+ type Props<As extends HTMLTag = 'ul'> = Polymorphic<{ as: As }> & {
6
+ size?: 'sm' | 'md' | 'lg'
7
+ color?: 'base' | 'brand'
8
+ contrast?: boolean
9
+ items?: (string | { text: string })[]
10
+ }
11
+
12
+ const { as = 'ul', items, ...rest } = Astro.props
13
+ ---
14
+
15
+ <Root
16
+ class:list="list"
17
+ {as}
18
+ {...rest}
19
+ >
20
+ {items?.map((item) => <li>{typeof item === 'string' ? item : item.text}</li>)}
21
+ </Root>
22
+
23
+ <style is:global lang="scss">
24
+ .list {
25
+ display: flex;
26
+ flex-direction: column;
27
+ padding-left: var(--space-5);
28
+ color: var(--color-11);
29
+ font-size: var(--text-2);
30
+ line-height: 1.625;
31
+ list-style-type: disc;
32
+
33
+ li {
34
+ align-items: center;
35
+ max-width: calc(var(--space-4) * 44);
36
+ color: var(--color-11);
37
+ font-size: var(--text-2);
38
+ line-height: 1.625;
39
+ }
40
+ }
41
+ </style>
@@ -1,28 +1,25 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types'
3
- import Component from '../_Component.astro'
3
+ import Root from 'fulldev-ui/components/Root.astro'
4
4
 
5
5
  type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
6
6
  color?: 'base' | 'brand'
7
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
8
- compact?: boolean
7
+ size?: 'sm' | 'md' | 'lg'
9
8
  }
10
9
 
11
10
  const { ...rest } = Astro.props
12
11
  ---
13
12
 
14
- <Component
15
- class:list={['masonry']}
13
+ <Root
14
+ class:list="masonry"
16
15
  {...rest}
17
16
  >
18
17
  <slot />
19
- </Component>
18
+ </Root>
20
19
 
21
20
  <style is:global lang="scss">
22
- @import '../../css/utils.scss';
23
-
24
- @include component('masonry') {
25
- --column-width: calc(16 * var(--space-4));
21
+ .masonry {
22
+ --column-width: calc(21 * var(--space-4));
26
23
  --gap: var(--space-4);
27
24
 
28
25
  position: relative;
@@ -33,7 +30,8 @@ const { ...rest } = Astro.props
33
30
  break-inside: avoid;
34
31
  width: 100%;
35
32
 
36
- & > .full + .full {
33
+ & > .root + .root,
34
+ & > * + * {
37
35
  break-inside: avoid;
38
36
  margin-top: var(--gap);
39
37
  margin-bottom: var(--gap);
@@ -0,0 +1,82 @@
1
+ ---
2
+ import type { HTMLAttributes } from 'astro/types'
3
+ import Icon from 'fulldev-ui/components/Icon.astro'
4
+ import Root from 'fulldev-ui/components/Root.astro'
5
+ import Avatar from './Avatar.astro'
6
+ import Column from './Column.astro'
7
+ import Label from './Label.astro'
8
+
9
+ type Props = HTMLAttributes<'div'> & {
10
+ color?: 'base' | 'brand'
11
+ value?: number
12
+ size?: string
13
+ label?: string
14
+ avatars?: string[]
15
+ avatar?: string
16
+ }
17
+
18
+ const { value, label, avatars, avatar, ...rest } = Astro.props
19
+
20
+ const getIcon = (count: number) => {
21
+ if (!value) return
22
+ const difference = value - count
23
+ if (difference >= -0.25) return 'star-filled'
24
+ if (difference >= -0.75) return 'star-half-filled'
25
+ return 'star'
26
+ }
27
+ ---
28
+
29
+ <Root
30
+ class:list="rating"
31
+ {...rest}
32
+ >
33
+ {
34
+ [avatar, ...(avatars ?? [])]?.filter(Boolean)?.map((avatar) => (
35
+ <Avatar
36
+ radius="full"
37
+ src={avatar}
38
+ />
39
+ ))
40
+ }
41
+ <Column>
42
+ <Root
43
+ class:list={'stars'}
44
+ {...rest}
45
+ >
46
+ {
47
+ value &&
48
+ [1, 2, 3, 4, 5].map((_, i) => (
49
+ <Icon
50
+ name={getIcon(i + 1)}
51
+ class:list={'rating-icon-solid'}
52
+ />
53
+ ))
54
+ }
55
+ </Root>
56
+ <Label
57
+ color="base"
58
+ html={label}
59
+ />
60
+ </Column>
61
+ </Root>
62
+
63
+ <style is:global lang="scss">
64
+ .rating {
65
+ display: flex;
66
+ gap: var(--space-4);
67
+
68
+ .avatar + .avatar {
69
+ margin-left: calc(var(--space-4) * -2.5);
70
+ }
71
+
72
+ .label {
73
+ margin-top: var(--space-2) !important;
74
+ }
75
+
76
+ .stars {
77
+ display: flex;
78
+ align-items: center;
79
+ gap: var(--space-2);
80
+ }
81
+ }
82
+ </style>
@@ -5,22 +5,20 @@ type Props<As extends HTMLTag> = {
5
5
  as?: As
6
6
  slot?: any
7
7
  if?: 'content' | any
8
- wrapper?: any
9
8
  [key: string | number | symbol]: any
10
9
  }
11
10
 
12
11
  const {
13
12
  as: As = 'div',
14
13
  if: ifProp = 'content',
15
- wrapper = true,
16
14
  space,
17
15
  theme,
18
- compact,
19
16
  variant,
20
17
  underline,
21
18
  density,
22
19
  size,
23
20
  align,
21
+ justify,
24
22
  color,
25
23
  position,
26
24
  frame,
@@ -32,6 +30,8 @@ const {
32
30
  radius,
33
31
  level,
34
32
  mask,
33
+ reverse,
34
+ lead,
35
35
  ...rest
36
36
  } = Astro.props
37
37
 
@@ -48,18 +48,18 @@ const render =
48
48
  render && (
49
49
  <As
50
50
  class:list={[
51
- 'full',
51
+ 'root',
52
52
  structure,
53
53
  {
54
- compact,
54
+ lead,
55
55
  contrast,
56
56
  [`theme-${theme}`]: theme,
57
57
  [`level-${level}`]: level,
58
58
  [`variant-${variant}`]: variant,
59
- [`density-${density}`]: density,
60
59
  [`structure-${structure}`]: structure,
61
60
  [`size-${size}`]: size,
62
61
  [`align-${align}`]: align,
62
+ [`justify-${justify}`]: justify,
63
63
  [`position-${position}`]: position,
64
64
  [`frame-${frame}`]: frame,
65
65
  [`ratio-${ratio}`]: ratio,
@@ -68,25 +68,23 @@ const render =
68
68
  [`radius-${radius}`]: radius,
69
69
  [`mask-${mask}`]: mask,
70
70
  [`space-${space}`]: space,
71
+ [`reverse-${reverse}`]: reverse,
71
72
  },
72
73
  ]}
73
74
  {...rest}
74
75
  >
75
76
  <Fragment set:html={slot} />
76
- <Fragment set:text={text} />
77
- <Fragment set:html={html} />
78
77
  </As>
79
78
  )
80
79
  }
81
80
 
82
81
  <style is:global lang="scss">
83
- @import '../css/utils.scss';
84
82
  @import '../css/color.css';
85
83
  @import '../css/styles.css';
86
- @import '../css/size.scss';
84
+ @import '../css/size.css';
87
85
  @import '../css/space.css';
88
86
 
89
- @include component('full') {
87
+ .root {
90
88
  z-index: 1;
91
89
  box-sizing: border-box;
92
90
  }
@@ -1,11 +1,10 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types'
3
- import Component from '../_Component.astro'
3
+ import Root from 'fulldev-ui/components/Root.astro'
4
4
 
5
5
  type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
6
6
  color?: 'base' | 'brand'
7
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
8
- compact?: boolean
7
+ size?: 'sm' | 'md' | 'lg'
9
8
  align?: 'start' | 'center' | 'end'
10
9
  space?: 'none' | 'auto'
11
10
  }
@@ -13,19 +12,17 @@ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
13
12
  const { space = 'auto', align = 'center', ...rest } = Astro.props
14
13
  ---
15
14
 
16
- <Component
17
- class:list={['row']}
15
+ <Root
16
+ class:list="row"
18
17
  {align}
19
18
  {space}
20
19
  {...rest}
21
20
  >
22
21
  <slot />
23
- </Component>
22
+ </Root>
24
23
 
25
24
  <style is:global lang="scss">
26
- @import '../../css/utils.scss';
27
-
28
- @include component('row') {
25
+ .row {
29
26
  display: flex;
30
27
 
31
28
  &.align-start {
@@ -0,0 +1,62 @@
1
+ ---
2
+ import Pagefind from 'astro-pagefind/components/Search'
3
+ import Dialog from './Dialog.astro'
4
+
5
+ const { variant = 'secondary', icon, ...rest } = Astro.props
6
+ ---
7
+
8
+ <Dialog
9
+ class:list="search"
10
+ id="search"
11
+ {variant}
12
+ {icon}
13
+ {...rest}
14
+ >
15
+ <Pagefind uiOptions={{ showImages: false }} />
16
+ </Dialog>
17
+
18
+ <style is:global lang="scss">
19
+ :root {
20
+ --pagefind-ui-primary: var(--brand-11);
21
+ --pagefind-ui-text: var(--base-12);
22
+ --pagefind-ui-background: var(--base-2);
23
+ --pagefind-ui-border: var(--base-6);
24
+ --pagefind-ui-tag: var(--base-6);
25
+ }
26
+
27
+ @media (max-width: 123.9999) {
28
+ .search,
29
+ #search,
30
+ #search-button {
31
+ display: none !important;
32
+ }
33
+ }
34
+
35
+ .dialog div {
36
+ width: 100%;
37
+ }
38
+
39
+ .pagefind-ui__search-input {
40
+ outline: none !important;
41
+ border: 1px solid var(--base-7);
42
+ color: var(--base-11);
43
+
44
+ &::placeholder {
45
+ color: var(--base-11);
46
+ }
47
+
48
+ &:hover {
49
+ outline: none;
50
+ }
51
+
52
+ &:focus {
53
+ outline: none;
54
+ box-shadow: inset 0 0 0 2px var(--base-8);
55
+ border-color: var(--base-8);
56
+ }
57
+ }
58
+
59
+ .pagefind-ui__search-clear {
60
+ background: transparent !important;
61
+ }
62
+ </style>
@@ -0,0 +1,274 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import type { CollectionEntry } from 'astro:content'
4
+ import Badge from 'fulldev-ui/components/Badge.astro'
5
+ import Box from 'fulldev-ui/components/Box.astro'
6
+ import Button from 'fulldev-ui/components/Button.astro'
7
+ import Card from 'fulldev-ui/components/Card.astro'
8
+ import Column from 'fulldev-ui/components/Column.astro'
9
+ import Heading from 'fulldev-ui/components/Heading.astro'
10
+ import Image from 'fulldev-ui/components/Image.astro'
11
+ import List from 'fulldev-ui/components/List.astro'
12
+ import Rating from 'fulldev-ui/components/Rating.astro'
13
+ import Root from 'fulldev-ui/components/Root.astro'
14
+ import Text from 'fulldev-ui/components/Text.astro'
15
+ import Wrap from 'fulldev-ui/components/Wrap.astro'
16
+ import Tagline from './Tagline.astro'
17
+
18
+ type Props<As extends HTMLTag = 'section'> = Polymorphic<{ as: As }> & {
19
+ position?: 'background' | 'cover' | 'inset'
20
+ ratio?: 'landscape' | 'portrait' | 'square' | number
21
+ mask?: 'sm' | 'md' | 'lg'
22
+ buttons?: ComponentProps<typeof Button<'a'>>[]
23
+ button?: ComponentProps<typeof Button<'a'>>
24
+ cards?: ComponentProps<typeof Card<'a'>>[]
25
+ badge?: string | ComponentProps<typeof Badge<'a'>>
26
+ image?: ComponentProps<typeof Image>['src']
27
+ rating?: number
28
+ pages?: CollectionEntry<'pages'>['data'][]
29
+ records?: CollectionEntry<'records'>['data'][]
30
+ heading?: string
31
+ title?: string
32
+ text?: string
33
+ html?: string
34
+ description?: string
35
+ label?: string
36
+ tagline?: string
37
+ list?: string[]
38
+ theme?: 'light' | 'dark'
39
+ color?: 'base' | 'brand'
40
+ size?: 'sm' | 'md' | 'lg'
41
+ frame?: 'none' | 'fill' | 'panel'
42
+ align?: 'start' | 'center' | 'end'
43
+ justify?: 'start' | 'center' | 'end'
44
+ structure?: 'column' | 'split' | 'spread' | 'carousel' | 'grid' | 'masonry'
45
+ level?: 1 | 2 | 3 | 4 | 5 | 6
46
+ space?: 'auto' | 'none'
47
+ reverse?: 'odd' | 'even'
48
+ variant?: 'primary' | 'secondary' | 'tertiary'
49
+ }
50
+
51
+ const {
52
+ as = 'section',
53
+ space = 'auto',
54
+ frame = 'none',
55
+ structure = 'column',
56
+ variant = 'secondary',
57
+ align = 'start',
58
+ level = 2,
59
+ position,
60
+ label,
61
+ heading,
62
+ badge,
63
+ title,
64
+ text,
65
+ list,
66
+ html,
67
+ tagline,
68
+ description,
69
+ buttons,
70
+ image,
71
+ rating,
72
+ size,
73
+ button,
74
+ cards,
75
+ pages,
76
+ records,
77
+ mask,
78
+ ratio,
79
+ ...rest
80
+ } = Astro.props
81
+
82
+ const mergedCards = (pages || records || cards)?.filter(Boolean)
83
+ const hasCards = mergedCards && mergedCards?.length > 0
84
+
85
+ const buttonVariant = (i: number) => {
86
+ if (variant === 'primary' && i === 0) return 'primary'
87
+ else if (variant === 'primary' && i === 1) return 'secondary'
88
+ else if (variant === 'primary' && i > 1) return 'tertiary'
89
+ else if (variant === 'secondary' && i === 0) return 'secondary'
90
+ else if (variant === 'secondary' && i > 0) return 'tertiary'
91
+ else if (variant === 'tertiary') return 'tertiary'
92
+ }
93
+ ---
94
+
95
+ <Root
96
+ class:list="section"
97
+ variant={hasCards ? undefined : variant}
98
+ structure={structure === 'split' ? 'split' : 'column'}
99
+ frame={frame === 'panel' && hasCards ? 'none' : frame}
100
+ {as}
101
+ {align}
102
+ {space}
103
+ {size}
104
+ {...rest}
105
+ >
106
+ <Box
107
+ structure={structure === 'spread' || structure === 'carousel'
108
+ ? 'spread'
109
+ : 'column'}
110
+ align={structure === 'split' ? 'start' : align}
111
+ >
112
+ <slot name="segment">
113
+ <Column
114
+ style={{ textWrap: 'balance' }}
115
+ align={structure === 'split' || structure === 'spread'
116
+ ? 'start'
117
+ : align}
118
+ >
119
+ <slot name="writeup">
120
+ <Rating
121
+ color="brand"
122
+ {...typeof rating === 'number' ? { value: rating } : rating}
123
+ />
124
+ <Badge
125
+ color="base"
126
+ radius="full"
127
+ {...typeof badge === 'string' ? { html: badge } : badge}
128
+ />
129
+ <Tagline
130
+ color="brand"
131
+ html={tagline}
132
+ />
133
+ <Heading
134
+ html={heading || title}
135
+ {level}
136
+ />
137
+ <Text
138
+ contrast={!hasCards && position === 'background' && true}
139
+ html={html || text || description}
140
+ lead={level === 1}
141
+ />
142
+ <List items={list} />
143
+ </slot>
144
+ </Column>
145
+ <Wrap>
146
+ <slot name="actions">
147
+ {
148
+ [button, ...(buttons ?? [])]
149
+ .filter(Boolean)
150
+ ?.map((button: any, i: number) => (
151
+ <Button
152
+ variant={buttonVariant(i)}
153
+ {...button}
154
+ />
155
+ ))
156
+ }
157
+ </slot>
158
+ </Wrap>
159
+ </slot>
160
+ </Box>
161
+ <slot>
162
+ <Box
163
+ structure={structure === 'split' || structure === 'spread'
164
+ ? 'column'
165
+ : structure}
166
+ position={structure === 'carousel' ? 'inset' : undefined}
167
+ size={size === 'lg' ? 'md' : 'sm'}
168
+ >
169
+ <slot name="deck">
170
+ {
171
+ mergedCards?.map(({ ...rest }: any) => (
172
+ <Card
173
+ align="start"
174
+ level={Number(level) + 2}
175
+ {position}
176
+ {frame}
177
+ {variant}
178
+ {ratio}
179
+ {mask}
180
+ {...rest}
181
+ />
182
+ ))
183
+ }
184
+ </slot>
185
+ </Box>
186
+ <Image
187
+ position={hasCards ? undefined : position}
188
+ ratio={hasCards ? undefined : ratio}
189
+ mask={hasCards ? undefined : mask}
190
+ src={image}
191
+ />
192
+ </slot>
193
+ </Root>
194
+
195
+ <style is:global lang="scss">
196
+ .section {
197
+ --inset-top: var(--space-7);
198
+ --inset-left: var(--gutter-left);
199
+ --inset-right: var(--gutter-right);
200
+ --inset-bottom: var(--space-7);
201
+
202
+ position: relative;
203
+
204
+ &:first-child {
205
+ --inset-top: var(--space-6);
206
+ --inset-bottom: var(--space-6);
207
+ }
208
+
209
+ &.frame-none {
210
+ padding: var(--inset-top) var(--inset-right) var(--inset-bottom)
211
+ var(--inset-left);
212
+ }
213
+
214
+ &.frame-fill {
215
+ background-color: var(--color-2);
216
+ padding: var(--inset-top) var(--inset-right) var(--inset-bottom)
217
+ var(--inset-left);
218
+ }
219
+
220
+ &.frame-panel {
221
+ --inset-top: var(--space-6);
222
+ --inset-left: min(var(--gutter), var(--space-7));
223
+ --inset-right: min(var(--gutter), var(--space-7));
224
+ --inset-bottom: var(--space-6);
225
+
226
+ margin: var(--inset-top) var(--gutter-right) var(--inset-bottom)
227
+ var(--gutter-left);
228
+ border: 1px solid var(--base-a6);
229
+ border-radius: var(--radius-2);
230
+ background-color: var(--color-2);
231
+ padding: var(--inset-top) var(--inset-right) var(--inset-bottom)
232
+ var(--inset-left);
233
+ max-width: calc(
234
+ 100vw - var(--sidebar-width) - var(--toc-width) - var(--inset-left) - var(
235
+ --inset-right
236
+ )
237
+ );
238
+ overflow: hidden;
239
+
240
+ @media (min-width: 1024px) {
241
+ --inset-top: var(--space-7);
242
+ --inset-bottom: var(--space-7);
243
+ }
244
+ }
245
+
246
+ &.frame-viewport {
247
+ padding: var(--inset-top) var(--inset-right) var(--inset-bottom)
248
+ var(--inset-left);
249
+ min-height: 100vh;
250
+ }
251
+
252
+ @media (min-width: 1024px) {
253
+ &:nth-of-type(odd).split.reverse-odd {
254
+ > :first-child {
255
+ order: 999;
256
+ }
257
+
258
+ > :last-child {
259
+ order: 0;
260
+ }
261
+ }
262
+
263
+ &:nth-of-type(even).split.reverse-even {
264
+ > :first-child {
265
+ order: 0;
266
+ }
267
+
268
+ > :last-child {
269
+ order: 999;
270
+ }
271
+ }
272
+ }
273
+ }
274
+ </style>