"use client"; /* * Documentation: * Text Input — https://app.subframe.com/f023064a5ca0/library?component=Text+Input_be48ca43-f8e7-4c0e-8870-d219ea11abfe */ import React from "react"; import { FeatherCircleDashed } from "@subframe/core"; import { FeatherEye } from "@subframe/core"; import { FeatherEyeOff } from "@subframe/core"; import { FeatherLock } from "@subframe/core"; import { FeatherPlus } from "@subframe/core"; import { FeatherSearch } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; export interface InputProps extends Omit< React.InputHTMLAttributes, "type" | "placeholder" | "value" > { type?: "text" | "password" | "email" | "number" | "tel" | "url" | "search"; placeholder?: React.ReactNode; value?: React.ReactNode; onChange?: (event: React.ChangeEvent) => void; className?: string; } const Input = React.forwardRef(function Input( { type = "text", placeholder, value, className, ...otherProps }: InputProps, ref ) { return ( ); }); export interface PasswordEyeButtonProps extends React.HTMLAttributes { showPassword?: boolean; className?: string; } const PasswordEyeButton = React.forwardRef< HTMLDivElement, PasswordEyeButtonProps >(function PasswordEyeButton( { showPassword = false, className, ...otherProps }: PasswordEyeButtonProps, ref ) { return (
{showPassword ? ( ) : ( )}
); }); export interface TextInputRootProps extends React.LabelHTMLAttributes { disabled?: boolean; error?: boolean; variant?: "outline" | "filled"; size?: "small" | "medium" | "large"; fillContainer?: boolean; borderless?: boolean; noPadding?: boolean; showLabel?: boolean; label?: React.ReactNode; helpText?: React.ReactNode; message?: React.ReactNode; icon?: React.ReactNode; iconRight?: React.ReactNode; type?: "text" | "password" | "email" | "number" | "tel" | "url" | "search"; children?: React.ReactNode; showIconLeft?: boolean; showIconRight?: boolean; className?: string; } const TextInputRoot = React.forwardRef( function TextInputRoot( { disabled = false, error = false, variant = "outline", size = "medium", fillContainer = false, borderless = false, noPadding = false, showLabel = false, label, helpText, message, icon = , iconRight = , type = "text", children, showIconLeft = false, showIconRight = false, className, ...otherProps }: TextInputRootProps, ref ) { return ( ); } ); export const TextInput = Object.assign(TextInputRoot, { Input, PasswordEyeButton, });