diff --git a/package.json b/package.json index f7dc15a..1ffdb43 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/react-fontawesome": "^0.2.2", "@radix-ui/react-hover-card": "^1.1.13", + "@radix-ui/react-label": "^2.1.6", "@radix-ui/react-slot": "^1.2.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/src/components/labeled-input.tsx b/src/components/labeled-input.tsx index af8879e..7b4768a 100644 --- a/src/components/labeled-input.tsx +++ b/src/components/labeled-input.tsx @@ -1,4 +1,5 @@ import { Input } from '@/components/ui/input'; +import { Label } from '@/components/ui/label'; export default function LabeledInput({ type, @@ -11,17 +12,17 @@ export default function LabeledInput({ placeholder?: string; value?: string; }) { - const randomId = Math.random().toString(36).substring(2, 15); + const elementId = Math.random().toString(36).substring(2, 15); return ( -
- +
+
); diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx new file mode 100644 index 0000000..6bc5f71 --- /dev/null +++ b/src/components/ui/label.tsx @@ -0,0 +1,24 @@ +'use client'; + +import * as React from 'react'; +import * as LabelPrimitive from '@radix-ui/react-label'; + +import { cn } from '@/lib/utils'; + +function Label({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} + +export { Label }; diff --git a/src/components/user/login-form.tsx b/src/components/user/login-form.tsx index 47e1945..20438e8 100644 --- a/src/components/user/login-form.tsx +++ b/src/components/user/login-form.tsx @@ -3,7 +3,7 @@ import { Button } from '@/components/ui/button'; export default function LoginForm() { return ( -
+