ui-ingredients 1.6.0 → 1.8.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/create-accordion.svelte.js +1 -1
- package/dist/alert/create-alert.svelte.js +1 -1
- package/dist/alert-dialog/create-alert-dialog.svelte.js +1 -1
- package/dist/anatomy.d.ts +1 -0
- package/dist/anatomy.js +1 -0
- 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/date-picker/create-date-picker.svelte.js +1 -1
- package/dist/dialog/create-dialog.svelte.js +1 -1
- package/dist/drawer/create-drawer.svelte.js +1 -1
- 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/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 +1 -0
- package/dist/index.js +1 -0
- package/dist/listbox/create-listbox.svelte.js +1 -1
- 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/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/tree-view/create-tree-view.svelte.js +1 -1
- package/dist/tree-view/tree-view-root.svelte +2 -0
- package/package.json +69 -63
- /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,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,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';
|
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';
|
@@ -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) {
|
@@ -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,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,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) {
|
@@ -1,41 +1,41 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Snippet} from 'svelte';
|
3
|
-
|
4
|
-
export interface EnvironmentProviderProps {
|
5
|
-
rootNode?:
|
6
|
-
| ShadowRoot
|
7
|
-
| Document
|
8
|
-
| Node
|
9
|
-
| (() => ShadowRoot | Document | Node);
|
10
|
-
children: Snippet;
|
11
|
-
}
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script lang="ts">
|
15
|
-
import {getDocument, getWindow} from '@zag-js/dom-query';
|
16
|
-
import {setEnvironmentContext} from './
|
17
|
-
|
18
|
-
let {rootNode, children}: EnvironmentProviderProps = $props();
|
19
|
-
|
20
|
-
let elem: HTMLSpanElement | null = $state(null);
|
21
|
-
|
22
|
-
function getRootNode() {
|
23
|
-
if (rootNode) {
|
24
|
-
return typeof rootNode === 'function' ? rootNode() : rootNode;
|
25
|
-
} else {
|
26
|
-
return elem?.ownerDocument ?? document;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
setEnvironmentContext({
|
31
|
-
getRootNode,
|
32
|
-
getDocument: () => getDocument(getRootNode()),
|
33
|
-
getWindow: () => getWindow(getRootNode()),
|
34
|
-
});
|
35
|
-
</script>
|
36
|
-
|
37
|
-
{@render children()}
|
38
|
-
|
39
|
-
{#if !rootNode}
|
40
|
-
<span bind:this={elem} hidden></span>
|
41
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Snippet} from 'svelte';
|
3
|
+
|
4
|
+
export interface EnvironmentProviderProps {
|
5
|
+
rootNode?:
|
6
|
+
| ShadowRoot
|
7
|
+
| Document
|
8
|
+
| Node
|
9
|
+
| (() => ShadowRoot | Document | Node);
|
10
|
+
children: Snippet;
|
11
|
+
}
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script lang="ts">
|
15
|
+
import {getDocument, getWindow} from '@zag-js/dom-query';
|
16
|
+
import {setEnvironmentContext} from './environment-provider-context.svelte.js';
|
17
|
+
|
18
|
+
let {rootNode, children}: EnvironmentProviderProps = $props();
|
19
|
+
|
20
|
+
let elem: HTMLSpanElement | null = $state(null);
|
21
|
+
|
22
|
+
function getRootNode() {
|
23
|
+
if (rootNode) {
|
24
|
+
return typeof rootNode === 'function' ? rootNode() : rootNode;
|
25
|
+
} else {
|
26
|
+
return elem?.ownerDocument ?? document;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
setEnvironmentContext({
|
31
|
+
getRootNode,
|
32
|
+
getDocument: () => getDocument(getRootNode()),
|
33
|
+
getWindow: () => getWindow(getRootNode()),
|
34
|
+
});
|
35
|
+
</script>
|
36
|
+
|
37
|
+
{@render children()}
|
38
|
+
|
39
|
+
{#if !rootNode}
|
40
|
+
<span bind:this={elem} hidden></span>
|
41
|
+
{/if}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { getEnvironmentContext, setEnvironmentContext, type Environment, } from './
|
1
|
+
export { getEnvironmentContext, setEnvironmentContext, type Environment, } from './environment-provider-context.svelte.js';
|
2
2
|
export { default as EnvironmentProvider, type EnvironmentProviderProps, } from './environment-provider.svelte';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { getEnvironmentContext, setEnvironmentContext, } from './
|
1
|
+
export { getEnvironmentContext, setEnvironmentContext, } from './environment-provider-context.svelte.js';
|
2
2
|
export { default as EnvironmentProvider, } from './environment-provider.svelte';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
2
2
|
import { ariaAttr, dataAttr, getDocument, getWindow } from '@zag-js/dom-query';
|
3
3
|
import { reflect } from '@zag-js/svelte';
|
4
|
-
import { getEnvironmentContext } from '../environment-provider/
|
4
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
5
5
|
import { parts } from './field-anatomy.js';
|
6
6
|
export function createField(props) {
|
7
7
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as fileUpload from '@zag-js/file-upload';
|
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 createFileUpload(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as floatingPanel from '@zag-js/floating-panel';
|
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 createFloatingPanel(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
<script lang="ts">
|
39
39
|
import {browser} from '$app/environment';
|
40
|
-
import {getEnvironmentContext} from '../environment-provider/
|
40
|
+
import {getEnvironmentContext} from '../environment-provider/environment-provider-context.svelte.js';
|
41
41
|
import type {Action, ActionReturn} from 'svelte/action';
|
42
42
|
import {createSplitProps} from '../create-split-props.js';
|
43
43
|
import type {Assign, HtmlIngredientProps} from '../types.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as hoverCard from '@zag-js/hover-card';
|
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 createHoverCard(props) {
|
6
6
|
const locale = getLocaleContext();
|
package/dist/index.d.ts
CHANGED
@@ -26,6 +26,7 @@ export * from './locale-provider/index.js';
|
|
26
26
|
export * from './menu/index.js';
|
27
27
|
export * from './number-input/index.js';
|
28
28
|
export * from './pagination/index.js';
|
29
|
+
export * from './password-input/index.js';
|
29
30
|
export * from './pin-input/index.js';
|
30
31
|
export * from './popover/index.js';
|
31
32
|
export * from './portal/index.js';
|
package/dist/index.js
CHANGED
@@ -26,6 +26,7 @@ export * from './locale-provider/index.js';
|
|
26
26
|
export * from './menu/index.js';
|
27
27
|
export * from './number-input/index.js';
|
28
28
|
export * from './pagination/index.js';
|
29
|
+
export * from './password-input/index.js';
|
29
30
|
export * from './pin-input/index.js';
|
30
31
|
export * from './popover/index.js';
|
31
32
|
export * from './portal/index.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as listbox from '@zag-js/listbox';
|
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 createListbox(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as menu from '@zag-js/menu';
|
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 createMenu(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as numberInput from '@zag-js/number-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 createNumberInput(props) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as pagination from '@zag-js/pagination';
|
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 createPagination(props) {
|
6
6
|
const locale = getLocaleContext();
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as passwordInput from '@zag-js/password-input';
|
2
|
+
export interface CreatePasswordInputProps extends Omit<passwordInput.Props, 'dir' | 'getRootNode'> {
|
3
|
+
}
|
4
|
+
export interface CreatePasswordInputReturn extends passwordInput.Api {
|
5
|
+
}
|
6
|
+
export declare function createPasswordInputContext(props: CreatePasswordInputProps): CreatePasswordInputReturn;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import * as passwordInput from '@zag-js/password-input';
|
2
|
+
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
|
+
import { getEnvironmentContext } from '../environment-provider/environment-provider-context.svelte.js';
|
4
|
+
import { getFieldContext } from '../field/field-context.svelte.js';
|
5
|
+
import { getLocaleContext } from '../locale-provider/locale-provider-context.svelte.js';
|
6
|
+
export function createPasswordInputContext(props) {
|
7
|
+
const field = getFieldContext();
|
8
|
+
const locale = getLocaleContext();
|
9
|
+
const environment = getEnvironmentContext();
|
10
|
+
const service = useMachine(passwordInput.machine, () => ({
|
11
|
+
dir: locale?.dir,
|
12
|
+
ids: {
|
13
|
+
label: field?.ids.label,
|
14
|
+
input: field?.ids.control,
|
15
|
+
},
|
16
|
+
invalid: field?.invalid,
|
17
|
+
required: field?.required,
|
18
|
+
disabled: field?.disabled,
|
19
|
+
readOnly: field?.readOnly,
|
20
|
+
getRootNode: environment?.getRootNode,
|
21
|
+
...props,
|
22
|
+
}));
|
23
|
+
return reflect(() => {
|
24
|
+
const api = passwordInput.connect(service, normalizeProps);
|
25
|
+
return {
|
26
|
+
...api,
|
27
|
+
getInputProps() {
|
28
|
+
return {
|
29
|
+
'aria-describedby': field?.['aria-describedby'],
|
30
|
+
...api.getInputProps(),
|
31
|
+
};
|
32
|
+
},
|
33
|
+
};
|
34
|
+
});
|
35
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export * as PasswordInput from './password-input.js';
|
2
|
+
export type { PasswordInputControlProps } from './password-input-control.svelte';
|
3
|
+
export type { PasswordInputIndicatorProps } from './password-input-indicator.svelte';
|
4
|
+
export type { PasswordInputInputProps } from './password-input-input.svelte';
|
5
|
+
export type { PasswordInputLabelProps } from './password-input-label.svelte';
|
6
|
+
export type { PasswordInputProps } from './password-input-root.svelte';
|
7
|
+
export type { PasswordInputVisibilityTriggerProps } from './password-input-visibility-trigger.svelte';
|
8
|
+
export { createPasswordInputContext, type CreatePasswordInputProps, type CreatePasswordInputReturn, } from './create-password-input.svelte.js';
|
9
|
+
export { anatomy as passwordInputAnatomy } from './password-input-anatomy.js';
|
10
|
+
export { getPasswordInputContext, setPasswordInputContext, } from './password-input-context.svelte.js';
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export * as PasswordInput from './password-input.js';
|
2
|
+
export { createPasswordInputContext, } from './create-password-input.svelte.js';
|
3
|
+
export { anatomy as passwordInputAnatomy } from './password-input-anatomy.js';
|
4
|
+
export { getPasswordInputContext, setPasswordInputContext, } from './password-input-context.svelte.js';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { anatomy } from '@zag-js/password-input';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { anatomy } from '@zag-js/password-input';
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface PasswordInputControlProps
|
5
|
+
extends HtmlIngredientProps<'div', HTMLDivElement> {}
|
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
|
+
}: PasswordInputControlProps = $props();
|
18
|
+
|
19
|
+
let passwordInput = getPasswordInputContext();
|
20
|
+
let mergedProps = $derived(
|
21
|
+
mergeProps(passwordInput.getControlProps(), props),
|
22
|
+
);
|
23
|
+
</script>
|
24
|
+
|
25
|
+
{#if asChild}
|
26
|
+
{@render asChild(mergedProps)}
|
27
|
+
{:else}
|
28
|
+
<div bind:this={ref} {...mergedProps}>
|
29
|
+
{@render children?.()}
|
30
|
+
</div>
|
31
|
+
{/if}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { HtmlIngredientProps } from '../types.js';
|
2
|
+
export interface PasswordInputControlProps extends HtmlIngredientProps<'div', HTMLDivElement> {
|
3
|
+
}
|
4
|
+
declare const PasswordInputControl: import("svelte").Component<PasswordInputControlProps, {}, "ref">;
|
5
|
+
type PasswordInputControl = ReturnType<typeof PasswordInputControl>;
|
6
|
+
export default PasswordInputControl;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface PasswordInputIndicatorProps
|
5
|
+
extends HtmlIngredientProps<'span', HTMLSpanElement> {}
|
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
|
+
}: PasswordInputIndicatorProps = $props();
|
18
|
+
|
19
|
+
let passwordInput = getPasswordInputContext();
|
20
|
+
let mergedProps = $derived(
|
21
|
+
mergeProps(passwordInput.getIndicatorProps(), props),
|
22
|
+
);
|
23
|
+
</script>
|
24
|
+
|
25
|
+
{#if asChild}
|
26
|
+
{@render asChild(mergedProps)}
|
27
|
+
{:else}
|
28
|
+
<span bind:this={ref} {...mergedProps}>
|
29
|
+
{@render children?.()}
|
30
|
+
</span>
|
31
|
+
{/if}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { HtmlIngredientProps } from '../types.js';
|
2
|
+
export interface PasswordInputIndicatorProps extends HtmlIngredientProps<'span', HTMLSpanElement> {
|
3
|
+
}
|
4
|
+
declare const PasswordInputIndicator: import("svelte").Component<PasswordInputIndicatorProps, {}, "ref">;
|
5
|
+
type PasswordInputIndicator = ReturnType<typeof PasswordInputIndicator>;
|
6
|
+
export default PasswordInputIndicator;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface PasswordInputInputProps
|
5
|
+
extends HtmlIngredientProps<'input', HTMLInputElement> {}
|
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
|
+
...props
|
16
|
+
}: PasswordInputInputProps = $props();
|
17
|
+
|
18
|
+
let passwordInput = getPasswordInputContext();
|
19
|
+
let mergedProps = $derived(mergeProps(passwordInput.getInputProps(), props));
|
20
|
+
</script>
|
21
|
+
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(mergedProps)}
|
24
|
+
{:else}
|
25
|
+
<input bind:this={ref} {...mergedProps} />
|
26
|
+
{/if}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { HtmlIngredientProps } from '../types.js';
|
2
|
+
export interface PasswordInputInputProps extends HtmlIngredientProps<'input', HTMLInputElement> {
|
3
|
+
}
|
4
|
+
declare const PasswordInputInput: import("svelte").Component<PasswordInputInputProps, {}, "ref">;
|
5
|
+
type PasswordInputInput = ReturnType<typeof PasswordInputInput>;
|
6
|
+
export default PasswordInputInput;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
|
4
|
+
export interface PasswordInputLabelProps
|
5
|
+
extends HtmlIngredientProps<'label', HTMLLabelElement> {}
|
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
|
+
}: PasswordInputLabelProps = $props();
|
18
|
+
|
19
|
+
let passwordInput = getPasswordInputContext();
|
20
|
+
let mergedProps = $derived(mergeProps(passwordInput.getLabelProps(), props));
|
21
|
+
</script>
|
22
|
+
|
23
|
+
{#if asChild}
|
24
|
+
{@render asChild(mergedProps)}
|
25
|
+
{:else}
|
26
|
+
<label bind:this={ref} {...mergedProps}>
|
27
|
+
{@render children?.()}
|
28
|
+
</label>
|
29
|
+
{/if}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { HtmlIngredientProps } from '../types.js';
|
2
|
+
export interface PasswordInputLabelProps extends HtmlIngredientProps<'label', HTMLLabelElement> {
|
3
|
+
}
|
4
|
+
declare const PasswordInputLabel: import("svelte").Component<PasswordInputLabelProps, {}, "ref">;
|
5
|
+
type PasswordInputLabel = ReturnType<typeof PasswordInputLabel>;
|
6
|
+
export default PasswordInputLabel;
|