mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: group apps together on workspace page (#18018)
This commit is contained in:
@@ -8,33 +8,45 @@ import { forwardRef } from "react";
|
||||
import { cn } from "utils/cn";
|
||||
|
||||
const buttonVariants = cva(
|
||||
`inline-flex items-center justify-center gap-1 whitespace-nowrap font-sans
|
||||
`
|
||||
inline-flex items-center justify-center gap-1 whitespace-nowrap font-sans
|
||||
border-solid rounded-md transition-colors
|
||||
text-sm font-semibold font-medium cursor-pointer no-underline
|
||||
text-sm font-medium cursor-pointer no-underline
|
||||
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-content-link
|
||||
disabled:pointer-events-none disabled:text-content-disabled
|
||||
[&:is(a):not([href])]:pointer-events-none [&:is(a):not([href])]:text-content-disabled
|
||||
[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:p-0.5
|
||||
[&>img]:pointer-events-none [&>img]:shrink-0 [&>img]:p-0.5`,
|
||||
[&_img]:pointer-events-none [&_img]:shrink-0 [&_img]:p-0.5
|
||||
`,
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default:
|
||||
"bg-surface-invert-primary text-content-invert hover:bg-surface-invert-secondary border-none disabled:bg-surface-secondary font-semibold",
|
||||
outline:
|
||||
"border border-border-default text-content-primary bg-transparent hover:bg-surface-secondary",
|
||||
subtle:
|
||||
"border-none bg-transparent text-content-secondary hover:text-content-primary",
|
||||
destructive:
|
||||
"border border-border-destructive text-content-primary bg-surface-destructive hover:bg-transparent disabled:bg-transparent disabled:text-content-disabled font-semibold",
|
||||
default: `
|
||||
border-none bg-surface-invert-primary font-semibold text-content-invert
|
||||
hover:bg-surface-invert-secondary
|
||||
disabled:bg-surface-secondary
|
||||
`,
|
||||
outline: `
|
||||
border border-border-default bg-transparent text-content-primary
|
||||
hover:bg-surface-secondary
|
||||
`,
|
||||
subtle: `
|
||||
border-none bg-transparent text-content-secondary
|
||||
hover:text-content-primary
|
||||
`,
|
||||
destructive: `
|
||||
border border-border-destructive font-semibold text-content-primary bg-surface-destructive
|
||||
hover:bg-transparent
|
||||
disabled:bg-transparent disabled:text-content-disabled
|
||||
`,
|
||||
},
|
||||
|
||||
size: {
|
||||
lg: "min-w-20 h-10 px-3 py-2 [&_svg]:size-icon-lg [&>img]:size-icon-lg",
|
||||
sm: "min-w-20 h-8 px-2 py-1.5 text-xs [&_svg]:size-icon-sm [&>img]:size-icon-sm",
|
||||
lg: "min-w-20 h-10 px-3 py-2 [&_svg]:size-icon-lg [&_img]:size-icon-lg",
|
||||
sm: "min-w-20 h-8 px-2 py-1.5 text-xs [&_svg]:size-icon-sm [&_img]:size-icon-sm",
|
||||
xs: "min-w-8 py-1 px-2 text-2xs rounded-md",
|
||||
icon: "size-8 px-1.5 [&_svg]:size-icon-sm [&>img]:size-icon-sm",
|
||||
"icon-lg": "size-10 px-2 [&_svg]:size-icon-lg [&>img]:size-icon-lg",
|
||||
icon: "size-8 px-1.5 [&_svg]:size-icon-sm [&_img]:size-icon-sm",
|
||||
"icon-lg": "size-10 px-2 [&_svg]:size-icon-lg [&_img]:size-icon-lg",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
|
||||
@@ -109,9 +109,15 @@ export const DropdownMenuItem = forwardRef<
|
||||
ref={ref}
|
||||
className={cn(
|
||||
[
|
||||
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-2 text-sm text-content-secondary font-medium outline-none transition-colors",
|
||||
"focus:bg-surface-secondary focus:text-content-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
||||
"[&>svg]:size-4 [&>svg]:shrink-0 [&>img]:size-4 [&>img]:shrink-0 no-underline",
|
||||
`
|
||||
relative flex cursor-default select-none items-center gap-2 rounded-sm
|
||||
px-2 py-1.5 text-sm text-content-secondary font-medium outline-none
|
||||
no-underline
|
||||
focus:bg-surface-secondary focus:text-content-primary
|
||||
data-[disabled]:pointer-events-none data-[disabled]:opacity-50
|
||||
[&_svg]:size-icon-sm [&>svg]:shrink-0
|
||||
[&_img]:size-icon-sm [&>img]:shrink-0
|
||||
`,
|
||||
inset && "pl-8",
|
||||
],
|
||||
className,
|
||||
|
||||
Reference in New Issue
Block a user