mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-07 14:10:43 -03:00
primera ui de la pagina para recuperar contraseña
This commit is contained in:
23
src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte
Normal file
23
src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import EllipsisIcon from "@lucide/svelte/icons/ellipsis";
|
||||||
|
import type { HTMLAttributes } from "svelte/elements";
|
||||||
|
import { cn, type WithElementRef, type WithoutChildren } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
...restProps
|
||||||
|
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLSpanElement>>> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<span
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="breadcrumb-ellipsis"
|
||||||
|
role="presentation"
|
||||||
|
aria-hidden="true"
|
||||||
|
class={cn("flex size-9 items-center justify-center", className)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
<EllipsisIcon class="size-4" />
|
||||||
|
<span class="sr-only">More</span>
|
||||||
|
</span>
|
||||||
20
src/lib/components/ui/breadcrumb/breadcrumb-item.svelte
Normal file
20
src/lib/components/ui/breadcrumb/breadcrumb-item.svelte
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { HTMLLiAttributes } from "svelte/elements";
|
||||||
|
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLLiAttributes> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<li
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="breadcrumb-item"
|
||||||
|
class={cn("inline-flex items-center gap-1.5", className)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{@render children?.()}
|
||||||
|
</li>
|
||||||
31
src/lib/components/ui/breadcrumb/breadcrumb-link.svelte
Normal file
31
src/lib/components/ui/breadcrumb/breadcrumb-link.svelte
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { HTMLAnchorAttributes } from "svelte/elements";
|
||||||
|
import type { Snippet } from "svelte";
|
||||||
|
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
href = undefined,
|
||||||
|
child,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLAnchorAttributes> & {
|
||||||
|
child?: Snippet<[{ props: HTMLAnchorAttributes }]>;
|
||||||
|
} = $props();
|
||||||
|
|
||||||
|
const attrs = $derived({
|
||||||
|
"data-slot": "breadcrumb-link",
|
||||||
|
class: cn("hover:text-foreground transition-colors", className),
|
||||||
|
href,
|
||||||
|
...restProps,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if child}
|
||||||
|
{@render child({ props: attrs })}
|
||||||
|
{:else}
|
||||||
|
<a bind:this={ref} {...attrs}>
|
||||||
|
{@render children?.()}
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
23
src/lib/components/ui/breadcrumb/breadcrumb-list.svelte
Normal file
23
src/lib/components/ui/breadcrumb/breadcrumb-list.svelte
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { HTMLOlAttributes } from "svelte/elements";
|
||||||
|
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLOlAttributes> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<ol
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="breadcrumb-list"
|
||||||
|
class={cn(
|
||||||
|
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{@render children?.()}
|
||||||
|
</ol>
|
||||||
23
src/lib/components/ui/breadcrumb/breadcrumb-page.svelte
Normal file
23
src/lib/components/ui/breadcrumb/breadcrumb-page.svelte
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { HTMLAttributes } from "svelte/elements";
|
||||||
|
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<span
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="breadcrumb-page"
|
||||||
|
role="link"
|
||||||
|
aria-disabled="true"
|
||||||
|
aria-current="page"
|
||||||
|
class={cn("text-foreground font-normal", className)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{@render children?.()}
|
||||||
|
</span>
|
||||||
27
src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte
Normal file
27
src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
|
||||||
|
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||||
|
import type { HTMLLiAttributes } from "svelte/elements";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLLiAttributes> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<li
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="breadcrumb-separator"
|
||||||
|
role="presentation"
|
||||||
|
aria-hidden="true"
|
||||||
|
class={cn("[&>svg]:size-3.5", className)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{#if children}
|
||||||
|
{@render children?.()}
|
||||||
|
{:else}
|
||||||
|
<ChevronRightIcon />
|
||||||
|
{/if}
|
||||||
|
</li>
|
||||||
21
src/lib/components/ui/breadcrumb/breadcrumb.svelte
Normal file
21
src/lib/components/ui/breadcrumb/breadcrumb.svelte
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { WithElementRef } from "$lib/utils.js";
|
||||||
|
import type { HTMLAttributes } from "svelte/elements";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLAttributes<HTMLElement>> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<nav
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="breadcrumb"
|
||||||
|
class={className}
|
||||||
|
aria-label="breadcrumb"
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{@render children?.()}
|
||||||
|
</nav>
|
||||||
25
src/lib/components/ui/breadcrumb/index.ts
Normal file
25
src/lib/components/ui/breadcrumb/index.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import Root from "./breadcrumb.svelte";
|
||||||
|
import Ellipsis from "./breadcrumb-ellipsis.svelte";
|
||||||
|
import Item from "./breadcrumb-item.svelte";
|
||||||
|
import Separator from "./breadcrumb-separator.svelte";
|
||||||
|
import Link from "./breadcrumb-link.svelte";
|
||||||
|
import List from "./breadcrumb-list.svelte";
|
||||||
|
import Page from "./breadcrumb-page.svelte";
|
||||||
|
|
||||||
|
export {
|
||||||
|
Root,
|
||||||
|
Ellipsis,
|
||||||
|
Item,
|
||||||
|
Separator,
|
||||||
|
Link,
|
||||||
|
List,
|
||||||
|
Page,
|
||||||
|
//
|
||||||
|
Root as Breadcrumb,
|
||||||
|
Ellipsis as BreadcrumbEllipsis,
|
||||||
|
Item as BreadcrumbItem,
|
||||||
|
Separator as BreadcrumbSeparator,
|
||||||
|
Link as BreadcrumbLink,
|
||||||
|
List as BreadcrumbList,
|
||||||
|
Page as BreadcrumbPage,
|
||||||
|
};
|
||||||
15
src/lib/components/ui/input-otp/index.ts
Normal file
15
src/lib/components/ui/input-otp/index.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import Root from "./input-otp.svelte";
|
||||||
|
import Group from "./input-otp-group.svelte";
|
||||||
|
import Slot from "./input-otp-slot.svelte";
|
||||||
|
import Separator from "./input-otp-separator.svelte";
|
||||||
|
|
||||||
|
export {
|
||||||
|
Root,
|
||||||
|
Group,
|
||||||
|
Slot,
|
||||||
|
Separator,
|
||||||
|
Root as InputOTP,
|
||||||
|
Group as InputOTPGroup,
|
||||||
|
Slot as InputOTPSlot,
|
||||||
|
Separator as InputOTPSeparator,
|
||||||
|
};
|
||||||
20
src/lib/components/ui/input-otp/input-otp-group.svelte
Normal file
20
src/lib/components/ui/input-otp/input-otp-group.svelte
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { HTMLAttributes } from "svelte/elements";
|
||||||
|
import { cn, type WithElementRef } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div
|
||||||
|
bind:this={ref}
|
||||||
|
data-slot="input-otp-group"
|
||||||
|
class={cn("flex items-center", className)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{@render children?.()}
|
||||||
|
</div>
|
||||||
19
src/lib/components/ui/input-otp/input-otp-separator.svelte
Normal file
19
src/lib/components/ui/input-otp/input-otp-separator.svelte
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { HTMLAttributes } from "svelte/elements";
|
||||||
|
import type { WithElementRef } from "$lib/utils.js";
|
||||||
|
import MinusIcon from "@lucide/svelte/icons/minus";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
children,
|
||||||
|
...restProps
|
||||||
|
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div bind:this={ref} data-slot="input-otp-separator" role="separator" {...restProps}>
|
||||||
|
{#if children}
|
||||||
|
{@render children?.()}
|
||||||
|
{:else}
|
||||||
|
<MinusIcon />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
31
src/lib/components/ui/input-otp/input-otp-slot.svelte
Normal file
31
src/lib/components/ui/input-otp/input-otp-slot.svelte
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { PinInput as InputOTPPrimitive } from "bits-ui";
|
||||||
|
import { cn } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
cell,
|
||||||
|
class: className,
|
||||||
|
...restProps
|
||||||
|
}: InputOTPPrimitive.CellProps = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<InputOTPPrimitive.Cell
|
||||||
|
{cell}
|
||||||
|
bind:ref
|
||||||
|
data-slot="input-otp-slot"
|
||||||
|
class={cn(
|
||||||
|
"border-input aria-invalid:border-destructive dark:bg-input/30 relative flex size-9 items-center justify-center border-y border-e text-sm transition-all outline-none first:rounded-s-md first:border-s last:rounded-e-md",
|
||||||
|
cell.isActive &&
|
||||||
|
"border-ring ring-ring/50 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40 aria-invalid:ring-destructive/20 ring-offset-background z-10 ring-[3px]",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...restProps}
|
||||||
|
>
|
||||||
|
{cell.char}
|
||||||
|
{#if cell.hasFakeCaret}
|
||||||
|
<div class="pointer-events-none absolute inset-0 flex items-center justify-center">
|
||||||
|
<div class="animate-caret-blink bg-foreground h-4 w-px duration-1000"></div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</InputOTPPrimitive.Cell>
|
||||||
22
src/lib/components/ui/input-otp/input-otp.svelte
Normal file
22
src/lib/components/ui/input-otp/input-otp.svelte
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { PinInput as InputOTPPrimitive } from "bits-ui";
|
||||||
|
import { cn } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
value = $bindable(""),
|
||||||
|
...restProps
|
||||||
|
}: InputOTPPrimitive.RootProps = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<InputOTPPrimitive.Root
|
||||||
|
bind:ref
|
||||||
|
bind:value
|
||||||
|
data-slot="input-otp"
|
||||||
|
class={cn(
|
||||||
|
"flex items-center gap-2 has-disabled:opacity-50 [&_input]:disabled:cursor-not-allowed",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...restProps}
|
||||||
|
/>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<Field>
|
<Field>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<FieldLabel for="password-{id}">Contraseña</FieldLabel>
|
<FieldLabel for="password-{id}">Contraseña</FieldLabel>
|
||||||
<a href="##" class="ml-auto inline-block text-sm underline">
|
<a href="/password-reset" class="ml-auto inline-block text-sm underline">
|
||||||
Te Olvidaste la contraseña?
|
Te Olvidaste la contraseña?
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
32
src/routes/password-reset/+page.svelte
Normal file
32
src/routes/password-reset/+page.svelte
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import BreadcrumbItem from '@/components/ui/breadcrumb/breadcrumb-item.svelte';
|
||||||
|
import BreadcrumbList from '@/components/ui/breadcrumb/breadcrumb-list.svelte';
|
||||||
|
import BreadcrumbSeparator from '@/components/ui/breadcrumb/breadcrumb-separator.svelte';
|
||||||
|
import Breadcrumb from '@/components/ui/breadcrumb/breadcrumb.svelte';
|
||||||
|
|
||||||
|
import Pasos from './Pasos.svelte';
|
||||||
|
import Card from '@/components/ui/card/card.svelte';
|
||||||
|
import CardContent from '@/components/ui/card/card-content.svelte';
|
||||||
|
import { slide } from 'svelte/transition';
|
||||||
|
import IngresarEmail from './IngresarEmail.svelte';
|
||||||
|
import Otp from './Otp.svelte';
|
||||||
|
import NuevaPass from './NuevaPass.svelte';
|
||||||
|
|
||||||
|
let estado: 'email' | 'otp' | 'nuevapass' = $state('email');
|
||||||
|
let email: string = $state('');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="flex min-h-fit w-full items-center justify-center p-6 md:p-10">
|
||||||
|
<div class="w-full max-w-6xl">
|
||||||
|
<Pasos {estado} />
|
||||||
|
<div class="mt-6">
|
||||||
|
{#if estado === 'email'}
|
||||||
|
<IngresarEmail bind:estado bind:email />
|
||||||
|
{:else if estado === 'otp'}
|
||||||
|
<Otp bind:estado />
|
||||||
|
{:else if estado === 'nuevapass'}
|
||||||
|
<NuevaPass />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
63
src/routes/password-reset/IngresarEmail.svelte
Normal file
63
src/routes/password-reset/IngresarEmail.svelte
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import Button from '@/components/ui/button/button.svelte';
|
||||||
|
import CardContent from '@/components/ui/card/card-content.svelte';
|
||||||
|
import Card from '@/components/ui/card/card.svelte';
|
||||||
|
import Input from '@/components/ui/input/input.svelte';
|
||||||
|
import Spinner from '@/components/ui/spinner/spinner.svelte';
|
||||||
|
import { checkEmail } from '@/hooks/checkEmail';
|
||||||
|
import Check from '@lucide/svelte/icons/check';
|
||||||
|
import Cross from '@lucide/svelte/icons/x';
|
||||||
|
import { slide } from 'svelte/transition';
|
||||||
|
|
||||||
|
let { estado = $bindable(), email = $bindable() } = $props();
|
||||||
|
|
||||||
|
let checkeado = $state<Boolean | null>(null);
|
||||||
|
let esEmailExistente = $state<boolean>(false);
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
if (email == '') {
|
||||||
|
checkeado = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
(async () => {
|
||||||
|
checkeado = true;
|
||||||
|
await Promise.all([checkEmaill(), new Promise((resolve) => setTimeout(resolve, 100))]);
|
||||||
|
checkeado = false;
|
||||||
|
})();
|
||||||
|
});
|
||||||
|
|
||||||
|
async function checkEmaill() {
|
||||||
|
esEmailExistente = !(await checkEmail(email));
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div transition:slide>
|
||||||
|
<Card>
|
||||||
|
<CardContent>
|
||||||
|
<div class="flex flex-col gap-4">
|
||||||
|
<h2 class="flex items-center justify-between text-xl font-semibold">
|
||||||
|
Ingresa tu correo electrónico
|
||||||
|
{#if checkeado == null}
|
||||||
|
<div hidden></div>
|
||||||
|
{:else if checkeado == true}
|
||||||
|
<Spinner></Spinner>
|
||||||
|
{:else if esEmailExistente}
|
||||||
|
<Check class="text-green-500" />
|
||||||
|
{:else}
|
||||||
|
<Cross class="text-red-500" />
|
||||||
|
{/if}
|
||||||
|
</h2>
|
||||||
|
<Input type="email" placeholder="correo@ejemplo.com" bind:value={email} />
|
||||||
|
<Button
|
||||||
|
disabled={!esEmailExistente}
|
||||||
|
onclick={async () => {
|
||||||
|
///WIP
|
||||||
|
estado = 'otp';
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Enviar código
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
41
src/routes/password-reset/NuevaPass.svelte
Normal file
41
src/routes/password-reset/NuevaPass.svelte
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<script>
|
||||||
|
import Button from '@/components/ui/button/button.svelte';
|
||||||
|
import CardContent from '@/components/ui/card/card-content.svelte';
|
||||||
|
import Card from '@/components/ui/card/card.svelte';
|
||||||
|
import Input from '@/components/ui/input/input.svelte';
|
||||||
|
import Label from '@/components/ui/label/label.svelte';
|
||||||
|
import { slide } from 'svelte/transition';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div transition:slide>
|
||||||
|
<Card>
|
||||||
|
<CardContent>
|
||||||
|
<h2 class="mb-4 text-2xl font-bold">Crear una Nueva Contraseña</h2>
|
||||||
|
<form onsubmit={() => {}}>
|
||||||
|
<div class="space-y-4">
|
||||||
|
<div>
|
||||||
|
<Label for="password" class="mb-1 block text-sm font-medium">Contraseña</Label>
|
||||||
|
<Input
|
||||||
|
type="password"
|
||||||
|
id="password"
|
||||||
|
class="w-full px-3 py-2"
|
||||||
|
placeholder="Ingresa tu nueva contraseña"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label for="confirmPassword" class="mb-1 block text-sm font-medium"
|
||||||
|
>Repetir Contraseña</Label
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
type="password"
|
||||||
|
id="confirmPassword"
|
||||||
|
class="w-full px-3 py-2"
|
||||||
|
placeholder="Repite tu nueva contraseña"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Button type="submit">Establecer Contraseña</Button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
46
src/routes/password-reset/Otp.svelte
Normal file
46
src/routes/password-reset/Otp.svelte
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<script>
|
||||||
|
import Button from '@/components/ui/button/button.svelte';
|
||||||
|
import CardContent from '@/components/ui/card/card-content.svelte';
|
||||||
|
import Card from '@/components/ui/card/card.svelte';
|
||||||
|
import InputOtpGroup from '@/components/ui/input-otp/input-otp-group.svelte';
|
||||||
|
import InputOtpSlot from '@/components/ui/input-otp/input-otp-slot.svelte';
|
||||||
|
import InputOtp from '@/components/ui/input-otp/input-otp.svelte';
|
||||||
|
import { slide } from 'svelte/transition';
|
||||||
|
|
||||||
|
let { estado = $bindable() } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div transition:slide>
|
||||||
|
<Card>
|
||||||
|
<CardContent>
|
||||||
|
<div class="space-y-6 py-4">
|
||||||
|
<h3 class="text-xl font-semibold">Verificación de correo</h3>
|
||||||
|
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
Hemos enviado un código de verificación a tu correo electrónico.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="space-y-4">
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<InputOtp maxlength={6}>
|
||||||
|
{#snippet children({ cells })}
|
||||||
|
<InputOtpGroup>
|
||||||
|
{#each cells as cell, i}
|
||||||
|
<InputOtpSlot class="p-3!" {cell}></InputOtpSlot>
|
||||||
|
{/each}
|
||||||
|
</InputOtpGroup>
|
||||||
|
{/snippet}
|
||||||
|
</InputOtp>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-between">
|
||||||
|
<Button onclick={() => (estado = 'nuevapass')}>Verificar</Button>
|
||||||
|
|
||||||
|
<Button variant="link" onclick={() => console.log('Reenviar código')}>
|
||||||
|
Reenviar código de verificación
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
30
src/routes/password-reset/Pasos.svelte
Normal file
30
src/routes/password-reset/Pasos.svelte
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<script>
|
||||||
|
import BreadcrumbItem from '@/components/ui/breadcrumb/breadcrumb-item.svelte';
|
||||||
|
import BreadcrumbList from '@/components/ui/breadcrumb/breadcrumb-list.svelte';
|
||||||
|
import BreadcrumbSeparator from '@/components/ui/breadcrumb/breadcrumb-separator.svelte';
|
||||||
|
import Breadcrumb from '@/components/ui/breadcrumb/breadcrumb.svelte';
|
||||||
|
|
||||||
|
let { estado } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="flex w-full justify-center">
|
||||||
|
<Breadcrumb>
|
||||||
|
<BreadcrumbList>
|
||||||
|
<BreadcrumbItem>
|
||||||
|
<p class={`select-none ${estado === 'email' ? 'font-bold text-white' : ''}`}>
|
||||||
|
Ingrese Email
|
||||||
|
</p>
|
||||||
|
</BreadcrumbItem>
|
||||||
|
<BreadcrumbSeparator />
|
||||||
|
<BreadcrumbItem>
|
||||||
|
<p class={`select-none ${estado === 'otp' ? 'font-bold text-white' : ''}`}>Ingresar OTP</p>
|
||||||
|
</BreadcrumbItem>
|
||||||
|
<BreadcrumbSeparator />
|
||||||
|
<BreadcrumbItem>
|
||||||
|
<p class={`select-none ${estado === 'nuevapass' ? 'font-bold text-white' : ''}`}>
|
||||||
|
Nueva Contraseña
|
||||||
|
</p>
|
||||||
|
</BreadcrumbItem>
|
||||||
|
</BreadcrumbList>
|
||||||
|
</Breadcrumb>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user