33import { type ReactNode , useCallback , useEffect , useMemo , useRef , useState } from 'react'
44import {
55 Badge ,
6- Button ,
6+ Chip ,
77 ChipConfirmModal ,
88 type ChipConfirmTextSegment ,
99 ChipDatePicker ,
@@ -16,7 +16,6 @@ import {
1616 cellIconNodeClass ,
1717 chipContentGap ,
1818 chipContentLabelClass ,
19- chipVariants ,
2019 cn ,
2120 FloatingTooltip ,
2221 isTextClipped ,
@@ -1067,20 +1066,18 @@ export function KnowledgeBase({
10671066 ( ) => (
10681067 < AutoWidthPanel >
10691068 < div className = 'flex flex-col gap-2' >
1070- < div className = 'flex h-5 items-center justify-between' >
1069+ < div className = 'flex items-center justify-between' >
10711070 < span className = { FILTER_SECTION_LABEL_CLASS } > Status</ span >
10721071 { enabledFilter !== 'all' && (
1073- < Button
1074- variant = 'ghost'
1072+ < Chip
10751073 onClick = { ( ) => {
10761074 setEnabledFilter ( 'all' )
10771075 setSelectedDocuments ( new Set ( ) )
10781076 setIsSelectAllMode ( false )
10791077 } }
1080- className = '-mr-1 h-auto px-1 py-0.5 text-[var(--text-muted)] text-caption hover-hover:text-[var(--text-secondary)]'
10811078 >
10821079 Clear
1083- </ Button >
1080+ </ Chip >
10841081 ) }
10851082 </ div >
10861083 < ChipDropdown
@@ -1119,35 +1116,34 @@ export function KnowledgeBase({
11191116 const ConnectorIcon = def ?. icon
11201117 const syncInFlight = isConnectorSyncingOrPending ( connector )
11211118 return (
1122- < button
1119+ < Chip
11231120 key = { connector . id }
1124- type = 'button'
11251121 onClick = { ( ) => setShowConnectorsModal ( true ) }
1126- className = { cn ( chipVariants ( { variant : 'filled' } ) , 'max-w-[180px]' ) }
1122+ className = 'max-w-[180px]'
1123+ leftAdornment = {
1124+ < span className = 'relative flex size-[14px] shrink-0 items-center justify-center' >
1125+ { syncInFlight ? (
1126+ < Loader className = 'size-[14px]' animate />
1127+ ) : (
1128+ ConnectorIcon && < BrandIcon icon = { ConnectorIcon } className = 'size-[14px]' />
1129+ ) }
1130+ { connector . status !== 'active' && ! syncInFlight && (
1131+ < span
1132+ className = { cn (
1133+ '-right-0.5 -top-0.5 absolute size-1.5 rounded-xs border border-[var(--surface-2)]' ,
1134+ connector . status === 'error'
1135+ ? 'bg-[var(--text-error)]'
1136+ : connector . status === 'disabled'
1137+ ? 'bg-[var(--caution)]'
1138+ : 'bg-[var(--text-muted)]'
1139+ ) }
1140+ />
1141+ ) }
1142+ </ span >
1143+ }
11271144 >
1128- < span className = 'relative flex size-[14px] shrink-0 items-center justify-center' >
1129- { syncInFlight ? (
1130- < Loader className = 'size-[14px]' animate />
1131- ) : (
1132- ConnectorIcon && < BrandIcon icon = { ConnectorIcon } className = 'size-[14px]' />
1133- ) }
1134- { connector . status !== 'active' && ! syncInFlight && (
1135- < span
1136- className = { cn (
1137- '-right-0.5 -top-0.5 absolute size-1.5 rounded-xs border border-[var(--surface-2)]' ,
1138- connector . status === 'error'
1139- ? 'bg-[var(--text-error)]'
1140- : connector . status === 'disabled'
1141- ? 'bg-[var(--caution)]'
1142- : 'bg-[var(--text-muted)]'
1143- ) }
1144- />
1145- ) }
1146- </ span >
1147- < span className = 'truncate text-[var(--text-body)]' >
1148- { def ?. name || connector . connectorType }
1149- </ span >
1150- </ button >
1145+ { def ?. name || connector . connectorType }
1146+ </ Chip >
11511147 )
11521148 } ) }
11531149 </ >
@@ -1770,17 +1766,9 @@ function TagFilterSection({ tagDefinitions, entries, onChange }: TagFilterSectio
17701766
17711767 return (
17721768 < div className = 'mt-3 border-[var(--border-1)] border-t pt-3' >
1773- < div className = 'flex h-5 items-center justify-between' >
1769+ < div className = 'flex items-center justify-between' >
17741770 < span className = { FILTER_SECTION_LABEL_CLASS } > Filter by tags</ span >
1775- { activeCount > 0 && (
1776- < Button
1777- variant = 'ghost'
1778- className = '-mr-1 h-auto px-1 py-0.5 text-[var(--text-muted)] text-caption hover-hover:text-[var(--text-secondary)]'
1779- onClick = { ( ) => onChange ( [ ] ) }
1780- >
1781- Clear all
1782- </ Button >
1783- ) }
1771+ { activeCount > 0 && < Chip onClick = { ( ) => onChange ( [ ] ) } > Clear all</ Chip > }
17841772 </ div >
17851773
17861774 < div
@@ -1827,14 +1815,11 @@ function TagFilterSection({ tagDefinitions, entries, onChange }: TagFilterSectio
18271815 />
18281816 ) }
18291817 </ div >
1830- < Button
1831- variant = 'ghost'
1832- className = 'relative size-[30px] shrink-0 p-0 text-[var(--text-muted)] before:absolute before:inset-[-5px] before:content-[""] hover-hover:bg-[var(--surface-active)] hover-hover:text-[var(--text-error)]'
1818+ < Chip
18331819 onClick = { ( ) => removeFilter ( entry . id ) }
18341820 aria-label = 'Remove tag filter'
1835- >
1836- < X className = 'size-[14px]' />
1837- </ Button >
1821+ leftIcon = { X }
1822+ />
18381823 </ div >
18391824 { entry . tagSlot && (
18401825 < TagFilterValueControl
@@ -1847,14 +1832,11 @@ function TagFilterSection({ tagDefinitions, entries, onChange }: TagFilterSectio
18471832 } ) }
18481833 </ div >
18491834
1850- < Button
1851- variant = 'ghost'
1852- onClick = { addFilter }
1853- className = 'mt-2 h-[30px] w-full justify-start gap-2 px-2 text-[var(--text-secondary)] text-caption hover-hover:text-[var(--text-primary)]'
1854- >
1855- < Plus className = 'size-[14px]' />
1856- Add filter
1857- </ Button >
1835+ < div className = 'mt-2' >
1836+ < Chip fullWidth leftIcon = { Plus } onClick = { addFilter } >
1837+ Add filter
1838+ </ Chip >
1839+ </ div >
18581840 </ div >
18591841 )
18601842}
0 commit comments