Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Add outlines to more ui components

Luke Vellac3b038f016e3
diff --git a/apps/web/src/app/[locale]/(app)/(space)/settings/components/sidebar.tsx b/apps/web/src/app/[locale]/(app)/(space)/settings/components/sidebar.tsx
index fae936fdc..723fea0a4 100644
--- a/apps/web/src/app/[locale]/(app)/(space)/settings/components/sidebar.tsx
+++ b/apps/web/src/app/[locale]/(app)/(space)/settings/components/sidebar.tsx
@@ -85,7 +85,7 @@ export function AccountSidebarMenu() {
href={item.href}
className="flex items-center gap-x-2"
>
- <Icon>{item.icon}</Icon>
+ {item.icon}
{item.label}
</HoverPrefetchLink>
</SidebarMenuButton>
diff --git a/apps/web/src/app/[locale]/(app)/(space)/settings/profile/profile-page.tsx b/apps/web/src/app/[locale]/(app)/(space)/settings/profile/profile-page.tsx
index dbe5e76a9..f5448f396 100644
--- a/apps/web/src/app/[locale]/(app)/(space)/settings/profile/profile-page.tsx
+++ b/apps/web/src/app/[locale]/(app)/(space)/settings/profile/profile-page.tsx
@@ -2,7 +2,6 @@
import { Button } from "@rallly/ui/button";
import { DialogTrigger } from "@rallly/ui/dialog";
-import { TrashIcon } from "lucide-react";
import {
PageSection,
@@ -78,8 +77,7 @@ export function ProfilePage() {
<PageSectionContent>
<DeleteAccountDialog>
<DialogTrigger asChild>
- <Button variant="destructive">
- <TrashIcon data-icon="inline-start" />
+ <Button className="text-destructive">
<Trans i18nKey="deleteAccount" defaults="Delete Account" />
</Button>
</DialogTrigger>
diff --git a/apps/web/src/features/billing/components/pay-wall-dialog.tsx b/apps/web/src/features/billing/components/pay-wall-dialog.tsx
index 300f0d61a..889b493d7 100644
--- a/apps/web/src/features/billing/components/pay-wall-dialog.tsx
+++ b/apps/web/src/features/billing/components/pay-wall-dialog.tsx
@@ -191,7 +191,7 @@ export function PayWallDialog({
{selectedPlan === "pro" && (
<label
htmlFor="annual-switch"
- className="relative flex select-none items-start justify-between gap-4 overflow-hidden rounded-lg bg-gray-50 p-4 ring ring-black/5 ring-inset hover:bg-gray-100 dark:bg-gray-700/50 dark:ring-white/10 dark:hover:bg-gray-700"
+ className="relative flex select-none items-start justify-between gap-4 overflow-hidden rounded-lg bg-gray-50 p-4 ring ring-button-outline ring-inset hover:bg-gray-100 dark:bg-gray-700/50 dark:hover:bg-gray-700"
>
<BadgeDollarSignIcon className="pointer-events-none absolute -top-5 right-16 size-24 opacity-5" />
diff --git a/packages/tailwind-config/shared-styles.css b/packages/tailwind-config/shared-styles.css
index f51e64863..485dc3fe1 100644
--- a/packages/tailwind-config/shared-styles.css
+++ b/packages/tailwind-config/shared-styles.css
@@ -13,6 +13,9 @@
--primary: var(--primary-light, var(--color-indigo-600));
--primary-foreground: var(--primary-light-foreground, var(--color-white));
+ --button-outline: rgba(0, 0, 0, 0.1);
+ --menu-item-outline: rgba(0, 0, 0, 0.05);
+
--border: var(--color-gray-200);
--border-muted: oklch(0.871 0.006 286.286 / 0.5);
@@ -61,6 +64,9 @@
--background: var(--color-gray-900);
--foreground: var(--color-gray-300);
+ --button-outline: rgba(255, 255, 255, 0.1);
+ --menu-item-outline: rgba(255, 255, 255, 0.05);
+
--primary: var(--primary-dark, var(--color-indigo-500));
--primary-foreground: var(--primary-dark-foreground, var(--color-white));
@@ -82,7 +88,7 @@
--destructive: var(--color-rose-500);
--destructive-foreground: var(--color-rose-50);
- --accent: var(--color-gray-700);
+ --accent: oklch(1 0 0 / 0.1);
--accent-border: var(--color-gray-600);
--accent-foreground: var(--color-gray-100);
@@ -105,6 +111,9 @@
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
+ --color-button-outline: var(--button-outline);
+ --color-menu-item-outline: var(--menu-item-outline);
+
--color-border: var(--border);
--color-border-muted: var(--border-muted);
diff --git a/packages/ui/src/avatar.tsx b/packages/ui/src/avatar.tsx
index 870c6a6e9..de0b11d9b 100644
--- a/packages/ui/src/avatar.tsx
+++ b/packages/ui/src/avatar.tsx
@@ -4,19 +4,22 @@ import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import * as React from "react";
-const avatarVariants = cva("relative flex shrink-0 overflow-hidden", {
- variants: {
- size: {
- xl: "size-12 rounded-xl text-lg",
- lg: "size-10 rounded-lg text-base",
- md: "size-8 rounded-lg text-sm",
- sm: "size-6 rounded-md text-[10px]",
+const avatarVariants = cva(
+ "relative flex shrink-0 overflow-hidden ring-1 ring-button-outline",
+ {
+ variants: {
+ size: {
+ xl: "size-12 rounded-xl text-lg",
+ lg: "size-10 rounded-lg text-base",
+ md: "size-8 rounded-lg text-sm",
+ sm: "size-6 rounded-md text-[10px]",
+ },
+ },
+ defaultVariants: {
+ size: "md",
},
},
- defaultVariants: {
- size: "md",
- },
-});
+);
export type AvatarProps = VariantProps<typeof avatarVariants>;
diff --git a/packages/ui/src/button-variants.ts b/packages/ui/src/button-variants.ts
index 2f27db24d..803b8a65e 100644
--- a/packages/ui/src/button-variants.ts
+++ b/packages/ui/src/button-variants.ts
@@ -4,18 +4,19 @@ import { cn } from "./lib/utils";
export const buttonVariants = cva(
cn(
- "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-lg font-normal outline-none transition-opacity focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:opacity-90 active:shadow-none disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:opacity-90",
+ "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-lg font-normal outline-none transition-opacity transition-transform focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:translate-y-0.5 active:shadow-none disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:opacity-90",
),
{
variants: {
variant: {
primary:
- "bg-primary text-primary-foreground ring-1 ring-black/10 ring-inset hover:bg-primary/90 dark:ring-white/10",
+ "bg-primary text-primary-foreground ring-1 ring-button-outline ring-inset hover:bg-primary/90",
destructive:
- "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
- default: "border border-input bg-transparent shadow-xs hover:bg-accent",
+ "bg-destructive text-destructive-foreground ring-1 ring-button-outline ring-inset hover:bg-destructive/90",
+ default:
+ "bg-transparent ring-1 ring-button-outline ring-inset hover:bg-accent",
ghost:
- "border-transparent bg-transparent text-foreground hover:bg-accent data-[state=open]:bg-accent",
+ "border-transparent bg-transparent text-foreground ring-1 ring-transparent ring-inset hover:bg-accent hover:ring-button-outline data-[state=open]:bg-accent data-[state=open]:ring-button-outline",
actionBar:
"border-transparent bg-action-bar text-action-bar-foreground hover:bg-action-bar-foreground/10 data-[state=open]:bg-action-bar-foreground/20",
link: "border-transparent text-primary underline-offset-4 hover:underline",
diff --git a/packages/ui/src/dropdown-menu.tsx b/packages/ui/src/dropdown-menu.tsx
index 602b0eae0..781a4b733 100644
--- a/packages/ui/src/dropdown-menu.tsx
+++ b/packages/ui/src/dropdown-menu.tsx
@@ -41,7 +41,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
<DropdownMenuPrimitive.SubTrigger
ref={ref}
className={cn(
- "flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent data-disabled:opacity-50",
+ dropdownMenuItemVariants({ variant: "default" }),
inset && "pl-8",
className,
)}
@@ -88,13 +88,13 @@ const DropdownMenuContent = React.forwardRef<
));
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
-const dropdownMenuItemVariants = cva(
- "relative flex cursor-default select-none items-center gap-x-2.5 rounded-lg px-2 py-1.5 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
+export const dropdownMenuItemVariants = cva(
+ "relative flex cursor-default select-none items-center gap-x-2.5 rounded-lg px-2 py-1.5 text-sm outline-hidden focus:bg-popover-accent focus:ring-1 focus:ring-menu-item-outline focus:ring-inset data-disabled:pointer-events-none data-disabled:opacity-50",
+
{
variants: {
variant: {
- default:
- "focus:bg-popover-accent focus:ring-1 focus:ring-black/5 focus:ring-inset dark:focus:ring-white/5",
+ default: "",
destructive: "text-destructive focus:bg-popover-accent",
},
},
diff --git a/packages/ui/src/select.tsx b/packages/ui/src/select.tsx
index 231805911..2e5fb7169 100644
--- a/packages/ui/src/select.tsx
+++ b/packages/ui/src/select.tsx
@@ -33,7 +33,11 @@ const SelectTrigger = React.forwardRef<
>(({ className, children, ...props }, ref) => (
<SelectPrimitive.Trigger
ref={ref}
- className={cn(buttonVariants({ variant: "default" }), className)}
+ className={cn(
+ buttonVariants({ variant: "default" }),
+ "shadow-none",
+ className,
+ )}
{...props}
>
{children}
@@ -49,7 +53,7 @@ const SelectContent = React.forwardRef<
<SelectPrimitive.Content
ref={ref}
className={cn(
- "relative z-50 max-h-[300px] min-w-32 animate-in overflow-hidden rounded-lg border border-popover-border bg-popover shadow-md",
+ "relative z-50 max-h-[300px] min-w-32 animate-in overflow-hidden rounded-xl border border-popover-border bg-popover shadow-sm",
position === "popper" && "translate-y-1",
className,
)}
@@ -92,7 +96,7 @@ const SelectItem = React.forwardRef<
<SelectPrimitive.Item
ref={ref}
className={cn(
- "relative flex w-full cursor-default select-none items-center rounded-md py-2 pr-2 pl-8 text-sm outline-hidden focus:bg-popover-accent data-disabled:pointer-events-none data-disabled:opacity-50",
+ "relative flex w-full cursor-default select-none items-center rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-popover-accent focus:ring-1 focus:ring-black/5 focus:ring-inset data-disabled:pointer-events-none data-disabled:opacity-50 dark:focus:ring-white/5",
className,
)}
{...props}
diff --git a/packages/ui/src/sidebar.tsx b/packages/ui/src/sidebar.tsx
index 8e0385d7e..49740c559 100644
--- a/packages/ui/src/sidebar.tsx
+++ b/packages/ui/src/sidebar.tsx
@@ -515,9 +515,9 @@ const sidebarMenuButtonVariants = cva(
variants: {
variant: {
primary:
- "text-primary active:text-primary data-[active=false]:hover:bg-primary/10",
+ "text-primary ring-1 ring-transparent ring-inset active:text-primary data-[active=false]:hover:bg-primary/10 data-[active=false]:hover:ring-primary/20",
default:
- "text-muted-foreground hover:text-sidebar-accent-foreground hover:text-sidebar-accent-foreground focus:bg-sidebar-accent focus:text-sidebar-accent-foreground focus-visible:text-sidebar-accent-foreground data-[active=true]:ring-1 data-[active=true]:ring-1 data-[active=true]:ring-black/5 data-[active=true]:ring-inset",
+ "text-muted-foreground hover:text-sidebar-accent-foreground hover:text-sidebar-accent-foreground focus:bg-sidebar-accent focus:text-sidebar-accent-foreground focus-visible:text-sidebar-accent-foreground data-[active=true]:ring-1 data-[active=true]:ring-1 data-[active=true]:ring-button-outline data-[active=true]:ring-inset",
outline:
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
},
diff --git a/packages/ui/src/tile.tsx b/packages/ui/src/tile.tsx
index c831622c8..e2c57aa83 100644
--- a/packages/ui/src/tile.tsx
+++ b/packages/ui/src/tile.tsx
@@ -18,7 +18,7 @@ const Tile = React.forwardRef<
<Comp
ref={ref}
className={cn(
- "relative flex flex-col justify-end rounded-xl border border-card-border bg-card p-3 text-card-foreground shadow-xs hover:bg-card-accent",
+ "relative flex flex-col justify-end rounded-xl bg-card p-3 text-card-foreground shadow-xs ring-1 ring-button-outline ring-inset transition-transform hover:bg-card-accent active:translate-y-0.5",
className,
)}
{...props}