@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.
Files changed (115) hide show
  1. package/dist/components/accordion/accordion.anatomy.js +1 -2
  2. package/dist/components/angle-slider/angle-slider.anatomy.js +1 -2
  3. package/dist/components/avatar/avatar.anatomy.js +1 -2
  4. package/dist/components/client-only/index.js +1 -2
  5. package/dist/components/clipboard/clipboard.anatomy.js +1 -2
  6. package/dist/components/collapsible/collapsible.anatomy.js +1 -2
  7. package/dist/components/color-picker/color-picker-channel-input.cjs +3 -0
  8. package/dist/components/color-picker/color-picker-channel-input.js +3 -0
  9. package/dist/components/color-picker/color-picker-trigger.cjs +3 -0
  10. package/dist/components/color-picker/color-picker-trigger.js +3 -0
  11. package/dist/components/combobox/combobox-root.cjs +1 -0
  12. package/dist/components/combobox/combobox-root.js +1 -0
  13. package/dist/components/date-input/date-input.anatomy.js +1 -2
  14. package/dist/components/dialog/dialog.anatomy.js +1 -2
  15. package/dist/components/drawer/drawer.anatomy.js +1 -2
  16. package/dist/components/editable/editable.anatomy.js +1 -2
  17. package/dist/components/field/use-field.cjs +8 -7
  18. package/dist/components/field/use-field.js +8 -7
  19. package/dist/components/file-upload/file-upload-dropzone.cjs +3 -0
  20. package/dist/components/file-upload/file-upload-dropzone.js +3 -0
  21. package/dist/components/file-upload/file-upload-trigger.cjs +3 -0
  22. package/dist/components/file-upload/file-upload-trigger.js +3 -0
  23. package/dist/components/file-upload/file-upload.anatomy.js +1 -2
  24. package/dist/components/file-upload/use-file-upload.cjs +1 -0
  25. package/dist/components/file-upload/use-file-upload.js +1 -0
  26. package/dist/components/floating-panel/floating-panel.anatomy.js +1 -2
  27. package/dist/components/focus-trap/index.js +1 -2
  28. package/dist/components/frame/index.js +1 -2
  29. package/dist/components/hover-card/hover-card.anatomy.js +1 -2
  30. package/dist/components/image-cropper/image-cropper.anatomy.js +1 -2
  31. package/dist/components/marquee/marquee.anatomy.js +1 -2
  32. package/dist/components/menu/menu.anatomy.js +1 -2
  33. package/dist/components/navigation-menu/navigation-menu.anatomy.js +1 -2
  34. package/dist/components/number-input/number-input.anatomy.js +1 -2
  35. package/dist/components/pagination/index.d.cts +1 -1
  36. package/dist/components/pagination/index.d.ts +1 -1
  37. package/dist/components/pagination/pagination-first-trigger.cjs +4 -0
  38. package/dist/components/pagination/pagination-first-trigger.d.cts +3 -2
  39. package/dist/components/pagination/pagination-first-trigger.d.ts +3 -2
  40. package/dist/components/pagination/pagination-first-trigger.js +4 -0
  41. package/dist/components/pagination/pagination-item.cjs +4 -0
  42. package/dist/components/pagination/pagination-item.d.cts +3 -2
  43. package/dist/components/pagination/pagination-item.d.ts +3 -2
  44. package/dist/components/pagination/pagination-item.js +4 -0
  45. package/dist/components/pagination/pagination-last-trigger.cjs +4 -0
  46. package/dist/components/pagination/pagination-last-trigger.d.cts +3 -2
  47. package/dist/components/pagination/pagination-last-trigger.d.ts +3 -2
  48. package/dist/components/pagination/pagination-last-trigger.js +4 -0
  49. package/dist/components/pagination/pagination-next-trigger.cjs +4 -0
  50. package/dist/components/pagination/pagination-next-trigger.d.cts +3 -2
  51. package/dist/components/pagination/pagination-next-trigger.d.ts +3 -2
  52. package/dist/components/pagination/pagination-next-trigger.js +4 -0
  53. package/dist/components/pagination/pagination-prev-trigger.cjs +4 -0
  54. package/dist/components/pagination/pagination-prev-trigger.d.cts +3 -2
  55. package/dist/components/pagination/pagination-prev-trigger.d.ts +3 -2
  56. package/dist/components/pagination/pagination-prev-trigger.js +4 -0
  57. package/dist/components/pagination/pagination.anatomy.js +1 -2
  58. package/dist/components/pagination/use-pagination.d.cts +5 -0
  59. package/dist/components/pagination/use-pagination.d.ts +5 -0
  60. package/dist/components/password-input/password-input.anatomy.js +1 -2
  61. package/dist/components/pin-input/pin-input-control.cjs +3 -0
  62. package/dist/components/pin-input/pin-input-control.js +3 -0
  63. package/dist/components/pin-input/pin-input.anatomy.js +1 -2
  64. package/dist/components/popover/popover.anatomy.js +1 -2
  65. package/dist/components/portal/index.js +1 -2
  66. package/dist/components/progress/progress.anatomy.js +1 -2
  67. package/dist/components/qr-code/qr-code.anatomy.js +1 -2
  68. package/dist/components/radio-group/radio-group.anatomy.js +1 -2
  69. package/dist/components/rating-group/rating-group-control.cjs +3 -0
  70. package/dist/components/rating-group/rating-group-control.js +3 -0
  71. package/dist/components/rating-group/rating-group-item.cjs +3 -0
  72. package/dist/components/rating-group/rating-group-item.js +3 -0
  73. package/dist/components/rating-group/rating-group.anatomy.js +1 -2
  74. package/dist/components/scroll-area/scroll-area.anatomy.js +1 -2
  75. package/dist/components/select/select-trigger.cjs +3 -0
  76. package/dist/components/select/select-trigger.js +3 -0
  77. package/dist/components/select/select.anatomy.js +1 -2
  78. package/dist/components/signature-pad/signature-pad-control.cjs +3 -0
  79. package/dist/components/signature-pad/signature-pad-control.js +3 -0
  80. package/dist/components/signature-pad/signature-pad.anatomy.js +1 -2
  81. package/dist/components/slider/slider.anatomy.js +1 -2
  82. package/dist/components/splitter/splitter.anatomy.js +1 -2
  83. package/dist/components/steps/steps.anatomy.js +1 -2
  84. package/dist/components/switch/switch.anatomy.js +1 -2
  85. package/dist/components/tabs/tabs.anatomy.js +1 -2
  86. package/dist/components/tags-input/tags-input-input.cjs +3 -0
  87. package/dist/components/tags-input/tags-input-input.js +3 -0
  88. package/dist/components/tags-input/tags-input.anatomy.js +1 -2
  89. package/dist/components/timer/timer.anatomy.js +1 -2
  90. package/dist/components/toast/toast-root.cjs +15 -7
  91. package/dist/components/toast/toast-root.js +17 -9
  92. package/dist/components/toast/toast.anatomy.js +1 -2
  93. package/dist/components/toc/toc-nav.cjs +1 -1
  94. package/dist/components/toc/toc-nav.js +1 -1
  95. package/dist/components/toc/toc-root-provider.cjs +3 -1
  96. package/dist/components/toc/toc-root-provider.js +3 -1
  97. package/dist/components/toc/toc-root.cjs +1 -0
  98. package/dist/components/toc/toc-root.js +1 -0
  99. package/dist/components/toc/toc.anatomy.js +1 -2
  100. package/dist/components/toggle-group/toggle-group.anatomy.js +1 -2
  101. package/dist/components/tooltip/tooltip.anatomy.js +1 -2
  102. package/dist/components/tour/index.d.cts +1 -1
  103. package/dist/components/tour/index.d.ts +1 -1
  104. package/dist/components/tour/tour.anatomy.d.cts +1 -1
  105. package/dist/components/tour/tour.anatomy.d.ts +1 -1
  106. package/dist/components/tour/tour.d.cts +1 -1
  107. package/dist/components/tour/tour.d.ts +1 -1
  108. package/dist/components/tree-view/tree-view.anatomy.js +1 -2
  109. package/dist/providers/hotkeys/use-platform.cjs +1 -2
  110. package/dist/providers/hotkeys/use-platform.d.cts +2 -1
  111. package/dist/providers/hotkeys/use-platform.d.ts +2 -1
  112. package/dist/providers/hotkeys/use-platform.js +1 -2
  113. package/dist/utils/attr.js +1 -2
  114. package/dist/utils/react-activity.cjs +1 -1
  115. 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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as paginationAnatomy } from "@zag-js/pagination";
