diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-04-20 23:49:24 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-04-21 01:00:34 +0000 |
| commit | cd632f295d896100207e1b02bfeb574175c07633 (patch) | |
| tree | 4944263d3bea3092b31799e584130200e6fb3dbf /apps/web/components/ui | |
| parent | ca58d68f0ef8d0c3afada6cb81b196f2db157376 (diff) | |
| download | karakeep-cd632f295d896100207e1b02bfeb574175c07633.tar.zst | |
ui(web): Reduce shadows, lighten some fonts, and a smaller editor. #1261
Diffstat (limited to 'apps/web/components/ui')
| -rw-r--r-- | apps/web/components/ui/info-tooltip.tsx | 2 | ||||
| -rw-r--r-- | apps/web/components/ui/input.tsx | 42 |
2 files changed, 33 insertions, 11 deletions
diff --git a/apps/web/components/ui/info-tooltip.tsx b/apps/web/components/ui/info-tooltip.tsx index 0254aa80..4dd97199 100644 --- a/apps/web/components/ui/info-tooltip.tsx +++ b/apps/web/components/ui/info-tooltip.tsx @@ -23,7 +23,7 @@ export default function InfoTooltip({ {variant === "tip" ? ( <Info color="#494949" - className={cn("cursor-pointer", className)} + className={cn("z-10 cursor-pointer", className)} size={size} /> ) : ( diff --git a/apps/web/components/ui/input.tsx b/apps/web/components/ui/input.tsx index 5543446c..09f9def9 100644 --- a/apps/web/components/ui/input.tsx +++ b/apps/web/components/ui/input.tsx @@ -1,20 +1,42 @@ import * as React from "react"; import { cn } from "@/lib/utils"; +import { LucideIcon } from "lucide-react"; -export type InputProps = React.InputHTMLAttributes<HTMLInputElement>; +export interface InputProps + extends React.InputHTMLAttributes<HTMLInputElement> { + startIcon?: LucideIcon; + endIcon?: LucideIcon; +} const Input = React.forwardRef<HTMLInputElement, InputProps>( - ({ className, type, ...props }, ref) => { + ({ className, type, startIcon, endIcon, ...props }, ref) => { + const StartIcon = startIcon; + const EndIcon = endIcon; + return ( - <input - type={type} - className={cn( - "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", - className, + <div className="relative w-full"> + {StartIcon && ( + <div className="absolute left-2 top-1/2 -translate-y-1/2 transform"> + <StartIcon size={18} className="text-muted-foreground" /> + </div> + )} + <input + type={type} + className={cn( + "flex h-10 w-full rounded-md border border-input bg-background px-4 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50", + startIcon ? "pl-8" : "", + endIcon ? "pr-8" : "", + className, + )} + ref={ref} + {...props} + /> + {EndIcon && ( + <div className="absolute right-3 top-1/2 -translate-y-1/2 transform"> + <EndIcon className="text-muted-foreground" size={18} /> + </div> )} - ref={ref} - {...props} - /> + </div> ); }, ); |
