fulldev-ui 0.3.36 → 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} +14 -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} +7 -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 -17
  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
@@ -1,10 +1,9 @@
1
1
  ---
2
2
  import type { HTMLTag, Polymorphic } from 'astro/types'
3
- import Component from '../_Component.astro'
4
- import Icon from './Icon.astro'
3
+ import Icon from 'fulldev-ui/components/Icon.astro'
4
+ import Root from 'fulldev-ui/components/Root.astro'
5
5
 
6
- type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
7
- variant?: 'solid' | 'surface' | 'soft' | 'outline' | 'ghost'
6
+ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
8
7
  radius?: 'none' | 'auto' | 'full'
9
8
  size?: 'sm' | 'md' | 'lg'
10
9
  color?: 'base' | 'brand'
@@ -14,23 +13,33 @@ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
14
13
  icon?: string
15
14
  }
16
15
 
17
- const { variant = 'outline', radius = 'auto', icon, ...rest } = Astro.props
16
+ const {
17
+ href,
18
+ html,
19
+ text,
20
+ as = href ? 'a' : 'div',
21
+ radius = 'full',
22
+ icon,
23
+ ...rest
24
+ } = Astro.props
18
25
  ---
19
26
 
20
- <Component
21
- class:list={['badge']}
22
- {variant}
27
+ <Root
28
+ class:list="badge"
23
29
  {radius}
30
+ {as}
31
+ {href}
24
32
  {...rest}
25
33
  >
26
- <slot />
27
- <Icon name={icon} />
28
- </Component>
34
+ <slot>
35
+ <Fragment set:text={text} />
36
+ <Fragment set:html={html} />
37
+ <Icon name={icon} />
38
+ </slot>
39
+ </Root>
29
40
 
30
41
  <style is:global lang="scss">
