mirror of
https://github.com/whekin/household-bot.git
synced 2026-04-01 00:24:03 +00:00
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
This commit is contained in:
65
apps/miniapp/src/components/ui/input.tsx
Normal file
65
apps/miniapp/src/components/ui/input.tsx
Normal file
@@ -0,0 +1,65 @@
|
||||
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}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user