@ark-ui/react 1.1.0 → 1.2.1

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 (118) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +29 -16
  3. package/color-picker/color-picker.cjs +1 -1
  4. package/color-picker/color-picker.mjs +1 -1
  5. package/combobox/combobox.cjs +1 -1
  6. package/combobox/combobox.d.ts +1 -1
  7. package/combobox/combobox.mjs +1 -1
  8. package/date-picker/date-picker.cjs +2 -2
  9. package/date-picker/date-picker.mjs +2 -2
  10. package/date-picker/date-picker.stories.d.ts +1 -0
  11. package/dialog/dialog-backdrop.cjs +1 -1
  12. package/dialog/dialog-backdrop.mjs +1 -1
  13. package/dialog/dialog.cjs +2 -1
  14. package/dialog/dialog.mjs +2 -1
  15. package/editable/editable.cjs +2 -2
  16. package/editable/editable.mjs +2 -2
  17. package/factory.cjs +1 -2
  18. package/factory.d.ts +1 -1
  19. package/factory.mjs +2 -3
  20. package/factory.test.d.ts +1 -0
  21. package/file-upload/file-upload-item-preview-image.cjs +25 -0
  22. package/file-upload/file-upload-item-preview-image.d.ts +6 -0
  23. package/file-upload/file-upload-item-preview-image.mjs +21 -0
  24. package/file-upload/file-upload-item-preview.cjs +3 -9
  25. package/file-upload/file-upload-item-preview.d.ts +6 -1
  26. package/file-upload/file-upload-item-preview.mjs +4 -10
  27. package/file-upload/file-upload.cjs +6 -2
  28. package/file-upload/file-upload.mjs +6 -2
  29. package/file-upload/index.cjs +7 -5
  30. package/file-upload/index.d.ts +9 -7
  31. package/file-upload/index.mjs +7 -5
  32. package/file-upload/use-file-upload.cjs +2 -1
  33. package/file-upload/use-file-upload.mjs +2 -1
  34. package/hover-card/hover-card.cjs +2 -1
  35. package/hover-card/hover-card.mjs +2 -1
  36. package/index.cjs +8 -6
  37. package/index.mjs +4 -3
  38. package/menu/menu.cjs +4 -3
  39. package/menu/menu.mjs +2 -1
  40. package/number-input/index.cjs +3 -3
  41. package/number-input/index.d.ts +1 -1
  42. package/number-input/index.mjs +1 -1
  43. package/number-input/number-input.cjs +30 -33
  44. package/number-input/number-input.mjs +30 -33
  45. package/package.json +67 -55
  46. package/pagination/pagination-item.cjs +1 -1
  47. package/pagination/pagination-item.mjs +1 -1
  48. package/pagination/pagination.cjs +2 -2
  49. package/pagination/pagination.mjs +2 -2
  50. package/pin-input/index.cjs +3 -3
  51. package/pin-input/index.d.ts +1 -1
  52. package/pin-input/index.mjs +1 -1
  53. package/pin-input/pin-input.cjs +2 -2
  54. package/pin-input/pin-input.mjs +2 -2
  55. package/popover/popover.cjs +2 -1
  56. package/popover/popover.mjs +2 -1
  57. package/portal.cjs +2 -1
  58. package/portal.d.ts +2 -2
  59. package/portal.mjs +2 -1
  60. package/radio-group/radio-group-indicator.cjs +1 -2
  61. package/radio-group/radio-group-indicator.mjs +1 -2
  62. package/radio-group/radio-group-item.d.ts +1 -1
  63. package/radio-group/radio-group.cjs +2 -2
  64. package/radio-group/radio-group.mjs +2 -2
  65. package/rating-group/rating-group-control.cjs +2 -2
  66. package/rating-group/rating-group-control.mjs +2 -2
  67. package/rating-group/rating-group-item-context.d.ts +2 -2
  68. package/rating-group/rating-group-item.cjs +5 -4
  69. package/rating-group/rating-group-item.mjs +5 -4
  70. package/rating-group/rating-group.cjs +2 -2
  71. package/rating-group/rating-group.mjs +2 -2
  72. package/rating-group/use-rating-group.cjs +4 -4
  73. package/rating-group/use-rating-group.d.ts +4 -4
  74. package/rating-group/use-rating-group.mjs +3 -3
  75. package/segment-group/segment-group-indicator.cjs +2 -2
  76. package/segment-group/segment-group-indicator.mjs +2 -2
  77. package/segment-group/segment-group-item-context.d.ts +1 -13
  78. package/segment-group/segment-group-item-control.cjs +2 -2
  79. package/segment-group/segment-group-item-control.mjs +2 -2
  80. package/segment-group/segment-group-item-text.cjs +2 -2
  81. package/segment-group/segment-group-item-text.mjs +2 -2
  82. package/segment-group/segment-group-item.cjs +3 -3
  83. package/segment-group/segment-group-item.d.ts +3 -2
  84. package/segment-group/segment-group-item.mjs +3 -3
  85. package/segment-group/segment-group-label.cjs +2 -2
  86. package/segment-group/segment-group-label.mjs +2 -2
  87. package/segment-group/segment-group.cjs +4 -4
  88. package/segment-group/segment-group.mjs +4 -4
  89. package/select/select-item-group.cjs +2 -2
  90. package/select/select-item-group.mjs +2 -2
  91. package/select/select.cjs +1 -1
  92. package/select/select.d.ts +1 -1
  93. package/select/select.mjs +1 -1
  94. package/switch/switch.cjs +2 -2
  95. package/switch/switch.mjs +2 -2
  96. package/toast/create-toaster.cjs +2 -2
  97. package/toast/create-toaster.d.ts +1 -1
  98. package/toast/create-toaster.mjs +2 -2
  99. package/toast/index.cjs +5 -2
  100. package/toast/index.d.ts +6 -4
  101. package/toast/index.mjs +5 -3
  102. package/toast/toast-group.cjs +15 -0
  103. package/toast/toast-group.d.ts +6 -0
  104. package/toast/toast-group.mjs +11 -0
  105. package/tooltip/tooltip.cjs +2 -1
  106. package/tooltip/tooltip.mjs +2 -1
  107. package/use-is-server.cjs +16 -0
  108. package/use-is-server.d.ts +1 -0
  109. package/use-is-server.mjs +12 -0
  110. package/segment-group/segment-group.anatomy.cjs +0 -10
  111. package/segment-group/segment-group.anatomy.d.ts +0 -2
  112. package/segment-group/segment-group.anatomy.mjs +0 -6
  113. /package/number-input/{number-input-field.cjs → number-input-input.cjs} +0 -0
  114. /package/number-input/{number-input-field.d.ts → number-input-input.d.ts} +0 -0
  115. /package/number-input/{number-input-field.mjs → number-input-input.mjs} +0 -0
  116. /package/pin-input/{pin-input-field.cjs → pin-input-input.cjs} +0 -0
  117. /package/pin-input/{pin-input-field.d.ts → pin-input-input.d.ts} +0 -0
  118. /package/pin-input/{pin-input-field.mjs → pin-input-input.mjs} +0 -0
