Skip to content

Commit

Permalink
removes unused Form component; enhances Input component with improved…
Browse files Browse the repository at this point in the history
… styling, label support, and focus effects for better usability
  • Loading branch information
CarelessCourage committed Feb 26, 2025
1 parent 80474ec commit 2bb1ef6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
7 changes: 0 additions & 7 deletions packages/nobel/components/ui/Form.vue

This file was deleted.

36 changes: 34 additions & 2 deletions packages/nobel/components/ui/Input.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<script setup lang="ts">
import { ref } from 'vue'
import { ref, useModel } from 'vue'
import { useVModel } from '@vueuse/core'
defineOptions({
inheritAttrs: false,
})
const { size = 'medium' } = defineProps<{
size?: 'medium' | 'small' | 'mini'
label: string
}>()
const emit = defineEmits(['update:value'])
const focused = ref(false)
</script>

Expand All @@ -19,10 +26,11 @@ const focused = ref(false)
{{ label }}
</label>
<input
v-bind="$attrs"
:id="label"
ref="inputRef"
class="button buttonText buttonHover buttonActive buttonFocus focus"
:class="size"
:class="`${size}`"
:placeholder="label"
@focus="() => (focused = true)"
@blur="() => (focused = false)"
Expand All @@ -40,12 +48,27 @@ input {
/* input:-internal-autofill-selected {
background-color: var(--base-20) !important;
color: var(--base-contrast) !important;
}
input:-webkit-autofill {
background-color: var(--base-20) !important;
color: var(--base-contrast) !important;
}
input:-webkit-autofill::placeholder {
background-color: var(--base-20) !important;
color: var(--base-contrast) !important;
} */
.input {
position: relative;
}
div.input:has(input:not(:placeholder-shown)):not(:focus-within) label {
transform: translateY(0%);
opacity: 0;
}
div.input:has(+ div:focus-within) {
filter: blur(4px);
}
Expand All @@ -63,6 +86,15 @@ div.input:has(+ div:focus-within) {
transition: all 0.3s;
}
.input input.focus:focus {
color: var(--accent-120);
background: var(--accent-10);
}
.input input::placeholder {
color: var(--accent-120);
}
.input label.move {
transform: translateY(-100%);
height: var(--block);
Expand Down

0 comments on commit 2bb1ef6

Please sign in to comment.