Remove elements barrel file and next/image, add image/number field types

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rami Bitar
2026-06-09 15:59:47 -04:00
parent 3ed7e027c2
commit 791a257294
5 changed files with 7 additions and 32 deletions

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

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

@@ -1,5 +1,4 @@
import * as React from "react" import * as React from "react"
import NextImage from "next/image"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
@@ -38,7 +37,7 @@ function Image({
className, className,
}: ImageProps) { }: ImageProps) {
return ( return (
<NextImage <img
data-slot="image" data-slot="image"
src={src} src={src}
alt={alt} alt={alt}

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,8 @@ export type FieldType =
| "object" | "object"
| "boolean" | "boolean"
| "select" | "select"
| "image"
| "number"
export interface FieldOption { export interface FieldOption {
label: string label: string