@ark-ui/react 1.0.0-beta.3 → 1.0.0-beta.5
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 +11 -1
- package/accordion/accordion-context.d.ts +2 -1
- package/accordion/accordion-item-content.cjs +14 -21
- package/accordion/accordion-item-content.d.ts +1 -3
- package/accordion/accordion-item-content.mjs +14 -21
- package/accordion/accordion-item-context.d.ts +2 -2
- package/accordion/accordion-item-trigger.cjs +11 -1
- package/accordion/accordion-item-trigger.mjs +11 -1
- package/accordion/accordion-item.cjs +7 -1
- package/accordion/accordion-item.d.ts +4 -5
- package/accordion/accordion-item.mjs +7 -1
- package/accordion/accordion.cjs +7 -3
- package/accordion/accordion.d.ts +2 -1
- package/accordion/accordion.mjs +7 -3
- package/carousel/carousel.d.ts +4 -5
- package/carousel/carousel.stories.d.ts +2 -0
- package/checkbox/checkbox.cjs +2 -2
- package/checkbox/checkbox.d.ts +4 -5
- package/checkbox/checkbox.mjs +2 -2
- package/color-picker/color-picker-content.cjs +8 -11
- package/color-picker/color-picker-content.d.ts +1 -3
- package/color-picker/color-picker-content.mjs +8 -11
- package/color-picker/color-picker-positioner.cjs +6 -0
- package/color-picker/color-picker-positioner.mjs +6 -0
- package/color-picker/color-picker-view.cjs +15 -0
- package/color-picker/color-picker-view.d.ts +7 -0
- package/color-picker/color-picker-view.mjs +11 -0
- package/color-picker/color-picker.cjs +31 -28
- package/color-picker/color-picker.d.ts +6 -5
- package/color-picker/color-picker.mjs +32 -29
- package/color-picker/color-picker.stories.d.ts +1 -0
- package/color-picker/index.cjs +3 -1
- package/color-picker/index.d.ts +4 -1
- package/color-picker/index.mjs +3 -1
- package/combobox/combobox-content.cjs +8 -11
- package/combobox/combobox-content.d.ts +1 -3
- package/combobox/combobox-content.mjs +8 -11
- package/combobox/combobox-item.d.ts +6 -4
- package/combobox/combobox-positioner.cjs +6 -0
- package/combobox/combobox-positioner.mjs +6 -0
- package/combobox/combobox.cjs +8 -2
- package/combobox/combobox.d.ts +4 -3
- package/combobox/combobox.mjs +8 -2
- package/date-picker/date-picker-content.cjs +8 -11
- package/date-picker/date-picker-content.d.ts +1 -3
- package/date-picker/date-picker-content.mjs +8 -11
- package/date-picker/date-picker-positioner.cjs +6 -0
- package/date-picker/date-picker-positioner.mjs +6 -0
- package/date-picker/date-picker-view.d.ts +3 -3
- package/date-picker/date-picker.cjs +11 -5
- package/date-picker/date-picker.d.ts +6 -5
- package/date-picker/date-picker.mjs +11 -5
- package/date-picker/date-picker.stories.d.ts +1 -0
- package/dialog/dialog-backdrop.cjs +8 -11
- package/dialog/dialog-backdrop.d.ts +1 -3
- package/dialog/dialog-backdrop.mjs +8 -11
- package/dialog/dialog-content.cjs +8 -11
- package/dialog/dialog-content.d.ts +1 -3
- package/dialog/dialog-content.mjs +8 -11
- package/dialog/dialog-positioner.cjs +6 -0
- package/dialog/dialog-positioner.mjs +6 -0
- package/dialog/dialog-trigger.cjs +10 -1
- package/dialog/dialog-trigger.mjs +10 -1
- package/dialog/dialog.cjs +8 -3
- package/dialog/dialog.d.ts +4 -6
- package/dialog/dialog.mjs +8 -3
- package/editable/editable.d.ts +4 -5
- package/environment/environment-context.d.ts +1 -1
- package/hover-card/hover-card-content.cjs +8 -11
- package/hover-card/hover-card-content.d.ts +1 -3
- package/hover-card/hover-card-content.mjs +8 -11
- package/hover-card/hover-card-positioner.cjs +6 -0
- package/hover-card/hover-card-positioner.mjs +6 -0
- package/hover-card/hover-card.cjs +8 -3
- package/hover-card/hover-card.d.ts +4 -6
- package/hover-card/hover-card.mjs +8 -3
- package/index.cjs +10 -2
- package/index.mjs +4 -1
- package/menu/index.d.ts +1 -1
- package/menu/menu-content.cjs +8 -11
- package/menu/menu-content.d.ts +1 -3
- package/menu/menu-content.mjs +8 -11
- package/menu/menu-item-group-label.cjs +1 -1
- package/menu/menu-item-group-label.d.ts +3 -3
- package/menu/menu-item-group-label.mjs +1 -1
- package/menu/menu-option-item.d.ts +2 -2
- package/menu/menu.cjs +11 -12
- package/menu/menu.d.ts +4 -11
- package/menu/menu.mjs +12 -13
- package/menu/menu.stories.d.ts +4 -1
- package/number-input/number-input.stories.d.ts +6 -1
- package/package.json +50 -50
- package/pagination/pagination.d.ts +3 -3
- package/pin-input/pin-input.stories.d.ts +5 -0
- package/popover/popover-content.cjs +8 -11
- package/popover/popover-content.d.ts +1 -3
- package/popover/popover-content.mjs +8 -11
- package/popover/popover-positioner.cjs +6 -0
- package/popover/popover-positioner.mjs +6 -0
- package/popover/popover-trigger.cjs +10 -1
- package/popover/popover-trigger.mjs +10 -1
- package/popover/popover.cjs +8 -3
- package/popover/popover.d.ts +4 -6
- package/popover/popover.mjs +8 -3
- package/popover/popover.stories.d.ts +4 -1
- package/presence/index.cjs +8 -0
- package/presence/index.d.ts +8 -5
- package/presence/index.mjs +3 -0
- package/presence/presence-context.cjs +15 -0
- package/presence/presence-context.d.ts +6 -0
- package/presence/presence-context.mjs +10 -0
- package/presence/presence-props-context.cjs +17 -0
- package/presence/presence-props-context.d.ts +6 -0
- package/presence/presence-props-context.mjs +12 -0
- package/presence/presence.cjs +18 -19
- package/presence/presence.d.ts +6 -21
- package/presence/presence.mjs +19 -20
- package/presence/split-presence-props.d.ts +2 -2
- package/presence/use-presence.cjs +22 -4
- package/presence/use-presence.d.ts +21 -1
- package/presence/use-presence.mjs +20 -2
- package/radio-group/radio-group-item.d.ts +2 -3
- package/radio-group/radio-group.stories.d.ts +3 -0
- package/rating-group/rating-group-control.d.ts +5 -3
- package/rating-group/rating-group-item.d.ts +4 -5
- package/rating-group/rating-group.stories.d.ts +6 -0
- package/segment-group/segment-group-item.d.ts +2 -3
- package/segment-group/segment-group.stories.d.ts +3 -0
- package/select/select-content.cjs +8 -11
- package/select/select-content.d.ts +1 -3
- package/select/select-content.mjs +8 -11
- package/select/select-control.cjs +4 -1
- package/select/select-control.mjs +5 -2
- package/select/select-item.d.ts +2 -3
- package/select/select-positioner.cjs +6 -0
- package/select/select-positioner.mjs +6 -0
- package/select/select.cjs +8 -2
- package/select/select.d.ts +4 -3
- package/select/select.mjs +8 -2
- package/select/select.stories.d.ts +1 -1
- package/slider/index.cjs +4 -4
- package/slider/index.d.ts +4 -4
- package/slider/index.mjs +4 -4
- package/slider/{slider-output.cjs → slider-value-text.cjs} +5 -7
- package/slider/slider-value-text.d.ts +6 -0
- package/slider/slider-value-text.mjs +16 -0
- package/slider/slider.d.ts +3 -3
- package/slider/slider.stories.d.ts +9 -2
- package/splitter/splitter.d.ts +3 -3
- package/switch/switch.d.ts +3 -3
- package/switch/switch.stories.d.ts +1 -0
- package/tabs/tab-content.cjs +13 -12
- package/tabs/tab-content.d.ts +2 -4
- package/tabs/tab-content.mjs +13 -12
- package/tabs/tabs.cjs +7 -3
- package/tabs/tabs.d.ts +2 -1
- package/tabs/tabs.mjs +7 -3
- package/tags-input/tags-input-item.d.ts +4 -5
- package/tags-input/tags-input.d.ts +3 -3
- package/tags-input/tags-input.stories.d.ts +6 -0
- package/toast/toast.stories.d.ts +5 -1
- package/toggle-group/toggle-group.stories.d.ts +1 -1
- package/tooltip/tooltip-content.cjs +8 -11
- package/tooltip/tooltip-content.d.ts +1 -3
- package/tooltip/tooltip-content.mjs +8 -11
- package/tooltip/tooltip-positioner.cjs +6 -0
- package/tooltip/tooltip-positioner.mjs +6 -0
- package/tooltip/tooltip.cjs +8 -3
- package/tooltip/tooltip.d.ts +4 -4
- package/tooltip/tooltip.mjs +8 -3
- package/types.d.ts +1 -3
- package/use-event.cjs +6 -2
- package/use-event.mjs +6 -2
- package/slider/slider-output.d.ts +0 -9
- package/slider/slider-output.mjs +0 -18
- package/tabs/tab-presence.cjs +0 -17
- package/tabs/tab-presence.d.ts +0 -6
- package/tabs/tab-presence.mjs +0 -13
- package/use-latest-ref.cjs +0 -14
- package/use-latest-ref.d.ts +0 -3
- package/use-latest-ref.mjs +0 -10
|
@@ -7,22 +7,19 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
|
-
|
|
10
|
+
require('../presence/index.cjs');
|
|
11
11
|
const tooltipContext = require('./tooltip-context.cjs');
|
|
12
|
-
const
|
|
12
|
+
const presenceContext = require('../presence/presence-context.cjs');
|
|
13
13
|
|
|
14
14
|
const TooltipContent = react.forwardRef((props, ref) => {
|
|
15
|
-
const [presenceProps, tooltipContentProps] = splitPresenceProps.splitPresenceProps(props);
|
|
16
15
|
const api = tooltipContext.useTooltipContext();
|
|
17
|
-
|
|
16
|
+
const presenceApi = presenceContext.usePresenceContext();
|
|
17
|
+
const mergedProps = react$1.mergeProps(api.contentProps, presenceApi.getPresenceProps(ref), props);
|
|
18
|
+
if (presenceApi.isUnmounted) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps });
|
|
18
22
|
});
|
|
19
23
|
TooltipContent.displayName = "TooltipContent";
|
|
20
|
-
const TooltipInnerContent = react.forwardRef(
|
|
21
|
-
function TooltipInnerContent2(props, ref) {
|
|
22
|
-
const api = tooltipContext.useTooltipContext();
|
|
23
|
-
const mergedProps = react$1.mergeProps(api.contentProps, props);
|
|
24
|
-
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
24
|
|
|
28
25
|
exports.TooltipContent = TooltipContent;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import { type HTMLArkProps } from '../factory';
|
|
4
|
-
|
|
5
|
-
import type { Assign } from '../types';
|
|
6
|
-
export interface TooltipContentProps extends Assign<HTMLArkProps<'div'>, Omit<PresenceProps, 'children' | 'fallback'>> {
|
|
4
|
+
export interface TooltipContentProps extends HTMLArkProps<'div'> {
|
|
7
5
|
}
|
|
8
6
|
export declare const TooltipContent: ForwardRefExoticComponent<TooltipContentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -3,22 +3,19 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.mjs';
|
|
6
|
-
import
|
|
6
|
+
import '../presence/index.mjs';
|
|
7
7
|
import { useTooltipContext } from './tooltip-context.mjs';
|
|
8
|
-
import {
|
|
8
|
+
import { usePresenceContext } from '../presence/presence-context.mjs';
|
|
9
9
|
|
|
10
10
|
const TooltipContent = forwardRef((props, ref) => {
|
|
11
|
-
const [presenceProps, tooltipContentProps] = splitPresenceProps(props);
|
|
12
11
|
const api = useTooltipContext();
|
|
13
|
-
|
|
12
|
+
const presenceApi = usePresenceContext();
|
|
13
|
+
const mergedProps = mergeProps(api.contentProps, presenceApi.getPresenceProps(ref), props);
|
|
14
|
+
if (presenceApi.isUnmounted) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps });
|
|
14
18
|
});
|
|
15
19
|
TooltipContent.displayName = "TooltipContent";
|
|
16
|
-
const TooltipInnerContent = forwardRef(
|
|
17
|
-
function TooltipInnerContent2(props, ref) {
|
|
18
|
-
const api = useTooltipContext();
|
|
19
|
-
const mergedProps = mergeProps(api.contentProps, props);
|
|
20
|
-
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
20
|
|
|
24
21
|
export { TooltipContent };
|
|
@@ -7,12 +7,18 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
const react$1 = require('@zag-js/react');
|
|
8
8
|
const react = require('react');
|
|
9
9
|
const factory = require('../factory.cjs');
|
|
10
|
+
require('../presence/index.cjs');
|
|
10
11
|
const tooltipContext = require('./tooltip-context.cjs');
|
|
12
|
+
const presenceContext = require('../presence/presence-context.cjs');
|
|
11
13
|
|
|
12
14
|
const TooltipPositioner = react.forwardRef(
|
|
13
15
|
(props, ref) => {
|
|
14
16
|
const api = tooltipContext.useTooltipContext();
|
|
15
17
|
const mergedProps = react$1.mergeProps(api.positionerProps, props);
|
|
18
|
+
const presenceApi = presenceContext.usePresenceContext();
|
|
19
|
+
if (presenceApi.isUnmounted) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
16
22
|
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
17
23
|
}
|
|
18
24
|
);
|
|
@@ -3,12 +3,18 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { mergeProps } from '@zag-js/react';
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { ark } from '../factory.mjs';
|
|
6
|
+
import '../presence/index.mjs';
|
|
6
7
|
import { useTooltipContext } from './tooltip-context.mjs';
|
|
8
|
+
import { usePresenceContext } from '../presence/presence-context.mjs';
|
|
7
9
|
|
|
8
10
|
const TooltipPositioner = forwardRef(
|
|
9
11
|
(props, ref) => {
|
|
10
12
|
const api = useTooltipContext();
|
|
11
13
|
const mergedProps = mergeProps(api.positionerProps, props);
|
|
14
|
+
const presenceApi = usePresenceContext();
|
|
15
|
+
if (presenceApi.isUnmounted) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
12
18
|
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
13
19
|
}
|
|
14
20
|
);
|
package/tooltip/tooltip.cjs
CHANGED
|
@@ -5,15 +5,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
|
|
6
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
require('react');
|
|
8
|
+
require('../presence/index.cjs');
|
|
9
|
+
const splitPresenceProps = require('../presence/split-presence-props.cjs');
|
|
8
10
|
const runIfFn = require('../run-if-fn.cjs');
|
|
9
11
|
const tooltipContext = require('./tooltip-context.cjs');
|
|
10
12
|
const useTooltip = require('./use-tooltip.cjs');
|
|
13
|
+
const usePresence = require('../presence/use-presence.cjs');
|
|
14
|
+
const presenceContext = require('../presence/presence-context.cjs');
|
|
11
15
|
|
|
12
16
|
const Tooltip = (props) => {
|
|
13
|
-
const { children, ...
|
|
14
|
-
const api = useTooltip.useTooltip(
|
|
17
|
+
const [presenceProps, { children, ...localProps }] = splitPresenceProps.splitPresenceProps(props);
|
|
18
|
+
const api = useTooltip.useTooltip(localProps);
|
|
19
|
+
const presenceApi = usePresence.usePresence({ ...presenceProps, present: api.isOpen });
|
|
15
20
|
const view = runIfFn.runIfFn(children, api);
|
|
16
|
-
return /* @__PURE__ */ jsxRuntime.jsx(tooltipContext.TooltipProvider, { value: api, children: view });
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tooltipContext.TooltipProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(presenceContext.PresenceProvider, { value: presenceApi, children: view }) });
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
exports.Tooltip = Tooltip;
|
package/tooltip/tooltip.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { type UseTooltipProps } from './use-tooltip';
|
|
5
|
-
export interface TooltipProps extends UseTooltipProps {
|
|
6
|
-
children?: ReactNode | ((
|
|
3
|
+
import type { UsePresenceProps } from '../presence';
|
|
4
|
+
import { type UseTooltipProps, type UseTooltipReturn } from './use-tooltip';
|
|
5
|
+
export interface TooltipProps extends UseTooltipProps, UsePresenceProps {
|
|
6
|
+
children?: ReactNode | ((api: UseTooltipReturn) => ReactNode);
|
|
7
7
|
}
|
|
8
8
|
export declare const Tooltip: (props: TooltipProps) => JSX.Element;
|
package/tooltip/tooltip.mjs
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
|
+
import '../presence/index.mjs';
|
|
5
|
+
import { splitPresenceProps } from '../presence/split-presence-props.mjs';
|
|
4
6
|
import { runIfFn } from '../run-if-fn.mjs';
|
|
5
7
|
import { TooltipProvider } from './tooltip-context.mjs';
|
|
6
8
|
import { useTooltip } from './use-tooltip.mjs';
|
|
9
|
+
import { usePresence } from '../presence/use-presence.mjs';
|
|
10
|
+
import { PresenceProvider } from '../presence/presence-context.mjs';
|
|
7
11
|
|
|
8
12
|
const Tooltip = (props) => {
|
|
9
|
-
const { children, ...
|
|
10
|
-
const api = useTooltip(
|
|
13
|
+
const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
|
|
14
|
+
const api = useTooltip(localProps);
|
|
15
|
+
const presenceApi = usePresence({ ...presenceProps, present: api.isOpen });
|
|
11
16
|
const view = runIfFn(children, api);
|
|
12
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { value: api, children: view });
|
|
17
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { value: api, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presenceApi, children: view }) });
|
|
13
18
|
};
|
|
14
19
|
|
|
15
20
|
export { Tooltip };
|
package/types.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
type
|
|
2
|
-
export type Assign<T, U> = DistributiveOmit<T, keyof U> & U;
|
|
1
|
+
export type Assign<T, U> = Omit<T, keyof U> & U;
|
|
3
2
|
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
4
3
|
export type CollectionItem = string | object;
|
|
5
|
-
export {};
|
package/use-event.cjs
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
5
|
|
|
6
6
|
const react = require('react');
|
|
7
|
-
const useLatestRef = require('./use-latest-ref.cjs');
|
|
8
7
|
|
|
9
8
|
function useEvent(callback, opts = {}) {
|
|
10
9
|
const { sync = false } = opts;
|
|
11
|
-
const callbackRef = useLatestRef
|
|
10
|
+
const callbackRef = useLatestRef(callback);
|
|
12
11
|
return react.useCallback(
|
|
13
12
|
(...args) => {
|
|
14
13
|
if (sync)
|
|
@@ -18,5 +17,10 @@ function useEvent(callback, opts = {}) {
|
|
|
18
17
|
[sync, callbackRef]
|
|
19
18
|
);
|
|
20
19
|
}
|
|
20
|
+
function useLatestRef(value) {
|
|
21
|
+
const ref = react.useRef(value);
|
|
22
|
+
ref.current = value;
|
|
23
|
+
return ref;
|
|
24
|
+
}
|
|
21
25
|
|
|
22
26
|
exports.useEvent = useEvent;
|
package/use-event.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useCallback } from 'react';
|
|
3
|
-
import { useLatestRef } from './use-latest-ref.mjs';
|
|
2
|
+
import { useCallback, useRef } from 'react';
|
|
4
3
|
|
|
5
4
|
function useEvent(callback, opts = {}) {
|
|
6
5
|
const { sync = false } = opts;
|
|
@@ -14,5 +13,10 @@ function useEvent(callback, opts = {}) {
|
|
|
14
13
|
[sync, callbackRef]
|
|
15
14
|
);
|
|
16
15
|
}
|
|
16
|
+
function useLatestRef(value) {
|
|
17
|
+
const ref = useRef(value);
|
|
18
|
+
ref.current = value;
|
|
19
|
+
return ref;
|
|
20
|
+
}
|
|
17
21
|
|
|
18
22
|
export { useEvent };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ForwardRefExoticComponent, RefAttributes, type ReactNode } from 'react';
|
|
2
|
-
import { type HTMLArkProps } from '../factory';
|
|
3
|
-
import { type Assign } from '../types';
|
|
4
|
-
import { type UseSliderReturn } from './use-slider';
|
|
5
|
-
export interface SliderOutputProps extends Assign<HTMLArkProps<'output'>, {
|
|
6
|
-
children?: ((api: UseSliderReturn) => ReactNode) | ReactNode;
|
|
7
|
-
}> {
|
|
8
|
-
}
|
|
9
|
-
export declare const SliderOutput: ForwardRefExoticComponent<SliderOutputProps & RefAttributes<HTMLOutputElement>>;
|
package/slider/slider-output.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { mergeProps } from '@zag-js/react';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
5
|
-
import { ark } from '../factory.mjs';
|
|
6
|
-
import { runIfFn } from '../run-if-fn.mjs';
|
|
7
|
-
import { useSliderContext } from './slider-context.mjs';
|
|
8
|
-
|
|
9
|
-
const SliderOutput = forwardRef((props, ref) => {
|
|
10
|
-
const { children, ...rest } = props;
|
|
11
|
-
const api = useSliderContext();
|
|
12
|
-
const mergedProps = mergeProps(api.outputProps, rest);
|
|
13
|
-
const view = runIfFn(children, api);
|
|
14
|
-
return /* @__PURE__ */ jsx(ark.output, { ...mergedProps, ref, children: view });
|
|
15
|
-
});
|
|
16
|
-
SliderOutput.displayName = "SliderOutput";
|
|
17
|
-
|
|
18
|
-
export { SliderOutput };
|
package/tabs/tab-presence.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
require('@zag-js/tabs');
|
|
8
|
-
const index = require('../presence/index.cjs');
|
|
9
|
-
const tabsContext = require('./tabs-context.cjs');
|
|
10
|
-
|
|
11
|
-
const TabPresence = (props) => {
|
|
12
|
-
const { present, ...rest } = props;
|
|
13
|
-
const api = tabsContext.useTabsContext();
|
|
14
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: present !== void 0 ? present : api.value === props.value, ...rest });
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.TabPresence = TabPresence;
|
package/tabs/tab-presence.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import { type ContentProps } from '@zag-js/tabs';
|
|
3
|
-
import { type PresenceProps } from '../presence';
|
|
4
|
-
export interface TabPresenceProps extends PresenceProps, ContentProps {
|
|
5
|
-
}
|
|
6
|
-
export declare const TabPresence: (props: TabPresenceProps) => JSX.Element;
|
package/tabs/tab-presence.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import '@zag-js/tabs';
|
|
4
|
-
import { Presence } from '../presence/index.mjs';
|
|
5
|
-
import { useTabsContext } from './tabs-context.mjs';
|
|
6
|
-
|
|
7
|
-
const TabPresence = (props) => {
|
|
8
|
-
const { present, ...rest } = props;
|
|
9
|
-
const api = useTabsContext();
|
|
10
|
-
return /* @__PURE__ */ jsx(Presence, { present: present !== void 0 ? present : api.value === props.value, ...rest });
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { TabPresence };
|
package/use-latest-ref.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const react = require('react');
|
|
7
|
-
|
|
8
|
-
function useLatestRef(value) {
|
|
9
|
-
const ref = react.useRef(value);
|
|
10
|
-
ref.current = value;
|
|
11
|
-
return ref;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
exports.useLatestRef = useLatestRef;
|
package/use-latest-ref.d.ts
DELETED