diff --git a/src/runtime/components/Input.vue b/src/runtime/components/Input.vue index 63e68128..fc6ad669 100644 --- a/src/runtime/components/Input.vue +++ b/src/runtime/components/Input.vue @@ -23,6 +23,7 @@ export interface InputProps extends UseComponentIconsProps { variant?: InputVariants['variant'] size?: InputVariants['size'] required?: boolean + autocomplete?: InputHTMLAttributes['autocomplete'] autofocus?: boolean autofocusDelay?: number disabled?: boolean @@ -55,6 +56,7 @@ defineOptions({ inheritAttrs: false }) const props = withDefaults(defineProps(), { type: 'text', + autocomplete: 'off', autofocusDelay: 0 }) const emits = defineEmits() @@ -148,6 +150,7 @@ onMounted(() => { :class="ui.base({ class: props.ui?.base })" :disabled="disabled" :required="required" + :autocomplete="autocomplete" v-bind="$attrs" @input="onInput" @blur="onBlur" diff --git a/test/components/__snapshots__/ButtonGroup.spec.ts.snap b/test/components/__snapshots__/ButtonGroup.spec.ts.snap index b2d446af..2f5a1c3b 100644 --- a/test/components/__snapshots__/ButtonGroup.spec.ts.snap +++ b/test/components/__snapshots__/ButtonGroup.spec.ts.snap @@ -2,7 +2,7 @@ exports[`ButtonGroup > renders orientation vertical with default slot correctly 1`] = ` "
-
+
@@ -192,7 +192,7 @@ exports[`CommandPalette > renders with close correctly 1`] = ` exports[`CommandPalette > renders with close slot correctly 1`] = ` "
-
Close slot
+
Close slot
@@ -253,7 +253,7 @@ exports[`CommandPalette > renders with close slot correctly 1`] = ` exports[`CommandPalette > renders with closeIcon correctly 1`] = ` "
-
@@ -317,7 +317,7 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = ` exports[`CommandPalette > renders with custom slot correctly 1`] = ` "
-
+
@@ -377,7 +377,7 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = ` exports[`CommandPalette > renders with defaultValue correctly 1`] = ` "
-
+
@@ -440,7 +440,7 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = ` exports[`CommandPalette > renders with disabled correctly 1`] = ` "
-
+
@@ -503,7 +503,7 @@ exports[`CommandPalette > renders with disabled correctly 1`] = ` exports[`CommandPalette > renders with empty slot correctly 1`] = ` "
-
+
@@ -566,7 +566,7 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = ` exports[`CommandPalette > renders with groups correctly 1`] = ` "
-
+
@@ -629,7 +629,7 @@ exports[`CommandPalette > renders with groups correctly 1`] = ` exports[`CommandPalette > renders with icon correctly 1`] = ` "
-
+
@@ -692,7 +692,7 @@ exports[`CommandPalette > renders with icon correctly 1`] = ` exports[`CommandPalette > renders with item slot correctly 1`] = ` "
-
+
@@ -740,7 +740,7 @@ exports[`CommandPalette > renders with item slot correctly 1`] = ` exports[`CommandPalette > renders with item-label slot correctly 1`] = ` "
-
+
@@ -803,7 +803,7 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = ` exports[`CommandPalette > renders with item-leading slot correctly 1`] = ` "
-
+
@@ -857,7 +857,7 @@ exports[`CommandPalette > renders with item-leading slot correctly 1`] = ` exports[`CommandPalette > renders with item-trailing slot correctly 1`] = ` "
-
+
@@ -917,7 +917,7 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = ` exports[`CommandPalette > renders with loading correctly 1`] = ` "
-
+
@@ -980,7 +980,7 @@ exports[`CommandPalette > renders with loading correctly 1`] = ` exports[`CommandPalette > renders with loadingIcon correctly 1`] = ` "
-
+
@@ -1007,7 +1007,7 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = ` exports[`CommandPalette > renders with modelValue correctly 1`] = ` "
-
+
@@ -1070,7 +1070,7 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = ` exports[`CommandPalette > renders with placeholder correctly 1`] = ` "
-
+
@@ -1133,7 +1133,7 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = ` exports[`CommandPalette > renders with selectedIcon correctly 1`] = ` "
-
+
@@ -1196,7 +1196,7 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = ` exports[`CommandPalette > renders with ui correctly 1`] = ` "
-
+
diff --git a/test/components/__snapshots__/Form.spec.ts.snap b/test/components/__snapshots__/Form.spec.ts.snap index e613ca54..fb523fd3 100644 --- a/test/components/__snapshots__/Form.spec.ts.snap +++ b/test/components/__snapshots__/Form.spec.ts.snap @@ -8,7 +8,7 @@ exports[`Form > custom validation works > with error 1`] = `
-
+
@@ -21,7 +21,7 @@ exports[`Form > custom validation works > with error 1`] = `
-
+
@@ -39,7 +39,7 @@ exports[`Form > custom validation works > without error 1`] = `
-
+
@@ -52,7 +52,7 @@ exports[`Form > custom validation works > without error 1`] = `
-
+
@@ -70,7 +70,7 @@ exports[`Form > joi validation works > with error 1`] = `
-
+
@@ -83,7 +83,7 @@ exports[`Form > joi validation works > with error 1`] = `
-
+
@@ -101,7 +101,7 @@ exports[`Form > joi validation works > without error 1`] = `
-
+
@@ -114,7 +114,7 @@ exports[`Form > joi validation works > without error 1`] = `
-
+
@@ -136,7 +136,7 @@ exports[`Form > valibot safeParser validation works > with error 1`] = `
-
+
@@ -149,7 +149,7 @@ exports[`Form > valibot safeParser validation works > with error 1`] = `
-
+
@@ -167,7 +167,7 @@ exports[`Form > valibot safeParser validation works > without error 1`] = `
-
+
@@ -180,7 +180,7 @@ exports[`Form > valibot safeParser validation works > without error 1`] = `
-
+
@@ -198,7 +198,7 @@ exports[`Form > valibot validation works > with error 1`] = `
-
+
@@ -211,7 +211,7 @@ exports[`Form > valibot validation works > with error 1`] = `
-
+
@@ -229,7 +229,7 @@ exports[`Form > valibot validation works > without error 1`] = `
-
+
@@ -242,7 +242,7 @@ exports[`Form > valibot validation works > without error 1`] = `
-
+
@@ -260,7 +260,7 @@ exports[`Form > yup validation works > with error 1`] = `
-
+
@@ -273,7 +273,7 @@ exports[`Form > yup validation works > with error 1`] = `
-
+
@@ -291,7 +291,7 @@ exports[`Form > yup validation works > without error 1`] = `
-
+
@@ -304,7 +304,7 @@ exports[`Form > yup validation works > without error 1`] = `
-
+
@@ -322,7 +322,7 @@ exports[`Form > zod validation works > with error 1`] = `
-
+
@@ -335,7 +335,7 @@ exports[`Form > zod validation works > with error 1`] = `
-
+
@@ -353,7 +353,7 @@ exports[`Form > zod validation works > without error 1`] = `
-
+
@@ -366,7 +366,7 @@ exports[`Form > zod validation works > without error 1`] = `
-
+
diff --git a/test/components/__snapshots__/Input.spec.ts.snap b/test/components/__snapshots__/Input.spec.ts.snap index b29f11d4..f5125eba 100644 --- a/test/components/__snapshots__/Input.spec.ts.snap +++ b/test/components/__snapshots__/Input.spec.ts.snap @@ -1,222 +1,222 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`Input > renders with class correctly 1`] = ` -"
+"
" `; exports[`Input > renders with default slot correctly 1`] = ` -"
Default slot +"
Default slot
" `; exports[`Input > renders with disabled correctly 1`] = ` -"
+"
" `; exports[`Input > renders with gray variant ghost correctly 1`] = ` -"
+"
" `; exports[`Input > renders with gray variant none correctly 1`] = ` -"
+"
" `; exports[`Input > renders with gray variant outline correctly 1`] = ` -"
+"
" `; exports[`Input > renders with gray variant soft correctly 1`] = ` -"
+"
" `; exports[`Input > renders with gray variant subtle correctly 1`] = ` -"
+"
" `; exports[`Input > renders with icon correctly 1`] = ` -"
+"
" `; exports[`Input > renders with id correctly 1`] = ` -"
+"
" `; exports[`Input > renders with leading and icon correctly 1`] = ` -"
+"
" `; exports[`Input > renders with leading slot correctly 1`] = ` -"
Leading slot +"
Leading slot
" `; exports[`Input > renders with leadingIcon correctly 1`] = ` -"
+"
" `; exports[`Input > renders with loading correctly 1`] = ` -"
+"
" `; exports[`Input > renders with loadingIcon correctly 1`] = ` -"
+"
" `; exports[`Input > renders with name correctly 1`] = ` -"
+"
" `; exports[`Input > renders with placeholder correctly 1`] = ` -"
+"
" `; exports[`Input > renders with primary variant ghost correctly 1`] = ` -"
+"
" `; exports[`Input > renders with primary variant none correctly 1`] = ` -"
+"
" `; exports[`Input > renders with primary variant outline correctly 1`] = ` -"
+"
" `; exports[`Input > renders with primary variant soft correctly 1`] = ` -"
+"
" `; exports[`Input > renders with primary variant subtle correctly 1`] = ` -"
+"
" `; exports[`Input > renders with required correctly 1`] = ` -"
+"
" `; exports[`Input > renders with size lg correctly 1`] = ` -"
+"
" `; exports[`Input > renders with size md correctly 1`] = ` -"
+"
" `; exports[`Input > renders with size sm correctly 1`] = ` -"
+"
" `; exports[`Input > renders with size xl correctly 1`] = ` -"
+"
" `; exports[`Input > renders with size xs correctly 1`] = ` -"
+"
" `; exports[`Input > renders with trailing and icon correctly 1`] = ` -"
+"
" `; exports[`Input > renders with trailing slot correctly 1`] = ` -"
+"
Trailing slot
" `; exports[`Input > renders with trailingIcon correctly 1`] = ` -"
+"
" `; exports[`Input > renders with type correctly 1`] = ` -"
+"
" `; exports[`Input > renders with ui correctly 1`] = ` -"
+"
"