mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 17:56:37 +02:00
💄 UI Tweaks (#1673)
This commit is contained in:
parent
e20b04a259
commit
7faa698b18
7 changed files with 32 additions and 30 deletions
|
@ -37,3 +37,5 @@ t("menu", { defaultValue: "Menu" });
|
||||||
25. i18nKeys should describe the message in camelCase. Ex. "lastUpdated": "Last Updated"
|
25. i18nKeys should describe the message in camelCase. Ex. "lastUpdated": "Last Updated"
|
||||||
26. Keep i18nKeys up to 25 characters
|
26. Keep i18nKeys up to 25 characters
|
||||||
27. If the i18nKey is not intended to be reused, prefix it with the component name in camelCase
|
27. If the i18nKey is not intended to be reused, prefix it with the component name in camelCase
|
||||||
|
28. Always use kebab-case for file names
|
||||||
|
29. Prefer double quotes for strings over single quotes
|
||||||
|
|
|
@ -29,10 +29,10 @@ const pageIconVariants = cva("inline-flex items-center justify-center", {
|
||||||
purple: "bg-purple-500 text-white",
|
purple: "bg-purple-500 text-white",
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
sm: "size-6 [&_svg]:size-3 rounded-md",
|
sm: "p-1 size-6 [&_svg]:size-3 rounded-md",
|
||||||
md: "size-7 [&_svg]:size-4 rounded-lg",
|
md: "p-2 size-8 [&_svg]:size-5 rounded-lg",
|
||||||
lg: "size-9 [&_svg]:size-5 rounded-xl",
|
lg: "p-3 size-9 [&_svg]:size-5 rounded-xl",
|
||||||
xl: "size-10 [&_svg]:size-5 rounded-xl",
|
xl: "p-4 size-10 [&_svg]:size-5 rounded-xl",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
|
@ -95,9 +95,9 @@ export function TeamsPageIcon() {
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export function HomePageIcon() {
|
export function HomePageIcon(props: PageIconVariantProps) {
|
||||||
return (
|
return (
|
||||||
<PageIcon color="darkGray" size="md">
|
<PageIcon color="darkGray" size="md" {...props}>
|
||||||
<HomeIcon />
|
<HomeIcon />
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
);
|
);
|
||||||
|
@ -118,33 +118,33 @@ export function PollPageIcon(props: PageIconVariantProps) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function EventPageIcon() {
|
export function EventPageIcon(props: PageIconVariantProps) {
|
||||||
return (
|
return (
|
||||||
<PageIcon color="rose" size="md">
|
<PageIcon color="rose" size="md" {...props}>
|
||||||
<CalendarIcon />
|
<CalendarIcon />
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ProfilePageIcon() {
|
export function ProfilePageIcon(props: PageIconVariantProps) {
|
||||||
return (
|
return (
|
||||||
<PageIcon color="gray" size="md">
|
<PageIcon color="gray" size="md" {...props}>
|
||||||
<UserIcon />
|
<UserIcon />
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PreferencesPageIcon() {
|
export function PreferencesPageIcon(props: PageIconVariantProps) {
|
||||||
return (
|
return (
|
||||||
<PageIcon color="gray" size="md">
|
<PageIcon color="gray" size="md" {...props}>
|
||||||
<Settings2Icon />
|
<Settings2Icon />
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function BillingPageIcon() {
|
export function BillingPageIcon(props: PageIconVariantProps) {
|
||||||
return (
|
return (
|
||||||
<PageIcon color="gray" size="md">
|
<PageIcon color="gray" size="md" {...props}>
|
||||||
<CreditCardIcon />
|
<CreditCardIcon />
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
);
|
);
|
||||||
|
|
|
@ -22,7 +22,7 @@ export function PageTitle({
|
||||||
return (
|
return (
|
||||||
<h1
|
<h1
|
||||||
className={cn(
|
className={cn(
|
||||||
"text-foreground flex gap-3 truncate text-xl font-bold tracking-tight",
|
"text-foreground flex items-center gap-3 truncate text-xl font-bold leading-none tracking-tight",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const ParticipantAvatarBar = ({
|
||||||
return (
|
return (
|
||||||
<ul className="flex cursor-default items-center -space-x-1 rounded-full bg-white p-0.5">
|
<ul className="flex cursor-default items-center -space-x-1 rounded-full bg-white p-0.5">
|
||||||
{visibleParticipants.map((participant, index) => (
|
{visibleParticipants.map((participant, index) => (
|
||||||
<Tooltip key={index}>
|
<Tooltip delayDuration={100} key={index}>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<li className="z-10 inline-flex items-center justify-center rounded-full ring-2 ring-white">
|
<li className="z-10 inline-flex items-center justify-center rounded-full ring-2 ring-white">
|
||||||
<OptimizedAvatarImage
|
<OptimizedAvatarImage
|
||||||
|
|
|
@ -64,7 +64,7 @@ export function CommandMenu() {
|
||||||
</CommandEmpty>
|
</CommandEmpty>
|
||||||
<CommandGroup heading={<Trans i18nKey="polls" defaults="Actions" />}>
|
<CommandGroup heading={<Trans i18nKey="polls" defaults="Actions" />}>
|
||||||
<CommandItem onSelect={() => handleSelect("/new")}>
|
<CommandItem onSelect={() => handleSelect("/new")}>
|
||||||
<PageIcon>
|
<PageIcon size="sm">
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
</PageIcon>
|
</PageIcon>
|
||||||
<Trans i18nKey="create" defaults="Create" />
|
<Trans i18nKey="create" defaults="Create" />
|
||||||
|
@ -72,15 +72,15 @@ export function CommandMenu() {
|
||||||
</CommandGroup>
|
</CommandGroup>
|
||||||
<CommandGroup heading="Navigation">
|
<CommandGroup heading="Navigation">
|
||||||
<CommandItem onSelect={() => handleSelect("/")}>
|
<CommandItem onSelect={() => handleSelect("/")}>
|
||||||
<HomePageIcon />
|
<HomePageIcon size="sm" />
|
||||||
<Trans i18nKey="home" defaults="Home" />
|
<Trans i18nKey="home" defaults="Home" />
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
<CommandItem onSelect={() => handleSelect("/polls")}>
|
<CommandItem onSelect={() => handleSelect("/polls")}>
|
||||||
<PollPageIcon />
|
<PollPageIcon size="sm" />
|
||||||
<Trans i18nKey="polls" defaults="Polls" />
|
<Trans i18nKey="polls" defaults="Polls" />
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
<CommandItem onSelect={() => handleSelect("/events")}>
|
<CommandItem onSelect={() => handleSelect("/events")}>
|
||||||
<EventPageIcon />
|
<EventPageIcon size="sm" />
|
||||||
<Trans i18nKey="events" defaults="Events" />
|
<Trans i18nKey="events" defaults="Events" />
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
{/* <CommandItem onSelect={() => handleSelect("/teams")}>
|
{/* <CommandItem onSelect={() => handleSelect("/teams")}>
|
||||||
|
@ -96,15 +96,15 @@ export function CommandMenu() {
|
||||||
heading={<Trans i18nKey="account" defaults="Account" />}
|
heading={<Trans i18nKey="account" defaults="Account" />}
|
||||||
>
|
>
|
||||||
<CommandItem onSelect={() => handleSelect("/settings/profile")}>
|
<CommandItem onSelect={() => handleSelect("/settings/profile")}>
|
||||||
<ProfilePageIcon />
|
<ProfilePageIcon size="sm" />
|
||||||
<Trans i18nKey="profile" defaults="Profile" />
|
<Trans i18nKey="profile" defaults="Profile" />
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
<CommandItem onSelect={() => handleSelect("/settings/preferences")}>
|
<CommandItem onSelect={() => handleSelect("/settings/preferences")}>
|
||||||
<PreferencesPageIcon />
|
<PreferencesPageIcon size="sm" />
|
||||||
<Trans i18nKey="preferences" defaults="Preferences" />
|
<Trans i18nKey="preferences" defaults="Preferences" />
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
<CommandItem onSelect={() => handleSelect("/settings/billing")}>
|
<CommandItem onSelect={() => handleSelect("/settings/billing")}>
|
||||||
<BillingPageIcon />
|
<BillingPageIcon size="sm" />
|
||||||
<Trans i18nKey="billing" defaults="Billing" />
|
<Trans i18nKey="billing" defaults="Billing" />
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
</CommandGroup>
|
</CommandGroup>
|
||||||
|
|
|
@ -4,12 +4,12 @@ import * as React from "react";
|
||||||
import { cn } from "./lib/utils";
|
import { cn } from "./lib/utils";
|
||||||
|
|
||||||
const badgeVariants = cva(
|
const badgeVariants = cva(
|
||||||
"inline-flex group whitespace-nowrap items-center rounded-full justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
"inline-flex group whitespace-nowrap items-center rounded-full justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
primary: "bg-primary text-primary-50",
|
primary: "bg-primary text-primary-50",
|
||||||
default: "bg-gray-50 border text-muted-foreground",
|
default: "bg-gray-50 border",
|
||||||
destructive: "bg-destructive text-destructive-foreground",
|
destructive: "bg-destructive text-destructive-foreground",
|
||||||
outline: "text-foreground",
|
outline: "text-foreground",
|
||||||
green: "bg-green-600 text-white",
|
green: "bg-green-600 text-white",
|
||||||
|
|
|
@ -10,18 +10,18 @@ import { cn } from "./lib/utils";
|
||||||
const buttonVariants = cva(
|
const buttonVariants = cva(
|
||||||
cn(
|
cn(
|
||||||
"inline-flex border text-shadow font-medium disabled:pointer-events-none select-none disabled:opacity-50 items-center justify-center whitespace-nowrap border",
|
"inline-flex border text-shadow font-medium disabled:pointer-events-none select-none disabled:opacity-50 items-center justify-center whitespace-nowrap border",
|
||||||
"focus:shadow-none focus-visible:ring-2 focus-visible:ring-ring",
|
"focus-visible:shadow-none",
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
primary:
|
primary:
|
||||||
"focus:ring-offset-1 border-primary bg-primary hover:bg-primary-500 disabled:bg-gray-400 disabled:border-transparent text-white shadow-sm",
|
"focus-visible:ring-offset-1 border-primary bg-primary hover:bg-primary-500 disabled:bg-gray-400 disabled:border-transparent text-white",
|
||||||
destructive:
|
destructive:
|
||||||
"focus:ring-offset-1 bg-destructive shadow-sm text-destructive-foreground active:bg-destructive border-destructive hover:bg-destructive/90",
|
"focus-visible:ring-offset-1 bg-destructive shadow-sm text-destructive-foreground active:bg-destructive border-destructive hover:bg-destructive/90",
|
||||||
default: "focus:ring-offset-1 hover:bg-gray-50 bg-white",
|
default: "focus-visible:ring-offset-1 hover:bg-gray-50 bg-white",
|
||||||
secondary:
|
secondary:
|
||||||
"focus:ring-offset-1 border-secondary bg-secondary hover:bg-secondary/80 text-secondary-foreground",
|
"focus-visible:ring-offset-1 border-secondary bg-secondary hover:bg-secondary/80 text-secondary-foreground",
|
||||||
ghost:
|
ghost:
|
||||||
"border-transparent bg-transparent data-[state=open]:bg-gray-500/20 text-gray-800 hover:bg-gray-500/10 active:bg-gray-500/20",
|
"border-transparent bg-transparent data-[state=open]:bg-gray-500/20 text-gray-800 hover:bg-gray-500/10 active:bg-gray-500/20",
|
||||||
actionBar:
|
actionBar:
|
||||||
|
|
Loading…
Add table
Reference in a new issue