Skip to content

Commit 9a77a4e

Browse files
BillLeoutsakosvl346Bill Leoutsakos
andauthored
improvement(ui): use chips for ordinary product actions (#8081)
* improvement(ui): use chips for ordinary product actions * improvement(ui): use shared chip alignment * improvement(ui): use shared search action sizes (#8160) Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local> --------- Co-authored-by: Bill Leoutsakos <billleoutsakos@Bills-MacBook-Pro.local>
1 parent d6cf7c1 commit 9a77a4e

6 files changed

Lines changed: 39 additions & 48 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/files/files.tsx‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
44
import {
5-
Button,
5+
Chip,
66
ChipCombobox,
77
ChipConfirmModal,
88
Columns2,
@@ -2057,13 +2057,9 @@ function FilesContent() {
20572057
</div>
20582058
)}
20592059
{hasActiveFilters && (
2060-
<Button
2061-
variant='ghost'
2062-
onClick={clearFileFilters}
2063-
className='h-[32px] w-full text-caption hover-hover:bg-[var(--surface-active)]'
2064-
>
2060+
<Chip fullWidth onClick={clearFileFilters} align='center'>
20652061
Clear all filters
2066-
</Button>
2062+
</Chip>
20672063
)}
20682064
</div>
20692065
)

‎apps/sim/app/workspace/[workspaceId]/logs/logs.tsx‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import {
1515
Button,
1616
Calendar,
17+
Chip,
1718
ChipCombobox,
1819
type ComboboxOption,
1920
cn,
@@ -1584,13 +1585,9 @@ function LogsFilterPanel({ searchQuery, onSearchQueryChange }: LogsFilterPanelPr
15841585
</div>
15851586

15861587
{filtersActive && (
1587-
<Button
1588-
variant='active'
1589-
onClick={handleClearFilters}
1590-
className='h-[32px] w-full rounded-md'
1591-
>
1588+
<Chip variant='border-shadow' fullWidth onClick={handleClearFilters} align='center'>
15921589
Clear All Filters
1593-
</Button>
1590+
</Chip>
15941591
)}
15951592
</div>
15961593
)

‎apps/sim/app/workspace/[workspaceId]/settings/components/admin/admin.tsx‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,8 @@ export function Admin() {
443443
Page {currentPage} of {totalPages} ({usersData.total} users)
444444
</span>
445445
<div className='flex gap-1'>
446-
<Button
447-
variant='active'
448-
className='h-[28px] text-caption'
446+
<Chip
447+
variant='border-shadow'
449448
onClick={() =>
450449
setAdminParams((prev) => ({
451450
offset: Math.max(0, prev.offset - PAGE_SIZE),
@@ -454,17 +453,16 @@ export function Admin() {
454453
disabled={usersOffset === 0 || usersLoading}
455454
>
456455
Previous
457-
</Button>
458-
<Button
459-
variant='active'
460-
className='h-[28px] text-caption'
456+
</Chip>
457+
<Chip
458+
variant='border-shadow'
461459
onClick={() =>
462460
setAdminParams((prev) => ({ offset: prev.offset + PAGE_SIZE }))
463461
}
464462
disabled={usersOffset + PAGE_SIZE >= (usersData?.total ?? 0) || usersLoading}
465463
>
466464
Next
467-
</Button>
465+
</Chip>
468466
</div>
469467
</div>
470468
)}

‎apps/sim/app/workspace/[workspaceId]/settings/components/mothership/mothership.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { useCallback, useMemo, useState } from 'react'
44
import {
55
Badge,
6-
Button,
6+
Chip,
77
ChipCopyInput,
88
ChipInput,
99
ChipModalTabs,
@@ -434,14 +434,13 @@ function LicensesTab({ environment }: { environment: MothershipEnv }) {
434434
className='w-[160px]'
435435
/>
436436
</div>
437-
<Button
437+
<Chip
438438
variant='primary'
439-
className='h-[32px]'
440439
onClick={handleGenerate}
441440
disabled={generateLicense.isPending || !newName.trim()}
442441
>
443442
{generateLicense.isPending ? 'Generating...' : 'Generate'}
444-
</Button>
443+
</Chip>
445444
</div>
446445

447446
{generatedKey && (

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/search-replace/workflow-search-replace.tsx‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,7 @@ function WorkflowSearchReplacePanel({ focusRef }: WorkflowSearchReplacePanelProp
575575
onMouseDown={(event) => event.stopPropagation()}
576576
>
577577
<span className='text-[var(--text-muted)] text-xs'>{matchCountLabel}</span>
578-
<Button
579-
aria-label='Close search'
580-
variant='ghost'
581-
className='size-[26px] p-0'
582-
onClick={close}
583-
>
578+
<Button aria-label='Close search' variant='ghost' iconSize='regular' onClick={close}>
584579
<X className='size-[14px]' />
585580
</Button>
586581
</div>
@@ -589,7 +584,7 @@ function WorkflowSearchReplacePanel({ focusRef }: WorkflowSearchReplacePanelProp
589584
<div className='grid grid-cols-[2rem_minmax(0,1fr)_2rem_2rem] items-start gap-1.5'>
590585
<Button
591586
variant='ghost'
592-
className='size-8 p-0'
587+
iconSize='roomy'
593588
aria-label={isReplaceExpanded ? 'Hide replace controls' : 'Show replace controls'}
594589
onClick={() => setIsReplaceExpanded((expanded) => !expanded)}
595590
>
@@ -614,7 +609,7 @@ function WorkflowSearchReplacePanel({ focusRef }: WorkflowSearchReplacePanelProp
614609
<Button
615610
aria-label='Previous match'
616611
variant='ghost'
617-
className='size-8 p-0'
612+
iconSize='roomy'
618613
disabled={hydratedMatches.length === 0}
619614
onClick={() => handleMoveActiveMatch(-1)}
620615
>
@@ -623,7 +618,7 @@ function WorkflowSearchReplacePanel({ focusRef }: WorkflowSearchReplacePanelProp
623618
<Button
624619
aria-label='Next match'
625620
variant='ghost'
626-
className='size-8 p-0'
621+
iconSize='roomy'
627622
disabled={hydratedMatches.length === 0}
628623
onClick={() => handleMoveActiveMatch(1)}
629624
>

‎apps/sim/app/workspace/[workspaceId]/w/components/preview/preview.tsx‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
import type React from 'react'
44
import { useEffect, useMemo, useRef, useState } from 'react'
5-
import { Button, cn, OverflowText, Tooltip } from '@sim/emcn'
5+
import {
6+
Chip,
7+
chipBorderShadowRing,
8+
chipContentLabelClass,
9+
chipGeometryClass,
10+
cn,
11+
OverflowText,
12+
Tooltip,
13+
} from '@sim/emcn'
614
import { ArrowLeft } from '@sim/emcn/icons'
715
import { redactApiKeys } from '@/lib/core/security/redaction'
816
import { PreviewEditor } from '@/app/workspace/[workspaceId]/w/components/preview/components/preview-editor'
@@ -295,23 +303,21 @@ export function Preview({
295303
<div className='absolute top-3 left-[12px] z-20 flex items-center gap-1.5'>
296304
<Tooltip.Root>
297305
<Tooltip.Trigger asChild>
298-
<Button
299-
variant='ghost'
300-
onClick={handleGoBack}
301-
className='flex h-[28px] gap-[5px] rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-2.5 shadow-xs hover-hover:bg-[var(--surface-4)]'
302-
>
303-
<ArrowLeft className='size-[12px]' />
304-
<span className='text-caption'>Back</span>
305-
</Button>
306+
<Chip variant='border-shadow' leftIcon={ArrowLeft} onClick={handleGoBack}>
307+
Back
308+
</Chip>
306309
</Tooltip.Trigger>
307310
<Tooltip.Content side='bottom'>Go back to parent workflow</Tooltip.Content>
308311
</Tooltip.Root>
309312
{currentWorkflowName && (
310-
<div className='flex h-[28px] max-w-[200px] items-center rounded-md border border-[var(--border)] bg-[var(--surface-2)] px-2.5 shadow-xs'>
311-
<OverflowText
312-
label={currentWorkflowName}
313-
className='text-[var(--text-secondary)] text-caption'
314-
/>
313+
<div
314+
className={cn(
315+
chipGeometryClass,
316+
chipBorderShadowRing,
317+
'inline-flex max-w-[200px] bg-[var(--surface-2)]'
318+
)}
319+
>
320+
<OverflowText label={currentWorkflowName} className={chipContentLabelClass} />
315321
</div>
316322
)}
317323
</div>

0 commit comments

Comments
 (0)