~james/core

core/web/src/lib/components/ui/LayerCardPrimary.svelte -rw-r--r-- 958 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<script module lang="ts">
	import { tv, type VariantProps } from "tailwind-variants";

	export const layerCardPrimary = tv({
		base: "relative min-w-0 overflow-clip rounded-md bg-background-default edge-ring ring-border-default",
		variants: {
			padding: {
				regular: "p-md",
				small: "p-sm",
				none: ""
			}
		},
		defaultVariants: {
			padding: "regular"
		}
	});

	export type LayerCardPrimaryVariants = VariantProps<typeof layerCardPrimary>;
</script>

<script lang="ts">
	import type { Snippet } from "svelte";
	import type { HTMLAttributes } from "svelte/elements";

	interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "class" | "children"> {
		padding?: LayerCardPrimaryVariants["padding"];
		class?: string;
		children?: Snippet;
	}

	let { padding = "regular", class: className, children, ...rest }: Props = $props();
</script>

<div class={layerCardPrimary({ padding, class: className })} {...rest}>
	{@render children?.()}
</div>