Skip to content

Commit 319f8bb

Browse files
authored
improvement(ui): reuse inline and overlay workflow actions
2 parents 3e6c870 + 08b4f43 commit 319f8bb

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/general/components/versions.tsx‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,8 @@ export function Versions({
329329
<Tooltip.Trigger asChild>
330330
<Button
331331
aria-label={v.description ? 'Edit description' : 'Add description'}
332-
variant='ghost'
333-
iconPadding='sm'
334-
className={cn(
335-
!v.description &&
336-
'text-[var(--text-quaternary)] hover-hover:text-[var(--text-tertiary)]'
337-
)}
332+
variant={v.description ? 'ghost' : 'ghost-secondary'}
333+
size='inline'
338334
onClick={(e) => {
339335
e.stopPropagation()
340336
handleOpenDescriptionModal(v.version)
@@ -359,7 +355,7 @@ export function Versions({
359355
<Button
360356
aria-label='Version actions'
361357
variant='ghost'
362-
iconPadding='sm'
358+
size='inline'
363359
disabled={isPromotingVersion}
364360
onClick={(e) => e.stopPropagation()}
365361
>

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/sub-block.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ const renderLabel = (
302302
{!wandState.isSearchActive ? (
303303
<Button
304304
variant='active'
305-
className='-my-1 h-5 py-0 text-xs'
305+
size='inline'
306+
className='-my-1'
306307
onClick={wandState.onSearchClick}
307308
>
308309
Generate

‎apps/sim/components/workflow/workflow-preview-action.tsx‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
'use client'
22

33
import { type ComponentProps, forwardRef } from 'react'
4-
import { Button, Tooltip } from '@sim/emcn'
4+
import { OverlayActionButton, Tooltip } from '@sim/emcn'
55

66
interface WorkflowPreviewActionProps
77
extends Omit<
8-
ComponentProps<typeof Button>,
9-
'variant' | 'size' | 'iconSize' | 'iconPadding' | 'type' | 'className'
8+
ComponentProps<typeof OverlayActionButton>,
9+
'size' | 'type' | 'className' | 'shape'
1010
> {
1111
'aria-label': string
1212
}
1313

14-
/** Solid corner action shared by embedded workflow previews. */
14+
/** Overlay corner action shared by embedded workflow previews. */
1515
export const WorkflowPreviewAction = forwardRef<HTMLButtonElement, WorkflowPreviewActionProps>(
1616
({ 'aria-label': label, ...props }, ref) => (
1717
<Tooltip.Root>
1818
<Tooltip.Trigger asChild>
19-
<Button
19+
<OverlayActionButton
2020
{...props}
2121
ref={ref}
2222
type='button'
2323
aria-label={label}
24-
variant='ghost'
25-
iconSize='compact-fixed'
26-
className='absolute right-[6px] bottom-1.5 z-10 cursor-pointer border border-[var(--border)] bg-[var(--surface-2)] hover-hover:bg-[var(--surface-4)]'
24+
size='md'
25+
className='absolute right-[6px] bottom-1.5 z-10'
2726
/>
2827
</Tooltip.Trigger>
2928
<Tooltip.Content side='top'>{label}</Tooltip.Content>

0 commit comments

Comments
 (0)