ui-ingredients 0.0.43 → 0.0.45
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -0
- package/dist/accordion/create-accordion.svelte.js +3 -4
- package/dist/accordion/item-content.svelte +7 -11
- package/dist/accordion/item.svelte +2 -2
- package/dist/accordion/root.svelte +4 -6
- package/dist/avatar/create-avatar.svelte.js +3 -4
- package/dist/avatar/root.svelte +2 -2
- package/dist/carousel/create-carousel.svelte.js +3 -4
- package/dist/carousel/indicator.svelte +2 -2
- package/dist/carousel/item.svelte +2 -2
- package/dist/carousel/root.svelte +2 -2
- package/dist/checkbox/create-checkbox.svelte.js +4 -5
- package/dist/checkbox/root.svelte +2 -2
- package/dist/clipboard/create-clipboard.svelte.js +3 -4
- package/dist/clipboard/root.svelte +2 -2
- package/dist/collapsible/create-collapsible.svelte.js +3 -4
- package/dist/collapsible/root.svelte +2 -2
- package/dist/color-picker/create-color-picker.svelte.js +3 -4
- package/dist/color-picker/root.svelte +2 -2
- package/dist/combobox/create-combobox.svelte.js +4 -5
- package/dist/combobox/item.svelte +2 -2
- package/dist/combobox/root.svelte +10 -16
- package/dist/create-context.svelte.js +1 -9
- package/dist/date-picker/create-date-picker.svelte.js +2 -3
- package/dist/date-picker/day-table-cell.svelte +2 -2
- package/dist/date-picker/month-table-cell.svelte +2 -2
- package/dist/date-picker/root.svelte +10 -18
- package/dist/date-picker/year-table-cell.svelte +2 -2
- package/dist/dialog/backdrop.svelte +7 -12
- package/dist/dialog/create-dialog.svelte.js +3 -4
- package/dist/dialog/root.svelte +6 -12
- package/dist/editable/create-editable.svelte.js +4 -5
- package/dist/editable/root.svelte +2 -2
- package/dist/environment-provider/root.svelte +5 -8
- package/dist/field/create-field.svelte.d.ts +1 -22
- package/dist/field/create-field.svelte.js +9 -20
- package/dist/field/root.svelte +2 -2
- package/dist/file-upload/create-file-upload.svelte.js +4 -5
- package/dist/file-upload/item.svelte +2 -2
- package/dist/file-upload/root.svelte +2 -2
- 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 +4 -4
- 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 +45 -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/highlight/highlight.svelte +42 -0
- package/dist/highlight/highlight.svelte.d.ts +18 -0
- package/dist/highlight/index.d.ts +1 -0
- package/dist/highlight/index.js +1 -0
- package/dist/hover-card/create-hover-card.svelte.js +3 -4
- package/dist/hover-card/root.svelte +6 -11
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/is-object.d.ts +2 -0
- package/dist/is-object.js +4 -0
- package/dist/locale-provider/root.svelte +8 -6
- package/dist/menu/create-menu.svelte.js +3 -4
- package/dist/menu/item.svelte +2 -2
- package/dist/menu/option-item.svelte +2 -2
- package/dist/menu/root.svelte +6 -12
- package/dist/merge-props.js +1 -4
- package/dist/number-input/create-number-input.svelte.js +4 -5
- package/dist/number-input/root.svelte +2 -2
- package/dist/pagination/create-pagination.svelte.js +3 -4
- package/dist/pagination/root.svelte +2 -2
- package/dist/pin-input/create-pin-input.svelte.js +4 -5
- package/dist/pin-input/root.svelte +2 -2
- package/dist/popover/create-popover.svelte.js +3 -4
- package/dist/popover/root.svelte +6 -11
- package/dist/presence/root.svelte +7 -3
- package/dist/progress/create-progress.svelte.js +3 -4
- package/dist/progress/root.svelte +2 -2
- package/dist/qr-code/create-qr-code.svelte.js +3 -4
- package/dist/qr-code/root.svelte +2 -2
- package/dist/radio-group/create-radio-group.svelte.js +3 -4
- package/dist/radio-group/item.svelte +2 -2
- package/dist/radio-group/root.svelte +2 -2
- package/dist/rating-group/create-rating-group.svelte.js +4 -5
- package/dist/rating-group/root.svelte +2 -2
- package/dist/segment-group/create-segment-group.svelte.js +3 -4
- package/dist/segment-group/item.svelte +2 -2
- package/dist/segment-group/root.svelte +2 -2
- package/dist/select/create-select.svelte.js +2 -3
- package/dist/select/item.svelte +2 -2
- package/dist/select/root.svelte +11 -19
- package/dist/signature-pad/create-signature-pad.svelte.js +3 -4
- package/dist/signature-pad/root.svelte +2 -2
- package/dist/slider/create-slider.svelte.js +3 -4
- package/dist/slider/root.svelte +2 -2
- package/dist/slider/thumb.svelte +2 -2
- package/dist/splitter/create-splitter.svelte.js +3 -4
- package/dist/splitter/panel.svelte +2 -2
- package/dist/splitter/resize-trigger.svelte +2 -2
- package/dist/splitter/root.svelte +2 -2
- package/dist/steps/create-steps.svelte.js +3 -4
- package/dist/steps/item.svelte +2 -2
- package/dist/steps/root.svelte +2 -2
- package/dist/switch/create-switch.svelte.js +4 -5
- package/dist/switch/root.svelte +2 -2
- package/dist/tabs/content.svelte +2 -2
- package/dist/tabs/create-tabs.svelte.js +3 -4
- package/dist/tabs/root.svelte +2 -2
- package/dist/tabs/trigger.svelte +2 -2
- package/dist/tags-input/create-tags-input.svelte.js +4 -5
- package/dist/tags-input/item.svelte +2 -2
- package/dist/tags-input/root.svelte +2 -2
- package/dist/time-picker/create-time-picker.svelte.js +3 -4
- package/dist/time-picker/root.svelte +11 -21
- package/dist/timer/create-timer.svelte.js +3 -4
- package/dist/timer/item.svelte +2 -2
- package/dist/timer/root.svelte +2 -2
- package/dist/toast/create-toast.svelte.js +1 -2
- package/dist/toast/create-toaster.svelte.js +2 -3
- package/dist/toggle-group/create-toggle-group.svelte.js +3 -4
- package/dist/toggle-group/item.svelte +2 -2
- package/dist/toggle-group/root.svelte +2 -2
- package/dist/tooltip/create-tooltip.svelte.js +3 -4
- package/dist/tooltip/root.svelte +6 -12
- 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 +4 -4
- 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 +38 -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 +47 -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/tree-view/branch.svelte +2 -2
- package/dist/tree-view/create-tree-view.svelte.js +3 -4
- package/dist/tree-view/item.svelte +2 -2
- package/dist/tree-view/root.svelte +2 -2
- package/dist/types.d.ts +10 -16
- package/package.json +2 -1
@@ -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 MaximizeTrigger: $$__sveltets_2_IsomorphicComponent<FloatingPanelMaximizeTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type MaximizeTrigger = InstanceType<typeof MaximizeTrigger>;
|
18
|
+
export default MaximizeTrigger;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface FloatingPanelMinimizeTriggerProps
|
5
|
+
extends HtmlIngredientProps<'button'> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getFloatingPanelContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: FloatingPanelMinimizeTriggerProps =
|
13
|
+
$props();
|
14
|
+
|
15
|
+
let floatingPanel = getFloatingPanelContext();
|
16
|
+
|
17
|
+
let mergedProps = $derived(
|
18
|
+
mergeProps(props, floatingPanel.getMinimizeTriggerProps()),
|
19
|
+
);
|
20
|
+
</script>
|
21
|
+
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(mergedProps)}
|
24
|
+
{:else}
|
25
|
+
<button type="button" {...mergedProps}>
|
26
|
+
{@render children?.()}
|
27
|
+
</button>
|
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 MinimizeTrigger: $$__sveltets_2_IsomorphicComponent<FloatingPanelMinimizeTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type MinimizeTrigger = InstanceType<typeof MinimizeTrigger>;
|
18
|
+
export default MinimizeTrigger;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface FloatingPanelPositionerProps
|
5
|
+
extends HtmlIngredientProps<'div'> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getPresenceContext} from '../presence/context.svelte.js';
|
11
|
+
import {getFloatingPanelContext} from './context.svelte.js';
|
12
|
+
|
13
|
+
let {asChild, children, ...props}: FloatingPanelPositionerProps = $props();
|
14
|
+
|
15
|
+
let floatingPanel = getFloatingPanelContext();
|
16
|
+
let presence = getPresenceContext();
|
17
|
+
|
18
|
+
let mergedProps = $derived(
|
19
|
+
mergeProps(
|
20
|
+
props,
|
21
|
+
floatingPanel.getPositionerProps(),
|
22
|
+
presence.getPresenceProps(),
|
23
|
+
),
|
24
|
+
);
|
25
|
+
</script>
|
26
|
+
|
27
|
+
{#if presence.mounted}
|
28
|
+
{#if asChild}
|
29
|
+
{@render asChild(mergedProps)}
|
30
|
+
{:else}
|
31
|
+
<div {...mergedProps}>
|
32
|
+
{@render children?.()}
|
33
|
+
</div>
|
34
|
+
{/if}
|
35
|
+
{/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<FloatingPanelPositionerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Positioner = InstanceType<typeof Positioner>;
|
18
|
+
export default Positioner;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {ResizeTriggerProps} from '@zag-js/floating-panel';
|
4
|
+
|
5
|
+
export interface FloatingPanelResizeTriggerProps
|
6
|
+
extends Assign<HtmlIngredientProps<'button'>, ResizeTriggerProps> {}
|
7
|
+
</script>
|
8
|
+
|
9
|
+
<script lang="ts">
|
10
|
+
import {mergeProps} from '../merge-props.js';
|
11
|
+
import {createSplitProps} from '@zag-js/utils';
|
12
|
+
import {getFloatingPanelContext} from './context.svelte.js';
|
13
|
+
|
14
|
+
let {asChild, children, ...props}: FloatingPanelResizeTriggerProps = $props();
|
15
|
+
|
16
|
+
let floatingPanel = getFloatingPanelContext();
|
17
|
+
|
18
|
+
let [resizeTriggerProps, localProps] = $derived(
|
19
|
+
createSplitProps<ResizeTriggerProps>([])(props),
|
20
|
+
);
|
21
|
+
|
22
|
+
let mergedProps = $derived(
|
23
|
+
mergeProps(
|
24
|
+
localProps,
|
25
|
+
floatingPanel.getResizeTriggerProps(resizeTriggerProps),
|
26
|
+
),
|
27
|
+
);
|
28
|
+
</script>
|
29
|
+
|
30
|
+
{#if asChild}
|
31
|
+
{@render asChild(mergedProps)}
|
32
|
+
{:else}
|
33
|
+
<button type="button" {...mergedProps}>
|
34
|
+
{@render children?.()}
|
35
|
+
</button>
|
36
|
+
{/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 ResizeTrigger: $$__sveltets_2_IsomorphicComponent<FloatingPanelResizeTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type ResizeTrigger = InstanceType<typeof ResizeTrigger>;
|
18
|
+
export default ResizeTrigger;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface FloatingPanelRestoreTriggerProps
|
5
|
+
extends HtmlIngredientProps<'button'> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getFloatingPanelContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: FloatingPanelRestoreTriggerProps =
|
13
|
+
$props();
|
14
|
+
|
15
|
+
let floatingPanel = getFloatingPanelContext();
|
16
|
+
|
17
|
+
let mergedProps = $derived(
|
18
|
+
mergeProps(props, floatingPanel.getRestoreTriggerProps()),
|
19
|
+
);
|
20
|
+
</script>
|
21
|
+
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(mergedProps)}
|
24
|
+
{:else}
|
25
|
+
<button type="button" {...mergedProps}>
|
26
|
+
{@render children?.()}
|
27
|
+
</button>
|
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 RestoreTrigger: $$__sveltets_2_IsomorphicComponent<FloatingPanelRestoreTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type RestoreTrigger = InstanceType<typeof RestoreTrigger>;
|
18
|
+
export default RestoreTrigger;
|
@@ -0,0 +1,45 @@
|
|
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
|
+
CreateFloatingPanelProps,
|
6
|
+
CreateFloatingPanelReturn,
|
7
|
+
} from './create-floating-panel.svelte.js';
|
8
|
+
|
9
|
+
export interface FloatingPanelProps
|
10
|
+
extends CreateFloatingPanelProps,
|
11
|
+
PresenceStrategyProps {
|
12
|
+
children?: Snippet<[CreateFloatingPanelReturn]>;
|
13
|
+
}
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script lang="ts">
|
17
|
+
import {setPresenceContext} from '../presence/context.svelte.js';
|
18
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
19
|
+
import {reflect} from '@zag-js/svelte';
|
20
|
+
import {createSplitProps} from '@zag-js/utils';
|
21
|
+
import {setFloatingPanelContext} from './context.svelte.js';
|
22
|
+
import {createFloatingPanel} from './create-floating-panel.svelte.js';
|
23
|
+
|
24
|
+
let {children, ...props}: FloatingPanelProps = $props();
|
25
|
+
|
26
|
+
let [presenceStrategyProps, floatingPanelProps] = $derived(
|
27
|
+
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
|
28
|
+
props,
|
29
|
+
),
|
30
|
+
);
|
31
|
+
|
32
|
+
let floatingPanel = createFloatingPanel(reflect(() => floatingPanelProps));
|
33
|
+
|
34
|
+
let presence = createPresence(
|
35
|
+
reflect(() => ({
|
36
|
+
...presenceStrategyProps,
|
37
|
+
present: floatingPanel.open,
|
38
|
+
})),
|
39
|
+
);
|
40
|
+
|
41
|
+
setFloatingPanelContext(floatingPanel);
|
42
|
+
setPresenceContext(presence);
|
43
|
+
</script>
|
44
|
+
|
45
|
+
{@render children?.(floatingPanel)}
|
@@ -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<FloatingPanelProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Root = InstanceType<typeof Root>;
|
18
|
+
export default Root;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface FloatingPanelTitleProps
|
5
|
+
extends HtmlIngredientProps<'span'> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getFloatingPanelContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: FloatingPanelTitleProps = $props();
|
13
|
+
|
14
|
+
let floatingPanel = getFloatingPanelContext();
|
15
|
+
|
16
|
+
let mergedProps = $derived(mergeProps(props, floatingPanel.getTitleProps()));
|
17
|
+
</script>
|
18
|
+
|
19
|
+
{#if asChild}
|
20
|
+
{@render asChild(mergedProps)}
|
21
|
+
{:else}
|
22
|
+
<span {...mergedProps}>
|
23
|
+
{@render children?.()}
|
24
|
+
</span>
|
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 Title: $$__sveltets_2_IsomorphicComponent<FloatingPanelTitleProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Title = InstanceType<typeof Title>;
|
18
|
+
export default Title;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface FloatingPanelTriggerProps
|
5
|
+
extends HtmlIngredientProps<'button'> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getFloatingPanelContext} from './context.svelte.js';
|
11
|
+
|
12
|
+
let {asChild, children, ...props}: FloatingPanelTriggerProps = $props();
|
13
|
+
|
14
|
+
let floatingPanel = getFloatingPanelContext();
|
15
|
+
|
16
|
+
let mergedProps = $derived(
|
17
|
+
mergeProps(props, floatingPanel.getTriggerProps()),
|
18
|
+
);
|
19
|
+
</script>
|
20
|
+
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(mergedProps)}
|
23
|
+
{:else}
|
24
|
+
<button type="button" {...mergedProps}>
|
25
|
+
{@render children?.()}
|
26
|
+
</button>
|
27
|
+
{/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 Trigger: $$__sveltets_2_IsomorphicComponent<FloatingPanelTriggerProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Trigger = InstanceType<typeof Trigger>;
|
18
|
+
export default Trigger;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {HighlightWordProps} from '@zag-js/highlight-word';
|
4
|
+
|
5
|
+
export interface HighlightProps
|
6
|
+
extends Assign<
|
7
|
+
Omit<HtmlIngredientProps<'div'>, 'children'>,
|
8
|
+
HighlightWordProps
|
9
|
+
> {}
|
10
|
+
</script>
|
11
|
+
|
12
|
+
<script lang="ts">
|
13
|
+
import {highlightWord} from '@zag-js/highlight-word';
|
14
|
+
import {createSplitProps} from '@zag-js/utils';
|
15
|
+
|
16
|
+
let {asChild, ...props}: HighlightProps = $props();
|
17
|
+
|
18
|
+
let [highlightProps, localProps] = $derived(
|
19
|
+
createSplitProps<HighlightWordProps>([
|
20
|
+
'text',
|
21
|
+
'query',
|
22
|
+
'matchAll',
|
23
|
+
'ignoreCase',
|
24
|
+
])(props),
|
25
|
+
);
|
26
|
+
|
27
|
+
let chunks = $derived(highlightWord(highlightProps));
|
28
|
+
</script>
|
29
|
+
|
30
|
+
{#if asChild}
|
31
|
+
{@render asChild(localProps)}
|
32
|
+
{:else}
|
33
|
+
<div {...localProps}>
|
34
|
+
{#each chunks as chunk}
|
35
|
+
{#if chunk.match}
|
36
|
+
<mark>{chunk.text}</mark>
|
37
|
+
{:else}
|
38
|
+
{chunk.text}
|
39
|
+
{/if}
|
40
|
+
{/each}
|
41
|
+
</div>
|
42
|
+
{/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 Highlight: $$__sveltets_2_IsomorphicComponent<HighlightProps, {
|
15
|
+
[evt: string]: CustomEvent<any>;
|
16
|
+
}, {}, {}, "">;
|
17
|
+
type Highlight = InstanceType<typeof Highlight>;
|
18
|
+
export default Highlight;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as Highlight, type HighlightProps } from './highlight.svelte';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as Highlight } from './highlight.svelte';
|
@@ -7,15 +7,14 @@ export function createHoverCard(props) {
|
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
|
-
const context =
|
10
|
+
const context = reflect(() => ({
|
11
11
|
...props,
|
12
12
|
id: props.id ?? id,
|
13
13
|
dir: locale?.dir,
|
14
14
|
open: props.defaultOpen ?? props.open,
|
15
15
|
getRootNode: environment?.getRootNode,
|
16
16
|
'open.controlled': props.open != null,
|
17
|
-
}))
|
17
|
+
}));
|
18
18
|
const [state, send] = useMachine(hoverCard.machine(context), { context });
|
19
|
-
|
20
|
-
return api;
|
19
|
+
return reflect(() => hoverCard.connect(state, send, normalizeProps));
|
21
20
|
}
|
@@ -38,17 +38,12 @@
|
|
38
38
|
|
39
39
|
let hoverCard = createHoverCard(reflect(() => hoverCardProps));
|
40
40
|
|
41
|
-
let presence = createPresence(
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
},
|
48
|
-
get keepMounted() {
|
49
|
-
return presenceStrategyProps.keepMounted;
|
50
|
-
},
|
51
|
-
});
|
41
|
+
let presence = createPresence(
|
42
|
+
reflect(() => ({
|
43
|
+
...presenceStrategyProps,
|
44
|
+
present: hoverCard.open,
|
45
|
+
})),
|
46
|
+
);
|
52
47
|
|
53
48
|
setHoverCardContext(hoverCard);
|
54
49
|
setPresenceContext(presence);
|
package/dist/index.d.ts
CHANGED
@@ -12,6 +12,8 @@ export * from './editable/index.js';
|
|
12
12
|
export * from './environment-provider/index.js';
|
13
13
|
export * from './field/index.js';
|
14
14
|
export * from './file-upload/index.js';
|
15
|
+
export * from './floating-panel/index.js';
|
16
|
+
export * from './highlight/index.js';
|
15
17
|
export * from './hover-card/index.js';
|
16
18
|
export * from './locale-provider/index.js';
|
17
19
|
export * from './menu/index.js';
|
@@ -39,4 +41,5 @@ export * from './timer/index.js';
|
|
39
41
|
export * from './toast/index.js';
|
40
42
|
export * from './toggle-group/index.js';
|
41
43
|
export * from './tooltip/index.js';
|
44
|
+
export * from './tour/index.js';
|
42
45
|
export * from './tree-view/index.js';
|
package/dist/index.js
CHANGED
@@ -12,6 +12,8 @@ export * from './editable/index.js';
|
|
12
12
|
export * from './environment-provider/index.js';
|
13
13
|
export * from './field/index.js';
|
14
14
|
export * from './file-upload/index.js';
|
15
|
+
export * from './floating-panel/index.js';
|
16
|
+
export * from './highlight/index.js';
|
15
17
|
export * from './hover-card/index.js';
|
16
18
|
export * from './locale-provider/index.js';
|
17
19
|
export * from './menu/index.js';
|
@@ -39,4 +41,5 @@ export * from './timer/index.js';
|
|
39
41
|
export * from './toast/index.js';
|
40
42
|
export * from './toggle-group/index.js';
|
41
43
|
export * from './tooltip/index.js';
|
44
|
+
export * from './tour/index.js';
|
42
45
|
export * from './tree-view/index.js';
|
@@ -8,17 +8,19 @@
|
|
8
8
|
</script>
|
9
9
|
|
10
10
|
<script lang="ts">
|
11
|
-
import {isRTL
|
11
|
+
import {isRTL} from '@zag-js/i18n-utils';
|
12
12
|
import {setLocaleContext} from './context.svelte.js';
|
13
13
|
|
14
14
|
let {children, ...props}: LocaleProviderProps = $props();
|
15
15
|
|
16
|
-
|
17
|
-
locale
|
18
|
-
|
16
|
+
setLocaleContext({
|
17
|
+
get locale() {
|
18
|
+
return props.locale;
|
19
|
+
},
|
20
|
+
get dir() {
|
21
|
+
return isRTL(props.locale) ? 'rtl' : 'ltr';
|
22
|
+
},
|
19
23
|
});
|
20
|
-
|
21
|
-
setLocaleContext(() => locale);
|
22
24
|
</script>
|
23
25
|
|
24
26
|
{@render children()}
|
@@ -7,15 +7,14 @@ export function createMenu(props) {
|
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
|
-
const context =
|
10
|
+
const context = reflect(() => ({
|
11
11
|
...props,
|
12
12
|
id: props.id ?? id,
|
13
13
|
dir: locale?.dir,
|
14
14
|
open: props.defaultOpen ?? props.open,
|
15
15
|
getRootNode: environment?.getRootNode,
|
16
16
|
'open.controlled': props.open != null,
|
17
|
-
}))
|
17
|
+
}));
|
18
18
|
const [state, send] = useMachine(menu.machine(context), { context });
|
19
|
-
|
20
|
-
return api;
|
19
|
+
return reflect(() => menu.connect(state, send, normalizeProps));
|
21
20
|
}
|
package/dist/menu/item.svelte
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
let menu = getMenuContext();
|
17
17
|
|
18
|
-
let [itemProps,
|
18
|
+
let [itemProps, localProps] = $derived(
|
19
19
|
createSplitProps<ItemProps>([
|
20
20
|
'value',
|
21
21
|
'valueText',
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
let itemState = $derived(menu.getItemState(itemProps));
|
28
28
|
let mergedProps = $derived(
|
29
|
-
mergeProps(
|
29
|
+
mergeProps(localProps, menu.getItemProps(itemProps)),
|
30
30
|
);
|
31
31
|
</script>
|
32
32
|
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
let menu = getMenuContext();
|
23
23
|
|
24
|
-
let [itemProps,
|
24
|
+
let [itemProps, localProps] = $derived(
|
25
25
|
createSplitProps<OptionItemProps>([
|
26
26
|
'type',
|
27
27
|
'value',
|
@@ -36,7 +36,7 @@
|
|
36
36
|
let itemState = $derived(menu.getOptionItemState(itemProps));
|
37
37
|
|
38
38
|
let mergedProps = $derived(
|
39
|
-
mergeProps(
|
39
|
+
mergeProps(localProps, menu.getOptionItemProps(itemProps)),
|
40
40
|
);
|
41
41
|
|
42
42
|
setMenuOptionItemPropsContext(() => itemProps);
|
package/dist/menu/root.svelte
CHANGED
@@ -48,18 +48,12 @@
|
|
48
48
|
);
|
49
49
|
|
50
50
|
let menu = createMenu(reflect(() => menuProps));
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
},
|
56
|
-
|
57
|
-
return presenceStrategyProps.lazyMount;
|
58
|
-
},
|
59
|
-
get keepMounted() {
|
60
|
-
return presenceStrategyProps.keepMounted;
|
61
|
-
},
|
62
|
-
});
|
51
|
+
let presence = createPresence(
|
52
|
+
reflect(() => ({
|
53
|
+
...presenceStrategyProps,
|
54
|
+
present: menu.open,
|
55
|
+
})),
|
56
|
+
);
|
63
57
|
|
64
58
|
setMenuContext(menu);
|
65
59
|
setPresenceContext(presence);
|
package/dist/merge-props.js
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
import { mergeProps as fn } from '@zag-js/svelte';
|
2
|
-
|
3
|
-
return (Object.prototype.toString.call(value) === '[object Object]' &&
|
4
|
-
value === Object(value));
|
5
|
-
}
|
2
|
+
import { isObject } from './is-object.js';
|
6
3
|
export function mergeProps(...args) {
|
7
4
|
const r = fn(...args);
|
8
5
|
const i = 'style';
|