@ark-ui/react 3.4.0-1 → 3.4.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/checkbox/checkbox-hidden-input.cjs +3 -1
- package/dist/components/checkbox/checkbox-hidden-input.js +3 -1
- package/dist/components/checkbox/use-checkbox.cjs +10 -0
- package/dist/components/checkbox/use-checkbox.js +10 -0
- package/dist/components/color-picker/color-picker-hidden-input.cjs +3 -1
- package/dist/components/color-picker/color-picker-hidden-input.js +3 -1
- package/dist/components/color-picker/color-picker-root.cjs +1 -0
- package/dist/components/color-picker/color-picker-root.js +1 -0
- package/dist/components/color-picker/use-color-picker.cjs +9 -0
- package/dist/components/color-picker/use-color-picker.js +9 -0
- package/dist/components/combobox/combobox-input.cjs +3 -1
- package/dist/components/combobox/combobox-input.js +3 -1
- package/dist/components/combobox/combobox-root.cjs +1 -0
- package/dist/components/combobox/combobox-root.js +1 -0
- package/dist/components/combobox/use-combobox.cjs +10 -0
- package/dist/components/combobox/use-combobox.js +10 -0
- package/dist/components/dialog/dialog-description.d.cts +1 -1
- package/dist/components/dialog/dialog-description.d.ts +1 -1
- package/dist/components/editable/editable-input.cjs +3 -1
- package/dist/components/editable/editable-input.js +3 -1
- package/dist/components/editable/editable-root.cjs +1 -0
- package/dist/components/editable/editable-root.js +1 -0
- package/dist/components/editable/use-editable.cjs +10 -0
- package/dist/components/editable/use-editable.js +10 -0
- package/dist/components/field/field-context.cjs +10 -0
- package/dist/components/field/field-context.d.cts +7 -0
- package/dist/components/field/field-context.d.ts +7 -0
- package/dist/components/field/field-context.js +6 -0
- package/dist/components/field/field-error-text.cjs +22 -0
- package/dist/components/field/field-error-text.d.cts +8 -0
- package/dist/components/field/field-error-text.d.ts +8 -0
- package/dist/components/field/field-error-text.js +18 -0
- package/dist/components/field/field-helper-text.cjs +19 -0
- package/dist/components/field/field-helper-text.d.cts +8 -0
- package/dist/components/field/field-helper-text.d.ts +8 -0
- package/dist/components/field/field-helper-text.js +15 -0
- package/dist/components/field/field-input.cjs +19 -0
- package/dist/components/field/field-input.d.cts +8 -0
- package/dist/components/field/field-input.d.ts +8 -0
- package/dist/components/field/field-input.js +15 -0
- package/dist/components/field/field-label.cjs +19 -0
- package/dist/components/field/field-label.d.cts +8 -0
- package/dist/components/field/field-label.d.ts +8 -0
- package/dist/components/field/field-label.js +15 -0
- package/dist/components/field/field-root-provider.cjs +22 -0
- package/dist/components/field/field-root-provider.d.cts +13 -0
- package/dist/components/field/field-root-provider.d.ts +13 -0
- package/dist/components/field/field-root-provider.js +18 -0
- package/dist/components/field/field-root.cjs +29 -0
- package/dist/components/field/field-root.d.cts +9 -0
- package/dist/components/field/field-root.d.ts +9 -0
- package/dist/components/field/field-root.js +25 -0
- package/dist/components/field/field-select.cjs +19 -0
- package/dist/components/field/field-select.d.cts +8 -0
- package/dist/components/field/field-select.d.ts +8 -0
- package/dist/components/field/field-select.js +15 -0
- package/dist/components/field/field-textarea.cjs +19 -0
- package/dist/components/field/field-textarea.d.cts +8 -0
- package/dist/components/field/field-textarea.d.ts +8 -0
- package/dist/components/field/field-textarea.js +15 -0
- package/dist/components/field/field.cjs +25 -0
- package/dist/components/field/field.d.cts +9 -0
- package/dist/components/field/field.d.ts +9 -0
- package/dist/components/field/field.js +9 -0
- package/dist/components/field/index.cjs +29 -0
- package/dist/components/field/index.d.cts +11 -0
- package/dist/components/field/index.d.ts +11 -0
- package/dist/components/field/index.js +12 -0
- package/dist/components/field/use-field-context.cjs +16 -0
- package/dist/components/field/use-field-context.d.cts +6 -0
- package/dist/components/field/use-field-context.d.ts +6 -0
- package/dist/components/field/use-field-context.js +11 -0
- package/dist/components/field/use-field.cjs +110 -0
- package/dist/components/field/use-field.d.cts +100 -0
- package/dist/components/field/use-field.d.ts +100 -0
- package/dist/components/field/use-field.js +106 -0
- package/dist/components/file-upload/file-upload-hidden-input.cjs +3 -1
- package/dist/components/file-upload/file-upload-hidden-input.js +3 -1
- package/dist/components/file-upload/file-upload-root.cjs +1 -0
- package/dist/components/file-upload/file-upload-root.js +1 -0
- package/dist/components/file-upload/use-file-upload.cjs +8 -0
- package/dist/components/file-upload/use-file-upload.js +8 -0
- package/dist/components/index.cjs +24 -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/menu/menu-checkbox-item.cjs +2 -2
- package/dist/components/menu/menu-checkbox-item.js +2 -2
- package/dist/components/menu/menu-radio-item.cjs +2 -2
- package/dist/components/menu/menu-radio-item.js +2 -2
- package/dist/components/number-input/number-input-input.cjs +3 -1
- package/dist/components/number-input/number-input-input.js +3 -1
- package/dist/components/number-input/number-input-root.cjs +1 -0
- package/dist/components/number-input/number-input-root.js +1 -0
- package/dist/components/number-input/use-number-input.cjs +10 -0
- package/dist/components/number-input/use-number-input.js +10 -0
- package/dist/components/pin-input/pin-input-hidden-input.cjs +3 -1
- package/dist/components/pin-input/pin-input-hidden-input.js +3 -1
- package/dist/components/pin-input/pin-input-root.cjs +2 -0
- package/dist/components/pin-input/pin-input-root.js +2 -0
- package/dist/components/pin-input/use-pin-input.cjs +10 -0
- package/dist/components/pin-input/use-pin-input.js +10 -0
- package/dist/components/popover/popover-description.d.cts +1 -1
- package/dist/components/popover/popover-description.d.ts +1 -1
- package/dist/components/portal/portal.cjs +8 -2
- package/dist/components/portal/portal.js +8 -2
- package/dist/components/rating-group/rating-group-hidden-input.cjs +3 -1
- package/dist/components/rating-group/rating-group-hidden-input.js +3 -1
- package/dist/components/rating-group/rating-group-root.cjs +1 -0
- package/dist/components/rating-group/rating-group-root.js +1 -0
- package/dist/components/rating-group/use-rating-group.cjs +9 -0
- package/dist/components/rating-group/use-rating-group.js +9 -0
- package/dist/components/select/select-hidden-select.cjs +3 -1
- package/dist/components/select/select-hidden-select.js +3 -1
- package/dist/components/select/select-root.cjs +1 -0
- package/dist/components/select/select-root.js +1 -0
- package/dist/components/select/use-select.cjs +10 -0
- package/dist/components/select/use-select.js +10 -0
- package/dist/components/signature-pad/index.cjs +2 -0
- package/dist/components/signature-pad/index.d.cts +1 -0
- package/dist/components/signature-pad/index.d.ts +1 -0
- package/dist/components/signature-pad/index.js +1 -0
- package/dist/components/signature-pad/signature-pad-hidden-input.cjs +25 -0
- package/dist/components/signature-pad/signature-pad-hidden-input.d.cts +10 -0
- package/dist/components/signature-pad/signature-pad-hidden-input.d.ts +10 -0
- package/dist/components/signature-pad/signature-pad-hidden-input.js +21 -0
- package/dist/components/signature-pad/signature-pad-root.cjs +4 -1
- package/dist/components/signature-pad/signature-pad-root.js +4 -1
- package/dist/components/signature-pad/signature-pad.cjs +2 -0
- package/dist/components/signature-pad/signature-pad.d.cts +1 -0
- package/dist/components/signature-pad/signature-pad.d.ts +1 -0
- package/dist/components/signature-pad/signature-pad.js +1 -0
- package/dist/components/signature-pad/use-signature-pad.cjs +9 -0
- package/dist/components/signature-pad/use-signature-pad.js +9 -0
- package/dist/components/switch/switch-hidden-input.cjs +3 -1
- package/dist/components/switch/switch-hidden-input.js +3 -1
- package/dist/components/switch/use-switch.cjs +10 -0
- package/dist/components/switch/use-switch.js +10 -0
- package/dist/components/tags-input/tags-input-hidden-input.cjs +3 -1
- package/dist/components/tags-input/tags-input-hidden-input.js +3 -1
- package/dist/components/tags-input/tags-input-root.cjs +1 -0
- package/dist/components/tags-input/tags-input-root.js +1 -0
- package/dist/components/tags-input/use-tags-input.cjs +10 -0
- package/dist/components/tags-input/use-tags-input.js +10 -0
- package/dist/index.cjs +24 -0
- package/dist/index.js +13 -0
- package/package.json +60 -49
|
@@ -7,13 +7,15 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
10
11
|
const useCheckboxContext = require('./use-checkbox-context.cjs');
|
|
11
12
|
|
|
12
13
|
const CheckboxHiddenInput = react.forwardRef(
|
|
13
14
|
(props, ref) => {
|
|
14
15
|
const checkbox = useCheckboxContext.useCheckboxContext();
|
|
15
16
|
const mergedProps = react$1.mergeProps(checkbox.getHiddenInputProps(), props);
|
|
16
|
-
|
|
17
|
+
const field = useFieldContext.useFieldContext();
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
17
19
|
}
|
|
18
20
|
);
|
|
19
21
|
CheckboxHiddenInput.displayName = "CheckboxHiddenInput";
|
|
@@ -3,13 +3,15 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.js';
|
|
6
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
6
7
|
import { useCheckboxContext } from './use-checkbox-context.js';
|
|
7
8
|
|
|
8
9
|
const CheckboxHiddenInput = forwardRef(
|
|
9
10
|
(props, ref) => {
|
|
10
11
|
const checkbox = useCheckboxContext();
|
|
11
12
|
const mergedProps = mergeProps(checkbox.getHiddenInputProps(), props);
|
|
12
|
-
|
|
13
|
+
const field = useFieldContext();
|
|
14
|
+
return /* @__PURE__ */ jsx(ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
13
15
|
}
|
|
14
16
|
);
|
|
15
17
|
CheckboxHiddenInput.displayName = "CheckboxHiddenInput";
|
|
@@ -9,6 +9,7 @@ const react = require('react');
|
|
|
9
9
|
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
10
10
|
const useLocaleContext = require('../../providers/locale/use-locale-context.cjs');
|
|
11
11
|
const useEvent = require('../../utils/use-event.cjs');
|
|
12
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
12
13
|
const useCheckboxGroupContext = require('./use-checkbox-group-context.cjs');
|
|
13
14
|
|
|
14
15
|
function _interopNamespaceDefault(e) {
|
|
@@ -32,6 +33,7 @@ const checkbox__namespace = /*#__PURE__*/_interopNamespaceDefault(checkbox);
|
|
|
32
33
|
|
|
33
34
|
const useCheckbox = (ownProps = {}) => {
|
|
34
35
|
const checkboxGroup = useCheckboxGroupContext.useCheckboxGroupContext();
|
|
36
|
+
const field = useFieldContext.useFieldContext();
|
|
35
37
|
const props = react.useMemo(() => {
|
|
36
38
|
return react$1.mergeProps(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});
|
|
37
39
|
}, [ownProps, checkboxGroup]);
|
|
@@ -39,7 +41,15 @@ const useCheckbox = (ownProps = {}) => {
|
|
|
39
41
|
const { dir } = useLocaleContext.useLocaleContext();
|
|
40
42
|
const initialContext = {
|
|
41
43
|
id: react.useId(),
|
|
44
|
+
ids: {
|
|
45
|
+
label: field?.ids.label,
|
|
46
|
+
hiddenInput: field?.ids.control
|
|
47
|
+
},
|
|
42
48
|
dir,
|
|
49
|
+
disabled: field?.disabled,
|
|
50
|
+
readOnly: field?.readOnly,
|
|
51
|
+
invalid: field?.invalid,
|
|
52
|
+
required: field?.required,
|
|
43
53
|
getRootNode,
|
|
44
54
|
checked: props.defaultChecked,
|
|
45
55
|
...props
|
|
@@ -5,10 +5,12 @@ import { useMemo, useId } from 'react';
|
|
|
5
5
|
import { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';
|
|
6
6
|
import { useLocaleContext } from '../../providers/locale/use-locale-context.js';
|
|
7
7
|
import { useEvent } from '../../utils/use-event.js';
|
|
8
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
8
9
|
import { useCheckboxGroupContext } from './use-checkbox-group-context.js';
|
|
9
10
|
|
|
10
11
|
const useCheckbox = (ownProps = {}) => {
|
|
11
12
|
const checkboxGroup = useCheckboxGroupContext();
|
|
13
|
+
const field = useFieldContext();
|
|
12
14
|
const props = useMemo(() => {
|
|
13
15
|
return mergeProps(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});
|
|
14
16
|
}, [ownProps, checkboxGroup]);
|
|
@@ -16,7 +18,15 @@ const useCheckbox = (ownProps = {}) => {
|
|
|
16
18
|
const { dir } = useLocaleContext();
|
|
17
19
|
const initialContext = {
|
|
18
20
|
id: useId(),
|
|
21
|
+
ids: {
|
|
22
|
+
label: field?.ids.label,
|
|
23
|
+
hiddenInput: field?.ids.control
|
|
24
|
+
},
|
|
19
25
|
dir,
|
|
26
|
+
disabled: field?.disabled,
|
|
27
|
+
readOnly: field?.readOnly,
|
|
28
|
+
invalid: field?.invalid,
|
|
29
|
+
required: field?.required,
|
|
20
30
|
getRootNode,
|
|
21
31
|
checked: props.defaultChecked,
|
|
22
32
|
...props
|
|
@@ -7,13 +7,15 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
10
11
|
const useColorPickerContext = require('./use-color-picker-context.cjs');
|
|
11
12
|
|
|
12
13
|
const ColorPickerHiddenInput = react.forwardRef(
|
|
13
14
|
(props, ref) => {
|
|
14
15
|
const colorPicker = useColorPickerContext.useColorPickerContext();
|
|
15
16
|
const mergedProps = react$1.mergeProps(colorPicker.getHiddenInputProps(), props);
|
|
16
|
-
|
|
17
|
+
const field = useFieldContext.useFieldContext();
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
17
19
|
}
|
|
18
20
|
);
|
|
19
21
|
ColorPickerHiddenInput.displayName = "ColorPickerHiddenInput";
|
|
@@ -3,13 +3,15 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.js';
|
|
6
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
6
7
|
import { useColorPickerContext } from './use-color-picker-context.js';
|
|
7
8
|
|
|
8
9
|
const ColorPickerHiddenInput = forwardRef(
|
|
9
10
|
(props, ref) => {
|
|
10
11
|
const colorPicker = useColorPickerContext();
|
|
11
12
|
const mergedProps = mergeProps(colorPicker.getHiddenInputProps(), props);
|
|
12
|
-
|
|
13
|
+
const field = useFieldContext();
|
|
14
|
+
return /* @__PURE__ */ jsx(ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
13
15
|
}
|
|
14
16
|
);
|
|
15
17
|
ColorPickerHiddenInput.displayName = "ColorPickerHiddenInput";
|
|
@@ -9,6 +9,7 @@ const react = require('react');
|
|
|
9
9
|
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
10
10
|
const useLocaleContext = require('../../providers/locale/use-locale-context.cjs');
|
|
11
11
|
const useEvent = require('../../utils/use-event.cjs');
|
|
12
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
12
13
|
|
|
13
14
|
function _interopNamespaceDefault(e) {
|
|
14
15
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -32,9 +33,17 @@ const colorPicker__namespace = /*#__PURE__*/_interopNamespaceDefault(colorPicker
|
|
|
32
33
|
const useColorPicker = (props) => {
|
|
33
34
|
const { getRootNode } = useEnvironmentContext.useEnvironmentContext();
|
|
34
35
|
const { dir } = useLocaleContext.useLocaleContext();
|
|
36
|
+
const field = useFieldContext.useFieldContext();
|
|
35
37
|
const initialContext = {
|
|
36
38
|
id: react.useId(),
|
|
39
|
+
ids: {
|
|
40
|
+
label: field?.ids.label,
|
|
41
|
+
input: field?.ids.control
|
|
42
|
+
},
|
|
37
43
|
dir,
|
|
44
|
+
disabled: field?.disabled,
|
|
45
|
+
readOnly: field?.readOnly,
|
|
46
|
+
required: field?.required,
|
|
38
47
|
getRootNode,
|
|
39
48
|
open: props.defaultOpen,
|
|
40
49
|
"open.controlled": props.open !== void 0,
|
|
@@ -5,13 +5,22 @@ import { useId } from 'react';
|
|
|
5
5
|
import { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';
|
|
6
6
|
import { useLocaleContext } from '../../providers/locale/use-locale-context.js';
|
|
7
7
|
import { useEvent } from '../../utils/use-event.js';
|
|
8
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
8
9
|
|
|
9
10
|
const useColorPicker = (props) => {
|
|
10
11
|
const { getRootNode } = useEnvironmentContext();
|
|
11
12
|
const { dir } = useLocaleContext();
|
|
13
|
+
const field = useFieldContext();
|
|
12
14
|
const initialContext = {
|
|
13
15
|
id: useId(),
|
|
16
|
+
ids: {
|
|
17
|
+
label: field?.ids.label,
|
|
18
|
+
input: field?.ids.control
|
|
19
|
+
},
|
|
14
20
|
dir,
|
|
21
|
+
disabled: field?.disabled,
|
|
22
|
+
readOnly: field?.readOnly,
|
|
23
|
+
required: field?.required,
|
|
15
24
|
getRootNode,
|
|
16
25
|
open: props.defaultOpen,
|
|
17
26
|
"open.controlled": props.open !== void 0,
|
|
@@ -7,12 +7,14 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
10
11
|
const useComboboxContext = require('./use-combobox-context.cjs');
|
|
11
12
|
|
|
12
13
|
const ComboboxInput = react.forwardRef((props, ref) => {
|
|
13
14
|
const combobox = useComboboxContext.useComboboxContext();
|
|
14
15
|
const mergedProps = react$1.mergeProps(combobox.getInputProps(), props);
|
|
15
|
-
|
|
16
|
+
const field = useFieldContext.useFieldContext();
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
16
18
|
});
|
|
17
19
|
ComboboxInput.displayName = "ComboboxInput";
|
|
18
20
|
|
|
@@ -3,12 +3,14 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.js';
|
|
6
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
6
7
|
import { useComboboxContext } from './use-combobox-context.js';
|
|
7
8
|
|
|
8
9
|
const ComboboxInput = forwardRef((props, ref) => {
|
|
9
10
|
const combobox = useComboboxContext();
|
|
10
11
|
const mergedProps = mergeProps(combobox.getInputProps(), props);
|
|
11
|
-
|
|
12
|
+
const field = useFieldContext();
|
|
13
|
+
return /* @__PURE__ */ jsx(ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
12
14
|
});
|
|
13
15
|
ComboboxInput.displayName = "ComboboxInput";
|
|
14
16
|
|
|
@@ -10,6 +10,7 @@ const useEnvironmentContext = require('../../providers/environment/use-environme
|
|
|
10
10
|
const useLocaleContext = require('../../providers/locale/use-locale-context.cjs');
|
|
11
11
|
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
12
12
|
const useEvent = require('../../utils/use-event.cjs');
|
|
13
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
13
14
|
|
|
14
15
|
function _interopNamespaceDefault(e) {
|
|
15
16
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -43,8 +44,17 @@ const useCombobox = (props) => {
|
|
|
43
44
|
);
|
|
44
45
|
const { dir } = useLocaleContext.useLocaleContext();
|
|
45
46
|
const { getRootNode } = useEnvironmentContext.useEnvironmentContext();
|
|
47
|
+
const field = useFieldContext.useFieldContext();
|
|
46
48
|
const initialContext = {
|
|
47
49
|
id: react.useId(),
|
|
50
|
+
ids: {
|
|
51
|
+
label: field?.ids.label,
|
|
52
|
+
input: field?.ids.control
|
|
53
|
+
},
|
|
54
|
+
disabled: field?.disabled,
|
|
55
|
+
readOnly: field?.readOnly,
|
|
56
|
+
required: field?.required,
|
|
57
|
+
invalid: field?.invalid,
|
|
48
58
|
dir,
|
|
49
59
|
getRootNode,
|
|
50
60
|
collection,
|
|
@@ -6,6 +6,7 @@ import { useEnvironmentContext } from '../../providers/environment/use-environme
|
|
|
6
6
|
import { useLocaleContext } from '../../providers/locale/use-locale-context.js';
|
|
7
7
|
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
8
8
|
import { useEvent } from '../../utils/use-event.js';
|
|
9
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
9
10
|
|
|
10
11
|
const useCombobox = (props) => {
|
|
11
12
|
const [collectionOptions, comboboxProps] = createSplitProps()(props, [
|
|
@@ -20,8 +21,17 @@ const useCombobox = (props) => {
|
|
|
20
21
|
);
|
|
21
22
|
const { dir } = useLocaleContext();
|
|
22
23
|
const { getRootNode } = useEnvironmentContext();
|
|
24
|
+
const field = useFieldContext();
|
|
23
25
|
const initialContext = {
|
|
24
26
|
id: useId(),
|
|
27
|
+
ids: {
|
|
28
|
+
label: field?.ids.label,
|
|
29
|
+
input: field?.ids.control
|
|
30
|
+
},
|
|
31
|
+
disabled: field?.disabled,
|
|
32
|
+
readOnly: field?.readOnly,
|
|
33
|
+
required: field?.required,
|
|
34
|
+
invalid: field?.invalid,
|
|
25
35
|
dir,
|
|
26
36
|
getRootNode,
|
|
27
37
|
collection,
|
|
@@ -5,4 +5,4 @@ export interface DialogDescriptionBaseProps extends PolymorphicProps {
|
|
|
5
5
|
}
|
|
6
6
|
export interface DialogDescriptionProps extends HTMLProps<'div'>, DialogDescriptionBaseProps {
|
|
7
7
|
}
|
|
8
|
-
export declare const DialogDescription: ForwardRefExoticComponent<DialogDescriptionProps & RefAttributes<
|
|
8
|
+
export declare const DialogDescription: ForwardRefExoticComponent<DialogDescriptionProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -5,4 +5,4 @@ export interface DialogDescriptionBaseProps extends PolymorphicProps {
|
|
|
5
5
|
}
|
|
6
6
|
export interface DialogDescriptionProps extends HTMLProps<'div'>, DialogDescriptionBaseProps {
|
|
7
7
|
}
|
|
8
|
-
export declare const DialogDescription: ForwardRefExoticComponent<DialogDescriptionProps & RefAttributes<
|
|
8
|
+
export declare const DialogDescription: ForwardRefExoticComponent<DialogDescriptionProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -7,12 +7,14 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
10
11
|
const useEditableContext = require('./use-editable-context.cjs');
|
|
11
12
|
|
|
12
13
|
const EditableInput = react.forwardRef((props, ref) => {
|
|
13
14
|
const editable = useEditableContext.useEditableContext();
|
|
14
15
|
const mergedProps = react$1.mergeProps(editable.getInputProps(), props);
|
|
15
|
-
|
|
16
|
+
const field = useFieldContext.useFieldContext();
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
16
18
|
});
|
|
17
19
|
EditableInput.displayName = "EditableInput";
|
|
18
20
|
|
|
@@ -3,12 +3,14 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.js';
|
|
6
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
6
7
|
import { useEditableContext } from './use-editable-context.js';
|
|
7
8
|
|
|
8
9
|
const EditableInput = forwardRef((props, ref) => {
|
|
9
10
|
const editable = useEditableContext();
|
|
10
11
|
const mergedProps = mergeProps(editable.getInputProps(), props);
|
|
11
|
-
|
|
12
|
+
const field = useFieldContext();
|
|
13
|
+
return /* @__PURE__ */ jsx(ark.input, { "aria-describedby": field?.ariaDescribedby, ...mergedProps, ref });
|
|
12
14
|
});
|
|
13
15
|
EditableInput.displayName = "EditableInput";
|
|
14
16
|
|
|
@@ -9,6 +9,7 @@ const react = require('react');
|
|
|
9
9
|
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
10
10
|
const useLocaleContext = require('../../providers/locale/use-locale-context.cjs');
|
|
11
11
|
const useEvent = require('../../utils/use-event.cjs');
|
|
12
|
+
const useFieldContext = require('../field/use-field-context.cjs');
|
|
12
13
|
|
|
13
14
|
function _interopNamespaceDefault(e) {
|
|
14
15
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -32,9 +33,18 @@ const editable__namespace = /*#__PURE__*/_interopNamespaceDefault(editable);
|
|
|
32
33
|
const useEditable = (props = {}) => {
|
|
33
34
|
const { getRootNode } = useEnvironmentContext.useEnvironmentContext();
|
|
34
35
|
const { dir } = useLocaleContext.useLocaleContext();
|
|
36
|
+
const field = useFieldContext.useFieldContext();
|
|
35
37
|
const initialContext = {
|
|
36
38
|
id: react.useId(),
|
|
39
|
+
ids: {
|
|
40
|
+
label: field?.ids.label,
|
|
41
|
+
input: field?.ids.control
|
|
42
|
+
},
|
|
37
43
|
dir,
|
|
44
|
+
disabled: field?.disabled,
|
|
45
|
+
invalid: field?.invalid,
|
|
46
|
+
readOnly: field?.readOnly,
|
|
47
|
+
required: field?.required,
|
|
38
48
|
getRootNode,
|
|
39
49
|
value: props.defaultValue,
|
|
40
50
|
...props
|
|
@@ -5,13 +5,23 @@ import { useId } from 'react';
|
|
|
5
5
|
import { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';
|
|
6
6
|
import { useLocaleContext } from '../../providers/locale/use-locale-context.js';
|
|
7
7
|
import { useEvent } from '../../utils/use-event.js';
|
|
8
|
+
import { useFieldContext } from '../field/use-field-context.js';
|
|
8
9
|
|
|
9
10
|
const useEditable = (props = {}) => {
|
|
10
11
|
const { getRootNode } = useEnvironmentContext();
|
|
11
12
|
const { dir } = useLocaleContext();
|
|
13
|
+
const field = useFieldContext();
|
|
12
14
|
const initialContext = {
|
|
13
15
|
id: useId(),
|
|
16
|
+
ids: {
|
|
17
|
+
label: field?.ids.label,
|
|
18
|
+
input: field?.ids.control
|
|
19
|
+
},
|
|
14
20
|
dir,
|
|
21
|
+
disabled: field?.disabled,
|
|
22
|
+
invalid: field?.invalid,
|
|
23
|
+
readOnly: field?.readOnly,
|
|
24
|
+
required: field?.required,
|
|
15
25
|
getRootNode,
|
|
16
26
|
value: props.defaultValue,
|
|
17
27
|
...props
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const useFieldContext = require('./use-field-context.cjs');
|
|
7
|
+
|
|
8
|
+
const FieldContext = (props) => props.children(useFieldContext.useFieldContext());
|
|
9
|
+
|
|
10
|
+
exports.FieldContext = FieldContext;
|
|
@@ -0,0 +1,22 @@
|
|
|
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('./use-field-context.cjs');
|
|
11
|
+
|
|
12
|
+
const FieldErrorText = react.forwardRef((props, ref) => {
|
|
13
|
+
const field = useFieldContext.useFieldContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(field.getErrorTextProps(), props);
|
|
15
|
+
if (field?.invalid) {
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref });
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
});
|
|
20
|
+
FieldErrorText.displayName = "FieldErrorText";
|
|
21
|
+
|
|
22
|
+
exports.FieldErrorText = FieldErrorText;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldErrorTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldErrorTextProps extends HTMLProps<'span'>, FieldErrorTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldErrorText: ForwardRefExoticComponent<FieldErrorTextProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldErrorTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldErrorTextProps extends HTMLProps<'span'>, FieldErrorTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldErrorText: ForwardRefExoticComponent<FieldErrorTextProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 './use-field-context.js';
|
|
7
|
+
|
|
8
|
+
const FieldErrorText = forwardRef((props, ref) => {
|
|
9
|
+
const field = useFieldContext();
|
|
10
|
+
const mergedProps = mergeProps(field.getErrorTextProps(), props);
|
|
11
|
+
if (field?.invalid) {
|
|
12
|
+
return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
});
|
|
16
|
+
FieldErrorText.displayName = "FieldErrorText";
|
|
17
|
+
|
|
18
|
+
export { FieldErrorText };
|
|
@@ -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 useFieldContext = require('./use-field-context.cjs');
|
|
11
|
+
|
|
12
|
+
const FieldHelperText = react.forwardRef((props, ref) => {
|
|
13
|
+
const field = useFieldContext.useFieldContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(field?.getHelperTextProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
FieldHelperText.displayName = "FieldHelperText";
|
|
18
|
+
|
|
19
|
+
exports.FieldHelperText = FieldHelperText;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldHelperTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldHelperTextProps extends HTMLProps<'span'>, FieldHelperTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldHelperText: ForwardRefExoticComponent<FieldHelperTextProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldHelperTextBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldHelperTextProps extends HTMLProps<'span'>, FieldHelperTextBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldHelperText: ForwardRefExoticComponent<FieldHelperTextProps & 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 { useFieldContext } from './use-field-context.js';
|
|
7
|
+
|
|
8
|
+
const FieldHelperText = forwardRef((props, ref) => {
|
|
9
|
+
const field = useFieldContext();
|
|
10
|
+
const mergedProps = mergeProps(field?.getHelperTextProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
FieldHelperText.displayName = "FieldHelperText";
|
|
14
|
+
|
|
15
|
+
export { FieldHelperText };
|
|
@@ -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 useFieldContext = require('./use-field-context.cjs');
|
|
11
|
+
|
|
12
|
+
const FieldInput = react.forwardRef((props, ref) => {
|
|
13
|
+
const field = useFieldContext.useFieldContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(field?.getInputProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
FieldInput.displayName = "FieldInput";
|
|
18
|
+
|
|
19
|
+
exports.FieldInput = FieldInput;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldInputBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldInputProps extends HTMLProps<'input'>, FieldInputBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldInput: ForwardRefExoticComponent<FieldInputProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface FieldInputBaseProps extends PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface FieldInputProps extends HTMLProps<'input'>, FieldInputBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const FieldInput: ForwardRefExoticComponent<FieldInputProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -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 { useFieldContext } from './use-field-context.js';
|
|
7
|
+
|
|
8
|
+
const FieldInput = forwardRef((props, ref) => {
|
|
9
|
+
const field = useFieldContext();
|
|
10
|
+
const mergedProps = mergeProps(field?.getInputProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.input, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
FieldInput.displayName = "FieldInput";
|
|
14
|
+
|
|
15
|
+
export { FieldInput };
|