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.
Files changed (91) hide show
  1. package/README.md +3 -0
  2. package/dist/file-upload/create-file-upload.svelte.js +1 -0
  3. package/dist/file-upload/root.svelte +1 -0
  4. package/dist/floating-panel/body.svelte +24 -0
  5. package/dist/floating-panel/body.svelte.d.ts +18 -0
  6. package/dist/floating-panel/close-trigger.svelte +27 -0
  7. package/dist/floating-panel/close-trigger.svelte.d.ts +18 -0
  8. package/dist/floating-panel/content.svelte +36 -0
  9. package/dist/floating-panel/content.svelte.d.ts +18 -0
  10. package/dist/floating-panel/context.svelte.d.ts +2 -0
  11. package/dist/floating-panel/context.svelte.js +2 -0
  12. package/dist/floating-panel/create-floating-panel.svelte.d.ts +7 -0
  13. package/dist/floating-panel/create-floating-panel.svelte.js +19 -0
  14. package/dist/floating-panel/drag-trigger.svelte +27 -0
  15. package/dist/floating-panel/drag-trigger.svelte.d.ts +18 -0
  16. package/dist/floating-panel/floating-panel.d.ts +13 -0
  17. package/dist/floating-panel/floating-panel.js +13 -0
  18. package/dist/floating-panel/header.svelte +25 -0
  19. package/dist/floating-panel/header.svelte.d.ts +18 -0
  20. package/dist/floating-panel/index.d.ts +16 -0
  21. package/dist/floating-panel/index.js +3 -0
  22. package/dist/floating-panel/maximize-trigger.svelte +28 -0
  23. package/dist/floating-panel/maximize-trigger.svelte.d.ts +18 -0
  24. package/dist/floating-panel/minimize-trigger.svelte +28 -0
  25. package/dist/floating-panel/minimize-trigger.svelte.d.ts +18 -0
  26. package/dist/floating-panel/positioner.svelte +35 -0
  27. package/dist/floating-panel/positioner.svelte.d.ts +18 -0
  28. package/dist/floating-panel/resize-trigger.svelte +36 -0
  29. package/dist/floating-panel/resize-trigger.svelte.d.ts +18 -0
  30. package/dist/floating-panel/restore-trigger.svelte +28 -0
  31. package/dist/floating-panel/restore-trigger.svelte.d.ts +18 -0
  32. package/dist/floating-panel/root.svelte +50 -0
  33. package/dist/floating-panel/root.svelte.d.ts +18 -0
  34. package/dist/floating-panel/title.svelte +25 -0
  35. package/dist/floating-panel/title.svelte.d.ts +18 -0
  36. package/dist/floating-panel/trigger.svelte +27 -0
  37. package/dist/floating-panel/trigger.svelte.d.ts +18 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +2 -0
  40. package/dist/is-object.d.ts +2 -0
  41. package/dist/is-object.js +4 -0
  42. package/dist/merge-props.js +1 -4
  43. package/dist/portal/root.svelte +32 -32
  44. package/dist/presence/root.svelte +5 -1
  45. package/dist/switch/control.svelte +24 -24
  46. package/dist/switch/hidden-input.svelte +23 -23
  47. package/dist/switch/label.svelte +24 -24
  48. package/dist/switch/root.svelte +54 -54
  49. package/dist/switch/thumb.svelte +24 -24
  50. package/dist/toast/actor.svelte +19 -19
  51. package/dist/toast/toaster.svelte +39 -39
  52. package/dist/tour/arrow-tip.svelte +24 -0
  53. package/dist/tour/arrow-tip.svelte.d.ts +18 -0
  54. package/dist/tour/arrow.svelte +24 -0
  55. package/dist/tour/arrow.svelte.d.ts +18 -0
  56. package/dist/tour/close-trigger.svelte +25 -0
  57. package/dist/tour/close-trigger.svelte.d.ts +18 -0
  58. package/dist/tour/content.svelte +30 -0
  59. package/dist/tour/content.svelte.d.ts +18 -0
  60. package/dist/tour/context.svelte.d.ts +2 -0
  61. package/dist/tour/context.svelte.js +3 -0
  62. package/dist/tour/create-tour.svelte.d.ts +7 -0
  63. package/dist/tour/create-tour.svelte.js +19 -0
  64. package/dist/tour/description.svelte +24 -0
  65. package/dist/tour/description.svelte.d.ts +18 -0
  66. package/dist/tour/index.d.ts +17 -0
  67. package/dist/tour/index.js +3 -0
  68. package/dist/tour/next-trigger.svelte +24 -0
  69. package/dist/tour/next-trigger.svelte.d.ts +18 -0
  70. package/dist/tour/overlay.svelte +43 -0
  71. package/dist/tour/overlay.svelte.d.ts +18 -0
  72. package/dist/tour/positioner.svelte +30 -0
  73. package/dist/tour/positioner.svelte.d.ts +18 -0
  74. package/dist/tour/prev-trigger.svelte +24 -0
  75. package/dist/tour/prev-trigger.svelte.d.ts +18 -0
  76. package/dist/tour/progress-text.svelte +28 -0
  77. package/dist/tour/progress-text.svelte.d.ts +18 -0
  78. package/dist/tour/root.svelte +52 -0
  79. package/dist/tour/root.svelte.d.ts +18 -0
  80. package/dist/tour/skip-trigger.svelte +24 -0
  81. package/dist/tour/skip-trigger.svelte.d.ts +18 -0
  82. package/dist/tour/spotlight.svelte +24 -0
  83. package/dist/tour/spotlight.svelte.d.ts +18 -0
  84. package/dist/tour/title.svelte +24 -0
  85. package/dist/tour/title.svelte.d.ts +18 -0
  86. package/dist/tour/tour.d.ts +14 -0
  87. package/dist/tour/tour.js +14 -0
  88. package/dist/types.d.ts +10 -16
  89. package/package.json +46 -46
  90. package/dist/floating-panel/.gitkeep +0 -0
  91. 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,2 @@
1
+ import { type CreateTourReturn } from './create-tour.svelte.js';
2
+ export declare const getTourContext: () => CreateTourReturn, setTourContext: (context: CreateTourReturn | (() => CreateTourReturn)) => void;
@@ -0,0 +1,3 @@
1
+ import { createContext } from '../create-context.svelte.js';
2
+ import {} from './create-tour.svelte.js';
3
+ export const [getTourContext, setTourContext] = createContext('Tour');
@@ -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,3 @@
1
+ export * as Tour from './tour.js';
2
+ export { anatomy as tourAnatomy } from '@zag-js/tour';
3
+ 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;