Skip to content

Commit b61127a

Browse files
fix(AuthForm): ensure header is shown with leading slot (#5405)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
1 parent 345b0bc commit b61127a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/runtime/components/AuthForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ defineExpose({
187187

188188
<template>
189189
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
190-
<div v-if="(icon || !!slots.icon) || (title || !!slots.title) || (description || !!slots.description) || !!slots.header" :class="ui.header({ class: props.ui?.header })">
190+
<div v-if="(icon || !!slots.leading) || (title || !!slots.title) || (description || !!slots.description) || !!slots.header" :class="ui.header({ class: props.ui?.header })">
191191
<slot name="header">
192192
<div v-if="icon || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
193193
<slot name="leading" :ui="ui">

test/components/__snapshots__/AuthForm-vue.spec.ts.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,11 @@ exports[`AuthForm > renders with icon correctly 1`] = `
428428
429429
exports[`AuthForm > renders with leading slot correctly 1`] = `
430430
"<div class="w-full space-y-6">
431-
<!--v-if-->
431+
<div class="flex flex-col text-center">
432+
<div class="mb-2">Leading</div>
433+
<!--v-if-->
434+
<!--v-if-->
435+
</div>
432436
<div class="gap-y-6 flex flex-col">
433437
<!--v-if-->
434438
<!--v-if-->

test/components/__snapshots__/AuthForm.spec.ts.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ exports[`AuthForm > renders with icon correctly 1`] = `
446446
447447
exports[`AuthForm > renders with leading slot correctly 1`] = `
448448
"<div class="w-full space-y-6">
449-
<!--v-if-->
449+
<div class="flex flex-col text-center">
450+
<div class="mb-2">Leading</div>
451+
<!--v-if-->
452+
<!--v-if-->
453+
</div>
450454
<div class="gap-y-6 flex flex-col">
451455
<!--v-if-->
452456
<!--v-if-->

0 commit comments

Comments
 (0)