2026-06-24 20:56:53 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {Snippet} from "svelte"
|
2026-07-27 22:38:23 +00:00
|
|
|
import type {HTMLAttributes} from "svelte/elements"
|
2026-06-24 20:56:53 +00:00
|
|
|
import cx from "classnames"
|
|
|
|
|
|
2026-07-27 22:38:23 +00:00
|
|
|
type Props = HTMLAttributes<HTMLElement> & {
|
|
|
|
|
children?: Snippet
|
|
|
|
|
tag?: string
|
|
|
|
|
sm?: boolean
|
|
|
|
|
flat?: boolean
|
|
|
|
|
interactive?: boolean
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
const {
|
|
|
|
|
children,
|
|
|
|
|
tag = "div",
|
|
|
|
|
sm = false,
|
|
|
|
|
flat = false,
|
|
|
|
|
interactive = false,
|
|
|
|
|
...restProps
|
2026-07-27 22:38:23 +00:00
|
|
|
}: Props = $props()
|
2026-06-24 20:56:53 +00:00
|
|
|
|
|
|
|
|
const className = $derived(
|
|
|
|
|
cx(
|
|
|
|
|
"card",
|
|
|
|
|
{
|
|
|
|
|
"card-sm": sm,
|
|
|
|
|
"card-flat": flat,
|
|
|
|
|
"card-interactive": interactive,
|
|
|
|
|
},
|
|
|
|
|
restProps.class,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<svelte:element this={tag} {...restProps} class={className}>
|
|
|
|
|
{@render children?.()}
|
|
|
|
|
</svelte:element>
|