feat(react/ribbon): reintroduce button collection properties

This commit is contained in:
Elian Doran
2025-08-23 23:22:07 +03:00
parent ce1f5c6204
commit ea1397de63
4 changed files with 51 additions and 41 deletions

View File

@@ -19,9 +19,10 @@ export interface ButtonProps {
size?: "normal" | "small" | "micro";
style?: CSSProperties;
triggerCommand?: CommandNames;
title?: string;
}
const Button = memo(({ name, buttonRef: _buttonRef, className, text, onClick, keyboardShortcut, icon, primary, disabled, size, style, triggerCommand }: ButtonProps) => {
const Button = memo(({ name, buttonRef: _buttonRef, className, text, onClick, keyboardShortcut, icon, primary, disabled, size, style, triggerCommand, ...restProps }: ButtonProps) => {
// Memoize classes array to prevent recreation
const classes = useMemo(() => {
const classList: string[] = ["btn"];
@@ -65,6 +66,7 @@ const Button = memo(({ name, buttonRef: _buttonRef, className, text, onClick, ke
disabled={disabled}
style={style}
data-trigger-command={triggerCommand}
{...restProps}
>
{icon && <span className={`bx ${icon}`}></span>}
{text} {shortcutElements}