fulldev-ui 0.3.2 → 0.3.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.3.2",
3
+ "version": "0.3.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",
@@ -1,13 +1,12 @@
1
1
  ---
2
2
  import tablerIcons from '@iconify-json/tabler/icons.json'
3
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
3
+ import type { HTMLTag, Polymorphic } from 'astro/types'
4
4
  import Component from '../_Component.astro'
5
5
 
6
- type Props<As extends HTMLTag = 'i'> = Polymorphic<{ as: As }> &
7
- ComponentProps<typeof Component> & {
8
- name?: string
9
- color?: 'base' | 'brand'
10
- }
6
+ type Props<As extends HTMLTag = 'i'> = Polymorphic<{ as: As }> & {
7
+ name?: string
8
+ color?: 'base' | 'brand'
9
+ }
11
10
 
12
11
  const { as = 'i', name, ...rest } = Astro.props
13
12
 
@@ -3,8 +3,7 @@ import type { ComponentProps, HTMLTag } from 'astro/types'
3
3
  import Children from '../_Children.astro'
4
4
  import Component from '../_Component.astro'
5
5
 
6
- type Props<As extends HTMLTag = 'a'> = ComponentProps<typeof Component> &
7
- ComponentProps<typeof Children>
6
+ type Props<As extends HTMLTag = 'a'> = ComponentProps<typeof Children>
8
7
 
9
8
  const { as = 'a', href = '/', src, ...rest } = Astro.props
10
9
  ---
@@ -1,15 +1,14 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
4
  import Icon from './Icon.astro'
5
5
 
6
- type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> &
7
- ComponentProps<typeof Component> & {
8
- color?: 'base' | 'brand'
9
- value?: number
10
- size?: string
11
- compact?: boolean
12
- }
6
+ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
7
+ color?: 'base' | 'brand'
8
+ value?: number
9
+ size?: string
10
+ compact?: boolean
11
+ }
13
12
 
14
13
  const { size, compact, value = 5, ...rest } = Astro.props
15
14
 
@@ -1,24 +1,23 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
4
 
5
- type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Component> & {
7
- structure?: 'column' | 'group' | 'split' | 'spread' | 'row'
8
- align?: 'start' | 'center' | 'end' | 'stretch'
9
- frame?: 'panel' | 'none'
10
- color?: 'base' | 'brand'
11
- contrast?: boolean
12
- ratio?: 'landscape' | 'portrait' | 'square' | number
13
- variant?:
14
- | 'ghost'
15
- | 'subtle'
16
- | 'surface'
17
- | 'outline'
18
- | 'soft'
19
- | 'surface'
20
- | 'solid'
21
- }
5
+ type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
6
+ structure?: 'column' | 'group' | 'split' | 'spread' | 'row'
7
+ align?: 'start' | 'center' | 'end' | 'stretch'
8
+ frame?: 'panel' | 'none'
9
+ color?: 'base' | 'brand'
10
+ contrast?: boolean
11
+ ratio?: 'landscape' | 'portrait' | 'square' | number
12
+ variant?:
13
+ | 'ghost'
14
+ | 'subtle'
15
+ | 'surface'
16
+ | 'outline'
17
+ | 'soft'
18
+ | 'surface'
19
+ | 'solid'
20
+ }
22
21
 
