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