mirror of
https://github.com/hanzoai/svelte.git
synced 2026-10-01 00:41:47 +00:00
Extracted from @hanzo/ui pkg/ui/src/backends/svelte with its history. It lived inside a React component library, which meant every consumer of @hanzo/ui resolved svelte whether they rendered a single Svelte component or not, and the package declared peer svelte>=5 against a dev svelte ^4.2.20 — two answers to one question. Three runtime dependencies, all load-bearing: class-variance-authority for the variants the components already used, and clsx + tailwind-merge behind cn. The cn helper is vendored (17 lines) rather than imported back from @hanzo/ui, because depending on the package this was extracted from would undo the split. No design-system runtime, no icon pack, no CSS-in-JS. svelte-check: 50 files, 0 errors. Co-authored-by: Hanzo Dev <[email protected]>
23 lines
773 B
Svelte
23 lines
773 B
Svelte
<!-- Separator — standard-token rule; mirrors the shadcn backend. -->
|
|
<script lang="ts">
|
|
import { cn } from './core/cn'
|
|
|
|
let className: string | undefined = undefined
|
|
export { className as class }
|
|
export let orientation: 'horizontal' | 'vertical' = 'horizontal'
|
|
/** A purely-decorative separator is hidden from assistive tech. */
|
|
export let decorative = true
|
|
</script>
|
|
|
|
<div
|
|
role={decorative ? 'none' : 'separator'}
|
|
aria-orientation={decorative ? undefined : orientation}
|
|
data-slot="separator"
|
|
data-orientation={orientation}
|
|
class={cn(
|
|
'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
|
|
className,
|
|
)}
|
|
{...$$restProps}
|
|
></div>
|