ui-ingredients 0.0.42 → 0.0.44
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -0
- package/dist/file-upload/create-file-upload.svelte.js +1 -0
- package/dist/file-upload/root.svelte +1 -0
- package/dist/floating-panel/body.svelte +24 -0
- package/dist/floating-panel/body.svelte.d.ts +18 -0
- package/dist/floating-panel/close-trigger.svelte +27 -0
- package/dist/floating-panel/close-trigger.svelte.d.ts +18 -0
- package/dist/floating-panel/content.svelte +36 -0
- package/dist/floating-panel/content.svelte.d.ts +18 -0
- package/dist/floating-panel/context.svelte.d.ts +2 -0
- package/dist/floating-panel/context.svelte.js +2 -0
- package/dist/floating-panel/create-floating-panel.svelte.d.ts +7 -0
- package/dist/floating-panel/create-floating-panel.svelte.js +19 -0
- package/dist/floating-panel/drag-trigger.svelte +27 -0
- package/dist/floating-panel/drag-trigger.svelte.d.ts +18 -0
- package/dist/floating-panel/floating-panel.d.ts +13 -0
- package/dist/floating-panel/floating-panel.js +13 -0
- package/dist/floating-panel/header.svelte +25 -0
- package/dist/floating-panel/header.svelte.d.ts +18 -0
- package/dist/floating-panel/index.d.ts +16 -0
- package/dist/floating-panel/index.js +3 -0
- package/dist/floating-panel/maximize-trigger.svelte +28 -0
- package/dist/floating-panel/maximize-trigger.svelte.d.ts +18 -0
- package/dist/floating-panel/minimize-trigger.svelte +28 -0
- package/dist/floating-panel/minimize-trigger.svelte.d.ts +18 -0
- package/dist/floating-panel/positioner.svelte +35 -0
- package/dist/floating-panel/positioner.svelte.d.ts +18 -0
- package/dist/floating-panel/resize-trigger.svelte +36 -0
- package/dist/floating-panel/resize-trigger.svelte.d.ts +18 -0
- package/dist/floating-panel/restore-trigger.svelte +28 -0
- package/dist/floating-panel/restore-trigger.svelte.d.ts +18 -0
- package/dist/floating-panel/root.svelte +50 -0
- package/dist/floating-panel/root.svelte.d.ts +18 -0
- package/dist/floating-panel/title.svelte +25 -0
- package/dist/floating-panel/title.svelte.d.ts +18 -0
- package/dist/floating-panel/trigger.svelte +27 -0
- package/dist/floating-panel/trigger.svelte.d.ts +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/is-object.d.ts +2 -0
- package/dist/is-object.js +4 -0
- package/dist/merge-props.js +1 -4
- package/dist/portal/root.svelte +32 -32
- package/dist/presence/root.svelte +5 -1
- package/dist/switch/control.svelte +24 -24
- package/dist/switch/hidden-input.svelte +23 -23
- package/dist/switch/label.svelte +24 -24
- package/dist/switch/root.svelte +54 -54
- package/dist/switch/thumb.svelte +24 -24
- package/dist/toast/actor.svelte +19 -19
- package/dist/toast/toaster.svelte +39 -39
- package/dist/tour/arrow-tip.svelte +24 -0
- package/dist/tour/arrow-tip.svelte.d.ts +18 -0
- package/dist/tour/arrow.svelte +24 -0
- package/dist/tour/arrow.svelte.d.ts +18 -0
- package/dist/tour/close-trigger.svelte +25 -0
- package/dist/tour/close-trigger.svelte.d.ts +18 -0
- package/dist/tour/content.svelte +30 -0
- package/dist/tour/content.svelte.d.ts +18 -0
- package/dist/tour/context.svelte.d.ts +2 -0
- package/dist/tour/context.svelte.js +3 -0
- package/dist/tour/create-tour.svelte.d.ts +7 -0
- package/dist/tour/create-tour.svelte.js +19 -0
- package/dist/tour/description.svelte +24 -0
- package/dist/tour/description.svelte.d.ts +18 -0
- package/dist/tour/index.d.ts +17 -0
- package/dist/tour/index.js +3 -0
- package/dist/tour/next-trigger.svelte +24 -0
- package/dist/tour/next-trigger.svelte.d.ts +18 -0
- package/dist/tour/overlay.svelte +43 -0
- package/dist/tour/overlay.svelte.d.ts +18 -0
- package/dist/tour/positioner.svelte +30 -0
- package/dist/tour/positioner.svelte.d.ts +18 -0
- package/dist/tour/prev-trigger.svelte +24 -0
- package/dist/tour/prev-trigger.svelte.d.ts +18 -0
- package/dist/tour/progress-text.svelte +28 -0
- package/dist/tour/progress-text.svelte.d.ts +18 -0
- package/dist/tour/root.svelte +52 -0
- package/dist/tour/root.svelte.d.ts +18 -0
- package/dist/tour/skip-trigger.svelte +24 -0
- package/dist/tour/skip-trigger.svelte.d.ts +18 -0
- package/dist/tour/spotlight.svelte +24 -0
- package/dist/tour/spotlight.svelte.d.ts +18 -0
- package/dist/tour/title.svelte +24 -0
- package/dist/tour/title.svelte.d.ts +18 -0
- package/dist/tour/tour.d.ts +14 -0
- package/dist/tour/tour.js +14 -0
- package/dist/types.d.ts +10 -16
- package/package.json +46 -46
- package/dist/floating-panel/.gitkeep +0 -0
- package/dist/tour/.gitkeep +0 -0
@@ -1,39 +1,39 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {CreateToastReturn} from './create-toast.svelte.js';
|
4
|
-
import type {CreateToasterReturn} from './create-toaster.svelte.js';
|
5
|
-
|
6
|
-
export interface ToasterProps
|
7
|
-
extends HtmlIngredientProps<'div', CreateToastReturn> {
|
8
|
-
toaster: CreateToasterReturn;
|
9
|
-
}
|
10
|
-
</script>
|
11
|
-
|
12
|
-
<script lang="ts">
|
13
|
-
import {mergeProps} from '../merge-props.js';
|
14
|
-
import {Portal} from '../portal/index.js';
|
15
|
-
import {normalizeProps, useMachine} from '@zag-js/svelte';
|
16
|
-
import * as toast from '@zag-js/toast';
|
17
|
-
import ToastActor from './actor.svelte';
|
18
|
-
|
19
|
-
let {toaster, children, ...props}: ToasterProps = $props();
|
20
|
-
|
21
|
-
let [snapshot, send] = useMachine(toaster.machine);
|
22
|
-
|
23
|
-
let placement = $derived(snapshot.context.placement);
|
24
|
-
let api = $derived(toast.group.connect(snapshot, send, normalizeProps));
|
25
|
-
let toasts = $derived(api.getToastsByPlacement(placement));
|
26
|
-
let mergedProps = $derived(mergeProps(props, api.getGroupProps({placement})));
|
27
|
-
</script>
|
28
|
-
|
29
|
-
<Portal>
|
30
|
-
<div {...mergedProps}>
|
31
|
-
{#each toasts as toast (toast.id)}
|
32
|
-
<ToastActor actor={toast}>
|
33
|
-
{#snippet children$(ctx)}
|
34
|
-
{@render children?.(ctx)}
|
35
|
-
{/snippet}
|
36
|
-
</ToastActor>
|
37
|
-
{/each}
|
38
|
-
</div>
|
39
|
-
</Portal>
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {CreateToastReturn} from './create-toast.svelte.js';
|
4
|
+
import type {CreateToasterReturn} from './create-toaster.svelte.js';
|
5
|
+
|
6
|
+
export interface ToasterProps
|
7
|
+
extends HtmlIngredientProps<'div', CreateToastReturn> {
|
8
|
+
toaster: CreateToasterReturn;
|
9
|
+
}
|
10
|
+
</script>
|
11
|
+
|
12
|
+
<script lang="ts">
|
13
|
+
import {mergeProps} from '../merge-props.js';
|
14
|
+
import {Portal} from '../portal/index.js';
|
15
|
+
import {normalizeProps, useMachine} from '@zag-js/svelte';
|
16
|
+
import * as toast from '@zag-js/toast';
|
17
|
+
import ToastActor from './actor.svelte';
|
18
|
+
|
19
|
+
let {toaster, children, ...props}: ToasterProps = $props();
|
20
|
+
|
21
|
+
let [snapshot, send] = useMachine(toaster.machine);
|
22
|
+
|
23
|
+
let placement = $derived(snapshot.context.placement);
|
24
|
+
let api = $derived(toast.group.connect(snapshot, send, normalizeProps));
|
25
|
+
let toasts = $derived(api.getToastsByPlacement(placement));
|
26
|
+
let mergedProps = $derived(mergeProps(props, api.getGroupProps({placement})));
|
27
|
+
</script>
|
28
|
+
|
29
|
+
<Portal>
|
30
|
+
<div {...mergedProps}>
|
31
|
+
{#each toasts as toast (toast.id)}
|
32
|
+
<ToastActor actor={toast}>
|
33
|
+
{#snippet children$(ctx)}
|
34
|
+
{@render children?.(ctx)}
|
35
|
+
{/snippet}
|
36
|
+
</ToastActor>
|
37
|
+
{/each}
|
38
|
+
</div>
|
39
|
+
</Portal>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourArrowTipProps extends HtmlIngredientProps<'span'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getTourContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {asChild, children, ...props}: TourArrowTipProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getArrowTipProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<span {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</span>
|
24
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const ArrowTip: $$__sveltets_2_IsomorphicComponent<TourArrowTipProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ArrowTip = InstanceType<typeof ArrowTip>;
|
18
|
+
export default ArrowTip;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourArrowProps extends HtmlIngredientProps<'span'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getTourContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {asChild, children, ...props}: TourArrowProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getArrowProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<span {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</span>
|
24
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Arrow: $$__sveltets_2_IsomorphicComponent<TourArrowProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Arrow = InstanceType<typeof Arrow>;
|
18
|
+
export default Arrow;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourCloseTriggerProps
|
5
|
+
extends HtmlIngredientProps<'button'> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getTourContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: TourCloseTriggerProps = $props();
|
13
|
+
|
14
|
+
let tour = getTourContext();
|
15
|
+
|
16
|
+
let mergedProps = $derived(mergeProps(props, tour.getCloseTriggerProps()));
|
17
|
+
</script>
|
18
|
+
|
19
|
+
{#if asChild}
|
20
|
+
{@render asChild(mergedProps)}
|
21
|
+
{:else}
|
22
|
+
<button type="button" {...mergedProps}>
|
23
|
+
{@render children?.()}
|
24
|
+
</button>
|
25
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const CloseTrigger: $$__sveltets_2_IsomorphicComponent<TourCloseTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type CloseTrigger = InstanceType<typeof CloseTrigger>;
|
18
|
+
export default CloseTrigger;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourContentProps extends HtmlIngredientProps<'div'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getPresenceContext} from '../presence/context.svelte.js';
|
10
|
+
import {getTourContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: TourContentProps = $props();
|
13
|
+
|
14
|
+
let tour = getTourContext();
|
15
|
+
let presence = getPresenceContext();
|
16
|
+
|
17
|
+
let mergedProps = $derived(
|
18
|
+
mergeProps(props, tour.getContentProps(), presence.getPresenceProps()),
|
19
|
+
);
|
20
|
+
</script>
|
21
|
+
|
22
|
+
{#if presence.mounted}
|
23
|
+
{#if asChild}
|
24
|
+
{@render asChild(mergedProps)}
|
25
|
+
{:else}
|
26
|
+
<div use:presence.ref {...mergedProps}>
|
27
|
+
{@render children?.()}
|
28
|
+
</div>
|
29
|
+
{/if}
|
30
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Content: $$__sveltets_2_IsomorphicComponent<TourContentProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Content = InstanceType<typeof Content>;
|
18
|
+
export default Content;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as tour from '@zag-js/tour';
|
2
|
+
export interface CreateTourProps extends Omit<tour.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
4
|
+
}
|
5
|
+
export interface CreateTourReturn extends tour.Api<any> {
|
6
|
+
}
|
7
|
+
export declare function createTour(props: CreateTourProps): CreateTourReturn;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
2
|
+
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
3
|
+
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
4
|
+
import * as tour from '@zag-js/tour';
|
5
|
+
import { uid } from 'uid';
|
6
|
+
export function createTour(props) {
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
|
+
const id = uid();
|
10
|
+
const context = $derived(reflect(() => ({
|
11
|
+
...props,
|
12
|
+
id: props.id ?? id,
|
13
|
+
dir: locale?.dir,
|
14
|
+
getRootNode: environment?.getRootNode,
|
15
|
+
})));
|
16
|
+
const [state, send] = useMachine(tour.machine(context), { context });
|
17
|
+
const api = $derived(reflect(() => tour.connect(state, send, normalizeProps)));
|
18
|
+
return api;
|
19
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourDescriptionProps extends HtmlIngredientProps<'p'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getTourContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {asChild, children, ...props}: TourDescriptionProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getDescriptionProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<p {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</p>
|
24
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Description: $$__sveltets_2_IsomorphicComponent<TourDescriptionProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Description = InstanceType<typeof Description>;
|
18
|
+
export default Description;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export * as Tour from './tour.js';
|
2
|
+
export type { TourArrowTipProps } from './arrow-tip.svelte';
|
3
|
+
export type { TourArrowProps } from './arrow.svelte';
|
4
|
+
export type { TourCloseTriggerProps } from './close-trigger.svelte';
|
5
|
+
export type { TourContentProps } from './content.svelte';
|
6
|
+
export type { TourDescriptionProps } from './description.svelte';
|
7
|
+
export type { TourNextTriggerProps } from './next-trigger.svelte';
|
8
|
+
export type { TourOverlayProps } from './overlay.svelte';
|
9
|
+
export type { TourPositionerProps } from './positioner.svelte';
|
10
|
+
export type { TourPrevTriggerProps } from './prev-trigger.svelte';
|
11
|
+
export type { TourProgressTextProps } from './progress-text.svelte';
|
12
|
+
export type { TourProps } from './root.svelte';
|
13
|
+
export type { TourSkipTriggerProps } from './skip-trigger.svelte';
|
14
|
+
export type { TourSpotlightProps } from './spotlight.svelte';
|
15
|
+
export type { TourTitleProps } from './title.svelte';
|
16
|
+
export { anatomy as tourAnatomy } from '@zag-js/tour';
|
17
|
+
export { getTourContext } from './context.svelte.js';
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourNextTriggerProps extends HtmlIngredientProps<'button'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getTourContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {asChild, children, ...props}: TourNextTriggerProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getNextTriggerProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<button type="button" {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</button>
|
24
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const NextTrigger: $$__sveltets_2_IsomorphicComponent<TourNextTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type NextTrigger = InstanceType<typeof NextTrigger>;
|
18
|
+
export default NextTrigger;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourOverlayProps extends HtmlIngredientProps<'div'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getPresenceStrategyPropsContext} from '../presence/context.svelte.js';
|
10
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
11
|
+
import {getTourContext} from './context.svelte.js';
|
12
|
+
|
13
|
+
let {asChild, children, ...props}: TourOverlayProps = $props();
|
14
|
+
|
15
|
+
let tour = getTourContext();
|
16
|
+
|
17
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
18
|
+
let presence = createPresence({
|
19
|
+
get present() {
|
20
|
+
return tour.currentStep != null;
|
21
|
+
},
|
22
|
+
get lazyMount() {
|
23
|
+
return presenceStrategyProps.lazyMount;
|
24
|
+
},
|
25
|
+
get keepMounted() {
|
26
|
+
return presenceStrategyProps.keepMounted;
|
27
|
+
},
|
28
|
+
});
|
29
|
+
|
30
|
+
let mergedProps = $derived(
|
31
|
+
mergeProps(props, tour.getOverlayProps(), presence.getPresenceProps()),
|
32
|
+
);
|
33
|
+
</script>
|
34
|
+
|
35
|
+
{#if presence.mounted}
|
36
|
+
{#if asChild}
|
37
|
+
{@render asChild(mergedProps)}
|
38
|
+
{:else}
|
39
|
+
<div use:presence.ref {...mergedProps}>
|
40
|
+
{@render children?.()}
|
41
|
+
</div>
|
42
|
+
{/if}
|
43
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Overlay: $$__sveltets_2_IsomorphicComponent<TourOverlayProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Overlay = InstanceType<typeof Overlay>;
|
18
|
+
export default Overlay;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourPositionerProps extends HtmlIngredientProps<'div'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getPresenceContext} from '../presence/context.svelte.js';
|
10
|
+
import {getTourContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: TourPositionerProps = $props();
|
13
|
+
|
14
|
+
let tour = getTourContext();
|
15
|
+
let presence = getPresenceContext();
|
16
|
+
|
17
|
+
let mergedProps = $derived(
|
18
|
+
mergeProps(props, tour.getPositionerProps(), presence.getPresenceProps()),
|
19
|
+
);
|
20
|
+
</script>
|
21
|
+
|
22
|
+
{#if presence.mounted}
|
23
|
+
{#if asChild}
|
24
|
+
{@render asChild(mergedProps)}
|
25
|
+
{:else}
|
26
|
+
<div {...mergedProps}>
|
27
|
+
{@render children?.()}
|
28
|
+
</div>
|
29
|
+
{/if}
|
30
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const Positioner: $$__sveltets_2_IsomorphicComponent<TourPositionerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Positioner = InstanceType<typeof Positioner>;
|
18
|
+
export default Positioner;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourPrevTriggerProps extends HtmlIngredientProps<'button'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getTourContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {asChild, children, ...props}: TourPrevTriggerProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getPrevTriggerProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<button type="button" {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</button>
|
24
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const PrevTrigger: $$__sveltets_2_IsomorphicComponent<TourPrevTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type PrevTrigger = InstanceType<typeof PrevTrigger>;
|
18
|
+
export default PrevTrigger;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourProgressTextProps extends HtmlIngredientProps<'span'> {}
|
5
|
+
</script>
|
6
|
+
|
7
|
+
<script lang="ts">
|
8
|
+
import {mergeProps} from '../merge-props.js';
|
9
|
+
import {getTourContext} from './context.svelte.js';
|
10
|
+
|
11
|
+
let {asChild, children, ...props}: TourProgressTextProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getProgressTextProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<span {...mergedProps}>
|
22
|
+
{#if children}
|
23
|
+
{@render children?.()}
|
24
|
+
{:else}
|
25
|
+
{tour.getProgressText()}
|
26
|
+
{/if}
|
27
|
+
</span>
|
28
|
+
{/if}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
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> {
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
3
|
+
$$bindings?: Bindings;
|
4
|
+
} & Exports;
|
5
|
+
(internal: unknown, props: Props & {
|
6
|
+
$$events?: Events;
|
7
|
+
$$slots?: Slots;
|
8
|
+
}): Exports & {
|
9
|
+
$set?: any;
|
10
|
+
$on?: any;
|
11
|
+
};
|
12
|
+
z_$$bindings?: Bindings;
|
13
|
+
}
|
14
|
+
declare const ProgressText: $$__sveltets_2_IsomorphicComponent<TourProgressTextProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ProgressText = InstanceType<typeof ProgressText>;
|
18
|
+
export default ProgressText;
|