ui-ingredients 0.0.43 → 0.0.44
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -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 +2 -1
- package/dist/floating-panel/create-floating-panel.svelte.js +1 -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/presence/root.svelte +5 -1
- 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.js +1 -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 +1 -1
@@ -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;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
4
|
+
import type {
|
5
|
+
CreateTourProps,
|
6
|
+
CreateTourReturn,
|
7
|
+
} from './create-tour.svelte.js';
|
8
|
+
|
9
|
+
export interface TourProps extends CreateTourProps, PresenceStrategyProps {
|
10
|
+
children?: Snippet<[CreateTourReturn]>;
|
11
|
+
}
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script lang="ts">
|
15
|
+
import {
|
16
|
+
setPresenceContext,
|
17
|
+
setPresenceStrategyPropsContext,
|
18
|
+
} from '../presence/context.svelte.js';
|
19
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
20
|
+
import {reflect} from '@zag-js/svelte';
|
21
|
+
import {createSplitProps} from '@zag-js/utils';
|
22
|
+
import {setTourContext} from './context.svelte.js';
|
23
|
+
import {createTour} from './create-tour.svelte.js';
|
24
|
+
|
25
|
+
let {children, ...props}: TourProps = $props();
|
26
|
+
|
27
|
+
let [presenceStrategyProps, tourProps] = $derived(
|
28
|
+
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
|
29
|
+
props,
|
30
|
+
),
|
31
|
+
);
|
32
|
+
|
33
|
+
let tour = createTour(reflect(() => tourProps));
|
34
|
+
|
35
|
+
let presence = createPresence({
|
36
|
+
get present() {
|
37
|
+
return tour.currentStep != null;
|
38
|
+
},
|
39
|
+
get lazyMount() {
|
40
|
+
return presenceStrategyProps.lazyMount;
|
41
|
+
},
|
42
|
+
get keepMounted() {
|
43
|
+
return presenceStrategyProps.keepMounted;
|
44
|
+
},
|
45
|
+
});
|
46
|
+
|
47
|
+
setTourContext(tour);
|
48
|
+
setPresenceContext(presence);
|
49
|
+
setPresenceStrategyPropsContext(() => presenceStrategyProps);
|
50
|
+
</script>
|
51
|
+
|
52
|
+
{@render children?.(tour)}
|
@@ -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 Root: $$__sveltets_2_IsomorphicComponent<TourProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Root = InstanceType<typeof Root>;
|
18
|
+
export default Root;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourSkipTriggerProps 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}: TourSkipTriggerProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getSkipTriggerProps()));
|
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 SkipTrigger: $$__sveltets_2_IsomorphicComponent<TourSkipTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type SkipTrigger = InstanceType<typeof SkipTrigger>;
|
18
|
+
export default SkipTrigger;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourSpotlightProps extends HtmlIngredientProps<'div'> {}
|
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}: TourSpotlightProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getSpotlightProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<div {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</div>
|
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 Spotlight: $$__sveltets_2_IsomorphicComponent<TourSpotlightProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Spotlight = InstanceType<typeof Spotlight>;
|
18
|
+
export default Spotlight;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface TourTitleProps extends HtmlIngredientProps<'h2'> {}
|
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}: TourTitleProps = $props();
|
12
|
+
|
13
|
+
let tour = getTourContext();
|
14
|
+
|
15
|
+
let mergedProps = $derived(mergeProps(props, tour.getTitleProps()));
|
16
|
+
</script>
|
17
|
+
|
18
|
+
{#if asChild}
|
19
|
+
{@render asChild(mergedProps)}
|
20
|
+
{:else}
|
21
|
+
<h2 {...mergedProps}>
|
22
|
+
{@render children?.()}
|
23
|
+
</h2>
|
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 Title: $$__sveltets_2_IsomorphicComponent<TourTitleProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Title = InstanceType<typeof Title>;
|
18
|
+
export default Title;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export { default as ArrowTip } from './arrow-tip.svelte';
|
2
|
+
export { default as Arrow } from './arrow.svelte';
|
3
|
+
export { default as CloseTrigger } from './close-trigger.svelte';
|
4
|
+
export { default as Content } from './content.svelte';
|
5
|
+
export { default as Description } from './description.svelte';
|
6
|
+
export { default as NextTrigger } from './next-trigger.svelte';
|
7
|
+
export { default as Overlay } from './overlay.svelte';
|
8
|
+
export { default as Positioner } from './positioner.svelte';
|
9
|
+
export { default as PrevTrigger } from './prev-trigger.svelte';
|
10
|
+
export { default as ProgressText } from './progress-text.svelte';
|
11
|
+
export { default as Root } from './root.svelte';
|
12
|
+
export { default as SkipTrigger } from './skip-trigger.svelte';
|
13
|
+
export { default as Spotlight } from './spotlight.svelte';
|
14
|
+
export { default as Title } from './title.svelte';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export { default as ArrowTip } from './arrow-tip.svelte';
|
2
|
+
export { default as Arrow } from './arrow.svelte';
|
3
|
+
export { default as CloseTrigger } from './close-trigger.svelte';
|
4
|
+
export { default as Content } from './content.svelte';
|
5
|
+
export { default as Description } from './description.svelte';
|
6
|
+
export { default as NextTrigger } from './next-trigger.svelte';
|
7
|
+
export { default as Overlay } from './overlay.svelte';
|
8
|
+
export { default as Positioner } from './positioner.svelte';
|
9
|
+
export { default as PrevTrigger } from './prev-trigger.svelte';
|
10
|
+
export { default as ProgressText } from './progress-text.svelte';
|
11
|
+
export { default as Root } from './root.svelte';
|
12
|
+
export { default as SkipTrigger } from './skip-trigger.svelte';
|
13
|
+
export { default as Spotlight } from './spotlight.svelte';
|
14
|
+
export { default as Title } from './title.svelte';
|
package/dist/types.d.ts
CHANGED
@@ -1,27 +1,21 @@
|
|
1
1
|
import type { Snippet } from 'svelte';
|
2
2
|
import type { Action } from 'svelte/action';
|
3
3
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
4
|
-
import type { TransitionConfig } from 'svelte/transition';
|
5
4
|
export type GenericObject = Record<string, any>;
|
6
5
|
export type Assign<Target extends GenericObject, Source extends GenericObject> = Source & Omit<Target, keyof Source>;
|
7
|
-
export type
|
6
|
+
export type IntrinsicElement = keyof {
|
8
7
|
[K in keyof SvelteHTMLElements as string extends K ? never : number extends K ? never : K]: string;
|
9
8
|
};
|
10
|
-
export type HtmlProps<T extends
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
transition?: TransitionFunction;
|
16
|
-
}
|
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]>;
|
9
|
+
export type HtmlProps<T extends IntrinsicElement> = SvelteHTMLElements[T];
|
10
|
+
type AsChildWithRef<Ref extends Action, Context = never> = [Context] extends [
|
11
|
+
never
|
12
|
+
] ? Snippet<[ref: Ref, attrs: GenericObject]> : Snippet<[ref: Ref, attrs: GenericObject, context: Context]>;
|
13
|
+
type AsChildWithoutRef<Context = never> = [Context] extends [never] ? Snippet<[attrs: GenericObject]> : Snippet<[attrs: GenericObject, context: Context]>;
|
21
14
|
export type AsChild<Ref extends Action, Context = never> = [Ref] extends [never] ? AsChildWithoutRef<Context> : AsChildWithRef<Ref, Context>;
|
22
|
-
|
23
|
-
|
24
|
-
export type HtmlIngredientProps<Element extends
|
15
|
+
type Children<T = never> = [T] extends [never] ? Snippet : Snippet<[context: T]>;
|
16
|
+
type PropsWithoutChildren<T> = Omit<T, 'children'>;
|
17
|
+
export type HtmlIngredientProps<Element extends IntrinsicElement, Context = never, Ref extends Action = never> = PropsWithoutChildren<HtmlProps<Element>> & {
|
25
18
|
children?: Children<Context>;
|
26
19
|
asChild?: AsChild<Ref, Context>;
|
27
20
|
};
|
21
|
+
export {};
|