@@ -4,18 +4,18 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
+ const anatomy = require('@ark-ui/anatomy');
7
8
  const react$1 = require('@zag-js/react');
8
9
  const react = require('react');
9
10
  const factory = require('../factory.cjs');
10
11
  const segmentGroupContext = require('./segment-group-context.cjs');
11
- const segmentGroup_anatomy = require('./segment-group.anatomy.cjs');
12
12
 
13
13
  const SegmentGroupLabel = react.forwardRef(
14
14
  (props, ref) => {
15
15
  const api = segmentGroupContext.useSegmentGroupContext();
16
16
  const mergedProps = react$1.mergeProps(
17
17
  api.labelProps,
18
- segmentGroup_anatomy.parts.label.attrs,
18
+ anatomy.segmentGroupAnatomy.build().label.attrs,
19
19
  props
20
20
  );
21
21
  return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.label, { ...mergedProps, ref });
@@ -1,17 +1,17 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { segmentGroupAnatomy } from '@ark-ui/anatomy';
3
4
  import { mergeProps } from '@zag-js/react';
4
5
  import { forwardRef } from 'react';
5
6
  import { ark } from '../factory.mjs';
6
7
  import { useSegmentGroupContext } from './segment-group-context.mjs';
7
- import { parts } from './segment-group.anatomy.mjs';
8
8
 
9
9
  const SegmentGroupLabel = forwardRef(
10
10
  (props, ref) => {
11
11
  const api = useSegmentGroupContext();
12
12
  const mergedProps = mergeProps(
13
13
  api.labelProps,
14
- parts.label.attrs,
14
+ segmentGroupAnatomy.build().label.attrs,
15
15
  props
16
16
  );
17
17
  return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });
@@ -4,16 +4,16 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
+ const anatomy = require('@ark-ui/anatomy');
7
8
  const react$1 = require('@zag-js/react');
8
9
  const react = require('react');
9
10
  const createSplitProps = require('../create-split-props.cjs');
10
11
  const factory = require('../factory.cjs');
11
12
  const segmentGroupContext = require('./segment-group-context.cjs');
12
- const segmentGroup_anatomy = require('./segment-group.anatomy.cjs');
13
13
  const useSegmentGroup = require('./use-segment-group.cjs');
14
14
 
15
15
  const SegmentGroup = react.forwardRef((props, ref) => {
16
- const [useSegmentGroupProps, divProps] = createSplitProps.createSplitProps()(props, [
16
+ const [useSegmentGroupProps, localProps] = createSplitProps.createSplitProps()(props, [
17
17
  "defaultValue",
18
18
  "dir",
19
19
  "disabled",
@@ -29,8 +29,8 @@ const SegmentGroup = react.forwardRef((props, ref) => {
29
29
  const api = useSegmentGroup.useSegmentGroup(useSegmentGroupProps);
30
30
  const mergedProps = react$1.mergeProps(
31
31
  api.rootProps,
32
- segmentGroup_anatomy.parts.root.attrs,
33
- divProps
32
+ anatomy.segmentGroupAnatomy.build().root.attrs,
33
+ localProps
34
34
  );
35
35
  return /* @__PURE__ */ jsxRuntime.jsx(segmentGroupContext.SegmentGroupProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
36
36
  });
@@ -1,15 +1,15 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { segmentGroupAnatomy } from '@ark-ui/anatomy';
3
4
  import { mergeProps } from '@zag-js/react';
4
5
  import { forwardRef } from 'react';
5
6
  import { createSplitProps } from '../create-split-props.mjs';
6
7
  import { ark } from '../factory.mjs';
7
8
  import { SegmentGroupProvider } from './segment-group-context.mjs';
8
- import { parts } from './segment-group.anatomy.mjs';
9
9
  import { useSegmentGroup } from './use-segment-group.mjs';
10
10
 
11
11
  const SegmentGroup = forwardRef((props, ref) => {
12
- const [useSegmentGroupProps, divProps] = createSplitProps()(props, [
12
+ const [useSegmentGroupProps, localProps] = createSplitProps()(props, [
13
13
  "defaultValue",
14
14
  "dir",
15
15
  "disabled",
@@ -25,8 +25,8 @@ const SegmentGroup = forwardRef((props, ref) => {
25
25
  const api = useSegmentGroup(useSegmentGroupProps);
26
26
  const mergedProps = mergeProps(
27
27
  api.rootProps,
28
- parts.root.attrs,
29
- divProps
28
+ segmentGroupAnatomy.build().root.attrs,
29
+ localProps
30
30
  );
31
31
  return /* @__PURE__ */ jsx(SegmentGroupProvider, { value: api, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
32
32
  });
@@ -11,9 +11,9 @@ const factory = require('../factory.cjs');
11
11
  const selectContext = require('./select-context.cjs');
12
12
 
13
13
  const SelectItemGroup = react.forwardRef((props, ref) => {
14
- const [itemPropsProps, localProps] = createSplitProps.createSplitProps()(props, ["id"]);
14
+ const [itemGroupProps, localProps] = createSplitProps.createSplitProps()(props, ["id"]);
15
15
  const api = selectContext.useSelectContext();
16
- const mergedProps = react$1.mergeProps(api.getItemGroupProps(itemPropsProps), localProps);
16
+ const mergedProps = react$1.mergeProps(api.getItemGroupProps(itemGroupProps), localProps);
17
17
  return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
18
18
  });
19
19
  SelectItemGroup.displayName = "SelectItemGroup";
@@ -7,9 +7,9 @@ import { ark } from '../factory.mjs';
7
7
  import { useSelectContext } from './select-context.mjs';
8
8
 
9
9
  const SelectItemGroup = forwardRef((props, ref) => {
10
- const [itemPropsProps, localProps] = createSplitProps()(props, ["id"]);
10
+ const [itemGroupProps, localProps] = createSplitProps()(props, ["id"]);
11
11
  const api = useSelectContext();
12
- const mergedProps = mergeProps(api.getItemGroupProps(itemPropsProps), localProps);
12
+ const mergedProps = mergeProps(api.getItemGroupProps(itemGroupProps), localProps);
13
13
  return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
14
14
  });
15
15
  SelectItemGroup.displayName = "SelectItemGroup";
package/select/select.cjs CHANGED
@@ -52,7 +52,7 @@ const SelectImpl = (props, ref) => {
52
52
  ]
53
53
  );
54
54
  const api = useSelect.useSelect(useSelectProps);
55
- const presenceApi = usePresence.usePresence({ ...presenceProps, present: api.isOpen });
55
+ const presenceApi = usePresence.usePresence(react$1.mergeProps({ present: api.isOpen }, presenceProps));
56
56
  const view = runIfFn.runIfFn(children, api);
57
57
  const mergedProps = react$1.mergeProps(api.rootProps, localProps);
58
58
  return /* @__PURE__ */ jsxRuntime.jsx(selectContext.SelectProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(presenceContext.PresenceProvider, { value: presenceApi, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref, children: view }) }) });
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import { type JSX, type ReactNode } from 'react';
2
2
  import { type HTMLArkProps } from '../factory';
3
3
  import { type UsePresenceProps } from '../presence';
4
4
  import { type Assign, type CollectionItem } from '../types';
package/select/select.mjs CHANGED
@@ -48,7 +48,7 @@ const SelectImpl = (props, ref) => {
48
48
  ]
49
49
  );
50
50
  const api = useSelect(useSelectProps);
51
- const presenceApi = usePresence({ ...presenceProps, present: api.isOpen });
51
+ const presenceApi = usePresence(mergeProps({ present: api.isOpen }, presenceProps));
52
52
  const view = runIfFn(children, api);
53
53
  const mergedProps = mergeProps(api.rootProps, localProps);
54
54
  return /* @__PURE__ */ jsx(SelectProvider, { value: api, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presenceApi, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref, children: view }) }) });
package/switch/switch.cjs CHANGED
@@ -13,7 +13,7 @@ const switchContext = require('./switch-context.cjs');
13
13
  const useSwitch = require('./use-switch.cjs');
14
14
 
15
15
  const Switch = react.forwardRef((props, ref) => {
16
- const [switchProps, { children, ...labelProps }] = createSplitProps.createSplitProps()(props, [
16
+ const [switchProps, { children, ...localProps }] = createSplitProps.createSplitProps()(props, [
17
17
  "checked",
18
18
  "defaultChecked",
19
19
  "dir",
@@ -30,8 +30,8 @@ const Switch = react.forwardRef((props, ref) => {
30
30
  "value"
31
31
  ]);
32
32
  const api = useSwitch.useSwitch(switchProps);
33
+ const mergedProps = react$1.mergeProps(api.rootProps, localProps);
33
34
  const view = runIfFn.runIfFn(children, api);
34
- const mergedProps = react$1.mergeProps(api.rootProps, labelProps);
35
35
  return /* @__PURE__ */ jsxRuntime.jsx(switchContext.SwitchProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.label, { ...mergedProps, ref, children: view }) });
36
36
  });
37
37
  Switch.displayName = "Switch";
package/switch/switch.mjs CHANGED
@@ -9,7 +9,7 @@ import { SwitchProvider } from './switch-context.mjs';
9
9
  import { useSwitch } from './use-switch.mjs';
10
10
 
11
11
  const Switch = forwardRef((props, ref) => {
12
- const [switchProps, { children, ...labelProps }] = createSplitProps()(props, [
12
+ const [switchProps, { children, ...localProps }] = createSplitProps()(props, [
13
13
  "checked",
14
14
  "defaultChecked",
15
15
  "dir",
@@ -26,8 +26,8 @@ const Switch = forwardRef((props, ref) => {
26
26
  "value"
27
27
  ]);
28
28
  const api = useSwitch(switchProps);
29
+ const mergedProps = mergeProps(api.rootProps, localProps);
29
30
  const view = runIfFn(children, api);
30
- const mergedProps = mergeProps(api.rootProps, labelProps);
31
31
  return /* @__PURE__ */ jsx(SwitchProvider, { value: api, children: /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref, children: view }) });
32
32
  });
33
33
  Switch.displayName = "Switch";
@@ -8,8 +8,8 @@ const react = require('@zag-js/react');
8
8
  const toast = require('@zag-js/toast');
9
9
  const react$1 = require('react');
10
10
  require('../environment/index.cjs');
11
- const factory = require('../factory.cjs');
12
11
  const toastContext = require('./toast-context.cjs');
12
+ const toastGroup = require('./toast-group.cjs');
13
13
  const environmentContext = require('../environment/environment-context.cjs');
14
14
 
15
15
  function _interopNamespaceDefault(e) {
@@ -45,7 +45,7 @@ const createToaster = (props) => {
45
45
  }, []);
46
46
  const mergedProps = react.mergeProps(api.getGroupProps({ placement }), props2);
47
47
  const toasts = api.toastsByPlacement[placement] ?? [];
48
- return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.ol, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsxRuntime.jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
48
+ return /* @__PURE__ */ jsxRuntime.jsx(toastGroup.ToastGroup, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsxRuntime.jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
49
49
  });
50
50
  Toaster.displayName = "ToastGroup";
51
51
  return [Toaster, api];
@@ -1,6 +1,6 @@
1
1
  import { type PropTypes } from '@zag-js/react';
2
2
  import * as toast from '@zag-js/toast';
3
- import React from 'react';
3
+ import { type JSX } from 'react';
4
4
  import type { Optional } from '../types';
5
5
  type GroupContext = Partial<toast.GroupMachineContext>;
6
6
  export interface CreateToasterProps extends Omit<Optional<GroupContext, 'id'>, 'render'> {
@@ -4,8 +4,8 @@ import { normalizeProps, useActor, mergeProps } from '@zag-js/react';
4
4
  import * as toast from '@zag-js/toast';
5
5
  import { forwardRef, useEffect } from 'react';
6
6
  import '../environment/index.mjs';
7
- import { ark } from '../factory.mjs';
8
7
  import { ToastProvider } from './toast-context.mjs';
8
+ import { ToastGroup } from './toast-group.mjs';
9
9
  import { useEnvironmentContext } from '../environment/environment-context.mjs';
10
10
 
11
11
  const createToaster = (props) => {
@@ -22,7 +22,7 @@ const createToaster = (props) => {
22
22
  }, []);
23
23
  const mergedProps = mergeProps(api.getGroupProps({ placement }), props2);
24
24
  const toasts = api.toastsByPlacement[placement] ?? [];
25
- return /* @__PURE__ */ jsx(ark.ol, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
25
+ return /* @__PURE__ */ jsx(ToastGroup, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
26
26
  });
27
27
  Toaster.displayName = "ToastGroup";
28
28
  return [Toaster, api];
package/toast/index.cjs CHANGED
@@ -7,17 +7,20 @@ const createToaster = require('./create-toaster.cjs');
7
7
  const toast = require('./toast.cjs');
8
8
  const toastCloseTrigger = require('./toast-close-trigger.cjs');
9
9
  const toastDescription = require('./toast-description.cjs');
10
+ const toastGroup = require('./toast-group.cjs');
10
11
  const toastTitle = require('./toast-title.cjs');
11
12
 
12
13
  const Toast = Object.assign(toast.Toast, {
13
14
  Root: toast.Toast,
14
- Title: toastTitle.ToastTitle,
15
+ CloseTrigger: toastCloseTrigger.ToastCloseTrigger,
15
16
  Description: toastDescription.ToastDescription,
16
- CloseTrigger: toastCloseTrigger.ToastCloseTrigger
17
+ Group: toastGroup.ToastGroup,
18
+ Title: toastTitle.ToastTitle
17
19
  });
18
20
 
19
21
  exports.createToaster = createToaster.createToaster;
20
22
  exports.ToastCloseTrigger = toastCloseTrigger.ToastCloseTrigger;
21
23
  exports.ToastDescription = toastDescription.ToastDescription;
24
+ exports.ToastGroup = toastGroup.ToastGroup;
22
25
  exports.ToastTitle = toastTitle.ToastTitle;
23
26
  exports.Toast = Toast;
package/toast/index.d.ts CHANGED
@@ -4,12 +4,14 @@ import { createToaster, type CreateToasterProps, type CreateToasterReturn } from
4
4
  import { type ToastProps } from './toast';
5
5
  import { ToastCloseTrigger, type ToastCloseTriggerProps } from './toast-close-trigger';
6
6
  import { ToastDescription, type ToastDescriptionProps } from './toast-description';
7
+ import { ToastGroup, type ToastGroupProps } from './toast-group';
7
8
  import { ToastTitle, type ToastTitleProps } from './toast-title';
8
9
  declare const Toast: ForwardRefExoticComponent<ToastProps & RefAttributes<HTMLLIElement>> & {
9
10
  Root: ForwardRefExoticComponent<ToastProps & RefAttributes<HTMLLIElement>>;
10
- Title: ForwardRefExoticComponent<ToastTitleProps & RefAttributes<HTMLDivElement>>;
11
- Description: ForwardRefExoticComponent<ToastDescriptionProps & RefAttributes<HTMLDivElement>>;
12
11
  CloseTrigger: ForwardRefExoticComponent<ToastCloseTriggerProps & RefAttributes<HTMLButtonElement>>;
12
+ Description: ForwardRefExoticComponent<ToastDescriptionProps & RefAttributes<HTMLDivElement>>;
13
+ Group: ForwardRefExoticComponent<ToastGroupProps & RefAttributes<HTMLOListElement>>;
14
+ Title: ForwardRefExoticComponent<ToastTitleProps & RefAttributes<HTMLDivElement>>;
13
15
  };
14
- export { createToaster, Toast, ToastCloseTrigger, ToastDescription, ToastTitle };
15
- export type { CreateToasterProps, CreateToasterReturn, ToastCloseTriggerProps, ToastDescriptionProps, ToastProps, ToastTitleProps, };
16
+ export { createToaster, Toast, ToastCloseTrigger, ToastDescription, ToastGroup, ToastTitle };
17
+ export type { CreateToasterProps, CreateToasterReturn, ToastCloseTriggerProps, ToastDescriptionProps, ToastGroupProps, ToastProps, ToastTitleProps, };
package/toast/index.mjs CHANGED
@@ -3,13 +3,15 @@ export { createToaster } from './create-toaster.mjs';
3
3
  import { Toast as Toast$1 } from './toast.mjs';
4
4
  import { ToastCloseTrigger } from './toast-close-trigger.mjs';
5
5
  import { ToastDescription } from './toast-description.mjs';
6
+ import { ToastGroup } from './toast-group.mjs';
6
7
  import { ToastTitle } from './toast-title.mjs';
7
8
 
8
9
  const Toast = Object.assign(Toast$1, {
9
10
  Root: Toast$1,
10
- Title: ToastTitle,
11
+ CloseTrigger: ToastCloseTrigger,
11
12
  Description: ToastDescription,
12
- CloseTrigger: ToastCloseTrigger
13
+ Group: ToastGroup,
14
+ Title: ToastTitle
13
15
  });
14
16
 
15
- export { Toast, ToastCloseTrigger, ToastDescription, ToastTitle };
17
+ export { Toast, ToastCloseTrigger, ToastDescription, ToastGroup, ToastTitle };
@@ -0,0 +1,15 @@
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 = require('react');
8
+ const factory = require('../factory.cjs');
9
+
10
+ const ToastGroup = react.forwardRef((props, ref) => {
11
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.ol, { ...props, ref });
12
+ });
13
+ ToastGroup.displayName = "ToastGroup";
14
+
15
+ exports.ToastGroup = ToastGroup;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ToastGroupProps extends HTMLArkProps<'ol'> {
5
+ }
6
+ export declare const ToastGroup: ForwardRefExoticComponent<ToastGroupProps & RefAttributes<HTMLOListElement>>;
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
4
+ import { ark } from '../factory.mjs';
5
+
6
+ const ToastGroup = forwardRef((props, ref) => {
7
+ return /* @__PURE__ */ jsx(ark.ol, { ...props, ref });
8
+ });
9
+ ToastGroup.displayName = "ToastGroup";
10
+
11
+ export { ToastGroup };
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
 
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
+ const react = require('@zag-js/react');
7
8
  require('react');
8
9
  require('../presence/index.cjs');
9
10
  const splitPresenceProps = require('../presence/split-presence-props.cjs');
@@ -16,7 +17,7 @@ const presenceContext = require('../presence/presence-context.cjs');
16
17
  const Tooltip = (props) => {
17
18
  const [presenceProps, { children, ...localProps }] = splitPresenceProps.splitPresenceProps(props);
18
19
  const api = useTooltip.useTooltip(localProps);
19
- const presenceApi = usePresence.usePresence({ ...presenceProps, present: api.isOpen });
20
+ const presenceApi = usePresence.usePresence(react.mergeProps({ present: api.isOpen }, presenceProps));
20
21
  const view = runIfFn.runIfFn(children, api);
21
22
  return /* @__PURE__ */ jsxRuntime.jsx(tooltipContext.TooltipProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(presenceContext.PresenceProvider, { value: presenceApi, children: view }) });
22
23
  };
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
3
4
  import 'react';
4
5
  import '../presence/index.mjs';
5
6
  import { splitPresenceProps } from '../presence/split-presence-props.mjs';
@@ -12,7 +13,7 @@ import { PresenceProvider } from '../presence/presence-context.mjs';
12
13
  const Tooltip = (props) => {
13
14
  const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
14
15
  const api = useTooltip(localProps);
15
- const presenceApi = usePresence({ ...presenceProps, present: api.isOpen });
16
+ const presenceApi = usePresence(mergeProps({ present: api.isOpen }, presenceProps));
16
17
  const view = runIfFn(children, api);
17
18
  return /* @__PURE__ */ jsx(TooltipProvider, { value: api, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presenceApi, children: view }) });
18
19
  };
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const react = require('react');
7
+
8
+ const useIsServer = () => {
9
+ const [isServer, setServer] = react.useState(true);
10
+ react.useEffect(() => {
11
+ setServer(false);
12
+ }, []);
13
+ return isServer;
14
+ };
15
+
16
+ exports.useIsServer = useIsServer;
@@ -0,0 +1 @@
1
+ export declare const useIsServer: () => boolean;
@@ -0,0 +1,12 @@
1
+ 'use client';
2
+ import { useState, useEffect } from 'react';
3
+
4
+ const useIsServer = () => {
5
+ const [isServer, setServer] = useState(true);
6
+ useEffect(() => {
7
+ setServer(false);
8
+ }, []);
9
+ return isServer;
10
+ };
11
+
12
+ export { useIsServer };
@@ -1,10 +0,0 @@
1
- 'use client';
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const anatomy = require('@ark-ui/anatomy');
7
-
8
- const parts = anatomy.segmentGroupAnatomy.build();
9
-
10
- exports.parts = parts;
@@ -1,2 +0,0 @@
1
- import { type AnatomyPart } from '@ark-ui/anatomy';
2
- export declare const parts: Record<'root' | 'label' | 'item' | 'itemText' | 'itemControl' | 'indicator', AnatomyPart>;
@@ -1,6 +0,0 @@
1
- 'use client';
2
- import { segmentGroupAnatomy } from '@ark-ui/anatomy';
3
-
4
- const parts = segmentGroupAnatomy.build();
5
-
6
- export { parts };