@ark-ui/react 1.1.0 → 1.2.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/CHANGELOG.md +19 -0
- package/README.md +29 -16
- package/color-picker/color-picker.cjs +1 -1
- package/color-picker/color-picker.mjs +1 -1
- package/combobox/combobox.cjs +1 -1
- package/combobox/combobox.d.ts +1 -1
- package/combobox/combobox.mjs +1 -1
- package/date-picker/date-picker.cjs +2 -2
- package/date-picker/date-picker.mjs +2 -2
- package/date-picker/date-picker.stories.d.ts +1 -0
- package/dialog/dialog-backdrop.cjs +1 -1
- package/dialog/dialog-backdrop.mjs +1 -1
- package/dialog/dialog.cjs +2 -1
- package/dialog/dialog.mjs +2 -1
- package/editable/editable.cjs +2 -2
- package/editable/editable.mjs +2 -2
- package/factory.cjs +1 -2
- package/factory.d.ts +1 -1
- package/factory.mjs +2 -3
- package/factory.test.d.ts +1 -0
- package/file-upload/file-upload-item-preview-image.cjs +25 -0
- package/file-upload/file-upload-item-preview-image.d.ts +6 -0
- package/file-upload/file-upload-item-preview-image.mjs +21 -0
- package/file-upload/file-upload-item-preview.cjs +3 -9
- package/file-upload/file-upload-item-preview.d.ts +6 -1
- package/file-upload/file-upload-item-preview.mjs +4 -10
- package/file-upload/file-upload.cjs +6 -2
- package/file-upload/file-upload.mjs +6 -2
- package/file-upload/index.cjs +7 -5
- package/file-upload/index.d.ts +9 -7
- package/file-upload/index.mjs +7 -5
- package/file-upload/use-file-upload.cjs +2 -1
- package/file-upload/use-file-upload.mjs +2 -1
- package/hover-card/hover-card.cjs +2 -1
- package/hover-card/hover-card.mjs +2 -1
- package/index.cjs +8 -6
- package/index.mjs +4 -3
- package/menu/menu.cjs +4 -3
- package/menu/menu.mjs +2 -1
- package/number-input/index.cjs +3 -3
- package/number-input/index.d.ts +1 -1
- package/number-input/index.mjs +1 -1
- package/number-input/number-input.cjs +30 -33
- package/number-input/number-input.mjs +30 -33
- package/package.json +62 -55
- package/pagination/pagination-item.cjs +1 -1
- package/pagination/pagination-item.mjs +1 -1
- package/pagination/pagination.cjs +2 -2
- package/pagination/pagination.mjs +2 -2
- package/pin-input/index.cjs +3 -3
- package/pin-input/index.d.ts +1 -1
- package/pin-input/index.mjs +1 -1
- package/pin-input/pin-input.cjs +2 -2
- package/pin-input/pin-input.mjs +2 -2
- package/popover/popover.cjs +2 -1
- package/popover/popover.mjs +2 -1
- package/portal.cjs +2 -1
- package/portal.d.ts +2 -2
- package/portal.mjs +2 -1
- package/radio-group/radio-group-indicator.cjs +1 -2
- package/radio-group/radio-group-indicator.mjs +1 -2
- package/radio-group/radio-group-item.d.ts +1 -1
- package/radio-group/radio-group.cjs +2 -2
- package/radio-group/radio-group.mjs +2 -2
- package/rating-group/rating-group-control.cjs +2 -2
- package/rating-group/rating-group-control.mjs +2 -2
- package/rating-group/rating-group-item-context.d.ts +2 -2
- package/rating-group/rating-group-item.cjs +5 -4
- package/rating-group/rating-group-item.mjs +5 -4
- package/rating-group/rating-group.cjs +2 -2
- package/rating-group/rating-group.mjs +2 -2
- package/rating-group/use-rating-group.cjs +4 -4
- package/rating-group/use-rating-group.d.ts +4 -4
- package/rating-group/use-rating-group.mjs +3 -3
- package/segment-group/segment-group-indicator.cjs +2 -2
- package/segment-group/segment-group-indicator.mjs +2 -2
- package/segment-group/segment-group-item-context.d.ts +1 -13
- package/segment-group/segment-group-item-control.cjs +2 -2
- package/segment-group/segment-group-item-control.mjs +2 -2
- package/segment-group/segment-group-item-text.cjs +2 -2
- package/segment-group/segment-group-item-text.mjs +2 -2
- package/segment-group/segment-group-item.cjs +3 -3
- package/segment-group/segment-group-item.d.ts +3 -2
- package/segment-group/segment-group-item.mjs +3 -3
- package/segment-group/segment-group-label.cjs +2 -2
- package/segment-group/segment-group-label.mjs +2 -2
- package/segment-group/segment-group.cjs +4 -4
- package/segment-group/segment-group.mjs +4 -4
- package/select/select-item-group.cjs +2 -2
- package/select/select-item-group.mjs +2 -2
- package/select/select.cjs +1 -1
- package/select/select.d.ts +1 -1
- package/select/select.mjs +1 -1
- package/switch/switch.cjs +2 -2
- package/switch/switch.mjs +2 -2
- package/toast/create-toaster.cjs +2 -2
- package/toast/create-toaster.d.ts +1 -1
- package/toast/create-toaster.mjs +2 -2
- package/toast/index.cjs +5 -2
- package/toast/index.d.ts +6 -4
- package/toast/index.mjs +5 -3
- package/toast/toast-group.cjs +15 -0
- package/toast/toast-group.d.ts +6 -0
- package/toast/toast-group.mjs +11 -0
- package/tooltip/tooltip.cjs +2 -1
- package/tooltip/tooltip.mjs +2 -1
- package/use-is-server.cjs +16 -0
- package/use-is-server.d.ts +1 -0
- package/use-is-server.mjs +12 -0
- package/segment-group/segment-group.anatomy.cjs +0 -10
- package/segment-group/segment-group.anatomy.d.ts +0 -2
- package/segment-group/segment-group.anatomy.mjs +0 -6
- /package/number-input/{number-input-field.cjs → number-input-input.cjs} +0 -0
- /package/number-input/{number-input-field.d.ts → number-input-input.d.ts} +0 -0
- /package/number-input/{number-input-field.mjs → number-input-input.mjs} +0 -0
- /package/pin-input/{pin-input-field.cjs → pin-input-input.cjs} +0 -0
- /package/pin-input/{pin-input-field.d.ts → pin-input-input.d.ts} +0 -0
- /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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
33
|
-
|
|
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,
|
|
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
|
-
|
|
29
|
-
|
|
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 [
|
|
14
|
+
const [itemGroupProps, localProps] = createSplitProps.createSplitProps()(props, ["id"]);
|
|
15
15
|
const api = selectContext.useSelectContext();
|
|
16
|
-
const mergedProps = react$1.mergeProps(api.getItemGroupProps(
|
|
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 [
|
|
10
|
+
const [itemGroupProps, localProps] = createSplitProps()(props, ["id"]);
|
|
11
11
|
const api = useSelectContext();
|
|
12
|
-
const mergedProps = mergeProps(api.getItemGroupProps(
|
|
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({
|
|
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 }) }) });
|
package/select/select.d.ts
CHANGED
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({
|
|
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, ...
|
|
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, ...
|
|
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";
|
package/toast/create-toaster.cjs
CHANGED
|
@@ -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(
|
|
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
|
|
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'> {
|
package/toast/create-toaster.mjs
CHANGED
|
@@ -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(
|
|
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
|
-
|
|
15
|
+
CloseTrigger: toastCloseTrigger.ToastCloseTrigger,
|
|
15
16
|
Description: toastDescription.ToastDescription,
|
|
16
|
-
|
|
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
|
-
|
|
11
|
+
CloseTrigger: ToastCloseTrigger,
|
|
11
12
|
Description: ToastDescription,
|
|
12
|
-
|
|
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 };
|
package/tooltip/tooltip.cjs
CHANGED
|
@@ -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({
|
|
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
|
};
|
package/tooltip/tooltip.mjs
CHANGED
|
@@ -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({
|
|
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;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|