31
- @import '../../css/utils.scss';
32
-
33
- @include component('badge') {
42
+ .badge {
34
43
  display: inline-flex;
35
44
  flex-shrink: 0;
36
45
  justify-content: center;
@@ -38,20 +47,25 @@ const { variant = 'outline', radius = 'auto', icon, ...rest } = Astro.props
38
47
  vertical-align: top;
39
48
  gap: var(--space-2);
40
49
  transition: var(--transition);
41
- border: 1px solid var(--border);
42
- background-color: var(--background);
43
- padding-right: var(--space-3);
44
- padding-left: var(--space-3);
50
+ border: 1px solid var(--color-a6);
51
+ padding: 0 var(--space-3);
45
52
  height: calc(var(--text-1) + 2 * var(--space-2));
46
- color: var(--text);
47
- font-weight: var(--button-font-weight);
53
+ color: var(--color-11);
54
+ font-weight: 500;
48
55
  font-size: var(--text-1);
49
- line-height: 1.625;
50
- font-family: var(--button-font-family);
56
+ line-height: 1;
51
57
  text-align: center;
52
58
  text-decoration: none;
53
59
  white-space: nowrap;
54
60
 
61
+ &[href] {
62
+ border-color: var(--color-7);
63
+
64
+ &:hover {
65
+ border-color: var(--color-8);
66
+ }
67
+ }
68
+
55
69
  &.radius-none {
56
70
  border-radius: 0;
57
71
  }
@@ -1,27 +1,24 @@
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
+ size?: 'sm' | 'md' | 'lg'
6
7
  color?: 'base' | 'brand'
7
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
8
- compact?: boolean
9
8
  }
10
9
 
11
10
  const { ...rest } = Astro.props
12
11
  ---
13
12
 
14
- <Component
15
- class:list={['bento']}
13
+ <Root
14
+ class:list="bento"
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('bento') {
21
+ .bento {
25
22
  display: grid;
26
23
  position: relative;
27
24
  grid-template-columns: 1fr;
@@ -0,0 +1,157 @@
1
+ ---
2
+ import { getCollection, getEntries, getEntry } from 'astro:content'
3
+ import { assign, mapKeys } from 'radash'
4
+
5
+ interface Props {
6
+ _bookshop_name?: string
7
+ [key: string | number | symbol]: any
8
+ }
9
+
10
+ let { _bookshop_name, records, pages, source, ...rest } = Astro.props
11
+
12
+ const packageBlocks = import.meta.glob('../blocks/**/*.astro')
13
+ const userBlocks = import.meta.glob('/src/blocks/**/*.astro')
14
+
15
+ const mapBlockKeys = (blocks: any) =>
16
+ mapKeys(blocks, (key: any) => key.split('/').pop().split('.').shift())
17
+
18
+ const components = {
19
+ ...mapBlockKeys(packageBlocks),
20
+ ...mapBlockKeys(userBlocks),
21
+ }
22
+
23
+ const found = components[_bookshop_name as any] as any
24
+ const functioncomp = found && (await found())
25
+ const Component = functioncomp?.default
26
+
27
+ records = records
28
+ ? (await getEntries(records)).map((entry: any) => entry?.data)
29
+ : undefined
30
+
31
+ pages = pages
32
+ ? (await getEntries(pages)).map((entry: any) => ({
33
+ href: `/${entry.slug}/`,
34
+ ...entry?.data,
35
+ }))
36
+ : undefined
37
+
38
+ const slug = Astro.url.pathname.replace(/^\/|\/$/g, '')
39
+
40
+ const children =
41
+ source === 'children' && slug
42
+ ? [
43
+ ...(
44
+ await getCollection(
45
+ 'pages',
46
+ (page: any) =>
47
+ page.slug.startsWith(slug) &&
48
+ page.slug !== slug &&
49
+ !page.slug.replace(`${slug}/`, '').includes('/')
50
+ )
51
+ ).map((page: any) => ({ href: `/${page.slug}/`, ...page.data })),
52
+ ...(
53
+ await getCollection(
54
+ 'records',
55
+ (record: any) =>
56
+ record.id.startsWith(slug) &&
57
+ record.id !== slug &&
58
+ !record.id.replace(`${slug}/`, '').includes('/')
59
+ )
60
+ ).map((record: any) => record.data),
61
+ ]
62
+ : undefined
63
+
64
+ const references =
65
+ source === 'references' && slug
66
+ ? (
67
+ await getCollection('pages', (page: any) =>
68
+ page.data?.pages?.find(
69
+ (page: any) =>
70
+ page.slug
71
+ .replace('.md', '')
72
+ .replace('/index', '')
73
+ .replace('src/content/', '') === slug
74
+ )
75
+ )
76
+ ).map((item: any) => ({ href: `/${item.slug}/`, ...item.data }))
77
+ : undefined
78
+
79
+ const siblings =
80
+ source === 'siblings' && slug
81
+ ? (
82
+ await getCollection('pages', (page: any) => {
83
+ const currentPageFolder = slug.split('/').slice(0, -1).join('/')
84
+ const pageFolder = page.slug.split('/').slice(0, -1).join('/')
85
+ return (
86
+ page.slug !== slug &&
87
+ pageFolder === currentPageFolder &&
88
+ page.slug.startsWith(currentPageFolder)
89
+ )
90
+ })
91
+ )
92
+ .map((item: any) => ({ href: `/${item.slug}/`, ...item.data }))
93
+ .sort(() => Math.random() - 0.5) // Randomize the order
94
+ : undefined
95
+
96
+ const mergedPages = pages
97
+ ? await Promise.all(
98
+ pages.map(async (page: any) => {
99
+ if (!page.i18n) return page
100
+ const i18n = await getEntry(page.i18n)
101
+ return assign(i18n?.data, page)
102
+ })
103
+ )
104
+ : undefined
105
+
106
+ const mergedChildren = children
107
+ ? await Promise.all(
108
+ children.map(async (child: any) => {
109
+ if (!child.i18n) return child
110
+ const i18n = await getEntry(child.i18n)
111
+ return assign(i18n?.data, child)
112
+ })
113
+ )
114
+ : undefined
115
+
116
+ const mergedReferences = references
117
+ ? await Promise.all(
118
+ references.map(async (reference: any) => {
119
+ if (!reference.i18n) return reference
120
+ const i18n = await getEntry(reference.i18n)
121
+ return assign(i18n?.data, reference)
122
+ })
123
+ )
124
+ : undefined
125
+
126
+ const mergedSiblings = siblings
127
+ ? await Promise.all(
128
+ siblings.map(async (sibling: any) => {
129
+ if (!sibling.i18n) return sibling
130
+ const i18n = await getEntry(sibling.i18n)
131
+ return assign(i18n?.data, sibling)
132
+ })
133
+ )
134
+ : undefined
135
+ ---
136
+
137
+ {
138
+ Component && (
139
+ <Component
140
+ cards={
141
+ mergedPages ||
142
+ mergedSiblings ||
143
+ records ||
144
+ mergedChildren ||
145
+ mergedReferences
146
+ }
147
+ pages={
148
+ mergedPages ||
149
+ mergedSiblings ||
150
+ records ||
151
+ mergedChildren ||
152
+ mergedReferences
153
+ }
154
+ {...rest}
155
+ />
156
+ )
157
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Block from './Block.astro'
3
+ ---
4
+
5
+ {Object.values(Astro.props ?? {})?.map((block: any) => <Block {...block} />)}
@@ -0,0 +1,60 @@
1
+ ---
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
+ import Bento from './Bento.astro'
4
+ import Carousel from './Carousel.astro'
5
+ import Column from './Column.astro'
6
+ import Grid from './Grid.astro'
7
+ import Masonry from './Masonry.astro'
8
+ import Row from './Row.astro'
9
+ import Split from './Split.astro'
10
+ import Spread from './Spread.astro'
11
+ import Wrap from './Wrap.astro'
12
+
13
+ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
14
+ align?: 'start' | 'center' | 'end'
15
+ position?: 'inset'
16
+ space?: 'none' | 'auto'
17
+ size?: 'sm' | 'md' | 'lg'
18
+ structure?:
19
+ | 'bento'
20
+ | 'carousel'
21
+ | 'column'
22
+ | 'grid'
23
+ | 'masonry'
24
+ | 'row'
25
+ | 'split'
26
+ | 'spread'
27
+ | 'wrap'
28
+ }
29
+
30
+ const structuresMap = {
31
+ bento: Bento,
32
+ carousel: Carousel,
33
+ column: Column,
34
+ grid: Grid,
35
+ masonry: Masonry,
36
+ row: Row,
37
+ split: Split,
38
+ spread: Spread,
39
+ wrap: Wrap,
40
+ }
41
+
42
+ const {
43
+ as = 'div',
44
+ space = 'auto',
45
+ structure = 'column',
46
+ align = 'start',
47
+ ...rest
48
+ } = Astro.props
49
+
50
+ const Structure = structuresMap[structure] ?? structuresMap['column']
51
+ ---
52
+
53
+ <Structure
54
+ {as}
55
+ {align}
56
+ {space}
57
+ {...rest as any}
58
+ >
59
+ <slot />
60
+ </Structure>
@@ -0,0 +1,140 @@
1
+ ---
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
+ import Avatar from 'fulldev-ui/components/Avatar.astro'
4
+ import Icon from 'fulldev-ui/components/Icon.astro'
5
+ import Root from 'fulldev-ui/components/Root.astro'
6
+
7
+ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
8
+ variant?: 'primary' | 'secondary' | 'tertiary'
9
+ radius?: 'none' | 'auto' | 'full'
10
+ size?: 'sm' | 'md' | 'lg'
11
+ color?: 'base' | 'brand'
12
+ contrast?: boolean
13
+ avatar?: string
14
+ icon?: string
15
+ html?: string
16
+ text?: string
17
+ }
18
+
19
+ const {
20
+ as = 'a',
21
+ variant = 'primary',
22
+ radius = 'auto',
23
+ avatar,
24
+ icon,
25
+ html,
26
+ text,
27
+ ...rest
28
+ } = Astro.props
29
+ ---
30
+
31
+ <Root
32
+ class:list="button"
33
+ {as}
34
+ {variant}
35
+ {radius}
36
+ {...rest}
37
+ >
38
+ <slot>
39
+ <Avatar src={avatar} />
40
+ <Icon name={icon} />
41
+ <Fragment set:html={html} />
42
+ <Fragment set:text={text} />
43
+ </slot>
44
+ </Root>
45
+
46
+ <style is:global lang="scss">
47
+ .button {
48
+ display: inline-flex;
49
+ flex-shrink: 0;
50
+ justify-content: center;
51
+ align-items: center;
52
+ vertical-align: top;
53
+ gap: var(--space-2);
54
+ appearance: none;
55
+ transition: background-color var(--transition);
56
+ cursor: pointer;
57
+ outline: none;
58
+ box-shadow: none;
59
+ border: none;
60
+ background: none;
61
+ padding: 0 var(--space-4);
62
+ height: calc(var(--text-2) + 2 * var(--space-4));
63
+ color: var(--text);
64
+ font-weight: 500;
65
+ font-size: var(--text-2);
66
+ line-height: 1;
67
+ text-align: center;
68
+ text-decoration: none;
69
+ white-space: nowrap;
70
+
71
+ .avatar {
72
+ margin-right: calc(-1 * (var(--space-4)));
73
+ margin-left: var(--space-1);
74
+ padding: calc(var(--space-1) / 3);
75
+ width: calc(var(--text-2) + 2 * var(--space-4)) !important;
76
+ height: calc(var(--text-2) + 2 * var(--space-4)) !important;
77
+ }
78
+
79
+ &:focus-visible {
80
+ outline: 2px solid var(--focus) !important;
81
+ outline-offset: 2px;
82
+ }
83
+
84
+ &:disabled {
85
+ opacity: 0.5;
86
+ cursor: not-allowed;
87
+ pointer-events: none;
88
+ }
89
+
90
+ &.radius-none {
91
+ border-radius: 0;
92
+ }
93
+
94
+ &.radius-auto {
95
+ border-radius: var(--radius-1);
96
+ }
97
+
98
+ &.radius-full {
99
+ border-radius: 9999px;
100
+ }
101
+
102
+ &.variant-primary {
103
+ background-color: var(--color-9);
104
+ color: var(--color-contrast);
105
+
106
+ &:hover,
107
+ &:active {
108
+ background-color: var(--color-10);
109
+ }
110
+ }
111
+
112
+ &.variant-secondary {
113
+ box-shadow: 0 var(--space-1) var(--space-3) 0 rgba(0, 0, 0, 0.05);
114
+ background-color: var(--color-3);
115
+ color: var(--color-11);
116
+
117
+ &:hover {
118
+ background-color: var(--color-4);
119
+ }
120
+
121
+ &:active {
122
+ background-color: var(--color-5);
123
+ }
124
+ }
125
+
126
+ &.variant-tertiary {
127
+ box-shadow: 0 var(--space-1) var(--space-3) 0 rgba(0, 0, 0, 0.05);
128
+ background-color: transparent;
129
+ color: var(--color-11);
130
+
131
+ &:hover {
132
+ background-color: var(--color-3);
133
+ }
134
+
135
+ &:active {
136
+ background-color: var(--color-4);
137
+ }
138
+ }
139
+ }
140
+ </style>
@@ -0,0 +1,212 @@
1
+ ---
2
+ import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import Button from 'fulldev-ui/components/Button.astro'
4
+ import Price from 'fulldev-ui/components/experimental/Price.astro'
5
+ import Heading from 'fulldev-ui/components/Heading.astro'
6
+ import Icon from 'fulldev-ui/components/Icon.astro'
7
+ import Image from 'fulldev-ui/components/Image.astro'
8
+ import List from 'fulldev-ui/components/List.astro'
9
+ import Rating from 'fulldev-ui/components/Rating.astro'
10
+ import Root from 'fulldev-ui/components/Root.astro'
11
+ import Spread from 'fulldev-ui/components/Spread.astro'
12
+ import Tagline from 'fulldev-ui/components/Tagline.astro'
13
+ import Text from 'fulldev-ui/components/Text.astro'
14
+ import Wrap from 'fulldev-ui/components/Wrap.astro'
15
+
16
+ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
17
+ ratio?: 'landscape' | 'portrait' | 'square' | number
18
+ variant?: 'primary' | 'secondary' | 'tertiary'
19
+ position?: 'background' | 'cover' | 'inset'
20
+ align?: 'start' | 'center' | 'end'
21
+ level?: 1 | 2 | 3 | 4 | 5 | 6
22
+ size?: 'sm' | 'md' | 'lg'
23
+ radius?: 'auto' | 'none'
24
+ frame?: 'panel' | 'none'
25
+ color?: 'base' | 'brand'
26
+ space?: 'auto' | 'none'
27
+ mask?: 'sm' | 'md' | 'lg'
28
+ image?: string
29
+ button?: ComponentProps<typeof Button<'a'>>
30
+ buttons?: ComponentProps<typeof Button<'a'>>[]
31
+ rating?: number | ComponentProps<typeof Rating>
32
+ price?: number
33
+ icon?: string
34
+ avatar?: string
35
+ avatars?: string[]
36
+ label?: string
37
+ tagline?: string
38
+ contrast?: boolean
39
+ heading?: string
40
+ title?: string
41
+ description?: string
42
+ html?: string
43
+ text?: string
44
+ list?: string[]
45
+ }
46
+
47
+ const {
48
+ href,
49
+ as = href ? 'a' : 'div',
50
+ space = 'auto',
51
+ frame = 'panel',
52
+ radius = 'auto',
53
+ align = 'start',
54
+ variant,
55
+ level = 4,
56
+ position,
57
+ label,
58
+ heading,
59
+ title,
60
+ tagline,
61
+ text,
62
+ html,
63
+ description,
64
+ list,
65
+ buttons,
66
+ ratio,
67
+ image,
68
+ rating,
69
+ button,
70
+ price,
71
+ icon,
72
+ avatar,
73
+ mask,
74
+ avatars,
75
+ ...rest
76
+ } = Astro.props
77
+
78
+ const buttonVariant = (i: number) => {
79
+ if (variant === 'primary' && i === 0) return 'primary'
80
+ else if (variant === 'primary' && i === 1) return 'secondary'
81
+ else if (variant === 'primary' && i > 1) return 'tertiary'
82
+ else if (variant === 'secondary' && i === 0) return 'secondary'
83
+ else if (variant === 'secondary' && i > 0) return 'tertiary'
84
+ else if (variant === 'tertiary') return 'tertiary'
85
+ }
86
+ ---
87
+
88
+ <Root
89
+ class:list="card"
90
+ ratio={position === 'background' ? ratio : undefined}
91
+ structure="column"
92
+ {align}
93
+ {href}
94
+ {radius}
95
+ {space}
96
+ {frame}
97
+ {as}
98
+ {...rest}
99
+ >
100
+ <Image
101
+ {position}
102
+ {mask}
103
+ ratio={position === 'background' ? undefined : ratio}
104
+ src={image}
105
+ />
106
+ <Icon name={icon} />
107
+ <Rating
108
+ color="brand"
109
+ {...typeof rating === 'number' ? { value: rating } : rating}
110
+ />
111
+ <Tagline
112
+ color="base"
113
+ html={tagline}
114
+ />
115
+ <Spread>
116
+ <Heading
117
+ color="base"
118
+ html={heading ?? title}
119
+ {level}
120
+ />
121
+ <Price value={price} />
122
+ </Spread>
123
+ <Text
124
+ color="base"
125
+ contrast={position === 'background' && true}
126
+ html={html || text || description}
127
+ />
128
+ <List
129
+ color="base"
130
+ contrast
131
+ items={list}
132
+ />
133
+ <Wrap>
134
+ {
135
+ [button, ...(buttons ?? [])]
136
+ .filter(Boolean)
137
+ ?.map((button: any, i: number) => (
138
+ <Button
139
+ variant={buttonVariant(i)}
140
+ {...button}
141
+ />
142
+ ))
143
+ }
144
+ </Wrap>
145
+ <slot />
146
+ </Root>
147
+
148
+ <style is:global lang="scss">
149
+ .card {
150
+ --inset-top: var(--space-5);
151
+ --inset-left: var(--space-5);
152
+ --inset-right: var(--space-5);
153
+ --inset-bottom: var(--space-5);
154
+
155
+ position: relative;
156
+ text-decoration: none;
157
+
158
+ &[href] {
159
+ cursor: pointer;
160
+
161
+ > .root.image {
162
+ transition: var(--transition);
163
+ }
164
+
165
+ &:hover {
166
+ > .root.image {
167
+ opacity: 0.8;
168
+ }
169
+ }
170
+ }
171
+
172
+ &.ratio-landscape {
173
+ aspect-ratio: 4/3;
174
+ }
175
+
176
+ &.ratio-square {
177
+ aspect-ratio: 1/1;
178
+ }
179
+
180
+ &.ratio-portrait {
181
+ aspect-ratio: 3/4;
182
+ }
183
+
184
+ &.frame-fill {
185
+ border-radius: 0 !important;
186
+ }
187
+
188
+ &.frame-panel {
189
+ border: 1px solid var(--color-a6);
190
+ background-color: var(--color-2);
191
+ padding: var(--inset-top) var(--inset-right) var(--inset-bottom)
192
+ var(--inset-left);
193
+ overflow: hidden;
194
+
195
+ &[href]:hover {
196
+ border: 1px solid var(--color-a7);
197
+ }
198
+
199
+ &.radius-none {
200
+ border-radius: 0;
201
+ }
202
+
203
+ &.radius-auto {
204
+ border-radius: var(--radius-2);
205
+ }
206
+ }
207
+
208
+ > .image + * {
209
+ margin-top: var(--space-5);
210
+ }
211
+ }
212
+ </style>