Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Rename input size prop (#2258)

Luke Vellaf63fbed2c4d1
diff --git a/apps/web/src/app/[locale]/(auth)/forgot-password/components/forgot-password-form.tsx b/apps/web/src/app/[locale]/(auth)/forgot-password/components/forgot-password-form.tsx
index 372e0c174..73813654c 100644
--- a/apps/web/src/app/[locale]/(auth)/forgot-password/components/forgot-password-form.tsx
+++ b/apps/web/src/app/[locale]/(auth)/forgot-password/components/forgot-password-form.tsx
@@ -89,7 +89,7 @@ export function ForgotPasswordForm() {
<FormControl>
<Input
{...field}
- size="lg"
+ large
type="email"
disabled={formState.isSubmitting}
autoFocus={true}
diff --git a/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx b/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx
index b4747deb3..e6ebe36e7 100644
--- a/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx
+++ b/apps/web/src/app/[locale]/(auth)/login/components/login-email-form.tsx
@@ -142,7 +142,7 @@ export function LoginWithEmailForm() {
<FormControl>
<Input
{...field}
- size="lg"
+ large
type="text"
disabled={formState.isSubmitting}
autoFocus={true}
@@ -182,7 +182,7 @@ export function LoginWithEmailForm() {
<FormControl>
<Input
autoFocus={true}
- size="lg"
+ large
type="password"
disabled={form.formState.isSubmitting}
placeholder="••••••••"
diff --git a/apps/web/src/app/[locale]/(auth)/login/verify/components/otp-form.tsx b/apps/web/src/app/[locale]/(auth)/login/verify/components/otp-form.tsx
index ee5cf1989..0a08dfce0 100644
--- a/apps/web/src/app/[locale]/(auth)/login/verify/components/otp-form.tsx
+++ b/apps/web/src/app/[locale]/(auth)/login/verify/components/otp-form.tsx
@@ -68,7 +68,7 @@ export function OTPForm({ email }: { email: string }) {
<FormItem>
<FormControl>
<InputOTP
- size="lg"
+ large
placeholder={t("verificationCodePlaceholder")}
disabled={
form.formState.isSubmitting ||
diff --git a/apps/web/src/app/[locale]/(auth)/register/components/register-name-form.tsx b/apps/web/src/app/[locale]/(auth)/register/components/register-name-form.tsx
index cc2e2eea9..68a84ef06 100644
--- a/apps/web/src/app/[locale]/(auth)/register/components/register-name-form.tsx
+++ b/apps/web/src/app/[locale]/(auth)/register/components/register-name-form.tsx
@@ -137,7 +137,7 @@ export function RegisterNameForm() {
<FormControl>
<Input
{...field}
- size="lg"
+ large
data-1p-ignore
placeholder={t("namePlaceholder")}
disabled={form.formState.isSubmitting}
@@ -159,7 +159,7 @@ export function RegisterNameForm() {
</FormLabel>
<FormControl>
<Input
- size="lg"
+ large
placeholder={t("emailPlaceholder")}
disabled={form.formState.isSubmitting}
{...field}
@@ -179,7 +179,7 @@ export function RegisterNameForm() {
</FormLabel>
<FormControl>
<PasswordInput
- size="lg"
+ large
placeholder="••••••••"
disabled={form.formState.isSubmitting}
{...field}
diff --git a/apps/web/src/app/[locale]/(auth)/reset-password/components/reset-password-form.tsx b/apps/web/src/app/[locale]/(auth)/reset-password/components/reset-password-form.tsx
index c7a86a756..63c50b694 100644
--- a/apps/web/src/app/[locale]/(auth)/reset-password/components/reset-password-form.tsx
+++ b/apps/web/src/app/[locale]/(auth)/reset-password/components/reset-password-form.tsx
@@ -94,7 +94,7 @@ export function ResetPasswordForm() {
<FormControl>
<PasswordInput
{...field}
- size="lg"
+ large
disabled={formState.isSubmitting}
autoFocus={true}
placeholder="••••••••"
diff --git a/packages/ui/src/input.tsx b/packages/ui/src/input.tsx
index 218f5b528..f7c337ea3 100644
--- a/packages/ui/src/input.tsx
+++ b/packages/ui/src/input.tsx
@@ -1,40 +1,25 @@
-import type { VariantProps } from "class-variance-authority";
-import { cva } from "class-variance-authority";
import type * as React from "react";
import { cn } from "./lib/utils";
-const inputVariants = cva(
- cn(
- "w-full min-w-0 border border-input-border bg-transparent shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
- "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
- "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
- ),
- {
- variants: {
- size: {
- default: "h-8 rounded-lg px-2.5 py-1 text-sm",
- sm: "h-7 rounded-md px-2 text-sm",
- lg: "h-12 rounded-lg px-3 text-base",
- },
- },
- defaultVariants: {
- size: "default",
- },
- },
-);
-
function Input({
className,
type,
- size = "default",
+ large,
...props
-}: Omit<React.ComponentProps<"input">, "size"> &
- VariantProps<typeof inputVariants>) {
+}: React.ComponentProps<"input"> & { large?: boolean }) {
return (
<input
type={type}
data-slot="input"
- className={inputVariants({ size, className })}
+ className={cn(
+ "w-full min-w-0 border border-input-border bg-transparent shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30",
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
+ large
+ ? "h-12 rounded-lg px-3 text-base"
+ : "h-8 rounded-lg px-2.5 py-1 text-sm",
+ className,
+ )}
{...props}
/>
);