ui-ingredients 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/accordion-item-content.svelte +57 -57
- package/dist/accordion/create-accordion.svelte.js +1 -1
- package/dist/alert/create-alert.svelte.js +1 -1
- package/dist/alert-dialog/alert-dialog-backdrop.svelte +49 -49
- package/dist/alert-dialog/create-alert-dialog.svelte.js +1 -1
- package/dist/anatomy.d.ts +2 -1
- package/dist/anatomy.js +2 -1
- package/dist/angle-slider/create-angle-slider.svelte.js +1 -1
- package/dist/avatar/create-avatar.svelte.js +1 -1
- package/dist/carousel/create-carousel.svelte.js +1 -1
- package/dist/checkbox/create-checkbox.svelte.js +1 -1
- package/dist/clipboard/create-clipboard.svelte.js +1 -1
- package/dist/collapsible/create-collapsible.svelte.js +1 -1
- package/dist/color-picker/create-color-picker.svelte.js +1 -1
- package/dist/combobox/create-combobox.svelte.js +1 -1
- package/dist/create-filter.svelte.d.ts +4 -0
- package/dist/create-filter.svelte.js +10 -0
- package/dist/date-picker/create-date-picker.svelte.js +1 -1
- package/dist/dialog/create-dialog.svelte.js +1 -1
- package/dist/dialog/dialog-backdrop.svelte +45 -45
- package/dist/drawer/create-drawer.svelte.js +1 -1
- package/dist/drawer/drawer-backdrop.svelte +45 -45
- package/dist/editable/create-editable.svelte.js +1 -1
- package/dist/environment-provider/environment-provider.svelte +41 -41
- package/dist/environment-provider/index.d.ts +1 -1
- package/dist/environment-provider/index.js +1 -1
- package/dist/field/create-field.svelte.js +1 -1
- package/dist/field/field-error-text.svelte +49 -49
- package/dist/file-upload/create-file-upload.svelte.js +1 -1
- package/dist/floating-panel/create-floating-panel.svelte.js +1 -1
- package/dist/focus-trap/focus-trap.svelte +1 -1
- package/dist/hover-card/create-hover-card.svelte.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/listbox/create-listbox.svelte.js +1 -1
- package/dist/locale-provider/locale-provider.svelte +22 -22
- package/dist/menu/create-menu.svelte.js +1 -1
- package/dist/number-input/create-number-input.svelte.js +1 -1
- package/dist/pagination/create-pagination.svelte.js +1 -1
- package/dist/password-input/create-password-input.svelte.d.ts +6 -0
- package/dist/password-input/create-password-input.svelte.js +35 -0
- package/dist/password-input/index.d.ts +10 -0
- package/dist/password-input/index.js +4 -0
- package/dist/password-input/password-input-anatomy.d.ts +1 -0
- package/dist/password-input/password-input-anatomy.js +1 -0
- package/dist/password-input/password-input-context.svelte.d.ts +2 -0
- package/dist/password-input/password-input-context.svelte.js +2 -0
- package/dist/password-input/password-input-control.svelte +31 -0
- package/dist/password-input/password-input-control.svelte.d.ts +6 -0
- package/dist/password-input/password-input-indicator.svelte +31 -0
- package/dist/password-input/password-input-indicator.svelte.d.ts +6 -0
- package/dist/password-input/password-input-input.svelte +26 -0
- package/dist/password-input/password-input-input.svelte.d.ts +6 -0
- package/dist/password-input/password-input-label.svelte +29 -0
- package/dist/password-input/password-input-label.svelte.d.ts +6 -0
- package/dist/password-input/password-input-root.svelte +66 -0
- package/dist/password-input/password-input-root.svelte.d.ts +7 -0
- package/dist/password-input/password-input-visibility-trigger.svelte +31 -0
- package/dist/password-input/password-input-visibility-trigger.svelte.d.ts +6 -0
- package/dist/password-input/password-input.d.ts +6 -0
- package/dist/password-input/password-input.js +6 -0
- package/dist/pin-input/create-pin-input.svelte.js +1 -1
- package/dist/popover/create-popover.svelte.js +1 -1
- package/dist/presence/create-presence.svelte.js +11 -11
- package/dist/progress/create-progress.svelte.js +1 -1
- package/dist/qr-code/create-qr-code.svelte.js +1 -1
- package/dist/radio-group/create-radio-group.svelte.js +1 -1
- package/dist/rating-group/create-rating-group.svelte.js +1 -1
- package/dist/segment-group/create-segment-group.svelte.js +1 -1
- package/dist/select/create-select.svelte.js +1 -1
- package/dist/signature-pad/create-signature-pad.svelte.js +1 -1
- package/dist/slider/create-slider.svelte.js +1 -1
- package/dist/splitter/create-splitter.svelte.js +1 -1
- package/dist/steps/create-steps.svelte.js +1 -1
- package/dist/steps/steps-completed-content.svelte +50 -50
- package/dist/steps/steps-content.svelte +54 -54
- package/dist/switch/create-switch.svelte.js +1 -1
- package/dist/tabs/create-tabs.svelte.js +1 -1
- package/dist/tags-input/create-tags-input.svelte.js +1 -1
- package/dist/time-picker/create-time-picker.svelte.js +1 -1
- package/dist/timer/create-timer.svelte.js +1 -1
- package/dist/toast/toaster.svelte +1 -1
- package/dist/toggle-group/create-toggle-group.svelte.js +1 -1
- package/dist/tooltip/create-tooltip.svelte.js +1 -1
- package/dist/tour/create-tour.svelte.js +1 -1
- package/dist/tour/tour-backdrop.svelte +44 -44
- package/dist/tree-view/create-tree-view.svelte.js +1 -1
- package/dist/tree-view/tree-view-branch-content.svelte +57 -57
- package/dist/tree-view/tree-view-root.svelte +2 -0
- package/package.json +65 -59
- /package/dist/environment-provider/{enviroment-provider-context.svelte.d.ts → environment-provider-context.svelte.d.ts} +0 -0
- /package/dist/environment-provider/{enviroment-provider-context.svelte.js → environment-provider-context.svelte.js} +0 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps, Optional} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreatePasswordInputProps,
|
5
|
+
CreatePasswordInputReturn,
|
6
|
+
} from './create-password-input.svelte.js';
|
7
|
+
|
8
|
+
export interface PasswordInputProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreatePasswordInputReturn>,
|
11
|
+
Optional<CreatePasswordInputProps, 'id'>
|
12
|
+
> {}
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script lang="ts">
|
16
|
+
import {reflect} from '@zag-js/svelte';
|
17
|
+
import {createSplitProps} from '../create-split-props.js';
|
18
|
+
import {mergeProps} from '../merge-props.js';
|
19
|
+
import {createPasswordInputContext} from './create-password-input.svelte.js';
|
20
|
+
import {setPasswordInputContext} from './password-input-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
id,
|
24
|
+
ref = $bindable(null),
|
25
|
+
asChild,
|
26
|
+
children,
|
27
|
+
...props
|
28
|
+
}: PasswordInputProps = $props();
|
29
|
+
|
30
|
+
let uid = $props.id();
|
31
|
+
|
32
|
+
let [createPasswordInputProps, localProps] = $derived(
|
33
|
+
createSplitProps<Omit<CreatePasswordInputProps, 'id'>>([
|
34
|
+
'autoComplete',
|
35
|
+
'defaultVisible',
|
36
|
+
'disabled',
|
37
|
+
'ids',
|
38
|
+
'ignorePasswordManagers',
|
39
|
+
'invalid',
|
40
|
+
'name',
|
41
|
+
'onVisibilityChange',
|
42
|
+
'readOnly',
|
43
|
+
'required',
|
44
|
+
'translations',
|
45
|
+
'visible',
|
46
|
+
])(props),
|
47
|
+
);
|
48
|
+
|
49
|
+
let PasswordInput = createPasswordInputContext(
|
50
|
+
reflect(() => ({...createPasswordInputProps, id: id ?? uid})),
|
51
|
+
);
|
52
|
+
|
53
|
+
let mergedProps = $derived(
|
54
|
+
mergeProps(PasswordInput.getRootProps(), localProps),
|
55
|
+
);
|
56
|
+
|
57
|
+
setPasswordInputContext(PasswordInput);
|
58
|
+
</script>
|
59
|
+
|
60
|
+
{#if asChild}
|
61
|
+
{@render asChild(mergedProps, PasswordInput)}
|
62
|
+
{:else}
|
63
|
+
<div bind:this={ref} {...mergedProps}>
|
64
|
+
{@render children?.(PasswordInput)}
|
65
|
+
</div>
|
66
|
+
{/if}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { Assign, HtmlIngredientProps, Optional } from '../types.js';
|
2
|
+
import type { CreatePasswordInputProps, CreatePasswordInputReturn } from './create-password-input.svelte.js';
|
3
|
+
export interface PasswordInputProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreatePasswordInputReturn>, Optional<CreatePasswordInputProps, 'id'>> {
|
4
|
+
}
|
5
|
+
declare const PasswordInputRoot: import("svelte").Component<PasswordInputProps, {}, "ref">;
|
6
|
+
type PasswordInputRoot = ReturnType<typeof PasswordInputRoot>;
|
7
|
+
export default PasswordInputRoot;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface PasswordInputVisibilityTriggerProps
|
5
|
+
extends HtmlIngredientProps<'button', HTMLButtonElement> {}
|
6
|
+
</script>
|
7
|
+
|
8
|
+
<script lang="ts">
|
9
|
+
import {mergeProps} from '../merge-props.js';
|
10
|
+
import {getPasswordInputContext} from './password-input-context.svelte.js';
|
11
|
+
|
12
|
+
let {
|
13
|
+
ref = $bindable(null),
|
14
|
+
asChild,
|
15
|
+
children,
|
16
|
+
...props
|
17
|
+
}: PasswordInputVisibilityTriggerProps = $props();
|
18
|
+
|
19
|
+
let passwordInput = getPasswordInputContext();
|
20
|
+
let mergedProps = $derived(
|
21
|
+
mergeProps(passwordInput.getVisibilityTriggerProps(), props),
|
22
|
+
);
|
23
|
+
</script>
|
24
|
+
|
25
|
+
{#if asChild}
|
26
|
+
{@render asChild(mergedProps)}
|
27
|
+
{:else}
|
28
|
+
<button bind:this={ref} {...mergedProps}>
|
29
|
+
{@render children?.()}
|
30
|
+
</button>
|
31
|
+
{/if}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { HtmlIngredientProps } from '../types.js';
|
2
|
+
export interface PasswordInputVisibilityTriggerProps extends HtmlIngredientProps<'button', HTMLButtonElement> {
|
3
|
+
}
|
4
|
+
declare const PasswordInputVisibilityTrigger: import("svelte").Component<PasswordInputVisibilityTriggerProps, {}, "ref">;
|
5
|
+
type PasswordInputVisibilityTrigger = ReturnType<typeof PasswordInputVisibilityTrigger>;
|
6
|
+
export default PasswordInputVisibilityTrigger;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export { default as Control } from './password-input-control.svelte';
|
2
|
+
export { default as Indicator } from './password-input-indicator.svelte';
|
3
|
+
export { default as Input } from './password-input-input.svelte';
|
4
|
+
export { default as Label } from './password-input-label.svelte';
|
5
|
+
export { default as Root } from './password-input-root.svelte';
|
6
|
+
export { default as VisibilityTrigger } from './password-input-visibility-trigger.svelte';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export { default as Control } from './password-input-control.svelte';
|
2
|
+
export { default as Indicator } from './password-input-indicator.svelte';
|
3
|
+
export { default as Input } from './password-input-input.svelte';
|
4
|
+
export { default as Label } from './password-input-label.svelte';
|
5
|
+
export { default as Root } from './password-input-root.svelte';
|
6
|
+
export { default as VisibilityTrigger } from './password-input-visibility-trigger.svelte';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as pinInput from '@zag-js/pin-input';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getFieldContext } from '../field/field-context.svelte.js';
|
5
5
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
6
6
|
export function createPinInputContext(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as popover from '@zag-js/popover';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createPopover(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import * as presence from '@zag-js/presence';
|
2
2
|
import { normalizeProps, useMachine } from '@zag-js/svelte';
|
3
3
|
export function createPresence(props) {
|
4
|
-
const service = useMachine(presence.machine,
|
4
|
+
const service = useMachine(presence.machine, () => ({
|
5
|
+
present: props.present,
|
6
|
+
immediate: props.immediate,
|
7
|
+
onExitComplete: props.onExitComplete,
|
8
|
+
}));
|
5
9
|
const api = $derived(presence.connect(service, normalizeProps));
|
6
10
|
function getPresenceProps() {
|
7
11
|
return {
|
@@ -10,19 +14,15 @@ export function createPresence(props) {
|
|
10
14
|
};
|
11
15
|
}
|
12
16
|
let wasPresent = $state(false);
|
13
|
-
$effect(() => {
|
14
|
-
if (
|
15
|
-
|
16
|
-
|
17
|
-
return;
|
18
|
-
wasPresent = true;
|
17
|
+
$effect.pre(() => {
|
18
|
+
if (api.present) {
|
19
|
+
wasPresent = true;
|
20
|
+
}
|
19
21
|
});
|
20
22
|
const unmounted = $derived.by(() => {
|
21
|
-
if (api.present)
|
22
|
-
return false;
|
23
|
-
if (!wasPresent && props.lazyMount)
|
23
|
+
if (!api.present && !wasPresent && props.lazyMount)
|
24
24
|
return true;
|
25
|
-
if (
|
25
|
+
if (!props.keepMounted && !api.present && wasPresent)
|
26
26
|
return true;
|
27
27
|
return false;
|
28
28
|
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as progress from '@zag-js/progress';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createProgress(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as qrCode from '@zag-js/qr-code';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createQRCode(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as radioGroup from '@zag-js/radio-group';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createRadioGroup(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as ratingGroup from '@zag-js/rating-group';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getFieldContext } from '../field/field-context.svelte.js';
|
5
5
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
6
6
|
export function createRatingGroup(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as segmentGroup from '@zag-js/radio-group';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
import { parts } from './segment-group-anatomy.js';
|
6
6
|
export function createSegmentGroup(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as select from '@zag-js/select';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getFieldContext } from '../field/field-context.svelte.js';
|
5
5
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
6
6
|
export function createSelect(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as signaturePad from '@zag-js/signature-pad';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createSignaturePad(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as slider from '@zag-js/slider';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createSlider(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as splitter from '@zag-js/splitter';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createSplitter(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as steps from '@zag-js/steps';
|
2
2
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createSteps(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,50 +1,50 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Action} from 'svelte/action';
|
3
|
-
import type {HtmlIngredientProps} from '../types.js';
|
4
|
-
|
5
|
-
export interface StepsCompletedContentProps
|
6
|
-
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
-
</script>
|
8
|
-
|
9
|
-
<script lang="ts">
|
10
|
-
import {reflect} from '@zag-js/svelte';
|
11
|
-
import {mergeProps} from '../merge-props.js';
|
12
|
-
import {createPresence} from '../presence/create-presence.svelte.js';
|
13
|
-
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
14
|
-
import {getStepsContext} from './steps-context.svelte.js';
|
15
|
-
|
16
|
-
let {
|
17
|
-
ref = $bindable(null),
|
18
|
-
asChild,
|
19
|
-
children,
|
20
|
-
...props
|
21
|
-
}: StepsCompletedContentProps = $props();
|
22
|
-
|
23
|
-
let steps = getStepsContext();
|
24
|
-
let index = $derived(steps.count);
|
25
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
26
|
-
let presence = createPresence(
|
27
|
-
reflect(() => ({
|
28
|
-
...presenceStrategyProps,
|
29
|
-
present: steps.value === index,
|
30
|
-
})),
|
31
|
-
);
|
32
|
-
|
33
|
-
let mergedProps = $derived(
|
34
|
-
mergeProps(
|
35
|
-
steps.getContentProps({index}),
|
36
|
-
presence.getPresenceProps(),
|
37
|
-
props,
|
38
|
-
),
|
39
|
-
);
|
40
|
-
</script>
|
41
|
-
|
42
|
-
{#if presence.mounted}
|
43
|
-
{#if asChild}
|
44
|
-
{@render asChild(presence.setReference, mergedProps)}
|
45
|
-
{:else}
|
46
|
-
<div use:presence.setReference bind:this={ref} {...mergedProps}>
|
47
|
-
{@render children?.()}
|
48
|
-
</div>
|
49
|
-
{/if}
|
50
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Action} from 'svelte/action';
|
3
|
+
import type {HtmlIngredientProps} from '../types.js';
|
4
|
+
|
5
|
+
export interface StepsCompletedContentProps
|
6
|
+
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
+
</script>
|
8
|
+
|
9
|
+
<script lang="ts">
|
10
|
+
import {reflect} from '@zag-js/svelte';
|
11
|
+
import {mergeProps} from '../merge-props.js';
|
12
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
13
|
+
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
14
|
+
import {getStepsContext} from './steps-context.svelte.js';
|
15
|
+
|
16
|
+
let {
|
17
|
+
ref = $bindable(null),
|
18
|
+
asChild,
|
19
|
+
children,
|
20
|
+
...props
|
21
|
+
}: StepsCompletedContentProps = $props();
|
22
|
+
|
23
|
+
let steps = getStepsContext();
|
24
|
+
let index = $derived(steps.count);
|
25
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
26
|
+
let presence = createPresence(
|
27
|
+
reflect(() => ({
|
28
|
+
...presenceStrategyProps,
|
29
|
+
present: steps.value === index,
|
30
|
+
})),
|
31
|
+
);
|
32
|
+
|
33
|
+
let mergedProps = $derived(
|
34
|
+
mergeProps(
|
35
|
+
steps.getContentProps({index}),
|
36
|
+
presence.getPresenceProps(),
|
37
|
+
props,
|
38
|
+
),
|
39
|
+
);
|
40
|
+
</script>
|
41
|
+
|
42
|
+
{#if presence.mounted}
|
43
|
+
{#if asChild}
|
44
|
+
{@render asChild(presence.setReference, mergedProps)}
|
45
|
+
{:else}
|
46
|
+
<div use:presence.setReference bind:this={ref} {...mergedProps}>
|
47
|
+
{@render children?.()}
|
48
|
+
</div>
|
49
|
+
{/if}
|
50
|
+
{/if}
|
@@ -1,54 +1,54 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {ItemProps} from '@zag-js/steps';
|
3
|
-
import type {Action} from 'svelte/action';
|
4
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
5
|
-
|
6
|
-
export interface StepsContentProps
|
7
|
-
extends Assign<
|
8
|
-
HtmlIngredientProps<'div', HTMLDivElement, never, Action>,
|
9
|
-
ItemProps
|
10
|
-
> {}
|
11
|
-
</script>
|
12
|
-
|
13
|
-
<script lang="ts">
|
14
|
-
import {reflect} from '@zag-js/svelte';
|
15
|
-
import {mergeProps} from '../merge-props.js';
|
16
|
-
import {createPresence} from '../presence/create-presence.svelte.js';
|
17
|
-
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
18
|
-
import {getStepsContext} from './steps-context.svelte.js';
|
19
|
-
|
20
|
-
let {
|
21
|
-
ref = $bindable(null),
|
22
|
-
index,
|
23
|
-
asChild,
|
24
|
-
children,
|
25
|
-
...props
|
26
|
-
}: StepsContentProps = $props();
|
27
|
-
|
28
|
-
let steps = getStepsContext();
|
29
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
30
|
-
let presence = createPresence(
|
31
|
-
reflect(() => ({
|
32
|
-
...presenceStrategyProps,
|
33
|
-
present: steps.value === index,
|
34
|
-
})),
|
35
|
-
);
|
36
|
-
|
37
|
-
let mergedProps = $derived(
|
38
|
-
mergeProps(
|
39
|
-
steps.getContentProps({index}),
|
40
|
-
presence.getPresenceProps(),
|
41
|
-
props,
|
42
|
-
),
|
43
|
-
);
|
44
|
-
</script>
|
45
|
-
|
46
|
-
{#if presence.mounted}
|
47
|
-
{#if asChild}
|
48
|
-
{@render asChild(presence.setReference, mergedProps)}
|
49
|
-
{:else}
|
50
|
-
<div use:presence.setReference bind:this={ref} {...mergedProps}>
|
51
|
-
{@render children?.()}
|
52
|
-
</div>
|
53
|
-
{/if}
|
54
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {ItemProps} from '@zag-js/steps';
|
3
|
+
import type {Action} from 'svelte/action';
|
4
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
5
|
+
|
6
|
+
export interface StepsContentProps
|
7
|
+
extends Assign<
|
8
|
+
HtmlIngredientProps<'div', HTMLDivElement, never, Action>,
|
9
|
+
ItemProps
|
10
|
+
> {}
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script lang="ts">
|
14
|
+
import {reflect} from '@zag-js/svelte';
|
15
|
+
import {mergeProps} from '../merge-props.js';
|
16
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
17
|
+
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
18
|
+
import {getStepsContext} from './steps-context.svelte.js';
|
19
|
+
|
20
|
+
let {
|
21
|
+
ref = $bindable(null),
|
22
|
+
index,
|
23
|
+
asChild,
|
24
|
+
children,
|
25
|
+
...props
|
26
|
+
}: StepsContentProps = $props();
|
27
|
+
|
28
|
+
let steps = getStepsContext();
|
29
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
30
|
+
let presence = createPresence(
|
31
|
+
reflect(() => ({
|
32
|
+
...presenceStrategyProps,
|
33
|
+
present: steps.value === index,
|
34
|
+
})),
|
35
|
+
);
|
36
|
+
|
37
|
+
let mergedProps = $derived(
|
38
|
+
mergeProps(
|
39
|
+
steps.getContentProps({index}),
|
40
|
+
presence.getPresenceProps(),
|
41
|
+
props,
|
42
|
+
),
|
43
|
+
);
|
44
|
+
</script>
|
45
|
+
|
46
|
+
{#if presence.mounted}
|
47
|
+
{#if asChild}
|
48
|
+
{@render asChild(presence.setReference, mergedProps)}
|
49
|
+
{:else}
|
50
|
+
<div use:presence.setReference bind:this={ref} {...mergedProps}>
|
51
|
+
{@render children?.()}
|
52
|
+
</div>
|
53
|
+
{/if}
|
54
|
+
{/if}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as switch_ from '@zag-js/switch';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getFieldContext } from '../field/field-context.svelte.js';
|
5
5
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
6
6
|
export function createSwitch(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as tabs from '@zag-js/tabs';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createTabs(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as tagsInput from '@zag-js/tags-input';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getFieldContext } from '../field/field-context.svelte.js';
|
5
5
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
6
6
|
export function createTagsInput(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as timePicker from '@zag-js/time-picker';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createTimePicker(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as timer from '@zag-js/timer';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
export function createTimer(props) {
|
5
5
|
const environment = getEnvironmentContext();
|
6
6
|
const service = useMachine(timer.machine, () => ({
|
@@ -10,7 +10,7 @@
|
|
10
10
|
import {normalizeProps, portal, reflect, useMachine} from '@zag-js/svelte';
|
11
11
|
import * as toast from '@zag-js/toast';
|
12
12
|
import type {Snippet} from 'svelte';
|
13
|
-
import {getEnvironmentContext} from '../environment-provider/
|
13
|
+
import {getEnvironmentContext} from '../environment-provider/environment-provider-context.svelte.js';
|
14
14
|
import {getLocaleContext} from '../locale-provider/locale-provider-context.svelte.js';
|
15
15
|
import {getPortalProviderPropsContext} from '../portal/portal-context.svelte.js';
|
16
16
|
import ToastProvider from './toast-provider.svelte';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as toggleGroup from '@zag-js/toggle-group';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createToggleGroup(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as tooltip from '@zag-js/tooltip';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
export function createTooltip(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
2
|
import * as tour from '@zag-js/tour';
|
3
|
-
import { getEnvironmentContext } from '../environment-provider/
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
4
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
5
5
|
import { parts } from './tour-anatomy.js';
|
6
6
|
export function createTour(props) {
|