Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,12 @@ export function DocumentTagsModal({
<div className='flex shrink-0 items-center gap-1'>
<Button
aria-label='Remove tag'
variant='ghost'
variant='ghost-destructive-muted'
onClick={(e) => {
e.stopPropagation()
handleRemoveTag(index)
}}
className='size-4 p-0 text-[var(--text-muted)] hover-hover:text-[var(--text-error)]'
className='size-4 p-0'
>
<Trash className='size-3' />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ export function BaseTagsModal({ open, onOpenChange, knowledgeBaseId }: BaseTagsM
<div className='flex shrink-0 items-center gap-1'>
<Button
aria-label='Delete Tag'
variant='ghost'
variant='ghost-destructive-muted'
onClick={(e) => {
e.stopPropagation()
handleDeleteTagClick(tag)
}}
className='size-4 p-0 text-[var(--text-muted)] hover-hover:text-[var(--text-error)]'
className='size-4 p-0'
>
<Trash className='size-3' />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1023,12 +1023,12 @@ export function ConditionInput({
<Tooltip.Root>
<Tooltip.Trigger asChild>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={() => removeBlock(block.id)}
disabled={
isPreview || disabled || conditionalBlocks.length <= (isRouterMode ? 1 : 2)
}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Block</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ export function DocumentTagEntry({
<span className='sr-only'>Add Tag</span>
</Button>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={() => removeTag(tag.id)}
disabled={isReadOnly}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Tag</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ export function EvalInput({
<Tooltip.Root key={`remove-${metric.id}`}>
<Tooltip.Trigger asChild>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={() => removeMetric(metric.id)}
disabled={isPreview || disabled || metrics.length === 1}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Metric</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ export function FilterRuleRow({
<span className='sr-only'>Add Condition</span>
</Button>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={() => onRemove(rule.id)}
disabled={isReadOnly}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Condition</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,13 @@ export function KnowledgeTagFilters({
<span className='sr-only'>Add Filter</span>
</Button>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={(e) => {
e.stopPropagation()
removeFilter(filter.id)
}}
disabled={isReadOnly}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Filter</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ export function SortRuleRow({
<span className='sr-only'>Add Sort</span>
</Button>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={() => onRemove(rule.id)}
disabled={isReadOnly}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Sort</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ export function FieldFormat({
<span className='sr-only'>Add {title}</span>
</Button>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={() => removeField(field.id)}
disabled={isReadOnly}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)] hover-hover:opacity-90'
className='h-auto p-0 hover-hover:opacity-90'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Field</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,13 @@ export function VariablesInput({
<span className='sr-only'>Add Variable</span>
</Button>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={(e) => {
e.stopPropagation()
removeAssignment(assignment.id)
}}
disabled={isReadOnly}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
>
<Trash className='size-[14px]' />
<span className='sr-only'>Delete Variable</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ function VariableHeader({
)}
</div>
<Button
variant='ghost'
variant='ghost-destructive'
onClick={(e) => {
e.stopPropagation()
onRemove()
}}
className='h-auto p-0 text-[var(--text-error)] hover-hover:text-[var(--text-error)]'
className='h-auto p-0'
disabled={readOnly}
aria-label={`Delete ${variable.name || `variable ${index + 1}`}`}
>
Expand Down
10 changes: 10 additions & 0 deletions packages/emcn/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ const buttonVariants = cva(
destructive:
'bg-[var(--text-error)] text-white hover-hover:text-white hover-hover:brightness-106',
ghost: 'text-[var(--text-secondary)] hover-hover:text-[var(--text-primary)]',
/**
* Destructive action without a filled surface; stays red on hover.
* @example <Button variant='ghost-destructive'>Delete</Button>
*/
'ghost-destructive': 'text-[var(--text-error)] hover-hover:text-[var(--text-error)]',
/**
* Muted destructive action that turns red on hover.
* @example <Button variant='ghost-destructive-muted'>Remove</Button>
*/
'ghost-destructive-muted': 'text-[var(--text-muted)] hover-hover:text-[var(--text-error)]',
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)]',
Expand Down
Loading