feat(ui): refresh theme tokens + add Popover/StatusDot/EmptyState/Kbd
Visual overhaul to give @snowluma/ui a coherent, accessible identity. Tokens (styles/theme.css) - Deeper dark-mode surface ramp with more contrast between background / card / popover so dropdowns and dialogs read clearly in dark mode - New radius scale (xs → 3xl) anchored at 0.625rem for tighter feel - Layered shadow tokens (xs/sm/md/lg/xl) that adapt to mode - Semantic success / warning / info / destructive colour + foreground pairs replacing ad-hoc lookups - `--chrome-height` (52px) for consistent top-bar / sidebar header height - Utilities: `hover-lift`, `surface-glass`, `surface-gloss`; consumer- scoped scrollbar styling so native scrollbars match - Note: consumers must also `@import "tw-animate-css";` Components - Select: solid bg-popover + ring-1 ring-foreground/5; rotating chevron on open state; rounded-xl menu with shadow-xl (fixes the transparent dropdown bug) - Dialog / AlertDialog: bg-popover + ring; backdrop-blur on overlay; slide-in motion - Tooltip: ring + zoom-in motion, max-w-xs for long labels - Button: explicit transition list with active:translate-y-px; success / warning variants; icon-xs size - Input: hover border + focus ring + aria-invalid handling - Card: tighter line-height + typography - Badge: variants for success / warning / info / soft, size scale - ScrollArea: hover-only mode by default, slightly thicker thumb New components - Popover (radix wrapper) — for menus / inline overlays - StatusDot — semantic colored dot (replaces ad-hoc 🟢/🟡/🔴 emoji) - EmptyState — uniform placeholder for "nothing here yet" surfaces - Kbd — inline keyboard-key label
This commit is contained in:
16 files changed
+431
-107
No files matched your search
@@ -7,9 +7,10 @@ interface ScrollAreaProps extends React.ComponentPropsWithoutRef<typeof ScrollAr
|
||||
}
|
||||
|
||||
const ScrollArea = React.forwardRef<React.ElementRef<typeof ScrollAreaPrimitive.Root>, ScrollAreaProps>(
|
||||
({ className, children, viewportClassName, ...props }, ref) => (
|
||||
({ className, children, viewportClassName, type = 'hover', ...props }, ref) => (
|
||||
<ScrollAreaPrimitive.Root
|
||||
ref={ref}
|
||||
type={type}
|
||||
className={cn('relative overflow-hidden', className)}
|
||||
{...props}
|
||||
>
|
||||
@@ -22,7 +23,7 @@ const ScrollArea = React.forwardRef<React.ElementRef<typeof ScrollAreaPrimitive.
|
||||
<ScrollBar orientation="horizontal" />
|
||||
<ScrollAreaPrimitive.Corner />
|
||||
</ScrollAreaPrimitive.Root>
|
||||
)
|
||||
),
|
||||
);
|
||||
ScrollArea.displayName = 'ScrollArea';
|
||||
|
||||
@@ -35,13 +36,13 @@ const ScrollBar = React.forwardRef<
|
||||
orientation={orientation}
|
||||
className={cn(
|
||||
'flex touch-none select-none p-0.5 transition-colors',
|
||||
orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent',
|
||||
orientation === 'horizontal' && 'h-2 w-full flex-col border-t border-t-transparent',
|
||||
className
|
||||
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',
|
||||
orientation === 'horizontal' && 'h-2.5 w-full flex-col border-t border-t-transparent',
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border hover:bg-muted-foreground/40 transition-colors" />
|
||||
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border transition-colors hover:bg-muted-foreground/50" />
|
||||
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
||||
));
|
||||
ScrollBar.displayName = 'ScrollBar';
|
||||
|
||||
Reference in new issue
Block a user