Compare commits

...

4 Commits

Author SHA1 Message Date
Rami Bitar
cd19a01654 Add .env.local and .mcp.json to .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-16 23:44:02 -04:00
Rami Bitar
98dd7741a0 update 2026-06-09 17:06:15 -04:00
Rami Bitar
1ebe68efeb Wrap delegated Button/Image in DOM element, remove data-slot attributes
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 16:06:15 -04:00
Rami Bitar
791a257294 Remove elements barrel file and next/image, add image/number field types
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 15:59:47 -04:00
10 changed files with 33 additions and 61 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
node_modules/* node_modules/*
.next .next
next-env.d.ts next-env.d.ts
.env.local
.mcp.json

View File

@@ -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 (

View File

@@ -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 }

View File

@@ -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",
},
},
}, },
}, },
}, },

View File

@@ -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>

View File

@@ -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",
}, },
}, },

View File

@@ -38,8 +38,8 @@ function Image({
className, className,
}: ImageProps) { }: ImageProps) {
return ( return (
<span className="inline-block">
<NextImage <NextImage
data-slot="image"
src={src} src={src}
alt={alt} alt={alt}
height={height} height={height}
@@ -50,6 +50,7 @@ function Image({
className className
)} )}
/> />
</span>
) )
} }

View File

@@ -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],

View File

@@ -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"

View File

@@ -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