fulldev-ui 0.6.2 → 0.6.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 +1 -1
- package/src/blocks/Contact1.astro +2 -9
- package/src/blocks/Contact2.astro +2 -9
- package/src/blocks/Hero1.astro +4 -4
- package/src/components/Badge.astro +27 -2
- package/src/components/Button.astro +13 -2
- package/src/components/Checkbox.astro +3 -8
- package/src/components/Form.astro +6 -23
- package/src/components/Head.astro +1 -0
- package/src/components/Input.astro +7 -12
- package/src/components/Link.astro +13 -2
- package/src/components/List.astro +2 -2
- package/src/components/Menu.astro +12 -6
- package/src/components/Select.astro +34 -37
- package/src/components/Switch.astro +3 -8
- package/src/components/Textarea.astro +3 -8
- package/src/content/layouts/base.yml +0 -2
- package/src/content/pages/docs/components/rating.mdx +3 -3
- package/src/content/pages/docs/structures/carousel.mdx +14 -0
- package/src/schemas/{chip.ts → badge.ts} +3 -3
- package/src/schemas/block.ts +2 -1
- package/src/schemas/card.ts +2 -2
- package/src/structures/Drawer.astro +1 -0
- package/src/components/Chip.astro +0 -73
- package/src/content/pages/docs/components/chip.mdx +0 -75
package/package.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import Button from 'fulldev-ui/components/Button.astro'
|
|
3
2
|
import Channels from 'fulldev-ui/components/Channels.astro'
|
|
4
|
-
import Fields from 'fulldev-ui/components/Fields.astro'
|
|
5
3
|
import Form from 'fulldev-ui/components/Form.astro'
|
|
6
4
|
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
7
5
|
import Image from 'fulldev-ui/components/Image.astro'
|
|
@@ -58,13 +56,8 @@ const {
|
|
|
58
56
|
<Form
|
|
59
57
|
action="/thank-you"
|
|
60
58
|
method="POST"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<Button
|
|
64
|
-
type="submit"
|
|
65
|
-
text={form?.submit}
|
|
66
|
-
/>
|
|
67
|
-
</Form>
|
|
59
|
+
{...form}
|
|
60
|
+
/>
|
|
68
61
|
<Image {...image} />
|
|
69
62
|
</Prose>
|
|
70
63
|
</Container>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import Button from 'fulldev-ui/components/Button.astro'
|
|
3
2
|
import Channels from 'fulldev-ui/components/Channels.astro'
|
|
4
|
-
import Fields from 'fulldev-ui/components/Fields.astro'
|
|
5
3
|
import Form from 'fulldev-ui/components/Form.astro'
|
|
6
4
|
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
7
5
|
import Image from 'fulldev-ui/components/Image.astro'
|
|
@@ -60,13 +58,8 @@ const {
|
|
|
60
58
|
<Form
|
|
61
59
|
action="/thank-you"
|
|
62
60
|
method="POST"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<Button
|
|
66
|
-
type="submit"
|
|
67
|
-
text={form?.submit}
|
|
68
|
-
/>
|
|
69
|
-
</Form>
|
|
61
|
+
{...form}
|
|
62
|
+
/>
|
|
70
63
|
</Prose>
|
|
71
64
|
<Image {...image} />
|
|
72
65
|
</Split>
|
package/src/blocks/Hero1.astro
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
+
import Badge from 'fulldev-ui/components/Badge.astro'
|
|
2
3
|
import Buttons from 'fulldev-ui/components/Buttons.astro'
|
|
3
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
4
4
|
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
5
5
|
import Image from 'fulldev-ui/components/Image.astro'
|
|
6
6
|
import Paragraph from 'fulldev-ui/components/Paragraph.astro'
|
|
@@ -16,7 +16,7 @@ interface Props extends BlockSchema {}
|
|
|
16
16
|
|
|
17
17
|
const {
|
|
18
18
|
depth = 2,
|
|
19
|
-
|
|
19
|
+
badge,
|
|
20
20
|
tagline,
|
|
21
21
|
heading,
|
|
22
22
|
paragraph,
|
|
@@ -35,9 +35,9 @@ const {
|
|
|
35
35
|
<Container class="flex flex-col items-center gap-16">
|
|
36
36
|
<Prose align="center">
|
|
37
37
|
<Proof {...proof} />
|
|
38
|
-
<
|
|
38
|
+
<Badge
|
|
39
39
|
size="lg"
|
|
40
|
-
{...
|
|
40
|
+
{...badge}
|
|
41
41
|
/>
|
|
42
42
|
<Tagline
|
|
43
43
|
size="sm"
|
|
@@ -7,16 +7,27 @@ interface Props extends HTMLAttributes<'a'>, HTMLAttributes<'div'> {
|
|
|
7
7
|
size?: 'sm' | 'md' | 'lg' | undefined
|
|
8
8
|
text?: string | undefined
|
|
9
9
|
icon?: string | undefined
|
|
10
|
+
href?: string | undefined
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
variant = 'outline',
|
|
15
|
+
size = 'md',
|
|
16
|
+
text,
|
|
17
|
+
icon,
|
|
18
|
+
href,
|
|
19
|
+
target = href?.startsWith('http') ? '_blank' : undefined,
|
|
20
|
+
...rest
|
|
21
|
+
} = Astro.props
|
|
13
22
|
---
|
|
14
23
|
|
|
15
24
|
<Element
|
|
16
25
|
class:list="badge"
|
|
17
|
-
as={
|
|
26
|
+
as={href ? 'a' : 'div'}
|
|
18
27
|
{variant}
|
|
19
28
|
{size}
|
|
29
|
+
{href}
|
|
30
|
+
{target}
|
|
20
31
|
{...rest}
|
|
21
32
|
>
|
|
22
33
|
<Fragment set:html={text} />
|
|
@@ -27,6 +38,20 @@ const { variant = 'outline', size = 'md', text, icon, ...rest } = Astro.props
|
|
|
27
38
|
@layer fulldev {
|
|
28
39
|
.badge {
|
|
29
40
|
@apply inline-flex h-6 items-center justify-center whitespace-nowrap rounded-full px-2.5 text-xs font-medium leading-none ring-offset-background;
|
|
41
|
+
@apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
|
|
42
|
+
@apply disabled:pointer-events-none disabled:opacity-50;
|
|
43
|
+
|
|
44
|
+
&.size-sm {
|
|
45
|
+
@apply h-6 min-w-6 px-2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.size-md {
|
|
49
|
+
@apply h-7 min-w-7 px-3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.size-lg {
|
|
53
|
+
@apply h-8 min-w-8 px-3.5;
|
|
54
|
+
}
|
|
30
55
|
|
|
31
56
|
&.variant-primary {
|
|
32
57
|
@apply bg-primary text-primary-foreground;
|
|
@@ -11,16 +11,27 @@ interface Props
|
|
|
11
11
|
size?: 'sm' | 'md' | 'lg' | undefined
|
|
12
12
|
text?: string | undefined
|
|
13
13
|
icon?: string | undefined
|
|
14
|
+
href?: string | undefined
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
variant = 'primary',
|
|
19
|
+
size = 'md',
|
|
20
|
+
text,
|
|
21
|
+
icon,
|
|
22
|
+
href,
|
|
23
|
+
target = href?.startsWith('http') ? '_blank' : undefined,
|
|
24
|
+
...rest
|
|
25
|
+
} = Astro.props
|
|
17
26
|
---
|
|
18
27
|
|
|
19
28
|
<Element
|
|
20
29
|
class:list={['button']}
|
|
21
|
-
as={
|
|
30
|
+
as={href ? 'a' : rest.for ? 'label' : 'button'}
|
|
22
31
|
{variant}
|
|
23
32
|
{size}
|
|
33
|
+
{href}
|
|
34
|
+
{target}
|
|
24
35
|
{...rest}
|
|
25
36
|
>
|
|
26
37
|
<Element as="span">
|
|
@@ -12,9 +12,8 @@ interface Props extends HTMLAttributes<'input'> {
|
|
|
12
12
|
const { label, name = label, id = name, size = 'md', ...rest } = Astro.props
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
<
|
|
15
|
+
<Label
|
|
16
16
|
class:list="checkbox"
|
|
17
|
-
as="label"
|
|
18
17
|
for={id}
|
|
19
18
|
{size}
|
|
20
19
|
>
|
|
@@ -32,12 +31,8 @@ const { label, name = label, id = name, size = 'md', ...rest } = Astro.props
|
|
|
32
31
|
name="check"
|
|
33
32
|
{size}
|
|
34
33
|
/>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
text={label}
|
|
38
|
-
{size}
|
|
39
|
-
/>
|
|
40
|
-
</Element>
|
|
34
|
+
<Fragment set:html={label} />
|
|
35
|
+
</Label>
|
|
41
36
|
|
|
42
37
|
<style is:global>
|
|
43
38
|
@layer fulldev {
|
|
@@ -2,24 +2,14 @@
|
|
|
2
2
|
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
3
|
import Button from 'fulldev-ui/components/Button.astro'
|
|
4
4
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
5
|
-
import
|
|
6
|
-
import Select from 'fulldev-ui/components/Select.astro'
|
|
7
|
-
import Textarea from 'fulldev-ui/components/Textarea.astro'
|
|
5
|
+
import Fields from 'fulldev-ui/components/Fields.astro'
|
|
8
6
|
|
|
9
7
|
interface Props extends HTMLAttributes<'form'> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
| (
|
|
13
|
-
| ComponentProps<typeof Input>
|
|
14
|
-
| ComponentProps<typeof Select>
|
|
15
|
-
| (ComponentProps<typeof Textarea> & {
|
|
16
|
-
type?: 'textarea' | undefined
|
|
17
|
-
})
|
|
18
|
-
)[]
|
|
19
|
-
| undefined
|
|
8
|
+
fields?: ComponentProps<typeof Fields>['fields']
|
|
9
|
+
button?: ComponentProps<typeof Button> | undefined
|
|
20
10
|
}
|
|
21
11
|
|
|
22
|
-
const { fields,
|
|
12
|
+
const { fields, button, ...rest } = Astro.props
|
|
23
13
|
---
|
|
24
14
|
|
|
25
15
|
<Element
|
|
@@ -27,18 +17,11 @@ const { fields, submit, ...rest } = Astro.props
|
|
|
27
17
|
as="form"
|
|
28
18
|
{...rest}
|
|
29
19
|
>
|
|
30
|
-
{
|
|
31
|
-
fields?.map((field) => {
|
|
32
|
-
if ('options' in field) return <Select {...field} />
|
|
33
|
-
if ('type' in field && field.type === 'textarea')
|
|
34
|
-
return <Textarea {...field} />
|
|
35
|
-
return <Input {...(field as any)} />
|
|
36
|
-
})
|
|
37
|
-
}
|
|
20
|
+
<Fields {fields} />
|
|
38
21
|
<slot />
|
|
39
22
|
<Button
|
|
40
23
|
type="submit"
|
|
41
|
-
|
|
24
|
+
{...button}
|
|
42
25
|
/>
|
|
43
26
|
</Element>
|
|
44
27
|
|
|
@@ -23,22 +23,13 @@ const {
|
|
|
23
23
|
} = Astro.props
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
<
|
|
26
|
+
<Label
|
|
27
27
|
class:list="input"
|
|
28
|
-
as="label"
|
|
29
28
|
for={id}
|
|
30
29
|
{size}
|
|
31
30
|
{...rest}
|
|
32
31
|
>
|
|
33
|
-
<
|
|
34
|
-
for={name}
|
|
35
|
-
text={label}
|
|
36
|
-
{size}
|
|
37
|
-
/>
|
|
38
|
-
<Icon
|
|
39
|
-
name={icon}
|
|
40
|
-
{size}
|
|
41
|
-
/>
|
|
32
|
+
<Fragment set:html={label} />
|
|
42
33
|
<Element
|
|
43
34
|
class:list="input-input"
|
|
44
35
|
as="input"
|
|
@@ -49,7 +40,11 @@ const {
|
|
|
49
40
|
{type}
|
|
50
41
|
{value}
|
|
51
42
|
/>
|
|
52
|
-
|
|
43
|
+
<Icon
|
|
44
|
+
name={icon}
|
|
45
|
+
{size}
|
|
46
|
+
/>
|
|
47
|
+
</Label>
|
|
53
48
|
|
|
54
49
|
<style is:global>
|
|
55
50
|
@layer fulldev {
|
|
@@ -8,17 +8,28 @@ interface Props extends HTMLAttributes<'a'> {
|
|
|
8
8
|
size?: 'sm' | 'md' | 'lg' | undefined
|
|
9
9
|
text?: string | undefined
|
|
10
10
|
icon?: string | undefined
|
|
11
|
+
href?: string | undefined
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
href,
|
|
16
|
+
variant = 'muted',
|
|
17
|
+
size = 'md',
|
|
18
|
+
text,
|
|
19
|
+
icon,
|
|
20
|
+
target = href?.startsWith('http') ? '_blank' : undefined,
|
|
21
|
+
...rest
|
|
22
|
+
} = Astro.props
|
|
14
23
|
---
|
|
15
24
|
|
|
16
25
|
<Element
|
|
17
26
|
class:list="link"
|
|
18
27
|
as="a"
|
|
19
|
-
current={`/${Astro.params.page}/` ===
|
|
28
|
+
current={`/${Astro.params.page}/` === href}
|
|
20
29
|
{variant}
|
|
21
30
|
{size}
|
|
31
|
+
{href}
|
|
32
|
+
{target}
|
|
22
33
|
{...rest}
|
|
23
34
|
>
|
|
24
35
|
<Fragment set:html={text} />
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
import type { HTMLAttributes } from 'astro/types'
|
|
3
3
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
4
|
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
5
|
-
import
|
|
5
|
+
import Link from 'fulldev-ui/components/Link.astro'
|
|
6
6
|
import type { ComponentProps } from 'svelte'
|
|
7
|
-
import Links from './Links.astro'
|
|
8
7
|
|
|
9
8
|
interface Props extends HTMLAttributes<'div'> {
|
|
10
9
|
size?: 'sm' | 'md' | 'lg' | undefined
|
|
@@ -17,6 +16,7 @@ const { size = 'md', heading, links, ...rest } = Astro.props
|
|
|
17
16
|
|
|
18
17
|
<Element
|
|
19
18
|
class:list="menu"
|
|
19
|
+
as="menu"
|
|
20
20
|
{...rest}
|
|
21
21
|
>
|
|
22
22
|
{
|
|
@@ -28,10 +28,16 @@ const { size = 'md', heading, links, ...rest } = Astro.props
|
|
|
28
28
|
/>
|
|
29
29
|
)
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
{
|
|
32
|
+
links?.map((link) => (
|
|
33
|
+
<Element as="li">
|
|
34
|
+
<Link
|
|
35
|
+
{size}
|
|
36
|
+
{...link}
|
|
37
|
+
/>
|
|
38
|
+
</Element>
|
|
39
|
+
))
|
|
40
|
+
}
|
|
35
41
|
</Element>
|
|
36
42
|
|
|
37
43
|
<style is:global>
|
|
@@ -24,47 +24,44 @@ const {
|
|
|
24
24
|
} = Astro.props
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{id}
|
|
43
|
-
{name}
|
|
44
|
-
{...rest}
|
|
45
|
-
>
|
|
46
|
-
<Element
|
|
47
|
-
class:list="select-option"
|
|
48
|
-
as="option"
|
|
49
|
-
value={placeholder}
|
|
50
|
-
set:html={placeholder}
|
|
51
|
-
disabled
|
|
52
|
-
selected
|
|
53
|
-
/>
|
|
54
|
-
{
|
|
55
|
-
options?.map((option: any) => (
|
|
27
|
+
{
|
|
28
|
+
options && (
|
|
29
|
+
<Label
|
|
30
|
+
class:list="select"
|
|
31
|
+
for={id}
|
|
32
|
+
{size}
|
|
33
|
+
>
|
|
34
|
+
<Fragment set:html={label} />
|
|
35
|
+
<Element
|
|
36
|
+
class:list="select-select"
|
|
37
|
+
as="select"
|
|
38
|
+
{id}
|
|
39
|
+
{name}
|
|
40
|
+
{...rest}
|
|
41
|
+
>
|
|
56
42
|
<Element
|
|
57
43
|
class:list="select-option"
|
|
58
44
|
as="option"
|
|
59
|
-
|
|
60
|
-
set:html={
|
|
61
|
-
|
|
45
|
+
value={placeholder}
|
|
46
|
+
set:html={placeholder}
|
|
47
|
+
disabled
|
|
48
|
+
selected
|
|
62
49
|
/>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
{options?.map((option: any) => (
|
|
51
|
+
<Element
|
|
52
|
+
class:list="select-option"
|
|
53
|
+
as="option"
|
|
54
|
+
selected={value === option}
|
|
55
|
+
set:html={option}
|
|
56
|
+
value={option}
|
|
57
|
+
/>
|
|
58
|
+
))}
|
|
59
|
+
<slot />
|
|
60
|
+
</Element>
|
|
61
|
+
<Icon name="chevron-down" />
|
|
62
|
+
</Label>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
68
65
|
|
|
69
66
|
<style is:global>
|
|
70
67
|
@layer fulldev {
|
|
@@ -11,9 +11,8 @@ interface Props extends Omit<HTMLAttributes<'input'>, 'type'> {
|
|
|
11
11
|
const { label, name = label, id = name, size = 'md', ...rest } = Astro.props
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
<
|
|
14
|
+
<Label
|
|
15
15
|
class:list="switch"
|
|
16
|
-
as="label"
|
|
17
16
|
for={id}
|
|
18
17
|
{size}
|
|
19
18
|
>
|
|
@@ -32,12 +31,8 @@ const { label, name = label, id = name, size = 'md', ...rest } = Astro.props
|
|
|
32
31
|
show={id}
|
|
33
32
|
class="switch-mark"
|
|
34
33
|
/>
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
text={label}
|
|
38
|
-
{size}
|
|
39
|
-
/>
|
|
40
|
-
</Element>
|
|
34
|
+
<Fragment set:html={label} />
|
|
35
|
+
</Label>
|
|
41
36
|
|
|
42
37
|
<style is:global>
|
|
43
38
|
@layer fulldev {
|
|
@@ -19,17 +19,12 @@ const {
|
|
|
19
19
|
} = Astro.props
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
<
|
|
22
|
+
<Label
|
|
23
23
|
class:list="textarea"
|
|
24
|
-
as="label"
|
|
25
24
|
for={id}
|
|
26
25
|
{size}
|
|
27
26
|
>
|
|
28
|
-
<
|
|
29
|
-
for={name}
|
|
30
|
-
text={label}
|
|
31
|
-
{size}
|
|
32
|
-
/>
|
|
27
|
+
<Fragment set:html={label} />
|
|
33
28
|
<Element
|
|
34
29
|
class:list="textarea-textarea"
|
|
35
30
|
as="textarea"
|
|
@@ -40,7 +35,7 @@ const {
|
|
|
40
35
|
{rows}
|
|
41
36
|
{...rest}
|
|
42
37
|
/>
|
|
43
|
-
</
|
|
38
|
+
</Label>
|
|
44
39
|
|
|
45
40
|
<style is:global>
|
|
46
41
|
@layer textarea {
|
|
@@ -37,7 +37,7 @@ import Rating from 'fulldev-ui/components/Rating.astro'
|
|
|
37
37
|
import Rating from 'fulldev-ui/components/Rating.astro'
|
|
38
38
|
---
|
|
39
39
|
|
|
40
|
-
<Rating size="sm" score={
|
|
41
|
-
<Rating size="md" score={
|
|
42
|
-
<Rating size="lg" score={
|
|
40
|
+
<Rating size="sm" score={5} />
|
|
41
|
+
<Rating size="md" score={5} />
|
|
42
|
+
<Rating size="lg" score={5} />
|
|
43
43
|
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ComponentProps } from 'astro/types'
|
|
2
2
|
import { z } from 'astro:content'
|
|
3
|
-
import type
|
|
3
|
+
import type Badge from 'fulldev-ui/components/Badge.astro'
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const badgeSchema = z
|
|
6
6
|
.object({
|
|
7
7
|
icon: z.string().optional(),
|
|
8
8
|
text: z.string().optional(),
|
|
@@ -11,4 +11,4 @@ export const chipSchema = z
|
|
|
11
11
|
size: z.enum(['sm', 'md', 'lg']).optional(),
|
|
12
12
|
variant: z.enum(['primary', 'secondary', 'outline']).optional(),
|
|
13
13
|
})
|
|
14
|
-
.strict() satisfies z.ZodType<ComponentProps<typeof
|
|
14
|
+
.strict() satisfies z.ZodType<ComponentProps<typeof Badge>>
|
package/src/schemas/block.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
+
import { buttonSchema } from 'fulldev-ui/schemas/button.ts'
|
|
2
3
|
import { cardSchema } from 'fulldev-ui/schemas/card.ts'
|
|
3
4
|
import { menuSchema } from 'fulldev-ui/schemas/menu.ts'
|
|
4
5
|
import { pathSchema } from 'fulldev-ui/schemas/path.ts'
|
|
@@ -22,7 +23,7 @@ export const blockSchema = cardSchema
|
|
|
22
23
|
form: z
|
|
23
24
|
.object({
|
|
24
25
|
fields: z.array(z.any()).optional(),
|
|
25
|
-
|
|
26
|
+
button: buttonSchema.optional(),
|
|
26
27
|
})
|
|
27
28
|
.strict()
|
|
28
29
|
.optional(),
|
package/src/schemas/card.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
|
+
import { badgeSchema } from 'fulldev-ui/schemas/badge.ts'
|
|
2
3
|
import { buttonSchema } from 'fulldev-ui/schemas/button.ts'
|
|
3
4
|
import { channelSchema } from 'fulldev-ui/schemas/channel.ts'
|
|
4
|
-
import { chipSchema } from 'fulldev-ui/schemas/chip.ts'
|
|
5
5
|
import { imageSchema } from 'fulldev-ui/schemas/image.ts'
|
|
6
6
|
import { linkSchema } from 'fulldev-ui/schemas/link.ts'
|
|
7
7
|
import { logoSchema } from 'fulldev-ui/schemas/logo.ts'
|
|
@@ -16,6 +16,7 @@ export const cardSchema = z
|
|
|
16
16
|
dark: z.boolean().optional(),
|
|
17
17
|
text: z.string().optional(),
|
|
18
18
|
content: z.string().optional(),
|
|
19
|
+
badge: badgeSchema.optional(),
|
|
19
20
|
tagline: z.string().optional(),
|
|
20
21
|
heading: z.string().optional(),
|
|
21
22
|
paragraph: z.string().optional(),
|
|
@@ -25,7 +26,6 @@ export const cardSchema = z
|
|
|
25
26
|
link: linkSchema.optional(),
|
|
26
27
|
links: linkSchema.array().optional(),
|
|
27
28
|
menus: menuSchema.array().optional(),
|
|
28
|
-
chip: chipSchema.optional(),
|
|
29
29
|
badges: z.string().array().optional(),
|
|
30
30
|
button: buttonSchema.optional(),
|
|
31
31
|
buttons: buttonSchema.array().optional(),
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from 'astro/types'
|
|
3
|
-
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
|
-
import Icon from 'fulldev-ui/components/Icon.astro'
|
|
5
|
-
|
|
6
|
-
interface Props extends HTMLAttributes<'a'>, HTMLAttributes<'div'> {
|
|
7
|
-
variant?: 'primary' | 'secondary' | 'outline' | undefined
|
|
8
|
-
size?: 'sm' | 'md' | 'lg' | undefined
|
|
9
|
-
text?: string | undefined
|
|
10
|
-
icon?: string | undefined
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const { variant = 'outline', size = 'md', text, icon, ...rest } = Astro.props
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<Element
|
|
17
|
-
class:list="chip"
|
|
18
|
-
as={rest.href ? 'a' : 'div'}
|
|
19
|
-
{variant}
|
|
20
|
-
{size}
|
|
21
|
-
{...rest}
|
|
22
|
-
>
|
|
23
|
-
<Icon
|
|
24
|
-
size="sm"
|
|
25
|
-
name={icon}
|
|
26
|
-
/>
|
|
27
|
-
<Element as="span">
|
|
28
|
-
<Fragment set:html={text} />
|
|
29
|
-
<slot />
|
|
30
|
-
</Element>
|
|
31
|
-
</Element>
|
|
32
|
-
|
|
33
|
-
<style is:global>
|
|
34
|
-
@layer fulldev {
|
|
35
|
-
.chip {
|
|
36
|
-
@apply inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-full text-sm font-medium leading-none ring-offset-background transition-colors;
|
|
37
|
-
@apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
|
|
38
|
-
@apply disabled:pointer-events-none disabled:opacity-50;
|
|
39
|
-
|
|
40
|
-
&.size-sm {
|
|
41
|
-
@apply h-6 min-w-6 px-2;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&.size-md {
|
|
45
|
-
@apply h-7 min-w-7 px-3;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.size-lg {
|
|
49
|
-
@apply h-8 min-w-8 px-3.5;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&.variant-primary {
|
|
53
|
-
@apply bg-primary text-primary-foreground hover:bg-primary-hover;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&.variant-secondary {
|
|
57
|
-
@apply bg-secondary text-secondary-foreground hover:bg-secondary-hover;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&.variant-outline {
|
|
61
|
-
@apply border border-input text-accent-foreground hover:bg-accent;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.icon {
|
|
65
|
-
@apply first:last:absolute;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
span {
|
|
69
|
-
@apply text-inherit;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
</style>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
_block: Content7
|
|
3
|
-
title: Chip
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import Props from 'fulldev-ui/components/docs/Props.astro'
|
|
7
|
-
|
|
8
|
-
```astro live
|
|
9
|
-
---
|
|
10
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<Chip>Chip</Chip>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Props
|
|
17
|
-
|
|
18
|
-
<Props />
|
|
19
|
-
|
|
20
|
-
## Examples
|
|
21
|
-
|
|
22
|
-
### `variant`
|
|
23
|
-
|
|
24
|
-
```astro live
|
|
25
|
-
---
|
|
26
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
<Chip variant="primary">Primary</Chip>
|
|
30
|
-
<Chip variant="secondary">Secondary</Chip>
|
|
31
|
-
<Chip variant="outline">Outline</Chip>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### `size`
|
|
35
|
-
|
|
36
|
-
```astro live
|
|
37
|
-
---
|
|
38
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
<Chip size="sm">Small</Chip>
|
|
42
|
-
<Chip size="md">Medium</Chip>
|
|
43
|
-
<Chip size="lg">Large</Chip>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### `icon`
|
|
47
|
-
|
|
48
|
-
```astro live
|
|
49
|
-
---
|
|
50
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
<Chip icon="circle" text="Chip" />
|
|
54
|
-
<Chip icon="circle" />
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### `href`
|
|
58
|
-
|
|
59
|
-
```astro live
|
|
60
|
-
---
|
|
61
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
<Chip href="#">Link</Chip>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### `text`
|
|
68
|
-
|
|
69
|
-
```astro live
|
|
70
|
-
---
|
|
71
|
-
import Chip from 'fulldev-ui/components/Chip.astro'
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
<Chip text="Chip" />
|
|
75
|
-
```
|