Skip to content

Commit c5e48b6

Browse files
atrakhConvex, Inc.
authored and
Convex, Inc.
committed
dashboard: improve disabled button styles and add border for disabled items (#36811)
GitOrigin-RevId: 91b3cf80538641f8bf3c973257d109bbe6d8e3f0
1 parent 02375e7 commit c5e48b6

File tree

1 file changed

+29
-23
lines changed
  • npm-packages/@convex-dev/design-system/src

1 file changed

+29
-23
lines changed

npm-packages/@convex-dev/design-system/src/Button.tsx

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { forwardRef, useContext } from "react";
2-
import classNames from "classnames";
32
import { tv } from "tailwind-variants";
43
import { Tooltip, TooltipSide } from "@ui/Tooltip";
54
import { UrlObject } from "url";
@@ -132,10 +131,9 @@ const button = tv({
132131
base: "inline-flex animate-fadeInFromLoading select-none items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border focus-visible:border-border-selected focus-visible:outline-none",
133132
variants: {
134133
variant: {
135-
primary:
136-
"border-util-accent bg-util-accent text-white hover:bg-util-accent/80",
137-
neutral: "text-content-primary hover:bg-background-primary",
138-
danger: "text-content-error hover:bg-background-errorSecondary",
134+
primary: "border-white/30 bg-util-accent text-white",
135+
neutral: "text-content-primary",
136+
danger: "text-content-error",
139137
},
140138
icon: {
141139
true: "gap-1.5",
@@ -146,11 +144,7 @@ const button = tv({
146144
inline: "",
147145
},
148146
disabled: {
149-
true: classNames(
150-
"cursor-not-allowed",
151-
"bg-neutral-1 border-neutral-1 text-neutral-4 hover:bg-neutral-1",
152-
"dark:bg-neutral-11 dark:border-neutral-11 dark:text-neutral-6 dark:hover:bg-neutral-11",
153-
),
147+
true: "cursor-not-allowed opacity-50",
154148
false: "cursor-pointer",
155149
},
156150
focused: {
@@ -169,65 +163,77 @@ const button = tv({
169163
variant: "primary",
170164
accent: "inline",
171165
class: "bg-transparent text-content-accent hover:bg-background-tertiary",
172-
disabled: false,
173166
},
174167
{
175168
variant: "primary",
176169
focused: true,
177170
accent: "none",
178171
class: "bg-util-accent/80 text-white",
179-
disabled: false,
180172
},
181173
{
182174
variant: "primary",
183175
focused: true,
184176
accent: "inline",
185177
class: "bg-background-tertiary",
186-
disabled: false,
187178
},
188179
{
189180
variant: "neutral",
190181
accent: "none",
191182
class: "bg-background-tertiary",
192-
disabled: false,
193183
},
194184
{
195185
variant: "neutral",
196186
accent: "none",
197-
class: "border bg-background-secondary hover:bg-background-tertiary",
187+
class: "border bg-background-secondary",
188+
},
189+
{
190+
variant: "neutral",
191+
class: "hover:bg-background-tertiary",
198192
disabled: false,
199193
},
200194
{
201195
variant: "neutral",
202196
focused: true,
203197
accent: ["none", "inline"],
204198
class: "bg-background-primary",
205-
disabled: false,
206199
},
207200
{
208201
variant: "neutral",
209202
focused: true,
210203
accent: "none",
211204
class: "border border-border-selected bg-background-secondary",
212-
disabled: false,
213205
},
214206
{
215207
variant: "danger",
216208
accent: "none",
217-
class: "border-background-error bg-background-error",
218-
disabled: false,
209+
class:
210+
"border-background-error border-content-error/30 bg-background-error",
219211
},
220212
{
221213
variant: "danger",
222214
focused: true,
223215
class: "bg-background-errorSecondary text-content-error",
216+
},
217+
{
218+
variant: "primary",
224219
disabled: false,
220+
accent: "none",
221+
class: "hover:bg-util-accent/80",
225222
},
226223
{
227-
disabled: true,
228-
accent: "inline",
229-
class:
230-
"bg-transparent text-neutral-4 hover:bg-transparent dark:bg-transparent dark:text-neutral-6",
224+
variant: "danger",
225+
disabled: false,
226+
class: "hover:bg-background-errorSecondary",
227+
},
228+
{
229+
variant: "neutral",
230+
disabled: false,
231+
class: "hover:bg-background-primary",
232+
},
233+
{
234+
variant: "danger",
235+
disabled: false,
236+
class: "hover:bg-background-errorSecondary",
231237
},
232238
],
233239
defaultVariants: {

0 commit comments

Comments
 (0)