@ark-ui/react 5.9.2 → 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/field/use-field.cjs +7 -5
- package/dist/components/field/use-field.js +8 -6
- package/dist/components/fieldset/use-fieldset.cjs +11 -9
- package/dist/components/fieldset/use-fieldset.js +12 -10
- package/dist/components/index.cjs +27 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +13 -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 +27 -0
- package/dist/index.js +13 -0
- package/dist/providers/environment/environment-provider.cjs +1 -1
- package/dist/providers/environment/environment-provider.js +1 -1
- package/package.json +62 -59
|
@@ -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);
|
|
@@ -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
|
);
|
|
@@ -342,6 +342,17 @@ const paginationRootProvider = require('./pagination/pagination-root-provider.cj
|
|
|
342
342
|
const usePagination = require('./pagination/use-pagination.cjs');
|
|
343
343
|
const usePaginationContext = require('./pagination/use-pagination-context.cjs');
|
|
344
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');
|
|
345
356
|
const pinInputContext = require('./pin-input/pin-input-context.cjs');
|
|
346
357
|
const pinInputControl = require('./pin-input/pin-input-control.cjs');
|
|
347
358
|
const pinInputHiddenInput = require('./pin-input/pin-input-hidden-input.cjs');
|
|
@@ -670,6 +681,7 @@ const listbox = require('@zag-js/listbox');
|
|
|
670
681
|
const menu = require('@zag-js/menu');
|
|
671
682
|
const numberInput = require('@zag-js/number-input');
|
|
672
683
|
const pagination = require('@zag-js/pagination');
|
|
684
|
+
const passwordInput = require('@zag-js/password-input');
|
|
673
685
|
const pinInput = require('@zag-js/pin-input');
|
|
674
686
|
const popover = require('@zag-js/popover');
|
|
675
687
|
const progress = require('@zag-js/progress');
|
|
@@ -1042,6 +1054,17 @@ exports.PaginationRootProvider = paginationRootProvider.PaginationRootProvider;
|
|
|
1042
1054
|
exports.usePagination = usePagination.usePagination;
|
|
1043
1055
|
exports.usePaginationContext = usePaginationContext.usePaginationContext;
|
|
1044
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;
|
|
1045
1068
|
exports.PinInputContext = pinInputContext.PinInputContext;
|
|
1046
1069
|
exports.PinInputControl = pinInputControl.PinInputControl;
|
|
1047
1070
|
exports.PinInputHiddenInput = pinInputHiddenInput.PinInputHiddenInput;
|
|
@@ -1422,6 +1445,10 @@ Object.defineProperty(exports, "paginationAnatomy", {
|
|
|
1422
1445
|
enumerable: true,
|
|
1423
1446
|
get: () => pagination.anatomy
|
|
1424
1447
|
});
|
|
1448
|
+
Object.defineProperty(exports, "passwordInputAnatomy", {
|
|
1449
|
+
enumerable: true,
|
|
1450
|
+
get: () => passwordInput.anatomy
|
|
1451
|
+
});
|
|
1425
1452
|
Object.defineProperty(exports, "pinInputAnatomy", {
|
|
1426
1453
|
enumerable: true,
|
|
1427
1454
|
get: () => pinInput.anatomy
|
package/dist/components/index.js
CHANGED
|
@@ -360,6 +360,18 @@ export { usePagination } from './pagination/use-pagination.js';
|
|
|
360
360
|
export { usePaginationContext } from './pagination/use-pagination-context.js';
|
|
361
361
|
import * as pagination from './pagination/pagination.js';
|
|
362
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 };
|
|
363
375
|
export { PinInputContext } from './pin-input/pin-input-context.js';
|
|
364
376
|
export { PinInputControl } from './pin-input/pin-input-control.js';
|
|
365
377
|
export { PinInputHiddenInput } from './pin-input/pin-input-hidden-input.js';
|
|
@@ -711,6 +723,7 @@ export { anatomy as listboxAnatomy } from '@zag-js/listbox';
|
|
|
711
723
|
export { anatomy as menuAnatomy } from '@zag-js/menu';
|
|
712
724
|
export { anatomy as numberInputAnatomy } from '@zag-js/number-input';
|
|
713
725
|
export { anatomy as paginationAnatomy } from '@zag-js/pagination';
|
|
726
|
+
export { anatomy as passwordInputAnatomy } from '@zag-js/password-input';
|
|
714
727
|
export { anatomy as pinInputAnatomy } from '@zag-js/pin-input';
|
|
715
728
|
export { anatomy as popoverAnatomy } from '@zag-js/popover';
|
|
716
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 };
|
|
@@ -0,0 +1,21 @@
|
|
|
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 useFieldContext = require('../field/use-field-context.cjs');
|
|
11
|
+
const usePasswordInputContext = require('./use-password-input-context.cjs');
|
|
12
|
+
|
|
13
|
+
const PasswordInputInput = react.forwardRef((props, ref) => {
|
|
14
|
+
const passwordInput = usePasswordInputContext.usePasswordInputContext();
|
|
15
|
+
const mergedProps = react$1.mergeProps(passwordInput.getInputProps(), props);
|
|
16
|
+
const field = useFieldContext.useFieldContext();
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
18
|
+
});
|
|
19
|
+
PasswordInputInput.displayName = "PasswordInputInput";
|
|
20
|
+
|
|
21
|
+
exports.PasswordInputInput = PasswordInputInput;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputInputBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface PasswordInputInputProps extends HTMLProps<'input'>, PasswordInputInputBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const PasswordInputInput: ForwardRefExoticComponent<PasswordInputInputProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputInputBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface PasswordInputInputProps extends HTMLProps<'input'>, PasswordInputInputBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const PasswordInputInput: ForwardRefExoticComponent<PasswordInputInputProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { useFieldContext } from '../field/use-field-context.js';
|
|
7
|
+
import { usePasswordInputContext } from './use-password-input-context.js';
|
|
8
|
+
|
|
9
|
+
const PasswordInputInput = forwardRef((props, ref) => {
|
|
10
|
+
const passwordInput = usePasswordInputContext();
|
|
11
|
+
const mergedProps = mergeProps(passwordInput.getInputProps(), props);
|
|
12
|
+
const field = useFieldContext();
|
|
13
|
+
return /* @__PURE__ */ jsx(ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
14
|
+
});
|
|
15
|
+
PasswordInputInput.displayName = "PasswordInputInput";
|
|
16
|
+
|
|
17
|
+
export { PasswordInputInput };
|
|
@@ -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 PasswordInputLabel = react.forwardRef((props, ref) => {
|
|
13
|
+
const passwordInput = usePasswordInputContext.usePasswordInputContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(passwordInput.getLabelProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.label, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
PasswordInputLabel.displayName = "PasswordInputLabel";
|
|
18
|
+
|
|
19
|
+
exports.PasswordInputLabel = PasswordInputLabel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputLabelBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface PasswordInputLabelProps extends HTMLProps<'label'>, PasswordInputLabelBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const PasswordInputLabel: ForwardRefExoticComponent<PasswordInputLabelProps & RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface PasswordInputLabelBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface PasswordInputLabelProps extends HTMLProps<'label'>, PasswordInputLabelBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const PasswordInputLabel: ForwardRefExoticComponent<PasswordInputLabelProps & RefAttributes<HTMLLabelElement>>;
|