fulldev-ui 0.5.0-beta.3 → 0.5.0-beta.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fulldev-ui",
3
- "version": "0.5.0-beta.3",
3
+ "version": "0.5.0-beta.4",
4
4
  "description": "A component library built for Astro",
5
5
  "homepage": "https://ui.full.dev",
6
6
  "bugs": "https://github.com/fulldotdev/ui/issues",
@@ -13,35 +13,6 @@ import Tagline from 'fulldev-ui/components/Tagline.astro'
13
13
  import Text from 'fulldev-ui/components/Text.astro'
14
14
  import Textarea from 'fulldev-ui/components/Textarea.astro'
15
15
 
16
- // interface Channel {
17
- // type: 'tel' | 'email' | 'address'
18
- // text: string
19
- // heading?: string
20
- // icon?: string
21
- // href?: string
22
- // }
23
-
24
- // interface FormField {
25
- // type: 'text' | 'email' | 'tel' | 'textarea'
26
- // name: string
27
- // label: string
28
- // required?: boolean
29
- // }
30
-
31
- // interface Form {
32
- // fields: FormField[]
33
- // button: string
34
- // }
35
-
36
- // type Props<As extends HTMLTag = 'section'> = ComponentProps<
37
- // typeof Section<As>
38
- // > & {
39
- // form: Form
40
- // googleMaps?: string
41
- // socials?: any
42
- // channels: Channel[]
43
- // }
44
-
45
16
  const {
46
17
  heading,
47
18
  form,
@@ -53,7 +24,7 @@ const {
53
24
  position,
54
25
  image,
55
26
  channels,
56
- level = 2,
27
+ level = 1,
57
28
  ...rest
58
29
  } = Astro.props
59
30
  ---
@@ -69,6 +40,7 @@ const {
69
40
  text={tagline}
70
41
  />
71
42
  <Heading
43
+ size={'sm'}
72
44
  level={level}
73
45
  text={heading}
74
46
  />
@@ -106,6 +78,7 @@ const {
106
78
  <Button
107
79
  type="submit"
108
80
  color="brand"
81
+ variant="primary"
109
82
  text={form.button}
110
83
  />
111
84
  </Form>
@@ -126,6 +99,10 @@ const {
126
99
  align-items: flex-start;
127
100
  }
128
101
 
102
+ > .column {
103
+ gap: var(--space-5);
104
+ }
105
+
129
106
  .channel + .channel {
130
107
  margin-top: var(--space-3) !important;
131
108
  }
@@ -8,7 +8,7 @@ const { image, ...rest } = Astro.props
8
8
  class:list="intro"
9
9
  structure="column"
10
10
  size="sm"
11
- level={2}
11
+ level={1}
12
12
  {...rest}
13
13
  />
14
14
 
@@ -16,6 +16,8 @@ const { image, ...rest } = Astro.props
16
16
  @layer fulldev {
17
17
  .intro {
18
18
  border-bottom: 1px solid var(--base-6);
19
+ padding-top: var(--space-7);
20
+ padding-bottom: var(--space-7);
19
21
  }
20
22
  }
21
23
  </style>
@@ -9,6 +9,7 @@ import Image from 'fulldev-ui/components/Image.astro'
9
9
  import Writeup from 'fulldev-ui/components/Writeup.astro'
10
10
  import type { GlobalProps } from 'fulldev-ui/types/global-props'
11
11
  import Icon from './Icon.astro'
12
+ import Price from './Price.astro'
12
13
 
13
14
  interface Props
14
15
  extends GlobalProps,
@@ -22,9 +23,11 @@ interface Props
22
23
  variant?: ComponentProps<typeof Button>['variant']
23
24
  align?: ComponentProps<typeof Writeup>['align']
24
25
  icon?: ComponentProps<typeof Icon>['name']
26
+ price?: ComponentProps<typeof Price>['value']
25
27
  slug?: CollectionEntry<'pages'>['slug'] | undefined
26
28
  id?: any
27
29
  panel?: boolean | undefined
30
+ title?: ComponentProps<typeof Writeup>['heading']
28
31
  }
29
32
 
30
33
  const { slug } = Astro.props
@@ -47,12 +50,14 @@ const {
47
50
  heading,
48
51
  text,
49
52
  variant,
53
+ price,
50
54
  list,
51
55
  button,
52
56
  buttons,
53
57
  panel,
54
58
  image,
55
59
  icon,
60
+ title,
56
61
  images,
57
62
  position,
58
63
  ...rest
@@ -81,14 +86,15 @@ const {
81
86
  </slot>
82
87
  <slot name="writeup">
83
88
  <Writeup
89
+ heading={heading || title}
84
90
  {level}
85
91
  {rating}
86
92
  {badge}
87
93
  {tagline}
88
- {heading}
89
94
  {text}
90
95
  {list}
91
96
  />
97
+ <Price value={price} />
92
98
  </slot>
93
99
  <slot name="buttons">
94
100
  <Button
@@ -121,12 +127,12 @@ const {
121
127
  &[href] {
122
128
  cursor: pointer;
123
129
 
124
- > .root.image {
125
- transition: all;
130
+ > .image {
131
+ transition: all 0.2s ease;
126
132
  }
127
133
 
128
134
  &:hover {
129
- > .root.image {
135
+ > .image {
130
136
  opacity: 0.8;
131
137
  }
132
138
  }
@@ -53,9 +53,8 @@ const {
53
53
  >
54
54
  <Element class:list="column">
55
55
  <Logo
56
- id={logo}
57
- src={logo}
58
56
  {company}
57
+ {...typeof logo === 'string' ? { src: logo } : logo}
59
58
  />
60
59
  <Text
61
60
  color="base"
@@ -110,6 +109,7 @@ const {
110
109
  align-items: flex-start;
111
110
  gap: var(--space-6);
112
111
  margin-top: auto;
112
+ margin-top: auto;
113
113
  border-top-width: 1px;
114
114
  border-color: var(--base-a6);
115
115
  background-color: var(--base-2);
@@ -40,9 +40,8 @@ const {
40
40
  {...rest}
41
41
  >
42
42
  <Logo
43
- id={logo}
44
- src={logo}
45
43
  {company}
44
+ {...typeof logo === 'string' ? { src: logo } : logo}
46
45
  />
47
46
  <Buttons
48
47
  {buttons}
@@ -40,8 +40,8 @@ const {
40
40
  {open}
41
41
  >
42
42
  <Logo
43
- src={logo}
44
- company={company}
43
+ {company}
44
+ {...typeof logo === 'string' ? { src: logo } : logo}
45
45
  />
46
46
  {search && <Search />}
47
47
  <Element class:list="buttons">
@@ -26,3 +26,10 @@ const platform = () => {
26
26
  {variant}
27
27
  {href}
28
28
  />
29
+
30
+ <style is:global lang="scss">
31
+ .social {
32
+ padding: 0 var(--space-3);
33
+ height: calc(var(--text-2) + 2 * var(--space-3));
34
+ }
35
+ </style>
@@ -21,6 +21,8 @@ const { structure = 'column', ...rest } = Astro.props
21
21
  <style is:global lang="scss">
22
22
  .form {
23
23
  display: flex;
24
+ flex-direction: column;
25
+ gap: var(--space-4);
24
26
  width: 100%;
25
27
  max-width: calc(var(--space-4) * 44);
26
28
  }
@@ -3,6 +3,7 @@ component: DocsLayout
3
3
  sidebar: true
4
4
  header: false
5
5
  banner: false
6
+ toc: true
6
7
 
7
8
  navigation:
8
9
  company: Fulldev UI
@@ -84,10 +84,14 @@ const {
84
84
  </slot>
85
85
  </main>
86
86
  <slot name="toc">
87
- <Toc
88
- {render}
89
- {...toc}
90
- />
87
+ {
88
+ toc && (
89
+ <Toc
90
+ {render}
91
+ {...toc}
92
+ />
93
+ )
94
+ }
91
95
  </slot>
92
96
  </div>
93
97
  <slot name="footer">
@@ -108,25 +112,28 @@ const {
108
112
 
109
113
  body {
110
114
  --screen: 100vw;
115
+ display: flex;
116
+ flex-direction: column;
111
117
 
112
118
  background-color: var(--base-2);
113
119
  width: 100%;
120
+ min-height: 100vh;
114
121
  color: var(--base-11);
115
122
 
116
123
  .core {
117
124
  display: flex;
118
125
  position: relative;
126
+ flex-grow: 1;
127
+ height: 100%;
119
128
 
120
129
  main {
121
130
  --screen: 1280px;
122
-
123
131
  display: flex;
124
132
  flex: 1;
125
133
  flex-direction: column;
126
134
  background-color: var(--color-background);
127
135
  width: 100%;
128
136
  max-width: 100vw;
129
- min-height: 100vh;
130
137
  overflow-x: hidden;
131
138
  }
132
139
  }
@@ -23,11 +23,13 @@ const referenceChildren = await getReferenceChildren(slug)
23
23
  text={description}
24
24
  />
25
25
  <Categories
26
+ component="Categories"
26
27
  cards={folderChildren}
27
28
  structure="grid"
28
29
  panel
29
30
  />
30
31
  <Products
32
+ component="Products"
31
33
  cards={referenceChildren}
32
34
  structure="grid"
33
35
  />
@@ -22,3 +22,4 @@ export default z
22
22
  ),
23
23
  })
24
24
  .partial()
25
+ .passthrough()
@@ -2,9 +2,12 @@ import { z } from 'astro:content'
2
2
  import buttons from './buttons'
3
3
  import logo from './logo'
4
4
 
5
- export default z
6
- .object({
7
- logo,
8
- buttons,
9
- })
10
- .partial()
5
+ export default z.boolean().or(
6
+ z
7
+ .object({
8
+ logo,
9
+ buttons,
10
+ })
11
+ .partial()
12
+ .passthrough()
13
+ )
@@ -1,6 +1,8 @@
1
1
  import { getEntries, getEntry, z } from 'astro:content'
2
2
  import { assign } from 'radash'
3
3
  import fulldevConfig from 'virtual:fulldev-ui/config'
4
+ import footer from './components/footer'
5
+ import header from './components/header'
4
6
  import image from './components/image'
5
7
  import images from './components/images'
6
8
  import sections from './components/sections'
@@ -63,11 +65,12 @@ export default i18n.pipe(presets).pipe(
63
65
  image,
64
66
  images,
65
67
  sections,
66
- header: z.any(),
67
- footer: z.any(),
68
+ header,
69
+ footer,
68
70
  navigation,
69
71
  toc: z.any(),
70
72
  sidebar: z.any(),
73
+ banner: z.any(),
71
74
  })
72
75
  .partial()
73
76
  .passthrough()
@@ -1,7 +1,10 @@
1
1
  import { z } from 'astro:content'
2
+ import footer from './components/footer'
3
+ import header from './components/header'
2
4
  import image from './components/image'
3
5
  import sections from './components/sections'
4
6
  import component from './utils/component'
7
+ import navigation from './utils/navigation'
5
8
  import parents from './utils/parents'
6
9
 
7
10
  export default z
@@ -20,10 +23,11 @@ export default z
20
23
  description: z.string().optional(),
21
24
  image,
22
25
  sections,
23
- header: z.any(),
24
- footer: z.any(),
25
- navigation: z.any(),
26
+ header,
27
+ footer,
28
+ navigation,
26
29
  toc: z.any(),
27
30
  sidebar: z.any(),
28
31
  })
29
32
  .partial()
33
+ .passthrough()
@@ -17,6 +17,7 @@
17
17
  // })
18
18
 
19
19
  import { z } from 'astro:content'
20
+ import logo from '../components/logo'
20
21
  import pathSchema from '../utils/pathSchema'
21
22
 
22
23
  const button = pathSchema('pages').or(
@@ -43,7 +44,7 @@ const group = z
43
44
 
44
45
  export default z
45
46
  .object({
46
- logo: z.string(),
47
+ logo,
47
48
  search: z.boolean(),
48
49
  sidebar: z.boolean(),
49
50
  toc: z.boolean(),
@@ -8,4 +8,7 @@ export const getReferenceChildren = async (
8
8
  await getCollection('pages', (page) =>
9
9
  page.data?.parents?.some((p: any) => p.slug === slug)
10
10
  )
11
- )?.map((page) => page.data)
11
+ )?.map(({ slug, data }) => ({
12
+ ...data,
13
+ href: `/${slug}/`,
14
+ }))