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
@@ -1,57 +1,57 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Action} from 'svelte/action';
|
3
|
-
import type {HtmlIngredientProps} from '../types.js';
|
4
|
-
|
5
|
-
export interface AccordionItemContentProps
|
6
|
-
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
-
</script>
|
8
|
-
|
9
|
-
<script lang="ts">
|
10
|
-
import {reflect} from '@zag-js/svelte';
|
11
|
-
import {getCollapsibleContext} from '../collapsible/collapsible-context.svelte.js';
|
12
|
-
import {mergeProps} from '../merge-props.js';
|
13
|
-
import {createPresence} from '../presence/create-presence.svelte.js';
|
14
|
-
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
15
|
-
import {
|
16
|
-
getAccordionContext,
|
17
|
-
getAccordionItemPropsContext,
|
18
|
-
} from './accordion-context.svelte.js';
|
19
|
-
|
20
|
-
let {
|
21
|
-
ref = $bindable(null),
|
22
|
-
asChild,
|
23
|
-
children,
|
24
|
-
...props
|
25
|
-
}: AccordionItemContentProps = $props();
|
26
|
-
|
27
|
-
let accordion = getAccordionContext();
|
28
|
-
let itemProps = getAccordionItemPropsContext();
|
29
|
-
let itemsState = $derived(accordion.getItemState(itemProps));
|
30
|
-
let collapsible = getCollapsibleContext();
|
31
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
32
|
-
let presence = createPresence(
|
33
|
-
reflect(() => ({
|
34
|
-
...presenceStrategyProps,
|
35
|
-
present: itemsState.expanded,
|
36
|
-
})),
|
37
|
-
);
|
38
|
-
|
39
|
-
let mergedProps = $derived(
|
40
|
-
mergeProps(
|
41
|
-
collapsible.getContentProps(),
|
42
|
-
accordion.getItemContentProps(itemProps),
|
43
|
-
presence.getPresenceProps(),
|
44
|
-
props,
|
45
|
-
),
|
46
|
-
);
|
47
|
-
</script>
|
48
|
-
|
49
|
-
{#if presence.mounted}
|
50
|
-
{#if asChild}
|
51
|
-
{@render asChild(presence.setReference, mergedProps)}
|
52
|
-
{:else}
|
53
|
-
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
54
|
-
{@render children?.()}
|
55
|
-
</div>
|
56
|
-
{/if}
|
57
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Action} from 'svelte/action';
|
3
|
+
import type {HtmlIngredientProps} from '../types.js';
|
4
|
+
|
5
|
+
export interface AccordionItemContentProps
|
6
|
+
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
+
</script>
|
8
|
+
|
9
|
+
<script lang="ts">
|
10
|
+
import {reflect} from '@zag-js/svelte';
|
11
|
+
import {getCollapsibleContext} from '../collapsible/collapsible-context.svelte.js';
|
12
|
+
import {mergeProps} from '../merge-props.js';
|
13
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
14
|
+
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
15
|
+
import {
|
16
|
+
getAccordionContext,
|
17
|
+
getAccordionItemPropsContext,
|
18
|
+
} from './accordion-context.svelte.js';
|
19
|
+
|
20
|
+
let {
|
21
|
+
ref = $bindable(null),
|
22
|
+
asChild,
|
23
|
+
children,
|
24
|
+
...props
|
25
|
+
}: AccordionItemContentProps = $props();
|
26
|
+
|
27
|
+
let accordion = getAccordionContext();
|
28
|
+
let itemProps = getAccordionItemPropsContext();
|
29
|
+
let itemsState = $derived(accordion.getItemState(itemProps));
|
30
|
+
let collapsible = getCollapsibleContext();
|
31
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
32
|
+
let presence = createPresence(
|
33
|
+
reflect(() => ({
|
34
|
+
...presenceStrategyProps,
|
35
|
+
present: itemsState.expanded,
|
36
|
+
})),
|
37
|
+
);
|
38
|
+
|
39
|
+
let mergedProps = $derived(
|
40
|
+
mergeProps(
|
41
|
+
collapsible.getContentProps(),
|
42
|
+
accordion.getItemContentProps(itemProps),
|
43
|
+
presence.getPresenceProps(),
|
44
|
+
props,
|
45
|
+
),
|
46
|
+
);
|
47
|
+
</script>
|
48
|
+
|
49
|
+
{#if presence.mounted}
|
50
|
+
{#if asChild}
|
51
|
+
{@render asChild(presence.setReference, mergedProps)}
|
52
|
+
{:else}
|
53
|
+
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
54
|
+
{@render children?.()}
|
55
|
+
</div>
|
56
|
+
{/if}
|
57
|
+
{/if}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as accordion from '@zag-js/accordion';
|
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 createAccordion(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { getDocument, getWindow } from '@zag-js/dom-query';
|
2
|
-
import { getEnvironmentContext } from '../environment-provider/
|
2
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
3
3
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
4
4
|
import { parts } from './alert-anatomy.js';
|
5
5
|
export function createAlert(props) {
|
@@ -1,49 +1,49 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Action} from 'svelte/action';
|
3
|
-
import type {HtmlIngredientProps} from '../types.js';
|
4
|
-
|
5
|
-
export interface AlertDialogBackdropProps
|
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 {getAlertDialogContext} from './alert-dialog-context.svelte.js';
|
15
|
-
|
16
|
-
let {
|
17
|
-
ref = $bindable(null),
|
18
|
-
asChild,
|
19
|
-
children,
|
20
|
-
...props
|
21
|
-
}: AlertDialogBackdropProps = $props();
|
22
|
-
|
23
|
-
let alertDialog = getAlertDialogContext();
|
24
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
25
|
-
let presence = createPresence(
|
26
|
-
reflect(() => ({
|
27
|
-
...presenceStrategyProps,
|
28
|
-
present: alertDialog.open,
|
29
|
-
})),
|
30
|
-
);
|
31
|
-
|
32
|
-
let mergedProps = $derived(
|
33
|
-
mergeProps(
|
34
|
-
alertDialog.getBackdropProps(),
|
35
|
-
presence.getPresenceProps(),
|
36
|
-
props,
|
37
|
-
),
|
38
|
-
);
|
39
|
-
</script>
|
40
|
-
|
41
|
-
{#if presence.mounted}
|
42
|
-
{#if asChild}
|
43
|
-
{@render asChild(presence.setReference, mergedProps)}
|
44
|
-
{:else}
|
45
|
-
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
46
|
-
{@render children?.()}
|
47
|
-
</div>
|
48
|
-
{/if}
|
49
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Action} from 'svelte/action';
|
3
|
+
import type {HtmlIngredientProps} from '../types.js';
|
4
|
+
|
5
|
+
export interface AlertDialogBackdropProps
|
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 {getAlertDialogContext} from './alert-dialog-context.svelte.js';
|
15
|
+
|
16
|
+
let {
|
17
|
+
ref = $bindable(null),
|
18
|
+
asChild,
|
19
|
+
children,
|
20
|
+
...props
|
21
|
+
}: AlertDialogBackdropProps = $props();
|
22
|
+
|
23
|
+
let alertDialog = getAlertDialogContext();
|
24
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
25
|
+
let presence = createPresence(
|
26
|
+
reflect(() => ({
|
27
|
+
...presenceStrategyProps,
|
28
|
+
present: alertDialog.open,
|
29
|
+
})),
|
30
|
+
);
|
31
|
+
|
32
|
+
let mergedProps = $derived(
|
33
|
+
mergeProps(
|
34
|
+
alertDialog.getBackdropProps(),
|
35
|
+
presence.getPresenceProps(),
|
36
|
+
props,
|
37
|
+
),
|
38
|
+
);
|
39
|
+
</script>
|
40
|
+
|
41
|
+
{#if presence.mounted}
|
42
|
+
{#if asChild}
|
43
|
+
{@render asChild(presence.setReference, mergedProps)}
|
44
|
+
{:else}
|
45
|
+
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
46
|
+
{@render children?.()}
|
47
|
+
</div>
|
48
|
+
{/if}
|
49
|
+
{/if}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as dialog from '@zag-js/dialog';
|
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 { mergeProps } from '../merge-props.js';
|
6
6
|
import { parts } from './alert-dialog-anatomy.js';
|
package/dist/anatomy.d.ts
CHANGED
@@ -22,6 +22,7 @@ export { anatomy as listboxAnatomy } from './listbox/listbox-anatomy.js';
|
|
22
22
|
export { anatomy as menuAnatomy } from './menu/menu-anatomy.js';
|
23
23
|
export { anatomy as numberInputAnatomy } from './number-input/number-input-anatomy.js';
|
24
24
|
export { anatomy as paginationAnatomy } from './pagination/pagination-anatomy.js';
|
25
|
+
export { anatomy as passwordInputAnatomy } from './password-input/password-input-anatomy.js';
|
25
26
|
export { anatomy as pinInputAnatomy } from './pin-input/pin-input-anatomy.js';
|
26
27
|
export { anatomy as popoverAnatomy } from './popover/popover-anatomy.js';
|
27
28
|
export { anatomy as progressAnatomy } from './progress/progress-anatomy.js';
|
@@ -45,4 +46,4 @@ export { anatomy as toggleAnatomy } from './toggle/toggle-anatomy.js';
|
|
45
46
|
export { anatomy as tooltipAnatomy } from './tooltip/tooltip-anatomy.js';
|
46
47
|
export { anatomy as tourAnatomy } from './tour/tour-anatomy.js';
|
47
48
|
export { anatomy as treeViewAnatomy } from './tree-view/tree-view-anatomy.js';
|
48
|
-
export
|
49
|
+
export { createAnatomy, type Anatomy, type AnatomyInstance, type AnatomyPart, type AnatomyPartName, } from '@zag-js/anatomy';
|
package/dist/anatomy.js
CHANGED
@@ -22,6 +22,7 @@ export { anatomy as listboxAnatomy } from './listbox/listbox-anatomy.js';
|
|
22
22
|
export { anatomy as menuAnatomy } from './menu/menu-anatomy.js';
|
23
23
|
export { anatomy as numberInputAnatomy } from './number-input/number-input-anatomy.js';
|
24
24
|
export { anatomy as paginationAnatomy } from './pagination/pagination-anatomy.js';
|
25
|
+
export { anatomy as passwordInputAnatomy } from './password-input/password-input-anatomy.js';
|
25
26
|
export { anatomy as pinInputAnatomy } from './pin-input/pin-input-anatomy.js';
|
26
27
|
export { anatomy as popoverAnatomy } from './popover/popover-anatomy.js';
|
27
28
|
export { anatomy as progressAnatomy } from './progress/progress-anatomy.js';
|
@@ -45,4 +46,4 @@ export { anatomy as toggleAnatomy } from './toggle/toggle-anatomy.js';
|
|
45
46
|
export { anatomy as tooltipAnatomy } from './tooltip/tooltip-anatomy.js';
|
46
47
|
export { anatomy as tourAnatomy } from './tour/tour-anatomy.js';
|
47
48
|
export { anatomy as treeViewAnatomy } from './tree-view/tree-view-anatomy.js';
|
48
|
-
export
|
49
|
+
export { createAnatomy, } from '@zag-js/anatomy';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as angleSlider from '@zag-js/angle-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 createAngleSlider(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as avatar from '@zag-js/avatar';
|
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 createAvatar(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as carousel from '@zag-js/carousel';
|
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 createCarousel(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as checkbox from '@zag-js/checkbox';
|
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 createCheckbox(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as clipboard from '@zag-js/clipboard';
|
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
|
export function createClipboard(props) {
|
5
5
|
const environment = getEnvironmentContext();
|
6
6
|
const service = useMachine(clipboard.machine, () => ({
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as collapsible from '@zag-js/collapsible';
|
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 createCollapsible(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as colorPicker from '@zag-js/color-picker';
|
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 './color-picker-anatomy.js';
|
6
6
|
export function createColorPicker(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as combobox from '@zag-js/combobox';
|
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 createCombobox(props) {
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { createFilter as zagCreateFilter, } from '@zag-js/i18n-utils';
|
2
|
+
import { getLocaleContext } from './locale-provider/locale-provider-context.svelte.js';
|
3
|
+
export function createFilter(props = {}) {
|
4
|
+
const locale = getLocaleContext();
|
5
|
+
const options = $derived({
|
6
|
+
...props,
|
7
|
+
locale: props.locale ?? locale?.locale,
|
8
|
+
});
|
9
|
+
return zagCreateFilter(options);
|
10
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as datePicker from '@zag-js/date-picker';
|
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 createDatePicker(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as dialog from '@zag-js/dialog';
|
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 createDialog(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,45 +1,45 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Action} from 'svelte/action';
|
3
|
-
import type {HtmlIngredientProps} from '../types.js';
|
4
|
-
|
5
|
-
export interface DialogBackdropProps
|
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 {getDialogContext} from './dialog-context.svelte.js';
|
15
|
-
|
16
|
-
let {
|
17
|
-
ref = $bindable(null),
|
18
|
-
asChild,
|
19
|
-
children,
|
20
|
-
...props
|
21
|
-
}: DialogBackdropProps = $props();
|
22
|
-
|
23
|
-
let dialog = getDialogContext();
|
24
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
25
|
-
let presence = createPresence(
|
26
|
-
reflect(() => ({
|
27
|
-
...presenceStrategyProps,
|
28
|
-
present: dialog.open,
|
29
|
-
})),
|
30
|
-
);
|
31
|
-
|
32
|
-
let mergedProps = $derived(
|
33
|
-
mergeProps(dialog.getBackdropProps(), presence.getPresenceProps(), props),
|
34
|
-
);
|
35
|
-
</script>
|
36
|
-
|
37
|
-
{#if presence.mounted}
|
38
|
-
{#if asChild}
|
39
|
-
{@render asChild(presence.setReference, mergedProps)}
|
40
|
-
{:else}
|
41
|
-
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
42
|
-
{@render children?.()}
|
43
|
-
</div>
|
44
|
-
{/if}
|
45
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Action} from 'svelte/action';
|
3
|
+
import type {HtmlIngredientProps} from '../types.js';
|
4
|
+
|
5
|
+
export interface DialogBackdropProps
|
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 {getDialogContext} from './dialog-context.svelte.js';
|
15
|
+
|
16
|
+
let {
|
17
|
+
ref = $bindable(null),
|
18
|
+
asChild,
|
19
|
+
children,
|
20
|
+
...props
|
21
|
+
}: DialogBackdropProps = $props();
|
22
|
+
|
23
|
+
let dialog = getDialogContext();
|
24
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
25
|
+
let presence = createPresence(
|
26
|
+
reflect(() => ({
|
27
|
+
...presenceStrategyProps,
|
28
|
+
present: dialog.open,
|
29
|
+
})),
|
30
|
+
);
|
31
|
+
|
32
|
+
let mergedProps = $derived(
|
33
|
+
mergeProps(dialog.getBackdropProps(), presence.getPresenceProps(), props),
|
34
|
+
);
|
35
|
+
</script>
|
36
|
+
|
37
|
+
{#if presence.mounted}
|
38
|
+
{#if asChild}
|
39
|
+
{@render asChild(presence.setReference, mergedProps)}
|
40
|
+
{:else}
|
41
|
+
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
42
|
+
{@render children?.()}
|
43
|
+
</div>
|
44
|
+
{/if}
|
45
|
+
{/if}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as dialog from '@zag-js/dialog';
|
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 './drawer-anatomy.js';
|
6
6
|
export function createDrawer(props) {
|
@@ -1,45 +1,45 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Action} from 'svelte/action';
|
3
|
-
import type {HtmlIngredientProps} from '../types.js';
|
4
|
-
|
5
|
-
export interface DrawerBackdropProps
|
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 {getDrawerContext} from './drawer-context.svelte.js';
|
15
|
-
|
16
|
-
let {
|
17
|
-
ref = $bindable(null),
|
18
|
-
asChild,
|
19
|
-
children,
|
20
|
-
...props
|
21
|
-
}: DrawerBackdropProps = $props();
|
22
|
-
|
23
|
-
let drawer = getDrawerContext();
|
24
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
25
|
-
let presence = createPresence(
|
26
|
-
reflect(() => ({
|
27
|
-
...presenceStrategyProps,
|
28
|
-
present: drawer.open,
|
29
|
-
})),
|
30
|
-
);
|
31
|
-
|
32
|
-
let mergedProps = $derived(
|
33
|
-
mergeProps(drawer.getBackdropProps(), presence.getPresenceProps(), props),
|
34
|
-
);
|
35
|
-
</script>
|
36
|
-
|
37
|
-
{#if presence.mounted}
|
38
|
-
{#if asChild}
|
39
|
-
{@render asChild(presence.setReference, mergedProps)}
|
40
|
-
{:else}
|
41
|
-
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
42
|
-
{@render children?.()}
|
43
|
-
</div>
|
44
|
-
{/if}
|
45
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Action} from 'svelte/action';
|
3
|
+
import type {HtmlIngredientProps} from '../types.js';
|
4
|
+
|
5
|
+
export interface DrawerBackdropProps
|
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 {getDrawerContext} from './drawer-context.svelte.js';
|
15
|
+
|
16
|
+
let {
|
17
|
+
ref = $bindable(null),
|
18
|
+
asChild,
|
19
|
+
children,
|
20
|
+
...props
|
21
|
+
}: DrawerBackdropProps = $props();
|
22
|
+
|
23
|
+
let drawer = getDrawerContext();
|
24
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
25
|
+
let presence = createPresence(
|
26
|
+
reflect(() => ({
|
27
|
+
...presenceStrategyProps,
|
28
|
+
present: drawer.open,
|
29
|
+
})),
|
30
|
+
);
|
31
|
+
|
32
|
+
let mergedProps = $derived(
|
33
|
+
mergeProps(drawer.getBackdropProps(), presence.getPresenceProps(), props),
|
34
|
+
);
|
35
|
+
</script>
|
36
|
+
|
37
|
+
{#if presence.mounted}
|
38
|
+
{#if asChild}
|
39
|
+
{@render asChild(presence.setReference, mergedProps)}
|
40
|
+
{:else}
|
41
|
+
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
42
|
+
{@render children?.()}
|
43
|
+
</div>
|
44
|
+
{/if}
|
45
|
+
{/if}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as editable from '@zag-js/editable';
|
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 createEditable(props) {
|