diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/canvas-control-button.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/canvas-control-button.tsx new file mode 100644 index 00000000000..9adcad9155a --- /dev/null +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-controls/canvas-control-button.tsx @@ -0,0 +1,21 @@ +import type { ComponentProps } from 'react' +import { forwardRef } from 'react' +import { Button } from '@sim/emcn' + +interface CanvasControlButtonProps + extends Omit< + ComponentProps, + 'variant' | 'size' | 'iconSize' | 'iconPadding' | 'shape' | 'className' + > { + active?: boolean + 'aria-label': string +} + +/** Square action in the canvas navigation toolbar. */ +export const CanvasControlButton = forwardRef( + ({ active = false, ...props }, ref) => ( + + - + Undo @@ -177,15 +165,9 @@ export const WorkflowControls = memo(function WorkflowControls() { - + Redo @@ -196,14 +178,9 @@ export const WorkflowControls = memo(function WorkflowControls() { - + Fit to View diff --git a/packages/emcn/src/components/button/button.tsx b/packages/emcn/src/components/button/button.tsx index cc93c956b25..0ecb0e2ea09 100644 --- a/packages/emcn/src/components/button/button.tsx +++ b/packages/emcn/src/components/button/button.tsx @@ -40,6 +40,8 @@ const buttonVariants = cva( tertiary: 'bg-[var(--brand-accent)] text-[var(--text-inverse)] hover-hover:text-[var(--text-inverse)] hover-hover:bg-[var(--brand-accent-hover)] dark:bg-[var(--brand-accent)] dark:hover-hover:bg-[var(--brand-accent-hover)] dark:text-[var(--text-inverse)] dark:hover-hover:text-[var(--text-inverse)]', ghost: 'text-[var(--text-secondary)] hover-hover:text-[var(--text-primary)]', + 'ghost-hover': + 'text-[var(--text-secondary)] hover-hover:text-[var(--text-primary)] hover-hover:bg-[var(--surface-hover)]', subtle: 'text-[var(--text-body)] hover-hover:text-[var(--text-body)] hover-hover:bg-[var(--surface-4)]', 'ghost-secondary': 'text-[var(--text-muted)] hover-hover:text-[var(--text-primary)]', @@ -75,6 +77,7 @@ const buttonVariants = cva( */ { size: 'icon', variant: 'quiet', className: 'text-[var(--text-icon-muted)]' }, { size: 'icon', variant: 'ghost', className: 'text-[var(--text-icon-muted)]' }, + { size: 'icon', variant: 'ghost-hover', className: 'text-[var(--text-icon-muted)]' }, ], defaultVariants: { variant: 'default',