feat(lexical): support styling declarative actions
Accept className on action declarations and carry it through compiled actions, default toolbar controls, menu items, custom renderers, and custom controls. Keep preset action ordering consistent across toolbar and bubble placements, with coverage for default and custom rendering paths.
This commit is contained in:
@@ -4,13 +4,13 @@ import {
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@workspace/ui/components/tooltip"
|
||||
|
||||
import { useLexicalActionContext } from "./context"
|
||||
import { useLexicalMessage } from "./i18n"
|
||||
import type { LexicalControlProps } from "./types"
|
||||
|
||||
export function LexicalControl<Value = string>({
|
||||
action,
|
||||
className,
|
||||
label,
|
||||
presentation = "control",
|
||||
render,
|
||||
@@ -25,6 +25,7 @@ export function LexicalControl<Value = string>({
|
||||
const onClick = () => execute()
|
||||
const renderProps = {
|
||||
active,
|
||||
className,
|
||||
disabled,
|
||||
execute,
|
||||
label: resolvedLabel,
|
||||
@@ -54,6 +55,7 @@ export function LexicalControl<Value = string>({
|
||||
<Button
|
||||
type="button"
|
||||
size="icon-sm"
|
||||
className={className}
|
||||
variant={active ? "secondary" : "ghost"}
|
||||
disabled={disabled}
|
||||
aria-label={resolvedLabel}
|
||||
|
||||
Reference in New Issue
Block a user