Added versitality
This commit is contained in:
parent
2b1545f999
commit
61be8e2cab
2 changed files with 7 additions and 5 deletions
|
|
@ -27,7 +27,7 @@ $border: 1px solid color.adjust(vars.$background, $lightness: 20%)
|
||||||
padding: 0.5rem
|
padding: 0.5rem
|
||||||
color: color.adjust(vars.$background, $lightness: 60%)
|
color: color.adjust(vars.$background, $lightness: 60%)
|
||||||
outline: none
|
outline: none
|
||||||
transition: all 0.4s ease-out
|
transition: all 0.2s ease-out
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
border-color: color.adjust(vars.$background, $lightness: 30%)
|
border-color: color.adjust(vars.$background, $lightness: 30%)
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@ import './Input.sass'
|
||||||
import { Show } from 'solid-js'
|
import { Show } from 'solid-js'
|
||||||
import { TextField } from '@kobalte/core/text-field'
|
import { TextField } from '@kobalte/core/text-field'
|
||||||
|
|
||||||
export default (props: { value: string; onChange: (text:string) => void; label: string; isTextField?: boolean }) => (
|
export default (props: { value: string; onChange: (text: string) => void; label?: string; isTextField?: boolean; width?: number; height?: number }) => (
|
||||||
<>
|
<>
|
||||||
<TextField class="input" value={props.value} onChange={props.onChange}>
|
<TextField class="input" value={props.value} onChange={props.onChange} >
|
||||||
<TextField.Label class="input__label">{props.label}:</TextField.Label>
|
<Show when={props.label}>
|
||||||
|
<TextField.Label class="input__label">{props.label}:</TextField.Label>
|
||||||
|
</Show>
|
||||||
<Show when={props.isTextField}>
|
<Show when={props.isTextField}>
|
||||||
<TextField.TextArea class="input__textarea" />
|
<TextField.TextArea class="input__textarea" style={{ width: props.width ? `${props.width}rem` : '100%', height: props.height ? `${props.height}rem` : 'auto' }} />
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={!props.isTextField}>
|
<Show when={!props.isTextField}>
|
||||||
<TextField.Input class="input__text" />
|
<TextField.Input class="input__text" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue