You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.5 KiB
64 lines
1.5 KiB
<script setup>
|
|
defineProps({
|
|
label: { type: String, default: '' },
|
|
modelValue: { type: [String, Number], default: '' },
|
|
placeholder: { type: String, default: '' },
|
|
type: { type: String, default: 'text' },
|
|
required: { type: Boolean, default: false }
|
|
})
|
|
defineEmits(['update:modelValue'])
|
|
defineOptions({ name: 'SongInput' })
|
|
</script>
|
|
|
|
<template>
|
|
<label class="song-field">
|
|
<span v-if="label" class="song-field__label">
|
|
{{ label }}<span v-if="required" class="song-field__req">*</span>
|
|
</span>
|
|
<input
|
|
class="song-field__input"
|
|
:type="type"
|
|
:value="modelValue"
|
|
:placeholder="placeholder"
|
|
@input="$emit('update:modelValue', $event.target.value)"
|
|
/>
|
|
</label>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.song-field {
|
|
display: block;
|
|
}
|
|
.song-field__label {
|
|
display: block;
|
|
margin-bottom: 6px;
|
|
font-size: 13px;
|
|
color: var(--song-text-secondary);
|
|
}
|
|
.song-field__req {
|
|
color: var(--song-danger);
|
|
margin-left: 2px;
|
|
}
|
|
.song-field__input {
|
|
width: 100%;
|
|
height: 34px;
|
|
padding: 0 12px;
|
|
font-family: var(--song-font-sans);
|
|
font-size: 14px;
|
|
color: var(--song-text);
|
|
background: var(--song-bg-elevated);
|
|
border: 1px solid var(--song-border);
|
|
border-radius: var(--song-radius-s);
|
|
transition: border-color var(--song-dur-1) var(--song-ease);
|
|
}
|
|
.song-field__input::placeholder {
|
|
color: var(--song-text-disabled);
|
|
}
|
|
.song-field__input:hover {
|
|
border-color: var(--song-border-strong);
|
|
}
|
|
.song-field__input:focus {
|
|
outline: none;
|
|
border-color: var(--song-primary);
|
|
}
|
|
</style>
|