mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-28 23:30:23 +00:00
add admin checks for admin pages and run biome formating 🔨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 11m8s
This commit is contained in:
@ -1,45 +1,55 @@
|
||||
import * as React from 'react';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { cn } from '@/lib/utils';
|
||||
import * as React from "react";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const FloatingInput = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
|
||||
({ className, ...props }, ref) => {
|
||||
return <Input placeholder=" " className={cn('peer', className)} ref={ref} {...props} />;
|
||||
},
|
||||
);
|
||||
FloatingInput.displayName = 'FloatingInput';
|
||||
const FloatingInput = React.forwardRef<
|
||||
HTMLInputElement,
|
||||
React.InputHTMLAttributes<HTMLInputElement>
|
||||
>(({ className, ...props }, ref) => {
|
||||
return (
|
||||
<Input
|
||||
placeholder=" "
|
||||
className={cn("peer", className)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
FloatingInput.displayName = "FloatingInput";
|
||||
|
||||
const FloatingLabel = React.forwardRef<
|
||||
React.ElementRef<typeof Label>,
|
||||
React.ComponentPropsWithoutRef<typeof Label>
|
||||
React.ElementRef<typeof Label>,
|
||||
React.ComponentPropsWithoutRef<typeof Label>
|
||||
>(({ className, ...props }, ref) => {
|
||||
return (
|
||||
<Label
|
||||
className={cn(
|
||||
'peer-focus:secondary peer-focus:dark:secondary absolute start-2 top-2 z-10 origin-[0] -translate-y-4 scale-75 transform bg-background px-2 text-sm text-gray-500 duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 dark:bg-background rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4 cursor-text',
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<Label
|
||||
className={cn(
|
||||
"peer-focus:secondary peer-focus:dark:secondary absolute start-2 top-2 z-10 origin-[0] -translate-y-4 scale-75 transform bg-background px-2 text-sm text-gray-500 duration-300 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-2 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 dark:bg-background rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4 cursor-text",
|
||||
className,
|
||||
)}
|
||||
ref={ref}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
FloatingLabel.displayName = 'FloatingLabel';
|
||||
FloatingLabel.displayName = "FloatingLabel";
|
||||
|
||||
type FloatingLabelInputProps = React.InputHTMLAttributes<HTMLInputElement> & { label?: string };
|
||||
type FloatingLabelInputProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
||||
label?: string;
|
||||
};
|
||||
|
||||
const FloatingLabelInput = React.forwardRef<
|
||||
React.ElementRef<typeof FloatingInput>,
|
||||
React.PropsWithoutRef<FloatingLabelInputProps>
|
||||
React.ElementRef<typeof FloatingInput>,
|
||||
React.PropsWithoutRef<FloatingLabelInputProps>
|
||||
>(({ id, label, ...props }, ref) => {
|
||||
return (
|
||||
<div className="relative">
|
||||
<FloatingInput ref={ref} id={id} {...props} />
|
||||
<FloatingLabel htmlFor={id}>{label}</FloatingLabel>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div className="relative">
|
||||
<FloatingInput ref={ref} id={id} {...props} />
|
||||
<FloatingLabel htmlFor={id}>{label}</FloatingLabel>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
FloatingLabelInput.displayName = 'FloatingLabelInput';
|
||||
FloatingLabelInput.displayName = "FloatingLabelInput";
|
||||
|
||||
export { FloatingInput, FloatingLabel, FloatingLabelInput };
|
||||
|
Reference in New Issue
Block a user