@getmicdrop/svelte-components 5.1.1 → 5.1.3

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,13 @@
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
+
36
37
  // Legacy variant name mapping
37
38
  const variantMap = {
38
39
  "blue-solid": "default",
@@ -130,7 +131,7 @@
130
131
  {...$$restProps}
131
132
  >
132
133
  <span class="inline-flex items-center gap-1.5" class:invisible={loading || success}>
133
- {#if children}{children}{:else}<slot />{/if}
134
+ {#if typeof children === 'function'}{@render children()}{:else if children}{children}{/if}
134
135
  </span>
135
136
  {#if loading}
136
137
  <span class="absolute inset-0 flex items-center justify-center">
@@ -146,7 +147,7 @@
146
147
  {...$$restProps}
147
148
  >
148
149
  <span class="inline-flex items-center gap-1.5" class:invisible={loading || success}>
149
- {#if children}{children}{:else}<slot />{/if}
150
+ {#if typeof children === 'function'}{@render children()}{:else if children}{children}{/if}
150
151
  </span>
151
152
  {#if loading}
152
153
  <span class="absolute inset-0 flex items-center justify-center">
@@ -1,5 +1,5 @@
1
1
  export default Button;
2
- type Button = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
2
+ type Button = SvelteComponent<{
3
3
  [x: string]: any;
4
4
  class?: string | undefined;
5
5
  size?: string | undefined;
@@ -10,19 +10,15 @@ 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
- default: {};
16
- }>, {
17
15
  click: PointerEvent;
18
16
  } & {
19
17
  [evt: string]: CustomEvent<any>;
20
- }, {
21
- default: {};
22
- }> & {
18
+ }, {}> & {
23
19
  $$bindings?: string | undefined;
24
20
  };
25
- declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
21
+ declare const Button: $$__sveltets_2_IsomorphicComponent<{
26
22
  [x: string]: any;
27
23
  class?: string | undefined;
28
24
  size?: string | undefined;
@@ -33,21 +29,12 @@ declare const Button: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWit
33
29
  successText?: string | undefined;
34
30
  active?: boolean | undefined;
35
31
  href?: null | undefined;
36
- children?: string | undefined;
32
+ children?: string | Function | undefined;
37
33
  }, {
38
- default: {};
39
- }>, {
40
34
  click: PointerEvent;
41
35
  } & {
42
36
  [evt: string]: CustomEvent<any>;
43
- }, {
44
- default: {};
45
- }, {}, string>;
46
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
47
- default: any;
48
- } ? Props extends Record<string, never> ? any : {
49
- children?: any;
50
- } : {});
37
+ }, {}, {}, string>;
51
38
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
52
39
  new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
53
40
  $$bindings?: Bindings;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Button/Button.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkLA;;;;;;;;;;;;;;;;;;;;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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CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmicdrop/svelte-components",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "description": "Shared component library for Micdrop applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",