@getmicdrop/svelte-components 5.1.1 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,12 +27,15 @@
|
|
|
27
27
|
export let successText = "";
|
|
28
28
|
export let active = false;
|
|
29
29
|
export let href = null;
|
|
30
|
-
/** @type {string} Text content (alternative to slot, for Storybook) */
|
|
30
|
+
/** @type {string | Function} Text content or Svelte 5 snippet (alternative to slot, for Storybook) */
|
|
31
31
|
export let children = "";
|
|
32
32
|
/** @type {string} Additional CSS classes */
|
|
33
33
|
let className = "";
|
|
34
34
|
export { className as class };
|
|
35
35
|
|
|
36
|
+
// Check if children is a Svelte 5 snippet (function) or a string
|
|
37
|
+
$: isSnippet = typeof children === 'function';
|
|
38
|
+
|
|
36
39
|
// Legacy variant name mapping
|
|
37
40
|
const variantMap = {
|
|
38
41
|
"blue-solid": "default",
|
|
@@ -130,7 +133,7 @@
|
|
|
130
133
|
{...$$restProps}
|
|
131
134
|
>
|
|
132
135
|
<span class="inline-flex items-center gap-1.5" class:invisible={loading || success}>
|
|
133
|
-
{#if children}{children}{:else}<slot />{/if}
|
|
136
|
+
{#if isSnippet}{@render children()}{:else if children}{children}{:else}<slot />{/if}
|
|
134
137
|
</span>
|
|
135
138
|
{#if loading}
|
|
136
139
|
<span class="absolute inset-0 flex items-center justify-center">
|
|
@@ -146,7 +149,7 @@
|
|
|
146
149
|
{...$$restProps}
|
|
147
150
|
>
|
|
148
151
|
<span class="inline-flex items-center gap-1.5" class:invisible={loading || success}>
|
|
149
|
-
{#if children}{children}{:else}<slot />{/if}
|
|
152
|
+
{#if isSnippet}{@render children()}{:else if children}{children}{:else}<slot />{/if}
|
|
150
153
|
</span>
|
|
151
154
|
{#if loading}
|
|
152
155
|
<span class="absolute inset-0 flex items-center justify-center">
|
|
@@ -10,7 +10,7 @@ type Button = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
|
10
10
|
successText?: string | undefined;
|
|
11
11
|
active?: boolean | undefined;
|
|
12
12
|
href?: null | undefined;
|
|
13
|
-
children?: string | undefined;
|
|
13
|
+
children?: string | Function | undefined;
|
|
14
14
|
}, {
|
|
15
15
|
default: {};
|
|
16
16
|
}>, {
|
|
@@ -33,7 +33,7 @@ declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWit
|
|
|
33
33
|
successText?: string | undefined;
|
|
34
34
|
active?: boolean | undefined;
|
|
35
35
|
href?: null | undefined;
|
|
36
|
-
children?: string | undefined;
|
|
36
|
+
children?: string | Function | undefined;
|
|
37
37
|
}, {
|
|
38
38
|
default: {};
|
|
39
39
|
}>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqLA;;;;;;;;;;;;;;;;;;;;eAAqO;sCAT/L,KAAK,EAAE,KAAK;;;;;6CALL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,OAAO,OAAO,QAAQ;IAC3L,cAAc,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,WAAW,OAAO,SAAS,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
|