3
- export { paginationAnatomy };
2
+ export { anatomy as paginationAnatomy } from "@zag-js/pagination";
@@ -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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as passwordInputAnatomy } from "@zag-js/password-input";
3
- export { passwordInputAnatomy };
2
+ export { anatomy as passwordInputAnatomy } from "@zag-js/password-input";
@@ -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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as pinInputAnatomy } from "@zag-js/pin-input";
3
- export { pinInputAnatomy };
2
+ export { anatomy as pinInputAnatomy } from "@zag-js/pin-input";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as popoverAnatomy } from "@zag-js/popover";
3
- export { popoverAnatomy };
2
+ export { anatomy as popoverAnatomy } from "@zag-js/popover";
@@ -1,2 +1 @@
1
- import { Portal } from "./portal.js";
2
- export { Portal };
1
+ export { Portal } from "./portal.js";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as progressAnatomy } from "@zag-js/progress";
3
- export { progressAnatomy };
2
+ export { anatomy as progressAnatomy } from "@zag-js/progress";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as qrCodeAnatomy } from "@zag-js/qr-code";
3
- export { qrCodeAnatomy };
2
+ export { anatomy as qrCodeAnatomy } from "@zag-js/qr-code";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as radioGroupAnatomy } from "@zag-js/radio-group";
3
- export { radioGroupAnatomy };
2
+ export { anatomy as radioGroupAnatomy } from "@zag-js/radio-group";
@@ -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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as ratingGroupAnatomy } from "@zag-js/rating-group";
3
- export { ratingGroupAnatomy };
2
+ export { anatomy as ratingGroupAnatomy } from "@zag-js/rating-group";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as scrollAreaAnatomy } from "@zag-js/scroll-area";
3
- export { scrollAreaAnatomy };
2
+ export { anatomy as scrollAreaAnatomy } from "@zag-js/scroll-area";
@@ -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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as selectAnatomy } from "@zag-js/select";
3
- export { selectAnatomy };
2
+ export { anatomy as selectAnatomy } from "@zag-js/select";
@@ -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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as signaturePadAnatomy } from "@zag-js/signature-pad";
3
- export { signaturePadAnatomy };
2
+ export { anatomy as signaturePadAnatomy } from "@zag-js/signature-pad";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as sliderAnatomy } from "@zag-js/slider";
3
- export { sliderAnatomy };
2
+ export { anatomy as sliderAnatomy } from "@zag-js/slider";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as splitterAnatomy } from "@zag-js/splitter";
3
- export { splitterAnatomy };
2
+ export { anatomy as splitterAnatomy } from "@zag-js/splitter";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as stepsAnatomy } from "@zag-js/steps";
3
- export { stepsAnatomy };
2
+ export { anatomy as stepsAnatomy } from "@zag-js/steps";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as switchAnatomy } from "@zag-js/switch";
3
- export { switchAnatomy };
2
+ export { anatomy as switchAnatomy } from "@zag-js/switch";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as tabsAnatomy } from "@zag-js/tabs";
3
- export { tabsAnatomy };
2
+ export { anatomy as tabsAnatomy } from "@zag-js/tabs";
@@ -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,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as tagsInputAnatomy } from "@zag-js/tags-input";
3
- export { tagsInputAnatomy };
2
+ export { anatomy as tagsInputAnatomy } from "@zag-js/tags-input";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as timerAnatomy } from "@zag-js/timer";
3
- export { timerAnatomy };
2
+ export { anatomy as timerAnatomy } from "@zag-js/timer";
@@ -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(), props);
10
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
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(), props);
10
- return /* @__PURE__ */ jsxs("div", {
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";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as toastAnatomy } from "@zag-js/toast";
3
- export { toastAnatomy };
2
+ export { anatomy as toastAnatomy } from "@zag-js/toast";
@@ -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.getRootProps(), rest);
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.getRootProps(), rest);
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
- ...localProps,
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
- ...localProps,
15
+ ...mergedProps,
14
16
  ref
