Files
sim/apps/docs/components/ui/search-trigger.tsx
T
Waleed bcf6a804f9 improvement(emcn): extract design system into shared @sim/emcn package (#5257)
Moves apps/sim/components/emcn into a shared @sim/emcn package consumed directly by apps/sim and apps/docs. cn/keyboard/use-copy-to-clipboard move into the package; all imports become direct @sim/emcn (icons via @sim/emcn/icons, CSS via file path). ChipModal email validation is now prop-driven (quickValidateEmail stays in apps/sim, injected via validate). Docs drops its local chip/chip-dropdown/dropdown-menu mirrors and consumes @sim/emcn.
2026-06-28 22:50:48 -07:00

43 lines
1.0 KiB
TypeScript

'use client'
import {
chipContentIconClass,
chipFilledFillTokens,
chipGeometryClass,
TRIGGER_BORDER_CLASS,
} from '@sim/emcn'
import { Search } from 'lucide-react'
import { cn } from '@/lib/utils'
export function SearchTrigger() {
const openSearchDialog = () => {
const event = new KeyboardEvent('keydown', {
key: 'k',
metaKey: true,
bubbles: true,
})
document.dispatchEvent(event)
}
return (
<button
type='button'
data-search-trigger
className={cn(
chipGeometryClass,
chipFilledFillTokens,
TRIGGER_BORDER_CLASS,
'flex w-[360px] cursor-pointer font-season text-[var(--text-muted)] transition-colors hover:bg-[var(--surface-active)]'
)}
onClick={openSearchDialog}
>
<Search className={chipContentIconClass} />
<span>Search&hellip;</span>
<kbd className='ml-auto flex items-center'>
<span className='text-[15px]'>⌘</span>
<span className='text-[12px]'>K</span>
</kbd>
</button>
)
}