23
22
  const {
24
23
  href,
@@ -1,15 +1,14 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
4
 
5
- type Props<As extends HTMLTag = 'header'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Component> & {
7
- structure?: 'spread' | 'row' | 'column'
8
- position?: 'relative' | 'sticky' | 'fixed' | 'absolute'
9
- variant?: 'ghost' | 'subtle' | 'soft' | 'surface' | 'outline'
10
- frame?: 'fill' | 'panel'
11
- align?: 'start' | 'center' | 'end'
12
- }
5
+ type Props<As extends HTMLTag = 'header'> = Polymorphic<{ as: As }> & {
6
+ structure?: 'spread' | 'row' | 'column'
7
+ position?: 'relative' | 'sticky' | 'fixed' | 'absolute'
8
+ variant?: 'ghost' | 'subtle' | 'soft' | 'surface' | 'outline'
9
+ frame?: 'fill' | 'panel'
10
+ align?: 'start' | 'center' | 'end'
11
+ }
13
12
 
14
13
  const {
15
14
  as = 'header',
@@ -1,18 +1,17 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
4
 
5
- type Props<As extends HTMLTag = 'section'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Component> & {
7
- scheme?: 'light' | 'dark'
8
- color?: 'base' | 'brand'
9
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
10
- compact?: boolean
11
- frame?: 'fill' | 'viewport' | 'contain' | 'panel'
12
- variant?: 'ghost' | 'subtle' | 'outline' | 'soft' | 'solid' | 'surface'
13
- align?: 'start' | 'center' | 'end'
14
- structure?: 'column' | 'split' | 'spread' | 'row'
15
- }
5
+ type Props<As extends HTMLTag = 'section'> = Polymorphic<{ as: As }> & {
6
+ scheme?: 'light' | 'dark'
7
+ color?: 'base' | 'brand'
8
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
9
+ compact?: boolean
10
+ frame?: 'fill' | 'viewport' | 'contain' | 'panel'
11
+ variant?: 'ghost' | 'subtle' | 'outline' | 'soft' | 'solid' | 'surface'
12
+ align?: 'start' | 'center' | 'end'
13
+ structure?: 'column' | 'split' | 'spread' | 'row'
14
+ }
16
15
 
17
16
  const {
18
17
  as = 'div',
@@ -1,16 +1,15 @@
1
1
  ---
2
- import type { ComponentProps, HTMLTag, Polymorphic } from 'astro/types'
2
+ import type { HTMLTag, Polymorphic } from 'astro/types'
3
3
  import Component from '../_Component.astro'
4
4
 
5
- type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> &
6
- ComponentProps<typeof Component> & {
7
- scheme?: 'light' | 'dark'
8
- color?: 'base' | 'brand'
9
- size?: 'sm' | 'md' | 'lg'
10
- compact?: boolean
11
- frame?: 'container' | 'wrapper' | 'panel' | 'viewport' | 'card' | 'none'
12
- variant?: 'fill' | 'subtle' | 'outline' | 'soft' | 'solid' | 'surface'
13
- }
5
+ type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
6
+ scheme?: 'light' | 'dark'
7
+ color?: 'base' | 'brand'
8
+ size?: 'sm' | 'md' | 'lg'
9
+ compact?: boolean
10
+ frame?: 'container' | 'wrapper' | 'panel' | 'viewport' | 'card' | 'none'
11
+ variant?: 'fill' | 'subtle' | 'outline' | 'soft' | 'solid' | 'surface'
12
+ }
14
13
 
15
14
  const { ...rest } = Astro.props
16
15
  ---
@@ -1,5 +1,5 @@
1
1
  import { defineCollection, reference } from 'astro:content'
2
- import { pageSchema } from '../schemas/collection'
2
+ import { pageSchema } from '../schemas/schemas'
3
3
 
4
4
  const collection = defineCollection({
5
5
  type: 'content',
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Schemas and utils
2
- export * from './schemas/collection'
2
+ export * from './schemas/schemas'
3
3
 
4
4
  // Base components
5
5
  export { default as Badge } from './components/base/Badge.astro'
@@ -0,0 +1,57 @@
1
+ import { z } from 'astro/zod'
2
+
3
+ export const pathSchema = z.string().transform((value) => {
4
+ const path = value.split(`content`).pop()
5
+ const slug = path?.split('/').pop()?.split('.').shift()
6
+ return slug
7
+ })
8
+
9
+ export const buttonSchema = z
10
+ .object({
11
+ text: z.string(),
12
+ html: z.string(),
13
+ href: z.string(),
14
+ })
15
+ .partial()
16
+ .passthrough()
17
+
18
+ const baseSchema = z
19
+ .object({
20
+ image: z.string(),
21
+ images: z.string().array(),
22
+ icon: z.string(),
23
+ rating: z.number(),
24
+ badge: z.string(),
25
+ tagline: z.string(),
26
+ heading: z.string(),
27
+ text: z.string(),
28
+ list: z.string().array(),
29
+ price: z.string().or(z.number()),
30
+ button: buttonSchema,
31
+ buttons: buttonSchema.array(),
32
+ })
33
+ .partial()
34
+ .passthrough()
35
+
36
+ export const blockSchema = baseSchema
37
+ .extend({
38
+ card: baseSchema,
39
+ cards: baseSchema.array(),
40
+ })
41
+ .partial()
42
+ .passthrough()
43
+
44
+ export const pageSchema = baseSchema
45
+ .extend({
46
+ title: z.string(),
47
+ description: z.string(),
48
+ head: z
49
+ .object({
50
+ title: z.string(),
51
+ description: z.string(),
52
+ image: z.string().optional(),
53
+ })
54
+ .partial(),
55
+ })
56
+ .partial()
57
+ .passthrough()