feat: replace custom Textarea component with UI library version across multiple files
This commit is contained in:
parent
319229830e
commit
b0c00e2d0f
9 changed files with 8 additions and 29 deletions
|
|
@ -27,7 +27,6 @@ import {
|
||||||
CredenzaTitle,
|
CredenzaTitle,
|
||||||
CredenzaTrigger,
|
CredenzaTrigger,
|
||||||
} from "../custom_ui/credenza";
|
} from "../custom_ui/credenza";
|
||||||
import { Textarea } from "../custom_ui/textarea";
|
|
||||||
import { Button } from "../ui/button";
|
import { Button } from "../ui/button";
|
||||||
import Input from "../ui/input";
|
import Input from "../ui/input";
|
||||||
import { Label } from "../ui/label";
|
import { Label } from "../ui/label";
|
||||||
|
|
@ -40,6 +39,7 @@ import {
|
||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "../ui/select";
|
} from "../ui/select";
|
||||||
|
import { Textarea } from "../ui/textarea";
|
||||||
import { UserAvatar } from "../user_avatar";
|
import { UserAvatar } from "../user_avatar";
|
||||||
|
|
||||||
export const Potenziali = () => {
|
export const Potenziali = () => {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import { useRouter } from "next/router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import LoadingButton from "~/components/custom_ui/loading-button";
|
import LoadingButton from "~/components/custom_ui/loading-button";
|
||||||
import { Textarea } from "~/components/custom_ui/textarea";
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
|
|
@ -26,6 +25,7 @@ import {
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "~/components/ui/dialog";
|
} from "~/components/ui/dialog";
|
||||||
|
import { Textarea } from "~/components/ui/textarea";
|
||||||
import { useUserViewContext } from "~/lib/userViewContext";
|
import { useUserViewContext } from "~/lib/userViewContext";
|
||||||
import { api } from "~/utils/api";
|
import { api } from "~/utils/api";
|
||||||
import { Confirm } from "../confirm";
|
import { Confirm } from "../confirm";
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
import { forwardRef, type TextareaHTMLAttributes } from "react";
|
|
||||||
import { cn } from "src/lib/utils";
|
|
||||||
|
|
||||||
type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
||||||
|
|
||||||
const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
||||||
({ className, ...props }, ref) => {
|
|
||||||
return (
|
|
||||||
<textarea
|
|
||||||
className={cn(
|
|
||||||
`flex min-h-20 w-full rounded-lg border border-border bg-background px-3 py-2 shadow-sm outline-hidden transition-all duration-200 hover:border-muted-foreground focus:border-foreground focus:ring-foreground disabled:cursor-not-allowed disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:border-muted-foreground dark:hover:bg-input/50 dark:placeholder:text-neutral-400`,
|
|
||||||
className,
|
|
||||||
)}
|
|
||||||
ref={ref}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
Textarea.displayName = "Textarea";
|
|
||||||
|
|
||||||
export { Textarea };
|
|
||||||
|
|
@ -9,6 +9,7 @@ import {
|
||||||
UserActions,
|
UserActions,
|
||||||
} from "~/components/servizio/annuncio_actions";
|
} from "~/components/servizio/annuncio_actions";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
|
||||||
|
import { Textarea } from "~/components/ui/textarea";
|
||||||
import { useMediaQuery } from "~/hooks/use-media-query";
|
import { useMediaQuery } from "~/hooks/use-media-query";
|
||||||
import { handleConsegna } from "~/lib/annuncio_details";
|
import { handleConsegna } from "~/lib/annuncio_details";
|
||||||
import { getStorageUrl } from "~/lib/storage_utils";
|
import { getStorageUrl } from "~/lib/storage_utils";
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
||||||
return (
|
return (
|
||||||
<textarea
|
<textarea
|
||||||
className={cn(
|
className={cn(
|
||||||
"field-sizing-content flex min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs outline-hidden transition-[color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
`flex min-h-20 w-full rounded-lg border border-border bg-background px-3 py-2 shadow-sm outline-hidden transition-all duration-200 hover:border-muted-foreground focus:border-foreground focus:ring-foreground disabled:cursor-not-allowed disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:border-muted-foreground dark:hover:bg-input/50 dark:placeholder:text-neutral-400`,
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
data-slot="textarea"
|
data-slot="textarea"
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ import {
|
||||||
FormLabel,
|
FormLabel,
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "~/components/custom_ui/form";
|
} from "~/components/custom_ui/form";
|
||||||
import { Textarea } from "~/components/custom_ui/textarea";
|
|
||||||
import { Checkbox } from "~/components/ui/checkbox";
|
import { Checkbox } from "~/components/ui/checkbox";
|
||||||
import Input from "~/components/ui/input";
|
import Input from "~/components/ui/input";
|
||||||
import { PhoneInput } from "~/components/ui/phone-input";
|
import { PhoneInput } from "~/components/ui/phone-input";
|
||||||
|
import { Textarea } from "~/components/ui/textarea";
|
||||||
import { useZodForm } from "~/lib/zodForm";
|
import { useZodForm } from "~/lib/zodForm";
|
||||||
import { useTranslation } from "~/providers/I18nProvider";
|
import { useTranslation } from "~/providers/I18nProvider";
|
||||||
import { api } from "~/utils/api";
|
import { api } from "~/utils/api";
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import {
|
||||||
type ListOption,
|
type ListOption,
|
||||||
MultiSelect,
|
MultiSelect,
|
||||||
} from "~/components/custom_ui/multiselect";
|
} from "~/components/custom_ui/multiselect";
|
||||||
import { Textarea } from "~/components/custom_ui/textarea";
|
|
||||||
import { Button } from "~/components/ui/button";
|
import { Button } from "~/components/ui/button";
|
||||||
import { Calendar } from "~/components/ui/calendar";
|
import { Calendar } from "~/components/ui/calendar";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
|
||||||
|
|
@ -50,6 +49,7 @@ import {
|
||||||
} from "~/components/ui/select";
|
} from "~/components/ui/select";
|
||||||
import { Switch } from "~/components/ui/switch";
|
import { Switch } from "~/components/ui/switch";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
|
||||||
|
import { Textarea } from "~/components/ui/textarea";
|
||||||
import { VideoPlayer } from "~/components/videoPlayer";
|
import { VideoPlayer } from "~/components/videoPlayer";
|
||||||
import { FieldResetButton } from "~/forms/comps";
|
import { FieldResetButton } from "~/forms/comps";
|
||||||
import { filteredCaratteristiche } from "~/hooks/schedaAnnuncioUtils";
|
import { filteredCaratteristiche } from "~/hooks/schedaAnnuncioUtils";
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import {
|
||||||
} from "~/components/custom_ui/form";
|
} from "~/components/custom_ui/form";
|
||||||
import { NumberInput } from "~/components/custom_ui/InputNumber";
|
import { NumberInput } from "~/components/custom_ui/InputNumber";
|
||||||
import { MultiSelect, UnpackOptions } from "~/components/custom_ui/multiselect";
|
import { MultiSelect, UnpackOptions } from "~/components/custom_ui/multiselect";
|
||||||
import { Textarea } from "~/components/custom_ui/textarea";
|
|
||||||
import { Button } from "~/components/ui/button";
|
import { Button } from "~/components/ui/button";
|
||||||
import Input from "~/components/ui/input";
|
import Input from "~/components/ui/input";
|
||||||
import {
|
import {
|
||||||
|
|
@ -20,6 +19,7 @@ import {
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "~/components/ui/select";
|
} from "~/components/ui/select";
|
||||||
import { Switch } from "~/components/ui/switch";
|
import { Switch } from "~/components/ui/switch";
|
||||||
|
import { Textarea } from "~/components/ui/textarea";
|
||||||
import { FieldResetButton } from "~/forms/comps";
|
import { FieldResetButton } from "~/forms/comps";
|
||||||
import { useZodForm } from "~/lib/zodForm";
|
import { useZodForm } from "~/lib/zodForm";
|
||||||
import OrderTypeEnum from "~/schemas/public/OrderTypeEnum";
|
import OrderTypeEnum from "~/schemas/public/OrderTypeEnum";
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,12 @@ import {
|
||||||
FormMessage,
|
FormMessage,
|
||||||
} from "~/components/custom_ui/form";
|
} from "~/components/custom_ui/form";
|
||||||
import { DualInputLayout } from "~/components/custom_ui/inputLayouts";
|
import { DualInputLayout } from "~/components/custom_ui/inputLayouts";
|
||||||
import { Textarea } from "~/components/custom_ui/textarea";
|
|
||||||
import { Badge } from "~/components/ui/badge";
|
import { Badge } from "~/components/ui/badge";
|
||||||
import { Button } from "~/components/ui/button";
|
import { Button } from "~/components/ui/button";
|
||||||
import { Checkbox } from "~/components/ui/checkbox";
|
import { Checkbox } from "~/components/ui/checkbox";
|
||||||
import Input from "~/components/ui/input";
|
import Input from "~/components/ui/input";
|
||||||
import { PhoneInput } from "~/components/ui/phone-input";
|
import { PhoneInput } from "~/components/ui/phone-input";
|
||||||
|
import { Textarea } from "~/components/ui/textarea";
|
||||||
import { useZodForm } from "~/lib/zodForm";
|
import { useZodForm } from "~/lib/zodForm";
|
||||||
import { useTranslation } from "~/providers/I18nProvider";
|
import { useTranslation } from "~/providers/I18nProvider";
|
||||||
import { api } from "~/utils/api";
|
import { api } from "~/utils/api";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue