Skip to content

Commit

Permalink
πŸ”„ Merge pull request #13 from steeeee0223/feature/ui
Browse files Browse the repository at this point in the history
πŸ”§ `ui` Update components: button, hint
  • Loading branch information
steeeee0223 authored Feb 1, 2024
2 parents 4ca1da4 + d1c4d27 commit 48a7df7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/ui/src/components/custom/hint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,31 @@ import {
export interface HintProps {
children: ReactNode;
description: string;
asChild?: boolean;
side?: "left" | "right" | "top" | "bottom";
sideOffset?: number;
align?: "start" | "center" | "end";
alignOffset?: number;
}

export const Hint = ({
children,
description,
asChild,
side = "bottom",
sideOffset,
align,
alignOffset,
}: HintProps) => {
return (
<TooltipProvider>
<Tooltip delayDuration={0}>
<TooltipTrigger>{children}</TooltipTrigger>
<TooltipTrigger asChild={asChild}>{children}</TooltipTrigger>
<TooltipContent
sideOffset={sideOffset}
side={side}
align={align}
alignOffset={alignOffset}
className="max-w-[220px] break-words text-xs"
>
{description}
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const buttonVariants = cva(
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
/** Custom */
board: "hover:bg-blue-500/20 hover:text-blue-800",
boardActive: "bg-blue-500/20 text-blue-800",
},
size: {
sm: "h-8 rounded-md px-3 text-xs",
Expand Down

0 comments on commit 48a7df7

Please sign in to comment.