@ark-ui/react 5.9.1 → 5.10.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/components/collection.d.cts +1 -1
- package/dist/components/collection.d.ts +1 -1
- package/dist/components/field/use-field.cjs +7 -5
- package/dist/components/field/use-field.js +8 -6
- package/dist/components/fieldset/index.cjs +2 -0
- package/dist/components/fieldset/index.d.cts +1 -0
- package/dist/components/fieldset/index.d.ts +1 -0
- package/dist/components/fieldset/index.js +1 -0
- package/dist/components/fieldset/use-fieldset.cjs +11 -9
- package/dist/components/fieldset/use-fieldset.js +12 -10
- package/dist/components/index.cjs +29 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +14 -0
- package/dist/components/password-input/index.cjs +34 -0
- package/dist/components/password-input/index.d.cts +13 -0
- package/dist/components/password-input/index.d.ts +13 -0
- package/dist/components/password-input/index.js +13 -0
- package/dist/components/password-input/password-input-context.cjs +12 -0
- package/dist/components/password-input/password-input-context.d.cts +6 -0
- package/dist/components/password-input/password-input-context.d.ts +6 -0
- package/dist/components/password-input/password-input-context.js +8 -0
- package/dist/components/password-input/password-input-control.cjs +19 -0
- package/dist/components/password-input/password-input-control.d.cts +7 -0
- package/dist/components/password-input/password-input-control.d.ts +7 -0
- package/dist/components/password-input/password-input-control.js +15 -0
- package/dist/components/password-input/password-input-indicator.cjs +19 -0
- package/dist/components/password-input/password-input-indicator.d.cts +11 -0
- package/dist/components/password-input/password-input-indicator.d.ts +11 -0
- package/dist/components/password-input/password-input-indicator.js +15 -0
- package/dist/components/password-input/password-input-input.cjs +21 -0
- package/dist/components/password-input/password-input-input.d.cts +7 -0
- package/dist/components/password-input/password-input-input.d.ts +7 -0
- package/dist/components/password-input/password-input-input.js +17 -0
- package/dist/components/password-input/password-input-label.cjs +19 -0
- package/dist/components/password-input/password-input-label.d.cts +7 -0
- package/dist/components/password-input/password-input-label.d.ts +7 -0
- package/dist/components/password-input/password-input-label.js +15 -0
- package/dist/components/password-input/password-input-root-provider.cjs +19 -0
- package/dist/components/password-input/password-input-root-provider.d.cts +12 -0
- package/dist/components/password-input/password-input-root-provider.d.ts +12 -0
- package/dist/components/password-input/password-input-root-provider.js +15 -0
- package/dist/components/password-input/password-input-root.cjs +36 -0
- package/dist/components/password-input/password-input-root.d.cts +9 -0
- package/dist/components/password-input/password-input-root.d.ts +9 -0
- package/dist/components/password-input/password-input-root.js +32 -0
- package/dist/components/password-input/password-input-visibility-trigger.cjs +21 -0
- package/dist/components/password-input/password-input-visibility-trigger.d.cts +7 -0
- package/dist/components/password-input/password-input-visibility-trigger.d.ts +7 -0
- package/dist/components/password-input/password-input-visibility-trigger.js +17 -0
- package/dist/components/password-input/password-input.anatomy.d.cts +1 -0
- package/dist/components/password-input/password-input.anatomy.d.ts +1 -0
- package/dist/components/password-input/password-input.cjs +23 -0
- package/dist/components/password-input/password-input.d.cts +9 -0
- package/dist/components/password-input/password-input.d.ts +9 -0
- package/dist/components/password-input/password-input.js +8 -0
- package/dist/components/password-input/use-password-input-context.cjs +15 -0
- package/dist/components/password-input/use-password-input-context.d.cts +5 -0
- package/dist/components/password-input/use-password-input-context.d.ts +5 -0
- package/dist/components/password-input/use-password-input-context.js +10 -0
- package/dist/components/password-input/use-password-input.cjs +54 -0
- package/dist/components/password-input/use-password-input.d.cts +8 -0
- package/dist/components/password-input/use-password-input.d.ts +8 -0
- package/dist/components/password-input/use-password-input.js +31 -0
- package/dist/components/select/select-root.cjs +1 -0
- package/dist/components/select/select-root.js +1 -0
- package/dist/index.cjs +29 -0
- package/dist/index.js +14 -0
- package/dist/providers/environment/environment-provider.cjs +1 -1
- package/dist/providers/environment/environment-provider.js +1 -1
- package/package.json +62 -59
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollectionItem, CollectionOptions, FilePathTreeNode, ListCollection, TreeCollection, TreeCollectionOptions, TreeNode } from '@zag-js/collection';
|
|
2
|
-
export type { CollectionItem, ListCollection, SelectionMode } from '@zag-js/collection';
|
|
3
2
|
export declare const createListCollection: <T extends CollectionItem>(options: CollectionOptions<T>) => ListCollection<T>;
|
|
4
3
|
export type { TreeCollection, TreeNode } from '@zag-js/collection';
|
|
5
4
|
export declare const createTreeCollection: <T extends TreeNode>(options: TreeCollectionOptions<T>) => TreeCollection<T>;
|
|
6
5
|
export declare const createFileTreeCollection: (paths: string[]) => TreeCollection<FilePathTreeNode>;
|
|
6
|
+
export type { CollectionItem, ListCollection, SelectionMode, CollectionOptions, TreeCollectionOptions, GridCollectionOptions, } from '@zag-js/collection';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollectionItem, CollectionOptions, FilePathTreeNode, ListCollection, TreeCollection, TreeCollectionOptions, TreeNode } from '@zag-js/collection';
|
|
2
|
-
export type { CollectionItem, ListCollection, SelectionMode } from '@zag-js/collection';
|
|
3
2
|
export declare const createListCollection: <T extends CollectionItem>(options: CollectionOptions<T>) => ListCollection<T>;
|
|
4
3
|
export type { TreeCollection, TreeNode } from '@zag-js/collection';
|
|
5
4
|
export declare const createTreeCollection: <T extends TreeNode>(options: TreeCollectionOptions<T>) => TreeCollection<T>;
|
|
6
5
|
export declare const createFileTreeCollection: (paths: string[]) => TreeCollection<FilePathTreeNode>;
|
|
6
|
+
export type { CollectionItem, ListCollection, SelectionMode, CollectionOptions, TreeCollectionOptions, GridCollectionOptions, } from '@zag-js/collection';
|
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
|
|
6
6
|
const domQuery = require('@zag-js/dom-query');
|
|
7
7
|
const react = require('react');
|
|
8
|
+
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
8
9
|
const useSafeLayoutEffect = require('../../utils/use-safe-layout-effect.cjs');
|
|
9
10
|
const useFieldsetContext = require('../fieldset/use-fieldset-context.cjs');
|
|
10
11
|
const field_anatomy = require('./field.anatomy.cjs');
|
|
11
12
|
|
|
12
13
|
const useField = (props = {}) => {
|
|
13
14
|
const fieldset = useFieldsetContext.useFieldsetContext();
|
|
15
|
+
const env = useEnvironmentContext.useEnvironmentContext();
|
|
14
16
|
const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;
|
|
15
17
|
const [hasErrorText, setHasErrorText] = react.useState(false);
|
|
16
18
|
const [hasHelperText, setHasHelperText] = react.useState(false);
|
|
@@ -23,17 +25,17 @@ const useField = (props = {}) => {
|
|
|
23
25
|
useSafeLayoutEffect.useSafeLayoutEffect(() => {
|
|
24
26
|
const rootNode = rootRef.current;
|
|
25
27
|
if (!rootNode) return;
|
|
26
|
-
const win = domQuery.getWindow(rootNode);
|
|
27
|
-
const doc = win.document;
|
|
28
28
|
const checkTextElements = () => {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const docOrShadowRoot = env.getRootNode();
|
|
30
|
+
setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));
|
|
31
|
+
setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));
|
|
31
32
|
};
|
|
32
33
|
checkTextElements();
|
|
34
|
+
const win = env.getWindow();
|
|
33
35
|
const observer = new win.MutationObserver(checkTextElements);
|
|
34
36
|
observer.observe(rootNode, { childList: true, subtree: true });
|
|
35
37
|
return () => observer.disconnect();
|
|
36
|
-
}, [errorTextId, helperTextId]);
|
|
38
|
+
}, [env, errorTextId, helperTextId]);
|
|
37
39
|
const labelIds = react.useMemo(() => {
|
|
38
40
|
const ids2 = [];
|
|
39
41
|
if (hasErrorText && invalid) ids2.push(errorTextId);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { dataAttr, ariaAttr } from '@zag-js/dom-query';
|
|
3
3
|
import { useState, useId, useRef, useMemo } from 'react';
|
|
4
|
+
import { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';
|
|
4
5
|
import { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';
|
|
5
6
|
import { useFieldsetContext } from '../fieldset/use-fieldset-context.js';
|
|
6
7
|
import { parts } from './field.anatomy.js';
|
|
7
8
|
|
|
8
9
|
const useField = (props = {}) => {
|
|
9
10
|
const fieldset = useFieldsetContext();
|
|
11
|
+
const env = useEnvironmentContext();
|
|
10
12
|
const { ids, disabled = Boolean(fieldset?.disabled), invalid = false, readOnly = false, required = false } = props;
|
|
11
13
|
const [hasErrorText, setHasErrorText] = useState(false);
|
|
12
14
|
const [hasHelperText, setHasHelperText] = useState(false);
|
|
@@ -19,17 +21,17 @@ const useField = (props = {}) => {
|
|
|
19
21
|
useSafeLayoutEffect(() => {
|
|
20
22
|
const rootNode = rootRef.current;
|
|
21
23
|
if (!rootNode) return;
|
|
22
|
-
const win = getWindow(rootNode);
|
|
23
|
-
const doc = win.document;
|
|
24
24
|
const checkTextElements = () => {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const docOrShadowRoot = env.getRootNode();
|
|
26
|
+
setHasErrorText(!!docOrShadowRoot.getElementById(errorTextId));
|
|
27
|
+
setHasHelperText(!!docOrShadowRoot.getElementById(helperTextId));
|
|
27
28
|
};
|
|
28
29
|
checkTextElements();
|
|
30
|
+
const win = env.getWindow();
|
|
29
31
|
const observer = new win.MutationObserver(checkTextElements);
|
|
30
32
|
observer.observe(rootNode, { childList: true, subtree: true });
|
|
31
33
|
return () => observer.disconnect();
|
|
32
|
-
}, [errorTextId, helperTextId]);
|
|
34
|
+
}, [env, errorTextId, helperTextId]);
|
|
33
35
|
const labelIds = useMemo(() => {
|
|
34
36
|
const ids2 = [];
|
|
35
37
|
if (hasErrorText && invalid) ids2.push(errorTextId);
|
|
@@ -9,6 +9,7 @@ const fieldsetLegend = require('./fieldset-legend.cjs');
|
|
|
9
9
|
const fieldsetRoot = require('./fieldset-root.cjs');
|
|
10
10
|
const fieldsetRootProvider = require('./fieldset-root-provider.cjs');
|
|
11
11
|
const fieldset_anatomy = require('./fieldset.anatomy.cjs');
|
|
12
|
+
const useFieldset = require('./use-fieldset.cjs');
|
|
12
13
|
const useFieldsetContext = require('./use-fieldset-context.cjs');
|
|
13
14
|
const fieldset = require('./fieldset.cjs');
|
|
14
15
|
|
|
@@ -21,5 +22,6 @@ exports.FieldsetLegend = fieldsetLegend.FieldsetLegend;
|
|
|
21
22
|
exports.FieldsetRoot = fieldsetRoot.FieldsetRoot;
|
|
22
23
|
exports.FieldsetRootProvider = fieldsetRootProvider.FieldsetRootProvider;
|
|
23
24
|
exports.fieldsetAnatomy = fieldset_anatomy.fieldsetAnatomy;
|
|
25
|
+
exports.useFieldset = useFieldset.useFieldset;
|
|
24
26
|
exports.useFieldsetContext = useFieldsetContext.useFieldsetContext;
|
|
25
27
|
exports.Fieldset = fieldset;
|
|
@@ -5,5 +5,6 @@ export { FieldsetLegend, type FieldsetLegendBaseProps, type FieldsetLegendProps
|
|
|
5
5
|
export { FieldsetRoot, type FieldsetRootBaseProps, type FieldsetRootProps } from './fieldset-root';
|
|
6
6
|
export { FieldsetRootProvider, type FieldsetRootProviderBaseProps, type FieldsetRootProviderProps, } from './fieldset-root-provider';
|
|
7
7
|
export { fieldsetAnatomy } from './fieldset.anatomy';
|
|
8
|
+
export { useFieldset, type UseFieldsetProps, type UseFieldsetReturn } from './use-fieldset';
|
|
8
9
|
export { useFieldsetContext, type UseFieldsetContext } from './use-fieldset-context';
|
|
9
10
|
export * as Fieldset from './fieldset';
|
|
@@ -5,5 +5,6 @@ export { FieldsetLegend, type FieldsetLegendBaseProps, type FieldsetLegendProps
|
|
|
5
5
|
export { FieldsetRoot, type FieldsetRootBaseProps, type FieldsetRootProps } from './fieldset-root';
|
|
6
6
|
export { FieldsetRootProvider, type FieldsetRootProviderBaseProps, type FieldsetRootProviderProps, } from './fieldset-root-provider';
|
|
7
7
|
export { fieldsetAnatomy } from './fieldset.anatomy';
|
|
8
|
+
export { useFieldset, type UseFieldsetProps, type UseFieldsetReturn } from './use-fieldset';
|
|
8
9
|
export { useFieldsetContext, type UseFieldsetContext } from './use-fieldset-context';
|
|
9
10
|
export * as Fieldset from './fieldset';
|
|
@@ -5,6 +5,7 @@ export { FieldsetLegend } from './fieldset-legend.js';
|
|
|
5
5
|
export { FieldsetRoot } from './fieldset-root.js';
|
|
6
6
|
export { FieldsetRootProvider } from './fieldset-root-provider.js';
|
|
7
7
|
export { fieldsetAnatomy } from './fieldset.anatomy.js';
|
|
8
|
+
export { useFieldset } from './use-fieldset.js';
|
|
8
9
|
export { useFieldsetContext } from './use-fieldset-context.js';
|
|
9
10
|
import * as fieldset from './fieldset.js';
|
|
10
11
|
export { fieldset as Fieldset };
|
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
|
|
6
6
|
const domQuery = require('@zag-js/dom-query');
|
|
7
7
|
const react = require('react');
|
|
8
|
+
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
8
9
|
const useSafeLayoutEffect = require('../../utils/use-safe-layout-effect.cjs');
|
|
9
10
|
const fieldset_anatomy = require('./fieldset.anatomy.cjs');
|
|
10
11
|
|
|
11
12
|
const useFieldset = (props = {}) => {
|
|
12
13
|
const { disabled = false, invalid = false } = props;
|
|
14
|
+
const env = useEnvironmentContext.useEnvironmentContext();
|
|
13
15
|
const hasErrorText = react.useRef(false);
|
|
14
16
|
const hasHelperText = react.useRef(false);
|
|
15
17
|
const id = props.id ?? react.useId();
|
|
@@ -19,17 +21,17 @@ const useFieldset = (props = {}) => {
|
|
|
19
21
|
useSafeLayoutEffect.useSafeLayoutEffect(() => {
|
|
20
22
|
const rootNode = rootRef.current;
|
|
21
23
|
if (!rootNode) return;
|
|
22
|
-
const win = domQuery.getWindow(rootNode);
|
|
23
|
-
const doc = win.document;
|
|
24
24
|
const checkTextElements = () => {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const docOrShadowRoot = env.getRootNode();
|
|
26
|
+
hasErrorText.current = !!docOrShadowRoot.getElementById(errorTextId);
|
|
27
|
+
hasHelperText.current = !!docOrShadowRoot.getElementById(helperTextId);
|
|
27
28
|
};
|
|
28
29
|
checkTextElements();
|
|
30
|
+
const win = env.getWindow();
|
|
29
31
|
const observer = new win.MutationObserver(checkTextElements);
|
|
30
32
|
observer.observe(rootNode, { childList: true, subtree: true });
|
|
31
33
|
return () => observer.disconnect();
|
|
32
|
-
}, [errorTextId, helperTextId]);
|
|
34
|
+
}, [env, errorTextId, helperTextId]);
|
|
33
35
|
const labelIds = react.useMemo(() => {
|
|
34
36
|
const ids = [];
|
|
35
37
|
if (hasErrorText.current && invalid) ids.push(errorTextId);
|
|
@@ -41,8 +43,8 @@ const useFieldset = (props = {}) => {
|
|
|
41
43
|
...fieldset_anatomy.parts.root.attrs,
|
|
42
44
|
ref: rootRef,
|
|
43
45
|
disabled,
|
|
44
|
-
"data-disabled": disabled
|
|
45
|
-
"data-invalid": invalid
|
|
46
|
+
"data-disabled": domQuery.dataAttr(disabled),
|
|
47
|
+
"data-invalid": domQuery.dataAttr(invalid),
|
|
46
48
|
"aria-describedby": labelIds
|
|
47
49
|
}),
|
|
48
50
|
[disabled, invalid, labelIds]
|
|
@@ -50,8 +52,8 @@ const useFieldset = (props = {}) => {
|
|
|
50
52
|
const getLegendProps = react.useMemo(
|
|
51
53
|
() => () => ({
|
|
52
54
|
...fieldset_anatomy.parts.legend.attrs,
|
|
53
|
-
"data-disabled": disabled
|
|
54
|
-
"data-invalid": invalid
|
|
55
|
+
"data-disabled": domQuery.dataAttr(disabled),
|
|
56
|
+
"data-invalid": domQuery.dataAttr(invalid)
|
|
55
57
|
}),
|
|
56
58
|
[disabled, invalid]
|
|
57
59
|
);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { dataAttr } from '@zag-js/dom-query';
|
|
3
3
|
import { useRef, useId, useMemo } from 'react';
|
|
4
|
+
import { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';
|
|
4
5
|
import { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect.js';
|
|
5
6
|
import { parts } from './fieldset.anatomy.js';
|
|
6
7
|
|
|
7
8
|
const useFieldset = (props = {}) => {
|
|
8
9
|
const { disabled = false, invalid = false } = props;
|
|
10
|
+
const env = useEnvironmentContext();
|
|
9
11
|
const hasErrorText = useRef(false);
|
|
10
12
|
const hasHelperText = useRef(false);
|
|
11
13
|
const id = props.id ?? useId();
|
|
@@ -15,17 +17,17 @@ const useFieldset = (props = {}) => {
|
|
|
15
17
|
useSafeLayoutEffect(() => {
|
|
16
18
|
const rootNode = rootRef.current;
|
|
17
19
|
if (!rootNode) return;
|
|
18
|
-
const win = getWindow(rootNode);
|
|
19
|
-
const doc = win.document;
|
|
20
20
|
const checkTextElements = () => {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const docOrShadowRoot = env.getRootNode();
|
|
22
|
+
hasErrorText.current = !!docOrShadowRoot.getElementById(errorTextId);
|
|
23
|
+
hasHelperText.current = !!docOrShadowRoot.getElementById(helperTextId);
|
|
23
24
|
};
|
|
24
25
|
checkTextElements();
|
|
26
|
+
const win = env.getWindow();
|
|
25
27
|
const observer = new win.MutationObserver(checkTextElements);
|
|
26
28
|
observer.observe(rootNode, { childList: true, subtree: true });
|
|
27
29
|
return () => observer.disconnect();
|
|
28
|
-
}, [errorTextId, helperTextId]);
|
|
30
|
+
}, [env, errorTextId, helperTextId]);
|
|
29
31
|
const labelIds = useMemo(() => {
|
|
30
32
|
const ids = [];
|
|
31
33
|
if (hasErrorText.current && invalid) ids.push(errorTextId);
|
|
@@ -37,8 +39,8 @@ const useFieldset = (props = {}) => {
|
|
|
37
39
|
...parts.root.attrs,
|
|
38
40
|
ref: rootRef,
|
|
39
41
|
disabled,
|
|
40
|
-
"data-disabled": disabled
|
|
41
|
-
"data-invalid": invalid
|
|
42
|
+
"data-disabled": dataAttr(disabled),
|
|
43
|
+
"data-invalid": dataAttr(invalid),
|
|
42
44
|
"aria-describedby": labelIds
|
|
43
45
|
}),
|
|
44
46
|
[disabled, invalid, labelIds]
|
|
@@ -46,8 +48,8 @@ const useFieldset = (props = {}) => {
|
|
|
46
48
|
const getLegendProps = useMemo(
|
|
47
49
|
() => () => ({
|
|
48
50
|
...parts.legend.attrs,
|
|
49
|
-
"data-disabled": disabled
|
|
50
|
-
"data-invalid": invalid
|
|
51
|
+
"data-disabled": dataAttr(disabled),
|
|
52
|
+
"data-invalid": dataAttr(invalid)
|
|
51
53
|
}),
|
|
52
54
|
[disabled, invalid]
|
|
53
55
|
);
|
|
@@ -222,6 +222,7 @@ const fieldsetLegend = require('./fieldset/fieldset-legend.cjs');
|
|
|
222
222
|
const fieldsetRoot = require('./fieldset/fieldset-root.cjs');
|
|
223
223
|
const fieldsetRootProvider = require('./fieldset/fieldset-root-provider.cjs');
|
|
224
224
|
const fieldset_anatomy = require('./fieldset/fieldset.anatomy.cjs');
|
|
225
|
+
const useFieldset = require('./fieldset/use-fieldset.cjs');
|
|
225
226
|
const useFieldsetContext = require('./fieldset/use-fieldset-context.cjs');
|
|
226
227
|
const fieldset = require('./fieldset/fieldset.cjs');
|
|
227
228
|
const fileUploadClearTrigger = require('./file-upload/file-upload-clear-trigger.cjs');
|
|
@@ -341,6 +342,17 @@ const paginationRootProvider = require('./pagination/pagination-root-provider.cj
|
|
|
341
342
|
const usePagination = require('./pagination/use-pagination.cjs');
|
|
342
343
|
const usePaginationContext = require('./pagination/use-pagination-context.cjs');
|
|
343
344
|
const pagination$1 = require('./pagination/pagination.cjs');
|
|
345
|
+
const passwordInputContext = require('./password-input/password-input-context.cjs');
|
|
346
|
+
const passwordInputControl = require('./password-input/password-input-control.cjs');
|
|
347
|
+
const passwordInputIndicator = require('./password-input/password-input-indicator.cjs');
|
|
348
|
+
const passwordInputInput = require('./password-input/password-input-input.cjs');
|
|
349
|
+
const passwordInputLabel = require('./password-input/password-input-label.cjs');
|
|
350
|
+
const passwordInputRoot = require('./password-input/password-input-root.cjs');
|
|
351
|
+
const passwordInputRootProvider = require('./password-input/password-input-root-provider.cjs');
|
|
352
|
+
const passwordInputVisibilityTrigger = require('./password-input/password-input-visibility-trigger.cjs');
|
|
353
|
+
const usePasswordInput = require('./password-input/use-password-input.cjs');
|
|
354
|
+
const usePasswordInputContext = require('./password-input/use-password-input-context.cjs');
|
|
355
|
+
const passwordInput$1 = require('./password-input/password-input.cjs');
|
|
344
356
|
const pinInputContext = require('./pin-input/pin-input-context.cjs');
|
|
345
357
|
const pinInputControl = require('./pin-input/pin-input-control.cjs');
|
|
346
358
|
const pinInputHiddenInput = require('./pin-input/pin-input-hidden-input.cjs');
|
|
@@ -669,6 +681,7 @@ const listbox = require('@zag-js/listbox');
|
|
|
669
681
|
const menu = require('@zag-js/menu');
|
|
670
682
|
const numberInput = require('@zag-js/number-input');
|
|
671
683
|
const pagination = require('@zag-js/pagination');
|
|
684
|
+
const passwordInput = require('@zag-js/password-input');
|
|
672
685
|
const pinInput = require('@zag-js/pin-input');
|
|
673
686
|
const popover = require('@zag-js/popover');
|
|
674
687
|
const progress = require('@zag-js/progress');
|
|
@@ -921,6 +934,7 @@ exports.FieldsetLegend = fieldsetLegend.FieldsetLegend;
|
|
|
921
934
|
exports.FieldsetRoot = fieldsetRoot.FieldsetRoot;
|
|
922
935
|
exports.FieldsetRootProvider = fieldsetRootProvider.FieldsetRootProvider;
|
|
923
936
|
exports.fieldsetAnatomy = fieldset_anatomy.fieldsetAnatomy;
|
|
937
|
+
exports.useFieldset = useFieldset.useFieldset;
|
|
924
938
|
exports.useFieldsetContext = useFieldsetContext.useFieldsetContext;
|
|
925
939
|
exports.Fieldset = fieldset;
|
|
926
940
|
exports.FileUploadClearTrigger = fileUploadClearTrigger.FileUploadClearTrigger;
|
|
@@ -1040,6 +1054,17 @@ exports.PaginationRootProvider = paginationRootProvider.PaginationRootProvider;
|
|
|
1040
1054
|
exports.usePagination = usePagination.usePagination;
|
|
1041
1055
|
exports.usePaginationContext = usePaginationContext.usePaginationContext;
|
|
1042
1056
|
exports.Pagination = pagination$1;
|
|
1057
|
+
exports.PasswordInputContext = passwordInputContext.PasswordInputContext;
|
|
1058
|
+
exports.PasswordInputControl = passwordInputControl.PasswordInputControl;
|
|
1059
|
+
exports.PasswordInputIndicator = passwordInputIndicator.PasswordInputIndicator;
|
|
1060
|
+
exports.PasswordInputInput = passwordInputInput.PasswordInputInput;
|
|
1061
|
+
exports.PasswordInputLabel = passwordInputLabel.PasswordInputLabel;
|
|
1062
|
+
exports.PasswordInputRoot = passwordInputRoot.PasswordInputRoot;
|
|
1063
|
+
exports.PasswordInputRootProvider = passwordInputRootProvider.PasswordInputRootProvider;
|
|
1064
|
+
exports.PasswordInputVisibilityTrigger = passwordInputVisibilityTrigger.PasswordInputVisibilityTrigger;
|
|
1065
|
+
exports.usePasswordInput = usePasswordInput.usePasswordInput;
|
|
1066
|
+
exports.usePasswordInputContext = usePasswordInputContext.usePasswordInputContext;
|
|
1067
|
+
exports.PasswordInput = passwordInput$1;
|
|
1043
1068
|
exports.PinInputContext = pinInputContext.PinInputContext;
|
|
1044
1069
|
exports.PinInputControl = pinInputControl.PinInputControl;
|
|
1045
1070
|
exports.PinInputHiddenInput = pinInputHiddenInput.PinInputHiddenInput;
|
|
@@ -1420,6 +1445,10 @@ Object.defineProperty(exports, "paginationAnatomy", {
|
|
|
1420
1445
|
enumerable: true,
|
|
1421
1446
|
get: () => pagination.anatomy
|
|
1422
1447
|
});
|
|
1448
|
+
Object.defineProperty(exports, "passwordInputAnatomy", {
|
|
1449
|
+
enumerable: true,
|
|
1450
|
+
get: () => passwordInput.anatomy
|
|
1451
|
+
});
|
|
1423
1452
|
Object.defineProperty(exports, "pinInputAnatomy", {
|
|
1424
1453
|
enumerable: true,
|
|
1425
1454
|
get: () => pinInput.anatomy
|
package/dist/components/index.js
CHANGED
|
@@ -231,6 +231,7 @@ export { FieldsetLegend } from './fieldset/fieldset-legend.js';
|
|
|
231
231
|
export { FieldsetRoot } from './fieldset/fieldset-root.js';
|
|
232
232
|
export { FieldsetRootProvider } from './fieldset/fieldset-root-provider.js';
|
|
233
233
|
export { fieldsetAnatomy } from './fieldset/fieldset.anatomy.js';
|
|
234
|
+
export { useFieldset } from './fieldset/use-fieldset.js';
|
|
234
235
|
export { useFieldsetContext } from './fieldset/use-fieldset-context.js';
|
|
235
236
|
import * as fieldset from './fieldset/fieldset.js';
|
|
236
237
|
export { fieldset as Fieldset };
|
|
@@ -359,6 +360,18 @@ export { usePagination } from './pagination/use-pagination.js';
|
|
|
359
360
|
export { usePaginationContext } from './pagination/use-pagination-context.js';
|
|
360
361
|
import * as pagination from './pagination/pagination.js';
|
|
361
362
|
export { pagination as Pagination };
|
|
363
|
+
export { PasswordInputContext } from './password-input/password-input-context.js';
|
|
364
|
+
export { PasswordInputControl } from './password-input/password-input-control.js';
|
|
365
|
+
export { PasswordInputIndicator } from './password-input/password-input-indicator.js';
|
|
366
|
+
export { PasswordInputInput } from './password-input/password-input-input.js';
|
|
367
|
+
export { PasswordInputLabel } from './password-input/password-input-label.js';
|
|
368
|
+
export { PasswordInputRoot } from './password-input/password-input-root.js';
|
|
369
|
+
export { PasswordInputRootProvider } from './password-input/password-input-root-provider.js';
|
|
370
|
+
export { PasswordInputVisibilityTrigger } from './password-input/password-input-visibility-trigger.js';
|
|
371
|
+
export { usePasswordInput } from './password-input/use-password-input.js';
|
|
372
|
+
export { usePasswordInputContext } from './password-input/use-password-input-context.js';
|
|
373
|
+
import * as passwordInput from './password-input/password-input.js';
|
|
374
|
+
export { passwordInput as PasswordInput };
|
|
362
375
|
export { PinInputContext } from './pin-input/pin-input-context.js';
|
|
363
376
|
export { PinInputControl } from './pin-input/pin-input-control.js';
|
|
364
377
|
export { PinInputHiddenInput } from './pin-input/pin-input-hidden-input.js';
|
|
@@ -710,6 +723,7 @@ export { anatomy as listboxAnatomy } from '@zag-js/listbox';
|
|
|
710
723
|
export { anatomy as menuAnatomy } from '@zag-js/menu';
|
|
711
724
|
export { anatomy as numberInputAnatomy } from '@zag-js/number-input';
|
|
712
725
|
export { anatomy as paginationAnatomy } from '@zag-js/pagination';
|
|
726
|
+
export { anatomy as passwordInputAnatomy } from '@zag-js/password-input';
|
|
713
727
|
export { anatomy as pinInputAnatomy } from '@zag-js/pin-input';
|
|
714
728
|
export { anatomy as popoverAnatomy } from '@zag-js/popover';
|
|
715
729
|
export { anatomy as progressAnatomy } from '@zag-js/progress';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const passwordInputContext = require('./password-input-context.cjs');
|
|
6
|
+
const passwordInputControl = require('./password-input-control.cjs');
|
|
7
|
+
const passwordInputIndicator = require('./password-input-indicator.cjs');
|
|
8
|
+
const passwordInputInput = require('./password-input-input.cjs');
|
|
9
|
+
const passwordInputLabel = require('./password-input-label.cjs');
|
|
10
|
+
const passwordInputRoot = require('./password-input-root.cjs');
|
|
11
|
+
const passwordInputRootProvider = require('./password-input-root-provider.cjs');
|
|
12
|
+
const passwordInputVisibilityTrigger = require('./password-input-visibility-trigger.cjs');
|
|
13
|
+
const usePasswordInput = require('./use-password-input.cjs');
|
|
14
|
+
const usePasswordInputContext = require('./use-password-input-context.cjs');
|
|
15
|
+
const passwordInput$1 = require('./password-input.cjs');
|
|
16
|
+
const passwordInput = require('@zag-js/password-input');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.PasswordInputContext = passwordInputContext.PasswordInputContext;
|
|
21
|
+
exports.PasswordInputControl = passwordInputControl.PasswordInputControl;
|
|
22
|
+
exports.PasswordInputIndicator = passwordInputIndicator.PasswordInputIndicator;
|
|
23
|
+
exports.PasswordInputInput = passwordInputInput.PasswordInputInput;
|
|
24
|
+
exports.PasswordInputLabel = passwordInputLabel.PasswordInputLabel;
|
|
25
|
+
exports.PasswordInputRoot = passwordInputRoot.PasswordInputRoot;
|
|
26
|
+
exports.PasswordInputRootProvider = passwordInputRootProvider.PasswordInputRootProvider;
|
|
27
|
+
exports.PasswordInputVisibilityTrigger = passwordInputVisibilityTrigger.PasswordInputVisibilityTrigger;
|
|
28
|
+
exports.usePasswordInput = usePasswordInput.usePasswordInput;
|
|
29
|
+
exports.usePasswordInputContext = usePasswordInputContext.usePasswordInputContext;
|
|
30
|
+
exports.PasswordInput = passwordInput$1;
|
|
31
|
+
Object.defineProperty(exports, "passwordInputAnatomy", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: () => passwordInput.anatomy
|
|
34
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { VisibilityChangeDetails as PasswordInputVisibilityChangeDetails } from '@zag-js/password-input';
|
|
2
|
+
export { PasswordInputContext, type PasswordInputContextProps } from './password-input-context';
|
|
3
|
+
export { PasswordInputControl, type PasswordInputControlBaseProps, type PasswordInputControlProps, } from './password-input-control';
|
|
4
|
+
export { PasswordInputIndicator, type PasswordInputIndicatorBaseProps, type PasswordInputIndicatorProps, } from './password-input-indicator';
|
|
5
|
+
export { PasswordInputInput, type PasswordInputInputBaseProps, type PasswordInputInputProps, } from './password-input-input';
|
|
6
|
+
export { PasswordInputLabel, type PasswordInputLabelBaseProps, type PasswordInputLabelProps, } from './password-input-label';
|
|
7
|
+
export { PasswordInputRoot, type PasswordInputRootBaseProps, type PasswordInputRootProps } from './password-input-root';
|
|
8
|
+
export { PasswordInputRootProvider, type PasswordInputRootProviderBaseProps, type PasswordInputRootProviderProps, } from './password-input-root-provider';
|
|
9
|
+
export { PasswordInputVisibilityTrigger, type PasswordInputVisibilityTriggerBaseProps, type PasswordInputVisibilityTriggerProps, } from './password-input-visibility-trigger';
|
|
10
|
+
export { passwordInputAnatomy } from './password-input.anatomy';
|
|
11
|
+
export { usePasswordInput, type UsePasswordInputProps, type UsePasswordInputReturn } from './use-password-input';
|
|
12
|
+
export { usePasswordInputContext, type UsePasswordInputContext } from './use-password-input-context';
|
|
13
|
+
export * as PasswordInput from './password-input';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { VisibilityChangeDetails as PasswordInputVisibilityChangeDetails } from '@zag-js/password-input';
|
|
2
|
+
export { PasswordInputContext, type PasswordInputContextProps } from './password-input-context';
|
|
3
|
+
export { PasswordInputControl, type PasswordInputControlBaseProps, type PasswordInputControlProps, } from './password-input-control';
|
|
4
|
+
export { PasswordInputIndicator, type PasswordInputIndicatorBaseProps, type PasswordInputIndicatorProps, } from './password-input-indicator';
|
|
5
|
+
export { PasswordInputInput, type PasswordInputInputBaseProps, type PasswordInputInputProps, } from './password-input-input';
|
|
6
|
+
export { PasswordInputLabel, type PasswordInputLabelBaseProps, type PasswordInputLabelProps, } from './password-input-label';
|
|
7
|
+
export { PasswordInputRoot, type PasswordInputRootBaseProps, type PasswordInputRootProps } from './password-input-root';
|
|
8
|
+
export { PasswordInputRootProvider, type PasswordInputRootProviderBaseProps, type PasswordInputRootProviderProps, } from './password-input-root-provider';
|
|
9
|
+
export { PasswordInputVisibilityTrigger, type PasswordInputVisibilityTriggerBaseProps, type PasswordInputVisibilityTriggerProps, } from './password-input-visibility-trigger';
|
|
10
|
+
export { passwordInputAnatomy } from './password-input.anatomy';
|
|
11
|
+
export { usePasswordInput, type UsePasswordInputProps, type UsePasswordInputReturn } from './use-password-input';
|
|
12
|
+
export { usePasswordInputContext, type UsePasswordInputContext } from './use-password-input-context';
|
|
13
|
+
export * as PasswordInput from './password-input';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { PasswordInputContext } from './password-input-context.js';
|
|
2
|
+
export { PasswordInputControl } from './password-input-control.js';
|
|
3
|
+
export { PasswordInputIndicator } from './password-input-indicator.js';
|
|
4
|
+
export { PasswordInputInput } from './password-input-input.js';
|
|
5
|
+
export { PasswordInputLabel } from './password-input-label.js';
|
|
6
|
+
export { PasswordInputRoot } from './password-input-root.js';
|
|
7
|
+
export { PasswordInputRootProvider } from './password-input-root-provider.js';
|
|
8
|
+
export { PasswordInputVisibilityTrigger } from './password-input-visibility-trigger.js';
|
|
9
|
+
export { usePasswordInput } from './use-password-input.js';
|
|
10
|
+
export { usePasswordInputContext } from './use-password-input-context.js';
|
|
11
|
+
import * as passwordInput from './password-input.js';
|
|
12
|
+
export { passwordInput as PasswordInput };
|
|
13
|
+
export { anatomy as passwordInputAnatomy } from '@zag-js/password-input';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const usePasswordInputContext = require('./use-password-input-context.cjs');
|
|
7
|
+
|
|
8
|
+
const PasswordInputContext = (props) => {
|
|
9
|
+
return props.children(usePasswordInputContext.usePasswordInputContext());
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.PasswordInputContext = PasswordInputContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UsePasswordInputReturn } from './use-password-input';
|
|
3
|
+
export interface PasswordInputContextProps {
|
|
4
|
+
children: (context: UsePasswordInputReturn) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const PasswordInputContext: (props: PasswordInputContextProps) => ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UsePasswordInputReturn } from './use-password-input';
|
|
3
|
+
export interface PasswordInputContextProps {
|
|
4
|
+
children: (context: UsePasswordInputReturn) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const PasswordInputContext: (props: PasswordInputContextProps) => ReactNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const react$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const usePasswordInputContext = require('./use-password-input-context.cjs');
|
|
11
|
+
|
|
12
|
+
const PasswordInputControl = react.forwardRef((props, ref) => {
|
|
13
|
+
const passwordInput = usePasswordInputContext.usePasswordInputContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(passwordInput.getControlProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
PasswordInputControl.displayName = "PasswordInputControl";
|
|
18
|
+
|
|
19
|
+
exports.PasswordInputControl = PasswordInputControl;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputControlBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface PasswordInputControlProps extends HTMLProps<'div'>, PasswordInputControlBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const PasswordInputControl: ForwardRefExoticComponent<PasswordInputControlProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputControlBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface PasswordInputControlProps extends HTMLProps<'div'>, PasswordInputControlBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const PasswordInputControl: ForwardRefExoticComponent<PasswordInputControlProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { usePasswordInputContext } from './use-password-input-context.js';
|
|
7
|
+
|
|
8
|
+
const PasswordInputControl = forwardRef((props, ref) => {
|
|
9
|
+
const passwordInput = usePasswordInputContext();
|
|
10
|
+
const mergedProps = mergeProps(passwordInput.getControlProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
PasswordInputControl.displayName = "PasswordInputControl";
|
|
14
|
+
|
|
15
|
+
export { PasswordInputControl };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const react$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const usePasswordInputContext = require('./use-password-input-context.cjs');
|
|
11
|
+
|
|
12
|
+
const PasswordInputIndicator = react.forwardRef((props, ref) => {
|
|
13
|
+
const passwordInput = usePasswordInputContext.usePasswordInputContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(passwordInput.getIndicatorProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children: passwordInput.visible ? props.children : props.fallback });
|
|
16
|
+
});
|
|
17
|
+
PasswordInputIndicator.displayName = "PasswordInputIndicator";
|
|
18
|
+
|
|
19
|
+
exports.PasswordInputIndicator = PasswordInputIndicator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputIndicatorBaseProps extends PolymorphicProps {
|
|
4
|
+
/**
|
|
5
|
+
* The fallback content to display when the password is not visible.
|
|
6
|
+
*/
|
|
7
|
+
fallback?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface PasswordInputIndicatorProps extends HTMLProps<'span'>, PasswordInputIndicatorBaseProps {
|
|
10
|
+
}
|
|
11
|
+
export declare const PasswordInputIndicator: ForwardRefExoticComponent<PasswordInputIndicatorProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputIndicatorBaseProps extends PolymorphicProps {
|
|
4
|
+
/**
|
|
5
|
+
* The fallback content to display when the password is not visible.
|
|
6
|
+
*/
|
|
7
|
+
fallback?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface PasswordInputIndicatorProps extends HTMLProps<'span'>, PasswordInputIndicatorBaseProps {
|
|
10
|
+
}
|
|
11
|
+
export declare const PasswordInputIndicator: ForwardRefExoticComponent<PasswordInputIndicatorProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { usePasswordInputContext } from './use-password-input-context.js';
|
|
7
|
+
|
|
8
|
+
const PasswordInputIndicator = forwardRef((props, ref) => {
|
|
9
|
+
const passwordInput = usePasswordInputContext();
|
|
10
|
+
const mergedProps = mergeProps(passwordInput.getIndicatorProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: passwordInput.visible ? props.children : props.fallback });
|
|
12
|
+
});
|
|
13
|
+
PasswordInputIndicator.displayName = "PasswordInputIndicator";
|
|
14
|
+
|
|
15
|
+
export { PasswordInputIndicator };
|