Use brand styling for save actions

This commit is contained in:
Brandon Oxendine
2026-04-14 09:08:30 +02:00
committed by Rūdolfs Ošiņš
parent c167f4f804
commit ee001e96fa
5 changed files with 14 additions and 1 deletions
+10 -1
View File
@@ -22,6 +22,8 @@
rid: string;
placeholder?: string;
submitCaption?: string;
submitVariant?: ComponentProps<typeof Button>["variant"];
submitActiveVariant?: ComponentProps<typeof Button>["variant"];
focus?: boolean;
inline?: boolean;
body?: string;
@@ -56,6 +58,8 @@
rid,
placeholder = "Leave your comment",
submitCaption = "Comment",
submitVariant = "ghost",
submitActiveVariant = undefined,
focus = false,
inline = false,
body = $bindable(""),
@@ -79,6 +83,11 @@
const attachDisabledReason = $derived(
typeof attachDisabled === "string" ? attachDisabled : undefined,
);
const effectiveSubmitVariant = $derived(
body.trim().length > 0 && submitActiveVariant !== undefined
? submitActiveVariant
: submitVariant,
);
let selectionStart = $state(body.length);
let selectionEnd = $state(body.length);
@@ -364,7 +373,7 @@
{preview ? "Edit" : "Preview"}
</Button>
<Button
variant="ghost"
variant={effectiveSubmitVariant}
title={emptyBodyTooltip}
disabled={!isValid() ||
submitInProgress ||