Files
household-bot/apps/miniapp/src/components/ui/input.tsx
whekin 94a5904f54 feat(miniapp): refine UI and add utility bill management
- Fix collapsible padding and button spacing
- Add subtotal to balance card
- Add utility bill management for admins
- Fix lints and type checks across the monorepo
- Implement rejectPendingHouseholdMember in repository and service
2026-03-13 05:52:34 +04:00

66 lines
1.5 KiB
TypeScript

import type { JSX } from 'solid-js'
import { cn } from '../../lib/cn'
type InputProps = {
value?: string
placeholder?: string
type?: 'text' | 'number' | 'email'
min?: string | number
max?: string | number
step?: string | number
maxlength?: number
disabled?: boolean
invalid?: boolean
class?: string
style?: JSX.CSSProperties
list?: string
id?: string
onInput?: JSX.EventHandlerUnion<HTMLInputElement, InputEvent>
onChange?: JSX.EventHandlerUnion<HTMLInputElement, Event>
}
export function Input(props: InputProps) {
return (
<input
type={props.type ?? 'text'}
value={props.value ?? ''}
placeholder={props.placeholder}
min={props.min}
max={props.max}
step={props.step}
maxlength={props.maxlength}
disabled={props.disabled}
aria-invalid={props.invalid}
style={props.style}
list={props.list}
id={props.id}
class={cn('ui-input', props.class)}
onInput={props.onInput}
onChange={props.onChange}
/>
)
}
export function Textarea(props: {
value?: string
placeholder?: string
rows?: number
maxlength?: number
disabled?: boolean
class?: string
onInput?: JSX.EventHandlerUnion<HTMLTextAreaElement, InputEvent>
}) {
return (
<textarea
value={props.value ?? ''}
placeholder={props.placeholder}
rows={props.rows ?? 4}
maxlength={props.maxlength}
disabled={props.disabled}
class={cn('ui-input ui-textarea', props.class)}
onInput={props.onInput}
/>
)
}