fulldev-ui 0.3.7 → 0.3.9
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 +5 -2
- package/src/components/_Component.astro +2 -0
- package/src/components/_todo/Writeup.astro +3 -3
- package/src/components/base/Avatar.astro +23 -0
- package/src/components/base/Badge.astro +15 -3
- package/src/components/base/Button.astro +26 -6
- package/src/components/base/Image.astro +16 -0
- package/src/components/base/Logo.astro +10 -21
- package/src/components/base/Rating.astro +0 -2
- package/src/components/segment/Card.astro +11 -1
- package/src/components/segment/Header.astro +2 -14
- package/src/components/structure/Column.astro +2 -2
- package/src/components/structure/Row.astro +2 -2
- package/src/index.ts +1 -3
- package/src/schemas/collection-old-schemas.ts +0 -90
- package/src/schemas/schemas.ts +0 -57
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fulldev-ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
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",
|
|
@@ -31,9 +31,12 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@astrojs/check": "^0.5.9",
|
|
33
33
|
"@types/flat": "^5.0.5",
|
|
34
|
-
"astro": "^4.5.5",
|
|
35
34
|
"unocss": "^0.61.0"
|
|
36
35
|
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"astro": "^4.5.5",
|
|
38
|
+
"typescript": "^5.4.3"
|
|
39
|
+
},
|
|
37
40
|
"dependencies": {
|
|
38
41
|
"@iconify-json/tabler": "^1.1.109",
|
|
39
42
|
"astro-seo": "^0.8.3",
|
|
@@ -28,6 +28,7 @@ const {
|
|
|
28
28
|
structure,
|
|
29
29
|
text,
|
|
30
30
|
html,
|
|
31
|
+
radius,
|
|
31
32
|
level,
|
|
32
33
|
...rest
|
|
33
34
|
} = Astro.props
|
|
@@ -62,6 +63,7 @@ const render =
|
|
|
62
63
|
[`ratio-${ratio}`]: ratio,
|
|
63
64
|
[`color-${color}`]: color,
|
|
64
65
|
[`underline-${underline}`]: underline,
|
|
66
|
+
[`radius-${radius}`]: radius,
|
|
65
67
|
},
|
|
66
68
|
]}
|
|
67
69
|
{...rest}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { ComponentProps,
|
|
1
|
+
<!-- ---
|
|
2
|
+
import type { ComponentProps,HTMLTag,Polymorphic } from 'astro/types'
|
|
3
3
|
import Component from '../_Component.astro'
|
|
4
4
|
|
|
5
5
|
type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> &
|
|
@@ -21,4 +21,4 @@ const { as = 'div', ...rest } = Astro.props
|
|
|
21
21
|
|
|
22
22
|
@include component('writeup') {
|
|
23
23
|
}
|
|
24
|
-
</style>
|
|
24
|
+
</style> -->
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import { Image } from 'fulldev-ui'
|
|
4
|
+
|
|
5
|
+
type Props = Omit<ComponentProps<typeof Image>, 'position' | 'frame'> & {}
|
|
6
|
+
|
|
7
|
+
const { ...rest } = Astro.props
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<Image
|
|
11
|
+
class="avatar"
|
|
12
|
+
{...rest}
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<style is:global lang="scss">
|
|
16
|
+
@import '../../css/utils.scss';
|
|
17
|
+
|
|
18
|
+
@include component('avatar') {
|
|
19
|
+
border-radius: var(--radius-3);
|
|
20
|
+
max-width: calc(2.8 * var(--space-6));
|
|
21
|
+
height: auto;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -5,21 +5,22 @@ import Icon from './Icon.astro'
|
|
|
5
5
|
|
|
6
6
|
type Props<As extends HTMLTag = 'div'> = Polymorphic<{ as: As }> & {
|
|
7
7
|
variant?: 'solid' | 'surface' | 'soft' | 'outline' | 'ghost'
|
|
8
|
+
radius?: 'none' | 'auto' | 'full'
|
|
8
9
|
size?: 'sm' | 'md' | 'lg'
|
|
9
10
|
color?: 'base' | 'brand'
|
|
10
11
|
contrast?: boolean
|
|
11
|
-
compact?: boolean
|
|
12
12
|
html?: string
|
|
13
13
|
text?: string
|
|
14
14
|
icon?: string
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const { variant = 'outline', icon, ...rest } = Astro.props
|
|
17
|
+
const { variant = 'outline', radius = 'auto', icon, ...rest } = Astro.props
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
<Component
|
|
21
21
|
class:list={['badge']}
|
|
22
22
|
{variant}
|
|
23
|
+
{radius}
|
|
23
24
|
{...rest}
|
|
24
25
|
>
|
|
25
26
|
<slot />
|
|
@@ -38,7 +39,6 @@ const { variant = 'outline', icon, ...rest } = Astro.props
|
|
|
38
39
|
gap: var(--space-2);
|
|
39
40
|
transition: var(--transition);
|
|
40
41
|
border: 1px solid var(--border);
|
|
41
|
-
border-radius: var(--radius-1);
|
|
42
42
|
background-color: var(--background);
|
|
43
43
|
padding-right: var(--space-3);
|
|
44
44
|
padding-left: var(--space-3);
|
|
@@ -51,5 +51,17 @@ const { variant = 'outline', icon, ...rest } = Astro.props
|
|
|
51
51
|
text-align: center;
|
|
52
52
|
text-decoration: none;
|
|
53
53
|
white-space: nowrap;
|
|
54
|
+
|
|
55
|
+
&.radius-none {
|
|
56
|
+
border-radius: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.radius-auto {
|
|
60
|
+
border-radius: var(--radius-1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.radius-full {
|
|
64
|
+
border-radius: 9999px;
|
|
65
|
+
}
|
|
54
66
|
}
|
|
55
67
|
</style>
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
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
6
|
type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
|
|
7
|
+
variant?: 'solid' | 'soft' | 'surface' | 'outline' | 'ghost' | 'link'
|
|
7
8
|
size?: 'sm' | 'md' | 'lg'
|
|
8
9
|
color?: 'base' | 'brand'
|
|
10
|
+
radius?: 'none' | 'auto' | 'full'
|
|
9
11
|
contrast?: boolean
|
|
10
12
|
html?: string
|
|
11
13
|
text?: string
|
|
12
|
-
|
|
13
|
-
icon?: ComponentProps<typeof Icon> | ComponentProps<typeof Icon>['name']
|
|
14
|
+
icon?: string
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
as = 'a',
|
|
19
|
+
variant = 'solid',
|
|
20
|
+
radius = 'auto',
|
|
21
|
+
contrast,
|
|
22
|
+
icon,
|
|
23
|
+
...rest
|
|
24
|
+
} = Astro.props
|
|
17
25
|
---
|
|
18
26
|
|
|
19
27
|
<Component
|
|
@@ -21,10 +29,11 @@ const { as = 'a', variant = 'solid', contrast, icon, ...rest } = Astro.props
|
|
|
21
29
|
{as}
|
|
22
30
|
{variant}
|
|
23
31
|
{contrast}
|
|
32
|
+
{radius}
|
|
24
33
|
{...rest}
|
|
25
34
|
>
|
|
26
35
|
<slot />
|
|
27
|
-
|
|
36
|
+
<Icon name={icon} />
|
|
28
37
|
</Component>
|
|
29
38
|
|
|
30
39
|
<style is:global lang="scss">
|
|
@@ -41,7 +50,6 @@ const { as = 'a', variant = 'solid', contrast, icon, ...rest } = Astro.props
|
|
|
41
50
|
cursor: pointer;
|
|
42
51
|
outline: none !important;
|
|
43
52
|
border: 1px solid var(--border);
|
|
44
|
-
border-radius: var(--radius-1);
|
|
45
53
|
background-color: var(--background);
|
|
46
54
|
padding-right: var(--space-4);
|
|
47
55
|
padding-left: var(--space-4);
|
|
@@ -77,5 +85,17 @@ const { as = 'a', variant = 'solid', contrast, icon, ...rest } = Astro.props
|
|
|
77
85
|
color: var(--colo-12);
|
|
78
86
|
}
|
|
79
87
|
}
|
|
88
|
+
|
|
89
|
+
&.radius-none {
|
|
90
|
+
border-radius: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.radius-auto {
|
|
94
|
+
border-radius: var(--radius-1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&.radius-full {
|
|
98
|
+
border-radius: 9999px;
|
|
99
|
+
}
|
|
80
100
|
}
|
|
81
101
|
</style>
|
|
@@ -9,6 +9,7 @@ type Props = HTMLAttributes<'img'> & {
|
|
|
9
9
|
frame?: 'inset'
|
|
10
10
|
width?: number | 1920
|
|
11
11
|
height?: number | 1920
|
|
12
|
+
radius?: 'none' | 'auto' | 'full'
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
function getAltBySrc(): string {
|
|
@@ -26,6 +27,7 @@ const {
|
|
|
26
27
|
position,
|
|
27
28
|
frame,
|
|
28
29
|
width,
|
|
30
|
+
radius = 'none',
|
|
29
31
|
height,
|
|
30
32
|
...rest
|
|
31
33
|
} = Astro.props
|
|
@@ -43,6 +45,7 @@ const {
|
|
|
43
45
|
as="img"
|
|
44
46
|
{frame}
|
|
45
47
|
{position}
|
|
48
|
+
{radius}
|
|
46
49
|
{...rest}
|
|
47
50
|
/>
|
|
48
51
|
)}
|
|
@@ -79,6 +82,19 @@ const {
|
|
|
79
82
|
mask-image: linear-gradient(to top, transparent 0%, black 100%);
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
&.radius-none {
|
|
86
|
+
border-radius: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.radius-auto {
|
|
90
|
+
border-radius: var(--radius-1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
&.radius-full {
|
|
95
|
+
border-radius: 9999px;
|
|
96
|
+
}
|
|
97
|
+
|
|
82
98
|
&.position-background {
|
|
83
99
|
position: absolute;
|
|
84
100
|
top: 0;
|
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type { ComponentProps
|
|
3
|
-
import
|
|
4
|
-
import Component from '../_Component.astro'
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import { Image } from 'fulldev-ui'
|
|
5
4
|
|
|
6
|
-
type Props<
|
|
5
|
+
type Props = Omit<ComponentProps<typeof Image>, 'position' | 'frame'> & {}
|
|
7
6
|
|
|
8
|
-
const {
|
|
7
|
+
const { ...rest } = Astro.props
|
|
9
8
|
---
|
|
10
9
|
|
|
11
|
-
<
|
|
12
|
-
class
|
|
13
|
-
{href}
|
|
14
|
-
{as}
|
|
10
|
+
<Image
|
|
11
|
+
class="logo"
|
|
15
12
|
{...rest}
|
|
16
|
-
|
|
17
|
-
<slot name="before" />
|
|
18
|
-
<Children {...rest} />
|
|
19
|
-
<slot />
|
|
20
|
-
</Component>
|
|
13
|
+
/>
|
|
21
14
|
|
|
22
15
|
<style is:global lang="scss">
|
|
23
16
|
@import '../../css/utils.scss';
|
|
24
17
|
|
|
25
18
|
@include component('logo') {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
height: var(--space-6) !important;
|
|
30
|
-
object-fit: contain !important;
|
|
31
|
-
color: var(--12) !important;
|
|
32
|
-
}
|
|
19
|
+
max-width: calc(15 * var(--space-2));
|
|
20
|
+
height: 100%;
|
|
21
|
+
object-fit: contain;
|
|
33
22
|
}
|
|
34
23
|
</style>
|
|
@@ -5,6 +5,7 @@ import Component from '../_Component.astro'
|
|
|
5
5
|
type Props<As extends HTMLTag = 'a'> = Polymorphic<{ as: As }> & {
|
|
6
6
|
structure?: 'column' | 'group' | 'split' | 'spread' | 'row'
|
|
7
7
|
align?: 'start' | 'center' | 'end' | 'stretch'
|
|
8
|
+
radius?: 'none' | 'auto'
|
|
8
9
|
frame?: 'panel' | 'none'
|
|
9
10
|
color?: 'base' | 'brand'
|
|
10
11
|
contrast?: boolean
|
|
@@ -25,6 +26,7 @@ const {
|
|
|
25
26
|
frame = 'panel',
|
|
26
27
|
structure = 'column',
|
|
27
28
|
compact = true,
|
|
29
|
+
radius = 'auto',
|
|
28
30
|
variant = 'subtle',
|
|
29
31
|
...rest
|
|
30
32
|
} = Astro.props
|
|
@@ -34,6 +36,7 @@ const {
|
|
|
34
36
|
class:list={['card']}
|
|
35
37
|
{compact}
|
|
36
38
|
{href}
|
|
39
|
+
{radius}
|
|
37
40
|
{structure}
|
|
38
41
|
{variant}
|
|
39
42
|
{frame}
|
|
@@ -82,9 +85,16 @@ const {
|
|
|
82
85
|
--inner-y: var(--space-7);
|
|
83
86
|
|
|
84
87
|
border: 1px solid var(--border);
|
|
85
|
-
border-radius: var(--radius-3);
|
|
86
88
|
background-color: var(--background);
|
|
87
89
|
padding: var(--inner-y) var(--inner-x);
|
|
88
90
|
}
|
|
91
|
+
|
|
92
|
+
&.radius-none {
|
|
93
|
+
border-radius: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.radius-auto {
|
|
97
|
+
border-radius: var(--radius-1);
|
|
98
|
+
}
|
|
89
99
|
}
|
|
90
100
|
</style>
|
|
@@ -6,8 +6,10 @@ type Props<As extends HTMLTag = 'header'> = Polymorphic<{ as: As }> & {
|
|
|
6
6
|
structure?: 'spread' | 'row' | 'column'
|
|
7
7
|
position?: 'relative' | 'sticky' | 'fixed' | 'absolute'
|
|
8
8
|
variant?: 'ghost' | 'subtle' | 'soft' | 'surface' | 'outline'
|
|
9
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
9
10
|
frame?: 'fill' | 'panel'
|
|
10
11
|
align?: 'start' | 'center' | 'end'
|
|
12
|
+
compact?: boolean
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
const {
|
|
@@ -43,8 +45,6 @@ const {
|
|
|
43
45
|
top: 0;
|
|
44
46
|
right: 0;
|
|
45
47
|
left: 0;
|
|
46
|
-
justify-content: space-between;
|
|
47
|
-
align-items: center;
|
|
48
48
|
z-index: 10;
|
|
49
49
|
border-bottom: 1px solid var(--border);
|
|
50
50
|
background-color: var(--background);
|
|
@@ -82,17 +82,5 @@ const {
|
|
|
82
82
|
&.position-sticky {
|
|
83
83
|
position: sticky;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
&.align-start {
|
|
87
|
-
align-items: flex-start;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&.align-center {
|
|
91
|
-
align-items: center;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&.align-end {
|
|
95
|
-
align-items: flex-end;
|
|
96
|
-
}
|
|
97
85
|
}
|
|
98
86
|
</style>
|
|
@@ -25,8 +25,6 @@ const { align = 'start', ...rest } = Astro.props
|
|
|
25
25
|
@import '../../css/space.scss';
|
|
26
26
|
|
|
27
27
|
@include component('column') {
|
|
28
|
-
@include space-y;
|
|
29
|
-
|
|
30
28
|
display: flex;
|
|
31
29
|
position: relative;
|
|
32
30
|
flex-direction: column;
|
|
@@ -47,5 +45,7 @@ const { align = 'start', ...rest } = Astro.props
|
|
|
47
45
|
&.align-end {
|
|
48
46
|
align-items: flex-end;
|
|
49
47
|
}
|
|
48
|
+
|
|
49
|
+
@include space-y;
|
|
50
50
|
}
|
|
51
51
|
</style>
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// Schemas and utils
|
|
2
|
-
export * from './schemas/schemas'
|
|
3
|
-
|
|
4
1
|
// Base components
|
|
5
2
|
export { default as Badge } from './components/base/Badge.astro'
|
|
6
3
|
export { default as Button } from './components/base/Button.astro'
|
|
@@ -13,6 +10,7 @@ export { default as Checkbox } from './components/base/checkbox/Checkbox.astro'
|
|
|
13
10
|
export { default as Input } from './components/base/input/Input.astro'
|
|
14
11
|
export { default as InputElement } from './components/base/input/InputElement.astro'
|
|
15
12
|
// export { default as Radio } from './components/base/radio/Radio.astro'
|
|
13
|
+
export { default as Avatar } from './components/base/Avatar.astro'
|
|
16
14
|
export { default as Select } from './components/base/select/Select.astro'
|
|
17
15
|
export { default as SelectElement } from './components/base/select/SelectElement.astro'
|
|
18
16
|
export { default as SelectOption } from './components/base/select/SelectOption.astro'
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { ZodRawShape } from 'astro/zod'
|
|
2
|
-
import {
|
|
3
|
-
reference,
|
|
4
|
-
z,
|
|
5
|
-
type AnyEntryMap,
|
|
6
|
-
type ContentEntryMap,
|
|
7
|
-
type DataEntryMap,
|
|
8
|
-
type ValidContentEntrySlug,
|
|
9
|
-
} from 'astro:content'
|
|
10
|
-
|
|
11
|
-
export const pathSchema = <C extends keyof AnyEntryMap>(collection: C) =>
|
|
12
|
-
z
|
|
13
|
-
.string()
|
|
14
|
-
.transform((value) => {
|
|
15
|
-
const fullpath = value.split(`${collection}/`).pop()
|
|
16
|
-
const slug = fullpath?.split('.').shift()
|
|
17
|
-
return slug
|
|
18
|
-
})
|
|
19
|
-
.pipe(reference(collection))
|
|
20
|
-
|
|
21
|
-
const buttonSchema = z
|
|
22
|
-
.object({
|
|
23
|
-
text: z.string(),
|
|
24
|
-
html: z.string(),
|
|
25
|
-
href: z.string(),
|
|
26
|
-
})
|
|
27
|
-
.partial()
|
|
28
|
-
.passthrough()
|
|
29
|
-
|
|
30
|
-
const baseSchema = z
|
|
31
|
-
.object({
|
|
32
|
-
image: z.string(),
|
|
33
|
-
images: z.string().array(),
|
|
34
|
-
rating: z.number(),
|
|
35
|
-
badge: z.string(),
|
|
36
|
-
tagline: z.string(),
|
|
37
|
-
heading: z.string(),
|
|
38
|
-
paragraph: z.string(),
|
|
39
|
-
list: z.string().array(),
|
|
40
|
-
price: z.string().or(z.number()),
|
|
41
|
-
button: buttonSchema,
|
|
42
|
-
buttons: buttonSchema.array(),
|
|
43
|
-
})
|
|
44
|
-
.partial()
|
|
45
|
-
.passthrough()
|
|
46
|
-
|
|
47
|
-
const blockSchema = <R extends ZodRawShape>(references: R) =>
|
|
48
|
-
baseSchema
|
|
49
|
-
.extend({
|
|
50
|
-
card: baseSchema,
|
|
51
|
-
cards: baseSchema.array(),
|
|
52
|
-
})
|
|
53
|
-
.extend(references)
|
|
54
|
-
.partial()
|
|
55
|
-
.passthrough()
|
|
56
|
-
|
|
57
|
-
export const pageSchema = <R extends ZodRawShape>(references: R) =>
|
|
58
|
-
baseSchema
|
|
59
|
-
.extend({
|
|
60
|
-
title: z.string(),
|
|
61
|
-
description: z.string(),
|
|
62
|
-
block: blockSchema(references),
|
|
63
|
-
hero: blockSchema(references),
|
|
64
|
-
cta: blockSchema(references),
|
|
65
|
-
blocks: blockSchema(references).array(),
|
|
66
|
-
main: z.object({}).catchall(blockSchema(references)).partial(),
|
|
67
|
-
head: z
|
|
68
|
-
.object({
|
|
69
|
-
title: z.string(),
|
|
70
|
-
description: z.string(),
|
|
71
|
-
image: z.string().optional(),
|
|
72
|
-
})
|
|
73
|
-
.partial(),
|
|
74
|
-
})
|
|
75
|
-
.extend(references)
|
|
76
|
-
.partial()
|
|
77
|
-
.passthrough()
|
|
78
|
-
|
|
79
|
-
export type Reference<C extends keyof AnyEntryMap> =
|
|
80
|
-
C extends keyof ContentEntryMap
|
|
81
|
-
? {
|
|
82
|
-
collection: C
|
|
83
|
-
slug: ValidContentEntrySlug<C>
|
|
84
|
-
}
|
|
85
|
-
: C extends keyof DataEntryMap
|
|
86
|
-
? {
|
|
87
|
-
collection: C
|
|
88
|
-
id: keyof DataEntryMap[C]
|
|
89
|
-
}
|
|
90
|
-
: never
|
package/src/schemas/schemas.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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()
|