Compare commits
4 Commits
3ed7e027c2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd19a01654 | ||
|
|
98dd7741a0 | ||
|
|
1ebe68efeb | ||
|
|
791a257294 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,3 +2,5 @@
|
||||
node_modules/*
|
||||
.next
|
||||
next-env.d.ts
|
||||
.env.local
|
||||
.mcp.json
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Typography } from "@/components/elements"
|
||||
import { Typography } from "@/components/elements/Typography"
|
||||
|
||||
const Home: React.FC = () => {
|
||||
return (
|
||||
|
||||
@@ -20,7 +20,11 @@ export interface ButtonProps
|
||||
}
|
||||
|
||||
function Button({ variant = "default", size = "default", ...props }: ButtonProps) {
|
||||
return <ShadcnButton variant={variant} size={size} {...props} />
|
||||
return (
|
||||
<span className="inline-block">
|
||||
<ShadcnButton variant={variant} size={size} {...props} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
export { Button }
|
||||
|
||||
@@ -17,14 +17,8 @@ export const CardConfig: ElementConfig = {
|
||||
label: "Subtitle",
|
||||
},
|
||||
tags: {
|
||||
type: "array",
|
||||
type: "tags",
|
||||
label: "Tags",
|
||||
arrayFields: {
|
||||
tag: {
|
||||
type: "text",
|
||||
label: "Tag",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -10,15 +10,11 @@ import { cn } from "@/lib/utils"
|
||||
import { Image } from "./Image"
|
||||
import { Typography } from "./Typography"
|
||||
|
||||
export interface CardTag {
|
||||
tag: string
|
||||
}
|
||||
|
||||
export interface CardProps extends React.ComponentProps<typeof ShadcnCard> {
|
||||
image?: string
|
||||
title?: string
|
||||
subtitle?: string
|
||||
tags?: CardTag[]
|
||||
tags?: string[]
|
||||
}
|
||||
|
||||
function Card({
|
||||
@@ -31,7 +27,6 @@ function Card({
|
||||
}: CardProps) {
|
||||
return (
|
||||
<ShadcnCard
|
||||
data-slot="element-card"
|
||||
className={cn("overflow-hidden pt-0", className)}
|
||||
{...props}
|
||||
>
|
||||
@@ -59,9 +54,9 @@ function Card({
|
||||
|
||||
{tags && tags.length > 0 ? (
|
||||
<CardContent className="flex flex-wrap gap-2">
|
||||
{tags.map((item, index) => (
|
||||
<Badge key={`${item.tag}-${index}`} variant="secondary">
|
||||
{item.tag}
|
||||
{tags.map((tag, index) => (
|
||||
<Badge key={`${tag}-${index}`} variant="secondary">
|
||||
{tag}
|
||||
</Badge>
|
||||
))}
|
||||
</CardContent>
|
||||
|
||||
@@ -5,7 +5,7 @@ export const ImageConfig: ElementConfig = {
|
||||
label: "Image",
|
||||
fields: {
|
||||
src: {
|
||||
type: "text",
|
||||
type: "image",
|
||||
label: "Source URL",
|
||||
},
|
||||
alt: {
|
||||
@@ -28,11 +28,11 @@ export const ImageConfig: ElementConfig = {
|
||||
label: "Circle",
|
||||
},
|
||||
width: {
|
||||
type: "text",
|
||||
type: "number",
|
||||
label: "Width",
|
||||
},
|
||||
height: {
|
||||
type: "text",
|
||||
type: "number",
|
||||
label: "Height",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -38,8 +38,8 @@ function Image({
|
||||
className,
|
||||
}: ImageProps) {
|
||||
return (
|
||||
<span className="inline-block">
|
||||
<NextImage
|
||||
data-slot="image"
|
||||
src={src}
|
||||
alt={alt}
|
||||
height={height}
|
||||
@@ -50,6 +50,7 @@ function Image({
|
||||
className
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ function Typography({
|
||||
|
||||
return (
|
||||
<Comp
|
||||
data-slot="typography"
|
||||
data-variant={variant}
|
||||
className={cn(
|
||||
variantStyles[variant],
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
export * from "./types"
|
||||
|
||||
export { Typography } from "./Typography"
|
||||
export type {
|
||||
TypographyProps,
|
||||
TypographyVariant,
|
||||
TypographyAlign,
|
||||
TypographyWeight,
|
||||
} from "./Typography"
|
||||
export { TypographyConfig } from "./Typography.config"
|
||||
|
||||
export { Button } from "./Button"
|
||||
export type { ButtonProps, ButtonVariant, ButtonSize } from "./Button"
|
||||
export { ButtonConfig } from "./Button.config"
|
||||
|
||||
export { Image } from "./Image"
|
||||
export type { ImageProps, ObjectFit } from "./Image"
|
||||
export { ImageConfig } from "./Image.config"
|
||||
|
||||
export { Icon } from "./Icon"
|
||||
export type { IconProps, IconName } from "./Icon"
|
||||
export { IconConfig } from "./Icon.config"
|
||||
|
||||
export { Card } from "./Card"
|
||||
export type { CardProps, CardTag } from "./Card"
|
||||
export { CardConfig } from "./Card.config"
|
||||
@@ -7,6 +7,9 @@ export type FieldType =
|
||||
| "object"
|
||||
| "boolean"
|
||||
| "select"
|
||||
| "image"
|
||||
| "number"
|
||||
| "tags"
|
||||
|
||||
export interface FieldOption {
|
||||
label: string
|
||||
|
||||
Reference in New Issue
Block a user