@ark-ui/react 5.39.3 → 5.40.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/accordion/accordion.anatomy.js +1 -2
- package/dist/components/angle-slider/angle-slider.anatomy.js +1 -2
- package/dist/components/avatar/avatar.anatomy.js +1 -2
- package/dist/components/client-only/index.js +1 -2
- package/dist/components/clipboard/clipboard.anatomy.js +1 -2
- package/dist/components/collapsible/collapsible.anatomy.js +1 -2
- package/dist/components/color-picker/color-picker-channel-input.cjs +3 -0
- package/dist/components/color-picker/color-picker-channel-input.js +3 -0
- package/dist/components/color-picker/color-picker-trigger.cjs +3 -0
- package/dist/components/color-picker/color-picker-trigger.js +3 -0
- package/dist/components/combobox/combobox-root.cjs +1 -0
- package/dist/components/combobox/combobox-root.js +1 -0
- package/dist/components/date-input/date-input.anatomy.js +1 -2
- package/dist/components/dialog/dialog.anatomy.js +1 -2
- package/dist/components/drawer/drawer.anatomy.js +1 -2
- package/dist/components/editable/editable.anatomy.js +1 -2
- package/dist/components/field/use-field.cjs +8 -7
- package/dist/components/field/use-field.js +8 -7
- package/dist/components/file-upload/file-upload-dropzone.cjs +3 -0
- package/dist/components/file-upload/file-upload-dropzone.js +3 -0
- package/dist/components/file-upload/file-upload-trigger.cjs +3 -0
- package/dist/components/file-upload/file-upload-trigger.js +3 -0
- package/dist/components/file-upload/file-upload.anatomy.js +1 -2
- package/dist/components/file-upload/use-file-upload.cjs +1 -0
- package/dist/components/file-upload/use-file-upload.js +1 -0
- package/dist/components/floating-panel/floating-panel.anatomy.js +1 -2
- package/dist/components/focus-trap/index.js +1 -2
- package/dist/components/frame/index.js +1 -2
- package/dist/components/hover-card/hover-card.anatomy.js +1 -2
- package/dist/components/image-cropper/image-cropper.anatomy.js +1 -2
- package/dist/components/marquee/marquee.anatomy.js +1 -2
- package/dist/components/menu/menu.anatomy.js +1 -2
- package/dist/components/navigation-menu/navigation-menu.anatomy.js +1 -2
- package/dist/components/number-input/number-input.anatomy.js +1 -2
- package/dist/components/pagination/index.d.cts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/pagination/pagination-first-trigger.cjs +4 -0
- package/dist/components/pagination/pagination-first-trigger.d.cts +3 -2
- package/dist/components/pagination/pagination-first-trigger.d.ts +3 -2
- package/dist/components/pagination/pagination-first-trigger.js +4 -0
- package/dist/components/pagination/pagination-item.cjs +4 -0
- package/dist/components/pagination/pagination-item.d.cts +3 -2
- package/dist/components/pagination/pagination-item.d.ts +3 -2
- package/dist/components/pagination/pagination-item.js +4 -0
- package/dist/components/pagination/pagination-last-trigger.cjs +4 -0
- package/dist/components/pagination/pagination-last-trigger.d.cts +3 -2
- package/dist/components/pagination/pagination-last-trigger.d.ts +3 -2
- package/dist/components/pagination/pagination-last-trigger.js +4 -0
- package/dist/components/pagination/pagination-next-trigger.cjs +4 -0
- package/dist/components/pagination/pagination-next-trigger.d.cts +3 -2
- package/dist/components/pagination/pagination-next-trigger.d.ts +3 -2
- package/dist/components/pagination/pagination-next-trigger.js +4 -0
- package/dist/components/pagination/pagination-prev-trigger.cjs +4 -0
- package/dist/components/pagination/pagination-prev-trigger.d.cts +3 -2
- package/dist/components/pagination/pagination-prev-trigger.d.ts +3 -2
- package/dist/components/pagination/pagination-prev-trigger.js +4 -0
- package/dist/components/pagination/pagination.anatomy.js +1 -2
- package/dist/components/pagination/use-pagination.d.cts +5 -0
- package/dist/components/pagination/use-pagination.d.ts +5 -0
- package/dist/components/password-input/password-input.anatomy.js +1 -2
- package/dist/components/pin-input/pin-input-control.cjs +3 -0
- package/dist/components/pin-input/pin-input-control.js +3 -0
- package/dist/components/pin-input/pin-input.anatomy.js +1 -2
- package/dist/components/popover/popover.anatomy.js +1 -2
- package/dist/components/portal/index.js +1 -2
- package/dist/components/progress/progress.anatomy.js +1 -2
- package/dist/components/qr-code/qr-code.anatomy.js +1 -2
- package/dist/components/radio-group/radio-group.anatomy.js +1 -2
- package/dist/components/rating-group/rating-group-control.cjs +3 -0
- package/dist/components/rating-group/rating-group-control.js +3 -0
- package/dist/components/rating-group/rating-group-item.cjs +3 -0
- package/dist/components/rating-group/rating-group-item.js +3 -0
- package/dist/components/rating-group/rating-group.anatomy.js +1 -2
- package/dist/components/scroll-area/scroll-area.anatomy.js +1 -2
- package/dist/components/select/select-trigger.cjs +3 -0
- package/dist/components/select/select-trigger.js +3 -0
- package/dist/components/select/select.anatomy.js +1 -2
- package/dist/components/signature-pad/signature-pad-control.cjs +3 -0
- package/dist/components/signature-pad/signature-pad-control.js +3 -0
- package/dist/components/signature-pad/signature-pad.anatomy.js +1 -2
- package/dist/components/slider/slider.anatomy.js +1 -2
- package/dist/components/splitter/splitter.anatomy.js +1 -2
- package/dist/components/steps/steps.anatomy.js +1 -2
- package/dist/components/switch/switch.anatomy.js +1 -2
- package/dist/components/tabs/tabs.anatomy.js +1 -2
- package/dist/components/tags-input/tags-input-input.cjs +3 -0
- package/dist/components/tags-input/tags-input-input.js +3 -0
- package/dist/components/tags-input/tags-input.anatomy.js +1 -2
- package/dist/components/timer/timer.anatomy.js +1 -2
- package/dist/components/toast/toast-root.cjs +15 -7
- package/dist/components/toast/toast-root.js +17 -9
- package/dist/components/toast/toast.anatomy.js +1 -2
- package/dist/components/toc/toc-nav.cjs +1 -1
- package/dist/components/toc/toc-nav.js +1 -1
- package/dist/components/toc/toc-root-provider.cjs +3 -1
- package/dist/components/toc/toc-root-provider.js +3 -1
- package/dist/components/toc/toc-root.cjs +1 -0
- package/dist/components/toc/toc-root.js +1 -0
- package/dist/components/toc/toc.anatomy.js +1 -2
- package/dist/components/toggle-group/toggle-group.anatomy.js +1 -2
- package/dist/components/tooltip/tooltip.anatomy.js +1 -2
- package/dist/components/tour/index.d.cts +1 -1
- package/dist/components/tour/index.d.ts +1 -1
- package/dist/components/tour/tour.anatomy.d.cts +1 -1
- package/dist/components/tour/tour.anatomy.d.ts +1 -1
- package/dist/components/tour/tour.d.cts +1 -1
- package/dist/components/tour/tour.d.ts +1 -1
- package/dist/components/tree-view/tree-view.anatomy.js +1 -2
- package/dist/providers/hotkeys/use-platform.cjs +1 -2
- package/dist/providers/hotkeys/use-platform.d.cts +2 -1
- package/dist/providers/hotkeys/use-platform.d.ts +2 -1
- package/dist/providers/hotkeys/use-platform.js +1 -2
- package/dist/utils/attr.js +1 -2
- package/dist/utils/react-activity.cjs +1 -1
- package/package.json +80 -80
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLProps, PolymorphicProps } from '../factory.js';
|
|
2
|
+
import { PaginationAnchorProps } from './use-pagination.js';
|
|
2
3
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
4
|
export interface PaginationNextTriggerBaseProps extends PolymorphicProps {
|
|
4
5
|
}
|
|
5
|
-
export interface PaginationNextTriggerProps extends HTMLProps<'button'>, PaginationNextTriggerBaseProps {
|
|
6
|
+
export interface PaginationNextTriggerProps extends HTMLProps<'button'>, PaginationAnchorProps, PaginationNextTriggerBaseProps {
|
|
6
7
|
}
|
|
7
|
-
export declare const PaginationNextTrigger: ForwardRefExoticComponent<PaginationNextTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const PaginationNextTrigger: ForwardRefExoticComponent<PaginationNextTriggerProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -8,6 +8,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
var PaginationNextTrigger = forwardRef((props, ref) => {
|
|
9
9
|
const pagination = usePaginationContext();
|
|
10
10
|
const mergedProps = mergeProps(pagination.getNextTriggerProps(), props);
|
|
11
|
+
if (pagination.type === "link") return /* @__PURE__ */ jsx(ark.a, {
|
|
12
|
+
...mergedProps,
|
|
13
|
+
ref
|
|
14
|
+
});
|
|
11
15
|
return /* @__PURE__ */ jsx(ark.button, {
|
|
12
16
|
...mergedProps,
|
|
13
17
|
ref
|
|
@@ -8,6 +8,10 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
var PaginationPrevTrigger = (0, react.forwardRef)((props, ref) => {
|
|
9
9
|
const pagination = require_use_pagination_context.usePaginationContext();
|
|
10
10
|
const mergedProps = (0, _zag_js_react.mergeProps)(pagination.getPrevTriggerProps(), props);
|
|
11
|
+
if (pagination.type === "link") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.a, {
|
|
12
|
+
...mergedProps,
|
|
13
|
+
ref
|
|
14
|
+
});
|
|
11
15
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.button, {
|
|
12
16
|
...mergedProps,
|
|
13
17
|
ref
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLProps, PolymorphicProps } from '../factory.js';
|
|
2
|
+
import { PaginationAnchorProps } from './use-pagination.js';
|
|
2
3
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
4
|
export interface PaginationPrevTriggerBaseProps extends PolymorphicProps {
|
|
4
5
|
}
|
|
5
|
-
export interface PaginationPrevTriggerProps extends HTMLProps<'button'>, PaginationPrevTriggerBaseProps {
|
|
6
|
+
export interface PaginationPrevTriggerProps extends HTMLProps<'button'>, PaginationAnchorProps, PaginationPrevTriggerBaseProps {
|
|
6
7
|
}
|
|
7
|
-
export declare const PaginationPrevTrigger: ForwardRefExoticComponent<PaginationPrevTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const PaginationPrevTrigger: ForwardRefExoticComponent<PaginationPrevTriggerProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { HTMLProps, PolymorphicProps } from '../factory.js';
|
|
2
|
+
import { PaginationAnchorProps } from './use-pagination.js';
|
|
2
3
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
4
|
export interface PaginationPrevTriggerBaseProps extends PolymorphicProps {
|
|
4
5
|
}
|
|
5
|
-
export interface PaginationPrevTriggerProps extends HTMLProps<'button'>, PaginationPrevTriggerBaseProps {
|
|
6
|
+
export interface PaginationPrevTriggerProps extends HTMLProps<'button'>, PaginationAnchorProps, PaginationPrevTriggerBaseProps {
|
|
6
7
|
}
|
|
7
|
-
export declare const PaginationPrevTrigger: ForwardRefExoticComponent<PaginationPrevTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const PaginationPrevTrigger: ForwardRefExoticComponent<PaginationPrevTriggerProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
@@ -8,6 +8,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
var PaginationPrevTrigger = forwardRef((props, ref) => {
|
|
9
9
|
const pagination = usePaginationContext();
|
|
10
10
|
const mergedProps = mergeProps(pagination.getPrevTriggerProps(), props);
|
|
11
|
+
if (pagination.type === "link") return /* @__PURE__ */ jsx(ark.a, {
|
|
12
|
+
...mergedProps,
|
|
13
|
+
ref
|
|
14
|
+
});
|
|
11
15
|
return /* @__PURE__ */ jsx(ark.button, {
|
|
12
16
|
...mergedProps,
|
|
13
17
|
ref
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { PropTypes } from '@zag-js/react';
|
|
2
2
|
import { Optional } from '../../types.js';
|
|
3
|
+
import { HTMLProps } from '../factory.js';
|
|
3
4
|
import * as pagination from '@zag-js/pagination';
|
|
5
|
+
/**
|
|
6
|
+
* The anchor attributes the items and triggers accept, since they render as links under `type="link"`.
|
|
7
|
+
*/
|
|
8
|
+
export type PaginationAnchorProps = Omit<HTMLProps<'a'>, keyof HTMLProps<'button'>>;
|
|
4
9
|
export interface UsePaginationProps extends Optional<Omit<pagination.Props, 'dir' | 'getRootNode'>, 'id'> {
|
|
5
10
|
}
|
|
6
11
|
export interface UsePaginationReturn extends pagination.Api<PropTypes> {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { PropTypes } from '@zag-js/react';
|
|
2
2
|
import { Optional } from '../../types.js';
|
|
3
|
+
import { HTMLProps } from '../factory.js';
|
|
3
4
|
import * as pagination from '@zag-js/pagination';
|
|
5
|
+
/**
|
|
6
|
+
* The anchor attributes the items and triggers accept, since they render as links under `type="link"`.
|
|
7
|
+
*/
|
|
8
|
+
export type PaginationAnchorProps = Omit<HTMLProps<'a'>, keyof HTMLProps<'button'>>;
|
|
4
9
|
export interface UsePaginationProps extends Optional<Omit<pagination.Props, 'dir' | 'getRootNode'>, 'id'> {
|
|
5
10
|
}
|
|
6
11
|
export interface UsePaginationReturn extends pagination.Api<PropTypes> {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_factory = require("../factory.cjs");
|
|
3
|
+
const require_use_field_context = require("../field/use-field-context.cjs");
|
|
3
4
|
const require_use_pin_input_context = require("./use-pin-input-context.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let _zag_js_react = require("@zag-js/react");
|
|
@@ -8,7 +9,9 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
9
|
var PinInputControl = (0, react.forwardRef)((props, ref) => {
|
|
9
10
|
const pinInput = require_use_pin_input_context.usePinInputContext();
|
|
10
11
|
const mergedProps = (0, _zag_js_react.mergeProps)(pinInput.getControlProps(), props);
|
|
12
|
+
const field = require_use_field_context.useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ark } from "../factory.js";
|
|
3
|
+
import { useFieldContext } from "../field/use-field-context.js";
|
|
3
4
|
import { usePinInputContext } from "./use-pin-input-context.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { mergeProps } from "@zag-js/react";
|
|
@@ -8,7 +9,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
var PinInputControl = forwardRef((props, ref) => {
|
|
9
10
|
const pinInput = usePinInputContext();
|
|
10
11
|
const mergedProps = mergeProps(pinInput.getControlProps(), props);
|
|
12
|
+
const field = useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ jsx(ark.div, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Portal };
|
|
1
|
+
export { Portal } from "./portal.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_factory = require("../factory.cjs");
|
|
3
|
+
const require_use_field_context = require("../field/use-field-context.cjs");
|
|
3
4
|
const require_use_rating_group_context = require("./use-rating-group-context.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let _zag_js_react = require("@zag-js/react");
|
|
@@ -8,7 +9,9 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
9
|
var RatingGroupControl = (0, react.forwardRef)((props, ref) => {
|
|
9
10
|
const ratingGroup = require_use_rating_group_context.useRatingGroupContext();
|
|
10
11
|
const mergedProps = (0, _zag_js_react.mergeProps)(ratingGroup.getControlProps(), props);
|
|
12
|
+
const field = require_use_field_context.useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ark } from "../factory.js";
|
|
3
|
+
import { useFieldContext } from "../field/use-field-context.js";
|
|
3
4
|
import { useRatingGroupContext } from "./use-rating-group-context.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { mergeProps } from "@zag-js/react";
|
|
@@ -8,7 +9,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
var RatingGroupControl = forwardRef((props, ref) => {
|
|
9
10
|
const ratingGroup = useRatingGroupContext();
|
|
10
11
|
const mergedProps = mergeProps(ratingGroup.getControlProps(), props);
|
|
12
|
+
const field = useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ jsx(ark.div, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_create_split_props = require("../../utils/create-split-props.cjs");
|
|
3
3
|
const require_factory = require("../factory.cjs");
|
|
4
|
+
const require_use_field_context = require("../field/use-field-context.cjs");
|
|
4
5
|
const require_use_rating_group_context = require("./use-rating-group-context.cjs");
|
|
5
6
|
const require_use_rating_group_item_context = require("./use-rating-group-item-context.cjs");
|
|
6
7
|
let react = require("react");
|
|
@@ -13,9 +14,11 @@ var RatingGroupItem = (0, react.forwardRef)((props, ref) => {
|
|
|
13
14
|
const ratingGroup = require_use_rating_group_context.useRatingGroupContext();
|
|
14
15
|
const mergedProps = (0, _zag_js_react.mergeProps)(ratingGroup.getItemProps(itemProps), localProps);
|
|
15
16
|
const itemState = ratingGroup.getItemState(itemProps);
|
|
17
|
+
const field = require_use_field_context.useFieldContext();
|
|
16
18
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_rating_group_item_context.RatingGroupItemProvider, {
|
|
17
19
|
value: itemState,
|
|
18
20
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.span, {
|
|
21
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
19
22
|
...mergedProps,
|
|
20
23
|
ref
|
|
21
24
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createSplitProps } from "../../utils/create-split-props.js";
|
|
3
3
|
import { ark } from "../factory.js";
|
|
4
|
+
import { useFieldContext } from "../field/use-field-context.js";
|
|
4
5
|
import { useRatingGroupContext } from "./use-rating-group-context.js";
|
|
5
6
|
import { RatingGroupItemProvider } from "./use-rating-group-item-context.js";
|
|
6
7
|
import { forwardRef } from "react";
|
|
@@ -13,9 +14,11 @@ var RatingGroupItem = forwardRef((props, ref) => {
|
|
|
13
14
|
const ratingGroup = useRatingGroupContext();
|
|
14
15
|
const mergedProps = mergeProps(ratingGroup.getItemProps(itemProps), localProps);
|
|
15
16
|
const itemState = ratingGroup.getItemState(itemProps);
|
|
17
|
+
const field = useFieldContext();
|
|
16
18
|
return /* @__PURE__ */ jsx(RatingGroupItemProvider, {
|
|
17
19
|
value: itemState,
|
|
18
20
|
children: /* @__PURE__ */ jsx(ark.span, {
|
|
21
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
19
22
|
...mergedProps,
|
|
20
23
|
ref
|
|
21
24
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_factory = require("../factory.cjs");
|
|
3
|
+
const require_use_field_context = require("../field/use-field-context.cjs");
|
|
3
4
|
const require_use_select_context = require("./use-select-context.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let _zag_js_react = require("@zag-js/react");
|
|
@@ -8,7 +9,9 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
9
|
var SelectTrigger = (0, react.forwardRef)((props, ref) => {
|
|
9
10
|
const select = require_use_select_context.useSelectContext();
|
|
10
11
|
const mergedProps = (0, _zag_js_react.mergeProps)(select.getTriggerProps(), props);
|
|
12
|
+
const field = require_use_field_context.useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.button, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ark } from "../factory.js";
|
|
3
|
+
import { useFieldContext } from "../field/use-field-context.js";
|
|
3
4
|
import { useSelectContext } from "./use-select-context.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { mergeProps } from "@zag-js/react";
|
|
@@ -8,7 +9,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
var SelectTrigger = forwardRef((props, ref) => {
|
|
9
10
|
const select = useSelectContext();
|
|
10
11
|
const mergedProps = mergeProps(select.getTriggerProps(), props);
|
|
12
|
+
const field = useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ jsx(ark.button, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_factory = require("../factory.cjs");
|
|
3
|
+
const require_use_field_context = require("../field/use-field-context.cjs");
|
|
3
4
|
const require_use_signature_pad_context = require("./use-signature-pad-context.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let _zag_js_react = require("@zag-js/react");
|
|
@@ -8,7 +9,9 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
9
|
var SignaturePadControl = (0, react.forwardRef)((props, ref) => {
|
|
9
10
|
const signaturePad = require_use_signature_pad_context.useSignaturePadContext();
|
|
10
11
|
const mergedProps = (0, _zag_js_react.mergeProps)(signaturePad.getControlProps(), props);
|
|
12
|
+
const field = require_use_field_context.useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ark } from "../factory.js";
|
|
3
|
+
import { useFieldContext } from "../field/use-field-context.js";
|
|
3
4
|
import { useSignaturePadContext } from "./use-signature-pad-context.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { mergeProps } from "@zag-js/react";
|
|
@@ -8,7 +9,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
var SignaturePadControl = forwardRef((props, ref) => {
|
|
9
10
|
const signaturePad = useSignaturePadContext();
|
|
10
11
|
const mergedProps = mergeProps(signaturePad.getControlProps(), props);
|
|
12
|
+
const field = useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ jsx(ark.div, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_factory = require("../factory.cjs");
|
|
3
|
+
const require_use_field_context = require("../field/use-field-context.cjs");
|
|
3
4
|
const require_use_tags_input_context = require("./use-tags-input-context.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
let _zag_js_react = require("@zag-js/react");
|
|
@@ -8,7 +9,9 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
9
|
var TagsInputInput = (0, react.forwardRef)((props, ref) => {
|
|
9
10
|
const tagsInput = require_use_tags_input_context.useTagsInputContext();
|
|
10
11
|
const mergedProps = (0, _zag_js_react.mergeProps)(tagsInput.getInputProps(), props);
|
|
12
|
+
const field = require_use_field_context.useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.input, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ark } from "../factory.js";
|
|
3
|
+
import { useFieldContext } from "../field/use-field-context.js";
|
|
3
4
|
import { useTagsInputContext } from "./use-tags-input-context.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { mergeProps } from "@zag-js/react";
|
|
@@ -8,7 +9,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
9
|
var TagsInputInput = forwardRef((props, ref) => {
|
|
9
10
|
const tagsInput = useTagsInputContext();
|
|
10
11
|
const mergedProps = mergeProps(tagsInput.getInputProps(), props);
|
|
12
|
+
const field = useFieldContext();
|
|
11
13
|
return /* @__PURE__ */ jsx(ark.input, {
|
|
14
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
12
15
|
...mergedProps,
|
|
13
16
|
ref
|
|
14
17
|
});
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
const require_factory = require("../factory.cjs");
|
|
2
3
|
const require_use_toast_context = require("./use-toast-context.cjs");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _zag_js_react = require("@zag-js/react");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
//#region src/components/toast/toast-root.tsx
|
|
7
8
|
var ToastRoot = (0, react.forwardRef)((props, ref) => {
|
|
9
|
+
const { asChild, children, ...localProps } = props;
|
|
8
10
|
const toast = require_use_toast_context.useToastContext();
|
|
9
|
-
const mergedProps = (0, _zag_js_react.mergeProps)(toast.getRootProps(),
|
|
10
|
-
|
|
11
|
+
const mergedProps = (0, _zag_js_react.mergeProps)(toast.getRootProps(), localProps);
|
|
12
|
+
const withGhosts = (content) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
13
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...toast.getGhostBeforeProps() }),
|
|
14
|
+
content,
|
|
15
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...toast.getGhostAfterProps() })
|
|
16
|
+
] });
|
|
17
|
+
const asChildContent = () => {
|
|
18
|
+
if (!(0, react.isValidElement)(children)) return children;
|
|
19
|
+
return (0, react.cloneElement)(children, void 0, withGhosts(children.props.children));
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
|
|
11
22
|
...mergedProps,
|
|
23
|
+
asChild,
|
|
12
24
|
ref,
|
|
13
|
-
children:
|
|
14
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...toast.getGhostBeforeProps() }),
|
|
15
|
-
props.children,
|
|
16
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { ...toast.getGhostAfterProps() })
|
|
17
|
-
]
|
|
25
|
+
children: asChild ? asChildContent() : withGhosts(children)
|
|
18
26
|
});
|
|
19
27
|
});
|
|
20
28
|
ToastRoot.displayName = "ToastRoot";
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { ark } from "../factory.js";
|
|
2
3
|
import { useToastContext } from "./use-toast-context.js";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
+
import { cloneElement, forwardRef, isValidElement } from "react";
|
|
4
5
|
import { mergeProps } from "@zag-js/react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/toast/toast-root.tsx
|
|
7
8
|
var ToastRoot = forwardRef((props, ref) => {
|
|
9
|
+
const { asChild, children, ...localProps } = props;
|
|
8
10
|
const toast = useToastContext();
|
|
9
|
-
const mergedProps = mergeProps(toast.getRootProps(),
|
|
10
|
-
|
|
11
|
+
const mergedProps = mergeProps(toast.getRootProps(), localProps);
|
|
12
|
+
const withGhosts = (content) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx("div", { ...toast.getGhostBeforeProps() }),
|
|
14
|
+
content,
|
|
15
|
+
/* @__PURE__ */ jsx("div", { ...toast.getGhostAfterProps() })
|
|
16
|
+
] });
|
|
17
|
+
const asChildContent = () => {
|
|
18
|
+
if (!isValidElement(children)) return children;
|
|
19
|
+
return cloneElement(children, void 0, withGhosts(children.props.children));
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsx(ark.div, {
|
|
11
22
|
...mergedProps,
|
|
23
|
+
asChild,
|
|
12
24
|
ref,
|
|
13
|
-
children:
|
|
14
|
-
/* @__PURE__ */ jsx("div", { ...toast.getGhostBeforeProps() }),
|
|
15
|
-
props.children,
|
|
16
|
-
/* @__PURE__ */ jsx("div", { ...toast.getGhostAfterProps() })
|
|
17
|
-
]
|
|
25
|
+
children: asChild ? asChildContent() : withGhosts(children)
|
|
18
26
|
});
|
|
19
27
|
});
|
|
20
28
|
ToastRoot.displayName = "ToastRoot";
|
|
@@ -7,7 +7,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
7
7
|
var TocNav = (0, react.forwardRef)((props, ref) => {
|
|
8
8
|
const { placement, ...rest } = props;
|
|
9
9
|
const toc = require_use_toc_context.useTocContext();
|
|
10
|
-
const mergedProps = (0, _zag_js_react.mergeProps)(toc.
|
|
10
|
+
const mergedProps = (0, _zag_js_react.mergeProps)(toc.getNavProps(), rest);
|
|
11
11
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.nav, {
|
|
12
12
|
...mergedProps,
|
|
13
13
|
"data-placement": placement,
|
|
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
var TocNav = forwardRef((props, ref) => {
|
|
8
8
|
const { placement, ...rest } = props;
|
|
9
9
|
const toc = useTocContext();
|
|
10
|
-
const mergedProps = mergeProps(toc.
|
|
10
|
+
const mergedProps = mergeProps(toc.getNavProps(), rest);
|
|
11
11
|
return /* @__PURE__ */ jsx(ark.nav, {
|
|
12
12
|
...mergedProps,
|
|
13
13
|
"data-placement": placement,
|
|
@@ -2,15 +2,17 @@ const require_create_split_props = require("../../utils/create-split-props.cjs")
|
|
|
2
2
|
const require_factory = require("../factory.cjs");
|
|
3
3
|
const require_use_toc_context = require("./use-toc-context.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
|
+
let _zag_js_react = require("@zag-js/react");
|
|
5
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
//#region src/components/toc/toc-root-provider.tsx
|
|
7
8
|
var splitRootProviderProps = require_create_split_props.createSplitProps();
|
|
8
9
|
var TocRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
9
10
|
const [{ value: toc }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
11
|
+
const mergedProps = (0, _zag_js_react.mergeProps)(toc.getRootProps(), localProps);
|
|
10
12
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_use_toc_context.TocProvider, {
|
|
11
13
|
value: toc,
|
|
12
14
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.ark.div, {
|
|
13
|
-
...
|
|
15
|
+
...mergedProps,
|
|
14
16
|
ref
|
|
15
17
|
})
|
|
16
18
|
});
|
|
@@ -2,15 +2,17 @@ import { createSplitProps } from "../../utils/create-split-props.js";
|
|
|
2
2
|
import { ark } from "../factory.js";
|
|
3
3
|
import { TocProvider } from "./use-toc-context.js";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
+
import { mergeProps } from "@zag-js/react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/toc/toc-root-provider.tsx
|
|
7
8
|
var splitRootProviderProps = createSplitProps();
|
|
8
9
|
var TocRootProvider = forwardRef((props, ref) => {
|
|
9
10
|
const [{ value: toc }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
11
|
+
const mergedProps = mergeProps(toc.getRootProps(), localProps);
|
|
10
12
|
return /* @__PURE__ */ jsx(TocProvider, {
|
|
11
13
|
value: toc,
|
|
12
14
|
children: /* @__PURE__ */ jsx(ark.div, {
|
|
13
|
-
...
|
|
15
|
+
...mergedProps,
|
|
14
16
|
ref
|
|
15
17
|
})
|
|
16
18
|
});
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { tocAnatomy };
|
|
1
|
+
export { anatomy as tocAnatomy } from "@zag-js/toc";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { waitForElement, waitForElementValue, waitForPromise, type WaitOptions } from '@zag-js/tour';
|
|
2
2
|
export { waitForEvent, type WaitForEventOptions } from './wait-for-event.js';
|
|
3
|
-
export type { ElementIds as TourElementIds, FocusOutsideEvent as TourFocusOutsideEvent, InteractOutsideEvent as TourInteractOutsideEvent, IntlTranslations as TourIntlTranslations, Point as TourPoint, PointerDownOutsideEvent as TourPointerDownOutsideEvent, ProgressTextDetails as TourProgressTextDetails, StatusChangeDetails as TourStatusChangeDetails, StepAction as TourStepAction, StepActionFn as TourStepActionFn, StepActionMap as TourStepActionMap, StepActionType as TourStepActionType, StepBaseDetails as TourStepBaseDetails, StepChangeDetails as TourStepChangeDetails, StepDetails as TourStepDetails, StepEffectArgs as TourStepEffectArgs, StepEffectCleanup as TourStepEffectCleanup, StepPlacement as TourStepPlacement, StepsChangeDetails as TourStepsChangeDetails, StepStatus as TourStepStatus, StepType as TourStepType, } from '@zag-js/tour';
|
|
3
|
+
export type { ElementIds as TourElementIds, FocusOutsideEvent as TourFocusOutsideEvent, InteractOutsideEvent as TourInteractOutsideEvent, IntlTranslations as TourIntlTranslations, Point as TourPoint, PointerDownOutsideEvent as TourPointerDownOutsideEvent, ProgressTextDetails as TourProgressTextDetails, ScrollToTargetDetails as TourScrollToTargetDetails, StatusChangeDetails as TourStatusChangeDetails, StepAction as TourStepAction, StepActionFn as TourStepActionFn, StepActionMap as TourStepActionMap, StepActionType as TourStepActionType, StepBaseDetails as TourStepBaseDetails, StepChangeDetails as TourStepChangeDetails, StepDetails as TourStepDetails, StepEffectArgs as TourStepEffectArgs, StepEffectCleanup as TourStepEffectCleanup, StepPlacement as TourStepPlacement, StepsChangeDetails as TourStepsChangeDetails, StepStatus as TourStepStatus, StepType as TourStepType, } from '@zag-js/tour';
|
|
4
4
|
export { TourActionTrigger, type TourActionTriggerBaseProps, type TourActionTriggerProps, } from './tour-action-trigger.js';
|
|
5
5
|
export { TourActions, type TourActionsProps } from './tour-actions.js';
|
|
6
6
|
export { TourArrow, type TourArrowBaseProps, type TourArrowProps } from './tour-arrow.js';
|