;
});
diff --git a/sites/docs/src/lib/config/docs.ts b/sites/docs/src/lib/config/docs.ts
index c81e365f0..1590526fc 100644
--- a/sites/docs/src/lib/config/docs.ts
+++ b/sites/docs/src/lib/config/docs.ts
@@ -222,6 +222,12 @@ export const docsConfig: DocsConfig = {
href: "/docs/components/input",
items: [],
},
+ {
+ title: "Input OTP",
+ href: "/docs/components/input-otp",
+ items: [],
+ label: "New",
+ },
{
title: "Label",
href: "/docs/components/label",
diff --git a/sites/docs/src/lib/registry/default/example/input-otp-demo.svelte b/sites/docs/src/lib/registry/default/example/input-otp-demo.svelte
new file mode 100644
index 000000000..f8f013afe
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/example/input-otp-demo.svelte
@@ -0,0 +1,19 @@
+
+
+
+ {#snippet children({ cells })}
+
+ {#each cells.slice(0, 3) as cell}
+
+ {/each}
+
+
+
+ {#each cells.slice(3, 6) as cell}
+
+ {/each}
+
+ {/snippet}
+
diff --git a/sites/docs/src/lib/registry/default/example/input-otp-form.svelte b/sites/docs/src/lib/registry/default/example/input-otp-form.svelte
new file mode 100644
index 000000000..f6f2000af
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/example/input-otp-form.svelte
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ {#snippet children({ props })}
+
+ {#snippet children({ cells })}
+
+ {#each cells as cell}
+
+ {/each}
+
+ {/snippet}
+
+ {/snippet}
+
+ Please enter the one-time password sent to your phone.
+
+
+ Submit
+ {#if browser}
+
+ {/if}
+
diff --git a/sites/docs/src/lib/registry/default/example/input-otp-pattern.svelte b/sites/docs/src/lib/registry/default/example/input-otp-pattern.svelte
new file mode 100644
index 000000000..02f07e82e
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/example/input-otp-pattern.svelte
@@ -0,0 +1,14 @@
+
+
+
+ {#snippet children({ cells })}
+
+ {#each cells as cell}
+
+ {/each}
+
+ {/snippet}
+
diff --git a/sites/docs/src/lib/registry/default/example/input-otp-separator.svelte b/sites/docs/src/lib/registry/default/example/input-otp-separator.svelte
new file mode 100644
index 000000000..5d80da14a
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/example/input-otp-separator.svelte
@@ -0,0 +1,25 @@
+
+
+
+ {#snippet children({ cells })}
+
+ {#each cells.slice(0, 2) as cell}
+
+ {/each}
+
+
+
+ {#each cells.slice(2, 4) as cell}
+
+ {/each}
+
+
+
+ {#each cells.slice(4, 6) as cell}
+
+ {/each}
+
+ {/snippet}
+
diff --git a/sites/docs/src/lib/registry/default/ui/input-otp/index.ts b/sites/docs/src/lib/registry/default/ui/input-otp/index.ts
new file mode 100644
index 000000000..e9ae273e9
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/ui/input-otp/index.ts
@@ -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,
+};
diff --git a/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-group.svelte b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-group.svelte
new file mode 100644
index 000000000..7ef58a5a3
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-group.svelte
@@ -0,0 +1,16 @@
+
+
+
+ {@render children?.()}
+
diff --git a/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-separator.svelte b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-separator.svelte
new file mode 100644
index 000000000..40c9712fa
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-separator.svelte
@@ -0,0 +1,19 @@
+
+
+
+ {#if children}
+ {@render children?.()}
+ {:else}
+
+ {/if}
+
diff --git a/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-slot.svelte b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-slot.svelte
new file mode 100644
index 000000000..f5c6035c4
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp-slot.svelte
@@ -0,0 +1,30 @@
+
+
+
+ {cell.char}
+ {#if cell.hasFakeCaret}
+
+ {/if}
+
diff --git a/sites/docs/src/lib/registry/default/ui/input-otp/input-otp.svelte b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp.svelte
new file mode 100644
index 000000000..8b59b3f40
--- /dev/null
+++ b/sites/docs/src/lib/registry/default/ui/input-otp/input-otp.svelte
@@ -0,0 +1,22 @@
+
+
+
diff --git a/sites/docs/src/lib/registry/new-york/example/input-otp-demo.svelte b/sites/docs/src/lib/registry/new-york/example/input-otp-demo.svelte
new file mode 100644
index 000000000..b0b8f3e54
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/example/input-otp-demo.svelte
@@ -0,0 +1,19 @@
+
+
+
+ {#snippet children({ cells })}
+
+ {#each cells.slice(0, 3) as cell}
+
+ {/each}
+
+
+
+ {#each cells.slice(3, 6) as cell}
+
+ {/each}
+
+ {/snippet}
+
diff --git a/sites/docs/src/lib/registry/new-york/example/input-otp-form.svelte b/sites/docs/src/lib/registry/new-york/example/input-otp-form.svelte
new file mode 100644
index 000000000..aceff3f2e
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/example/input-otp-form.svelte
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ {#snippet children({ props })}
+
+ {#snippet children({ cells })}
+
+ {#each cells as cell}
+
+ {/each}
+
+ {/snippet}
+
+ {/snippet}
+
+ Please enter the one-time password sent to your phone.
+
+
+ Submit
+ {#if browser}
+
+ {/if}
+
diff --git a/sites/docs/src/lib/registry/new-york/example/input-otp-pattern.svelte b/sites/docs/src/lib/registry/new-york/example/input-otp-pattern.svelte
new file mode 100644
index 000000000..06f14ff74
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/example/input-otp-pattern.svelte
@@ -0,0 +1,14 @@
+
+
+
+ {#snippet children({ cells })}
+
+ {#each cells as cell}
+
+ {/each}
+
+ {/snippet}
+
diff --git a/sites/docs/src/lib/registry/new-york/example/input-otp-separator.svelte b/sites/docs/src/lib/registry/new-york/example/input-otp-separator.svelte
new file mode 100644
index 000000000..e55eae51a
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/example/input-otp-separator.svelte
@@ -0,0 +1,25 @@
+
+
+
+ {#snippet children({ cells })}
+
+ {#each cells.slice(0, 2) as cell}
+
+ {/each}
+
+
+
+ {#each cells.slice(2, 4) as cell}
+
+ {/each}
+
+
+
+ {#each cells.slice(4, 6) as cell}
+
+ {/each}
+
+ {/snippet}
+
diff --git a/sites/docs/src/lib/registry/new-york/ui/input-otp/index.ts b/sites/docs/src/lib/registry/new-york/ui/input-otp/index.ts
new file mode 100644
index 000000000..e9ae273e9
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/ui/input-otp/index.ts
@@ -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,
+};
diff --git a/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-group.svelte b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-group.svelte
new file mode 100644
index 000000000..7ef58a5a3
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-group.svelte
@@ -0,0 +1,16 @@
+
+
+
+ {@render children?.()}
+
diff --git a/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-separator.svelte b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-separator.svelte
new file mode 100644
index 000000000..eedef2f74
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-separator.svelte
@@ -0,0 +1,19 @@
+
+
+
+ {#if children}
+ {@render children?.()}
+ {:else}
+
+ {/if}
+
diff --git a/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-slot.svelte b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-slot.svelte
new file mode 100644
index 000000000..986d799ed
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp-slot.svelte
@@ -0,0 +1,30 @@
+
+
+
+ {cell.char}
+ {#if cell.hasFakeCaret}
+
+ {/if}
+
diff --git a/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp.svelte b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp.svelte
new file mode 100644
index 000000000..8b59b3f40
--- /dev/null
+++ b/sites/docs/src/lib/registry/new-york/ui/input-otp/input-otp.svelte
@@ -0,0 +1,22 @@
+
+
+
diff --git a/sites/docs/src/routes/(app)/+page.server.ts b/sites/docs/src/routes/(app)/+page.server.ts
index 8dee6183d..f65a63bcc 100644
--- a/sites/docs/src/routes/(app)/+page.server.ts
+++ b/sites/docs/src/routes/(app)/+page.server.ts
@@ -13,6 +13,7 @@ import { formSchema as textareaSchema } from "$lib/registry/default/example/text
import { formSchema as comboboxFormSchema } from "$lib/registry/default/example/combobox-form.svelte";
import { formSchema as datePickerFormSchema } from "$lib/registry/default/example/date-picker-form.svelte";
import { formSchema as checkboxMultipleSchema } from "$lib/registry/default/example/checkbox-form-multiple.svelte";
+import { formSchema as inputOtpSchema } from "$lib/registry/default/example/input-otp-form.svelte";
export const actions: Actions = {
username: async (e) => handleForm(e, formSchema),
@@ -24,6 +25,7 @@ export const actions: Actions = {
textarea: async (e) => handleForm(e, textareaSchema),
combobox: async (e) => handleForm(e, comboboxFormSchema),
datePicker: async (e) => handleForm(e, datePickerFormSchema),
+ inputOtp: async (e) => handleForm(e, inputOtpSchema),
};
async function handleForm(event: RequestEvent, schema: AnyZodObject) {
diff --git a/sites/docs/src/routes/(app)/docs/+layout.server.ts b/sites/docs/src/routes/(app)/docs/+layout.server.ts
index a9358f050..bd99042f6 100644
--- a/sites/docs/src/routes/(app)/docs/+layout.server.ts
+++ b/sites/docs/src/routes/(app)/docs/+layout.server.ts
@@ -11,6 +11,7 @@ import { formSchema as textareaSchema } from "$lib/registry/default/example/text
import { formSchema as comboboxFormSchema } from "$lib/registry/default/example/combobox-form.svelte";
import { formSchema as datePickerFormSchema } from "$lib/registry/default/example/date-picker-form.svelte";
import { formSchema as checkboxMultipleSchema } from "$lib/registry/default/example/checkbox-form-multiple.svelte";
+import { formSchema as inputOtpSchema } from "$lib/registry/default/example/input-otp-form.svelte";
export const load: LayoutServerLoad = async () => {
return {
@@ -23,6 +24,7 @@ export const load: LayoutServerLoad = async () => {
textarea: await superValidate(zod(textareaSchema)),
combobox: await superValidate(zod(comboboxFormSchema)),
datePicker: await superValidate(zod(datePickerFormSchema)),
+ inputOtp: await superValidate(zod(inputOtpSchema)),
};
};