diff --git a/package.json b/package.json index fc7a8a1..a5b4111 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@svelte-atoms/core", - "version": "1.0.0-alpha.18", + "version": "1.0.0-alpha.19", "description": "A modular, accessible, and extensible Svelte UI component library.", "repository": { "type": "git", diff --git a/src/lib/components/alert/alert-root.svelte b/src/lib/components/alert/alert-root.svelte index 88add26..140e402 100644 --- a/src/lib/components/alert/alert-root.svelte +++ b/src/lib/components/alert/alert-root.svelte @@ -17,7 +17,7 @@ ; -const CONTEXT_KEY = '@svelte-atoms/context/preset'; +export type PresetEntry = ( + this: Bond | undefined | null, + bond: Bond | undefined | null, + ...args: any[] +) => PresetEntryRecord; + +export type Preset = Record; export function getPreset(key: K): PresetEntry | undefined; export function getPreset(): Partial | undefined; diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index eee03b7..e2b05a2 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -4,10 +4,11 @@ import type { ClassValue as SvelteClassValue } from 'svelte/elements'; import clsx from 'clsx'; import { twMerge } from 'tailwind-merge'; -export type ClassValueFunction = (this: T, ...args: unknown[]) => SvelteClassValue; +export type ClassValueFunction = (bond: T, ...args: unknown[]) => SvelteClassValue; export type ClassValue = SvelteClassValue | ClassValueFunction | undefined; -export function cn(...inputs: SvelteClassValue[]) { +export type Cn = SvelteClassValue | undefined | false; +export function cn(...inputs: Cn[]) { return twMerge(clsx(...inputs)); } diff --git a/src/stories/Theme.svelte b/src/stories/Theme.svelte index 537ce8d..40b01f0 100644 --- a/src/stories/Theme.svelte +++ b/src/stories/Theme.svelte @@ -1,5 +1,5 @@