ui-ingredients 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/accordion/item-content.svelte +3 -2
- package/dist/color-picker/content.svelte +3 -1
- package/dist/combobox/content.svelte +4 -2
- package/dist/date-picker/content.svelte +4 -2
- package/dist/dialog/backdrop.svelte +4 -2
- package/dist/dialog/content.svelte +4 -2
- package/dist/hover-card/content.svelte +4 -2
- package/dist/menu/content.svelte +4 -2
- package/dist/popover/content.svelte +4 -2
- package/dist/select/content.svelte +4 -2
- package/dist/tooltip/content.svelte +4 -2
- package/dist/types.d.ts +8 -3
- package/package.json +1 -1
@@ -1,8 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
5
|
export interface AccordionItemContentProps
|
5
|
-
extends HtmlIngredientProps<'div'> {}
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
6
7
|
</script>
|
7
8
|
|
8
9
|
<script lang="ts">
|
@@ -34,7 +35,7 @@
|
|
34
35
|
</script>
|
35
36
|
|
36
37
|
{#if asChild}
|
37
|
-
{@render asChild(mergedProps)}
|
38
|
+
{@render asChild(presence.ref, mergedProps)}
|
38
39
|
{:else}
|
39
40
|
<div use:presence.ref {...mergedProps}>
|
40
41
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface ColorPickerContentProps
|
5
|
+
export interface ColorPickerContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface ComboboxContentProps
|
5
|
+
export interface ComboboxContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface DatePickerContentProps
|
5
|
+
export interface DatePickerContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -24,7 +26,7 @@
|
|
24
26
|
</script>
|
25
27
|
|
26
28
|
{#if asChild}
|
27
|
-
{@render asChild(mergedProps)}
|
29
|
+
{@render asChild(presence.ref, mergedProps)}
|
28
30
|
{:else}
|
29
31
|
<div use:presence.ref {...mergedProps}>
|
30
32
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface DialogBackdropProps
|
5
|
+
export interface DialogBackdropProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -24,7 +26,7 @@
|
|
24
26
|
</script>
|
25
27
|
|
26
28
|
{#if asChild}
|
27
|
-
{@render asChild(mergedProps)}
|
29
|
+
{@render asChild(presence.ref, mergedProps)}
|
28
30
|
{:else}
|
29
31
|
<div use:presence.ref {...mergedProps}>
|
30
32
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface DialogContentProps
|
5
|
+
export interface DialogContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface HoverCardContentProps
|
5
|
+
export interface HoverCardContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
package/dist/menu/content.svelte
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface MenuContentProps
|
5
|
+
export interface MenuContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface PopoverContentProps
|
5
|
+
export interface PopoverContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface SelectContentProps
|
5
|
+
export interface SelectContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
3
4
|
|
4
|
-
export interface TooltipContentProps
|
5
|
+
export interface TooltipContentProps
|
6
|
+
extends HtmlIngredientProps<'div', never, Action> {}
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<script lang="ts">
|
@@ -20,7 +22,7 @@
|
|
20
22
|
</script>
|
21
23
|
|
22
24
|
{#if asChild}
|
23
|
-
{@render asChild(mergedProps)}
|
25
|
+
{@render asChild(presence.ref, mergedProps)}
|
24
26
|
{:else}
|
25
27
|
<div use:presence.ref {...mergedProps}>
|
26
28
|
{@render children?.()}
|
package/dist/types.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { Snippet } from 'svelte';
|
2
|
+
import type { Action } from 'svelte/action';
|
2
3
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
3
4
|
import type { TransitionConfig } from 'svelte/transition';
|
4
5
|
export type GenericObject = Record<string, any>;
|
@@ -13,10 +14,14 @@ export interface TransitionProps {
|
|
13
14
|
out?: TransitionFunction;
|
14
15
|
transition?: TransitionFunction;
|
15
16
|
}
|
16
|
-
export type
|
17
|
+
export type AsChildWithRef<Ref extends Action, Context = never> = [
|
18
|
+
Context
|
19
|
+
] extends [never] ? Snippet<[ref: Ref, attrs: GenericObject]> : Snippet<[ref: Ref, attrs: GenericObject, context: Context]>;
|
20
|
+
export type AsChildWithoutRef<Context = never> = [Context] extends [never] ? Snippet<[attrs: GenericObject]> : Snippet<[attrs: GenericObject, context: Context]>;
|
21
|
+
export type AsChild<Ref extends Action, Context = never> = [Ref] extends [never] ? AsChildWithoutRef<Context> : AsChildWithRef<Ref, Context>;
|
17
22
|
export type Children<T = never> = [T] extends [never] ? Snippet : Snippet<[context: T]>;
|
18
23
|
export type PropsWithoutChildren<T> = Omit<T, 'children'>;
|
19
|
-
export type HtmlIngredientProps<
|
20
|
-
asChild?: AsChild<Context>;
|
24
|
+
export type HtmlIngredientProps<Element extends IntrinsicElements, Context = never, Ref extends Action = never> = TransitionProps & PropsWithoutChildren<HtmlProps<Element>> & {
|
21
25
|
children?: Children<Context>;
|
26
|
+
asChild?: AsChild<Ref, Context>;
|
22
27
|
};
|