import { Section } from "./section" import { H2, H3, H4, H5, Text, SmallText } from "./text" import "hono/jsx" import type { JSX, FC } from "hono/jsx" import { VStack, HStack } from "./stack" export type InputProps = JSX.IntrinsicElements["input"] & { labelPosition?: "above" | "left" | "right" children?: any } export const Input: FC = (props) => { const { labelPosition = "above", children, style, ...inputProps } = props const inputStyle: JSX.CSSProperties = { height: "40px", padding: "8px 12px", borderRadius: "6px", border: "1px solid #d1d5db", backgroundColor: "white", fontSize: "14px", outline: "none", ...(style as JSX.CSSProperties), } if (!children) { return } const labelStyle: JSX.CSSProperties = { fontSize: "14px", fontWeight: "500", color: "#111827", } const labelElement = ( ) if (labelPosition === "above") { return (
{labelElement}
) } if (labelPosition === "left") { return (
{labelElement}
) } if (labelPosition === "right") { return (
{labelElement}
) } return null } export const Test = () => { return (
{/* Basic inputs */}

Basic Inputs

{/* Custom styling */}

Custom Styling

{/* With values */}

With Values

{/* Disabled state */}

Disabled State

{/* Label above */}

Label Above

Name Email Password
{/* Label to the left */}

Label Left

Name Email Password
{/* Label to the right */}

Label Right

Name Email Password
{/* Horizontal layout */}

Horizontal Layout

First Last Age
{/* Custom styling */}

Custom Input Styling

Custom Label Required Field
) }