15
17
  })
16
18
  });
@@ -16,6 +16,7 @@ var TocRoot = (0, react.forwardRef)((props, ref) => {
16
16
  "id",
17
17
  "ids",
18
18
  "items",
19
+ "multiple",
19
20
  "onActiveChange",
20
21
  "rootMargin",
21
22
  "scrollBehavior",
@@ -16,6 +16,7 @@ var TocRoot = forwardRef((props, ref) => {
16
16
  "id",
17
17
  "ids",
18
18
  "items",
19
+ "multiple",
19
20
  "onActiveChange",
20
21
  "rootMargin",
21
22
  "scrollBehavior",
@@ -1,2 +1 @@
1
- import { anatomy as tocAnatomy } from "@zag-js/toc";
2
- export { tocAnatomy };
1
+ export { anatomy as tocAnatomy } from "@zag-js/toc";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as toggleGroupAnatomy } from "@zag-js/toggle-group";
3
- export { toggleGroupAnatomy };
2
+ export { anatomy as toggleGroupAnatomy } from "@zag-js/toggle-group";
@@ -1,3 +1,2 @@
1
1
  "use client";
2
- import { anatomy as tooltipAnatomy } from "@zag-js/tooltip";
3
- export { tooltipAnatomy };
2
+ export { anatomy as tooltipAnatomy } from "@zag-js/tooltip";
@@ -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';