@ark-ui/react 0.13.0 → 0.14.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 +26 -2
- package/accordion/accordion-context.d.ts +2 -9
- package/accordion/accordion.cjs +3 -2
- package/accordion/accordion.d.ts +2 -2
- package/accordion/accordion.mjs +3 -2
- package/accordion/index.cjs +1 -0
- package/accordion/index.d.ts +4 -4
- package/accordion/index.mjs +1 -0
- package/accordion/use-accordion.d.ts +2 -7
- package/avatar/avatar-context.d.ts +2 -9
- package/avatar/index.cjs +1 -0
- package/avatar/index.mjs +1 -0
- package/avatar/use-avatar.d.ts +2 -7
- package/carousel/carousel-context.d.ts +2 -9
- package/carousel/carousel.d.ts +3 -3
- package/carousel/index.cjs +1 -0
- package/carousel/index.d.ts +7 -12
- package/carousel/index.mjs +1 -0
- package/carousel/use-carousel.d.ts +2 -7
- package/checkbox/checkbox-context.d.ts +2 -9
- package/checkbox/checkbox.d.ts +3 -3
- package/checkbox/index.cjs +1 -0
- package/checkbox/index.d.ts +7 -13
- package/checkbox/index.mjs +1 -0
- package/checkbox/use-checkbox.d.ts +2 -7
- package/color-picker/color-picker-context.d.ts +2 -9
- package/color-picker/index.cjs +1 -0
- package/color-picker/index.mjs +1 -0
- package/color-picker/use-color-picker.d.ts +2 -7
- package/combobox/combobox-context.d.ts +2 -9
- package/combobox/combobox.cjs +0 -1
- package/combobox/combobox.d.ts +1 -1
- package/combobox/combobox.mjs +0 -1
- package/combobox/index.cjs +1 -0
- package/combobox/index.d.ts +7 -12
- package/combobox/index.mjs +1 -0
- package/combobox/use-combobox.d.ts +2 -7
- package/compose-refs.cjs +0 -1
- package/compose-refs.mjs +0 -1
- package/date-picker/date-picker-context.d.ts +2 -9
- package/date-picker/index.cjs +1 -0
- package/date-picker/index.mjs +1 -0
- package/date-picker/use-date-picker.d.ts +2 -7
- package/dialog/dialog-context.d.ts +2 -9
- package/dialog/index.cjs +1 -0
- package/dialog/index.mjs +1 -0
- package/dialog/use-dialog.d.ts +2 -7
- package/editable/editable-context.d.ts +2 -9
- package/editable/editable.d.ts +3 -3
- package/editable/index.cjs +1 -0
- package/editable/index.d.ts +7 -12
- package/editable/index.mjs +1 -0
- package/editable/use-editable.d.ts +2 -7
- package/environment/index.cjs +1 -0
- package/environment/index.mjs +1 -0
- package/factory.cjs +2 -3
- package/factory.mjs +1 -2
- package/hover-card/hover-card-context.d.ts +2 -9
- package/hover-card/index.cjs +1 -0
- package/hover-card/index.mjs +1 -0
- package/hover-card/use-hover-card.d.ts +2 -7
- package/index.cjs +0 -2
- package/index.mjs +0 -1
- package/menu/index.cjs +1 -0
- package/menu/index.d.ts +2 -2
- package/menu/index.mjs +1 -0
- package/menu/menu-item.d.ts +5 -8
- package/menu/use-menu.d.ts +1 -1
- package/number-input/index.cjs +1 -0
- package/number-input/index.d.ts +2 -2
- package/number-input/index.mjs +1 -0
- package/number-input/number-input-context.d.ts +2 -9
- package/number-input/number-input.d.ts +1 -1
- package/number-input/use-number-input.d.ts +2 -7
- package/package.json +49 -48
- package/pagination/index.cjs +1 -0
- package/pagination/index.d.ts +5 -11
- package/pagination/index.mjs +1 -0
- package/pagination/pagination-context.d.ts +2 -9
- package/pagination/pagination.d.ts +2 -2
- package/pagination/use-pagination.d.ts +2 -7
- package/pin-input/index.cjs +1 -0
- package/pin-input/index.d.ts +2 -2
- package/pin-input/index.mjs +1 -0
- package/pin-input/pin-input-context.d.ts +2 -9
- package/pin-input/pin-input.d.ts +1 -1
- package/pin-input/use-pin-input.d.ts +2 -7
- package/popover/index.cjs +1 -0
- package/popover/index.mjs +1 -0
- package/popover/popover-context.d.ts +2 -9
- package/popover/use-popover.d.ts +2 -7
- package/presence/index.cjs +1 -0
- package/presence/index.mjs +1 -0
- package/presence/use-presence.d.ts +1 -1
- package/pressable/index.cjs +1 -0
- package/pressable/index.mjs +1 -0
- package/pressable/use-pressable.d.ts +2 -7
- package/radio-group/index.cjs +1 -0
- package/radio-group/index.d.ts +2 -2
- package/radio-group/index.mjs +1 -0
- package/radio-group/radio-group-context.d.ts +2 -9
- package/radio-group/radio-group.d.ts +1 -1
- package/radio-group/use-radio-group.d.ts +2 -7
- package/range-slider/index.cjs +1 -0
- package/range-slider/index.d.ts +8 -16
- package/range-slider/index.mjs +1 -0
- package/range-slider/range-slider-context.d.ts +2 -9
- package/range-slider/range-slider.cjs +3 -0
- package/range-slider/range-slider.d.ts +1 -1
- package/range-slider/range-slider.mjs +3 -0
- package/range-slider/use-range-slider.d.ts +2 -7
- package/rating-group/index.cjs +1 -0
- package/rating-group/index.d.ts +6 -8
- package/rating-group/index.mjs +1 -0
- package/rating-group/rating-group-context.d.ts +2 -9
- package/rating-group/rating-group-control.d.ts +2 -2
- package/rating-group/rating-group.d.ts +1 -1
- package/rating-group/use-rating-group.d.ts +2 -7
- package/segment-group/index.cjs +1 -0
- package/segment-group/index.d.ts +2 -2
- package/segment-group/index.mjs +1 -0
- package/segment-group/segment-group-context.d.ts +2 -9
- package/segment-group/segment-group.d.ts +1 -1
- package/segment-group/use-segment-group.d.ts +2 -7
- package/select/index.cjs +1 -0
- package/select/index.mjs +1 -0
- package/select/select-context.d.ts +2 -9
- package/select/use-select.d.ts +2 -7
- package/slider/index.cjs +1 -0
- package/slider/index.d.ts +5 -15
- package/slider/index.mjs +1 -0
- package/slider/slider-context.d.ts +2 -9
- package/slider/slider.cjs +2 -0
- package/slider/slider.mjs +2 -0
- package/slider/use-slider.d.ts +2 -7
- package/splitter/index.cjs +1 -0
- package/splitter/index.d.ts +7 -12
- package/splitter/index.mjs +1 -0
- package/splitter/splitter-context.d.ts +2 -9
- package/splitter/splitter.d.ts +1 -1
- package/splitter/use-splitter.d.ts +2 -7
- package/switch/index.cjs +1 -3
- package/switch/index.d.ts +6 -19
- package/switch/index.mjs +2 -3
- package/switch/switch-context.d.ts +2 -9
- package/switch/switch-control.cjs +5 -2
- package/switch/switch-control.mjs +6 -3
- package/switch/switch.d.ts +2 -2
- package/switch/use-switch.d.ts +2 -7
- package/tabs/index.cjs +1 -0
- package/tabs/index.d.ts +2 -2
- package/tabs/index.mjs +1 -0
- package/tabs/tabs-context.d.ts +2 -9
- package/tabs/tabs.d.ts +1 -1
- package/tabs/use-tabs.cjs +21 -2
- package/tabs/use-tabs.d.ts +5 -10
- package/tabs/use-tabs.mjs +3 -3
- package/tags-input/index.cjs +1 -0
- package/tags-input/index.d.ts +2 -2
- package/tags-input/index.mjs +1 -0
- package/tags-input/tags-input-context.d.ts +2 -9
- package/tags-input/tags-input.cjs +1 -2
- package/tags-input/tags-input.d.ts +2 -2
- package/tags-input/tags-input.mjs +1 -2
- package/tags-input/use-tags-input.d.ts +2 -7
- package/toast/index.cjs +1 -0
- package/toast/index.d.ts +1 -1
- package/toast/index.mjs +1 -0
- package/toast/toast-group.d.ts +2 -2
- package/toast/toast-item-context.d.ts +2 -9
- package/toast/toast-provider.d.ts +2 -57
- package/toast/use-toast-item.d.ts +2 -7
- package/tooltip/index.cjs +1 -0
- package/tooltip/index.mjs +1 -0
- package/tooltip/tooltip-context.d.ts +2 -9
- package/tooltip/use-tooltip.d.ts +2 -7
- package/switch/switch-input.cjs +0 -19
- package/switch/switch-input.d.ts +0 -8
- package/switch/switch-input.mjs +0 -15
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { HTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
/// <reference types="react" />
|
|
3
1
|
import * as datePicker from '@zag-js/date-picker';
|
|
4
2
|
import type { Optional } from '../types';
|
|
5
3
|
export type UseDatePickerProps = Optional<datePicker.Context, 'id'>;
|
|
6
|
-
export type UseDatePickerReturn =
|
|
7
|
-
export declare const useDatePicker: (props: UseDatePickerProps) =>
|
|
8
|
-
element: HTMLAttributes<HTMLElement>;
|
|
9
|
-
style: CSSProperties;
|
|
10
|
-
}>;
|
|
4
|
+
export type UseDatePickerReturn = datePicker.Api;
|
|
5
|
+
export declare const useDatePicker: (props: UseDatePickerProps) => UseDatePickerReturn;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Provider, HTMLAttributes, CSSProperties } from 'react';
|
|
1
|
+
import { Provider } from 'react';
|
|
3
2
|
/// <reference types="react" />
|
|
4
3
|
import { type UseDialogReturn } from './use-dialog';
|
|
5
4
|
export type DialogContext = UseDialogReturn;
|
|
6
|
-
export declare const DialogProvider: Provider<
|
|
7
|
-
element: HTMLAttributes<HTMLElement>;
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>>, useDialogContext: () => PublicApi<JSX.IntrinsicElements & {
|
|
10
|
-
element: HTMLAttributes<HTMLElement>;
|
|
11
|
-
style: CSSProperties;
|
|
12
|
-
}>;
|
|
5
|
+
export declare const DialogProvider: Provider<UseDialogReturn>, useDialogContext: () => UseDialogReturn;
|
package/dialog/index.cjs
CHANGED
package/dialog/index.mjs
CHANGED
package/dialog/use-dialog.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { HTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
/// <reference types="react" />
|
|
3
1
|
import * as dialog from '@zag-js/dialog';
|
|
4
2
|
import { type Optional } from '../types';
|
|
5
3
|
export type UseDialogProps = Optional<dialog.Context, 'id'>;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>;
|
|
10
|
-
export type UseDialogReturn = ReturnType<typeof useDialog>;
|
|
4
|
+
export type UseDialogReturn = dialog.Api;
|
|
5
|
+
export declare const useDialog: (props: UseDialogProps) => UseDialogReturn;
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Provider, HTMLAttributes, CSSProperties } from 'react';
|
|
1
|
+
import { Provider } from 'react';
|
|
3
2
|
/// <reference types="react" />
|
|
4
3
|
import { type UseEditableReturn } from './use-editable';
|
|
5
4
|
export type EditableContext = UseEditableReturn;
|
|
6
|
-
export declare const EditableProvider: Provider<
|
|
7
|
-
element: HTMLAttributes<HTMLElement>;
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>>, useEditableContext: () => PublicApi<JSX.IntrinsicElements & {
|
|
10
|
-
element: HTMLAttributes<HTMLElement>;
|
|
11
|
-
style: CSSProperties;
|
|
12
|
-
}>;
|
|
5
|
+
export declare const EditableProvider: Provider<UseEditableReturn>, useEditableContext: () => UseEditableReturn;
|
package/editable/editable.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ import { type Assign } from '../types';
|
|
|
5
5
|
import { type EditableContext } from './editable-context';
|
|
6
6
|
import { type UseEditableProps } from './use-editable';
|
|
7
7
|
export type EditableProps = Assign<Omit<ComponentPropsWithoutRef<typeof ark.div>, 'children'> & {
|
|
8
|
-
children
|
|
8
|
+
children?: ReactNode | ((pages: EditableContext) => ReactNode);
|
|
9
9
|
}, UseEditableProps>;
|
|
10
10
|
export declare const Editable: ForwardRefExoticComponent<Omit<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
11
|
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
12
12
|
} & {
|
|
13
13
|
asChild?: boolean | undefined;
|
|
14
14
|
}, "ref">, "children"> & {
|
|
15
|
-
children
|
|
16
|
-
}, "name" | "value" | "getRootNode" | "form" | "id" | "ids" | "disabled" | "
|
|
15
|
+
children?: ReactNode | ((pages: EditableContext) => ReactNode);
|
|
16
|
+
}, "name" | "value" | "getRootNode" | "form" | "id" | "ids" | "disabled" | "defaultValue" | "dir" | "placeholder" | "onChange" | "onSubmit" | "maxLength" | "readOnly" | "onCancel" | "invalid" | "translations" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "finalFocusEl" | "autoResize" | "activationMode" | "submitMode" | "startWithEditView" | "selectOnFocus" | "onEdit"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
17
17
|
defaultValue?: string | undefined;
|
|
18
18
|
} & RefAttributes<HTMLDivElement>>;
|
package/editable/index.cjs
CHANGED
package/editable/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Context } from '@zag-js/editable';
|
|
2
|
+
import { UseEditableReturn } from './use-editable';
|
|
3
|
+
import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode, RefAttributes, ButtonHTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes } from 'react';
|
|
3
4
|
/// <reference types="react" />
|
|
4
5
|
import { type EditableProps } from './editable';
|
|
5
6
|
import { EditableArea, type EditableAreaProps } from './editable-area';
|
|
@@ -17,11 +18,8 @@ declare const Editable: ForwardRefExoticComponent<Omit<Omit<Omit<Omit<DetailedHT
|
|
|
17
18
|
} & {
|
|
18
19
|
asChild?: boolean | undefined;
|
|
19
20
|
}, "ref">, "children"> & {
|
|
20
|
-
children
|
|
21
|
-
|
|
22
|
-
style: CSSProperties;
|
|
23
|
-
}>) => ReactNode);
|
|
24
|
-
}, "name" | "value" | "getRootNode" | "form" | "id" | "ids" | "disabled" | "onChange" | "onSubmit" | "defaultValue" | "dir" | "placeholder" | "onCancel" | "maxLength" | "readOnly" | "invalid" | "translations" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "finalFocusEl" | "autoResize" | "activationMode" | "submitMode" | "startWithEditView" | "selectOnFocus" | "onEdit"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
21
|
+
children?: ReactNode | ((pages: UseEditableReturn) => ReactNode);
|
|
22
|
+
}, "name" | "value" | "getRootNode" | "form" | "id" | "ids" | "disabled" | "defaultValue" | "dir" | "placeholder" | "onChange" | "onSubmit" | "maxLength" | "readOnly" | "onCancel" | "invalid" | "translations" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "finalFocusEl" | "autoResize" | "activationMode" | "submitMode" | "startWithEditView" | "selectOnFocus" | "onEdit"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
25
23
|
defaultValue?: string | undefined;
|
|
26
24
|
} & RefAttributes<HTMLDivElement>> & {
|
|
27
25
|
Root: ForwardRefExoticComponent<Omit<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -29,11 +27,8 @@ declare const Editable: ForwardRefExoticComponent<Omit<Omit<Omit<Omit<DetailedHT
|
|
|
29
27
|
} & {
|
|
30
28
|
asChild?: boolean | undefined;
|
|
31
29
|
}, "ref">, "children"> & {
|
|
32
|
-
children
|
|
33
|
-
|
|
34
|
-
style: CSSProperties;
|
|
35
|
-
}>) => ReactNode);
|
|
36
|
-
}, "name" | "value" | "getRootNode" | "form" | "id" | "ids" | "disabled" | "onChange" | "onSubmit" | "defaultValue" | "dir" | "placeholder" | "onCancel" | "maxLength" | "readOnly" | "invalid" | "translations" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "finalFocusEl" | "autoResize" | "activationMode" | "submitMode" | "startWithEditView" | "selectOnFocus" | "onEdit"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
30
|
+
children?: ReactNode | ((pages: UseEditableReturn) => ReactNode);
|
|
31
|
+
}, "name" | "value" | "getRootNode" | "form" | "id" | "ids" | "disabled" | "defaultValue" | "dir" | "placeholder" | "onChange" | "onSubmit" | "maxLength" | "readOnly" | "onCancel" | "invalid" | "translations" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "finalFocusEl" | "autoResize" | "activationMode" | "submitMode" | "startWithEditView" | "selectOnFocus" | "onEdit"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
37
32
|
defaultValue?: string | undefined;
|
|
38
33
|
} & RefAttributes<HTMLDivElement>>;
|
|
39
34
|
Area: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
package/editable/index.mjs
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { HTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
/// <reference types="react" />
|
|
3
1
|
import * as editable from '@zag-js/editable';
|
|
4
2
|
import { type Optional } from '../types';
|
|
5
3
|
export type UseEditableProps = Optional<editable.Context, 'id'> & {
|
|
6
4
|
defaultValue?: editable.Context['value'];
|
|
7
5
|
};
|
|
8
|
-
export type UseEditableReturn =
|
|
9
|
-
export declare const useEditable: (props: UseEditableProps) =>
|
|
10
|
-
element: HTMLAttributes<HTMLElement>;
|
|
11
|
-
style: CSSProperties;
|
|
12
|
-
}>;
|
|
6
|
+
export type UseEditableReturn = editable.MachineApi;
|
|
7
|
+
export declare const useEditable: (props: UseEditableProps) => UseEditableReturn;
|
package/environment/index.cjs
CHANGED
package/environment/index.mjs
CHANGED
package/factory.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
4
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
4
|
|
|
6
5
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
const
|
|
6
|
+
const core = require('@zag-js/core');
|
|
8
7
|
const react = require('react');
|
|
9
8
|
const composeRefs = require('./compose-refs.cjs');
|
|
10
9
|
|
|
@@ -16,7 +15,7 @@ const withAsChild = (Component) => {
|
|
|
16
15
|
}
|
|
17
16
|
const onlyChild = react.Children.only(children);
|
|
18
17
|
return react.isValidElement(onlyChild) ? react.cloneElement(onlyChild, {
|
|
19
|
-
...
|
|
18
|
+
...core.mergeProps(restProps, onlyChild.props),
|
|
20
19
|
ref: ref ? composeRefs.composeRefs(ref, onlyChild.ref) : onlyChild.ref
|
|
21
20
|
}) : null;
|
|
22
21
|
});
|
package/factory.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { mergeProps } from '@zag-js/
|
|
2
|
+
import { mergeProps } from '@zag-js/core';
|
|
4
3
|
import { forwardRef, Children, isValidElement, cloneElement } from 'react';
|
|
5
4
|
import { composeRefs } from './compose-refs.mjs';
|
|
6
5
|
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Provider, HTMLAttributes, CSSProperties } from 'react';
|
|
1
|
+
import { Provider } from 'react';
|
|
3
2
|
/// <reference types="react" />
|
|
4
3
|
import { type UseHoverCardReturn } from './use-hover-card';
|
|
5
4
|
export type HoverCardContext = UseHoverCardReturn;
|
|
6
|
-
export declare const HoverCardProvider: Provider<
|
|
7
|
-
element: HTMLAttributes<HTMLElement>;
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>>, useHoverCardContext: () => PublicApi<JSX.IntrinsicElements & {
|
|
10
|
-
element: HTMLAttributes<HTMLElement>;
|
|
11
|
-
style: CSSProperties;
|
|
12
|
-
}>;
|
|
5
|
+
export declare const HoverCardProvider: Provider<UseHoverCardReturn>, useHoverCardContext: () => UseHoverCardReturn;
|
package/hover-card/index.cjs
CHANGED
package/hover-card/index.mjs
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { HTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
/// <reference types="react" />
|
|
3
1
|
import * as hoverCard from '@zag-js/hover-card';
|
|
4
2
|
import { type Optional } from '../types';
|
|
5
3
|
export type UseHoverCardProps = Optional<hoverCard.Context, 'id'>;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>;
|
|
10
|
-
export type UseHoverCardReturn = ReturnType<typeof useHoverCard>;
|
|
4
|
+
export type UseHoverCardReturn = hoverCard.Api;
|
|
5
|
+
export declare const useHoverCard: (props: UseHoverCardProps) => UseHoverCardReturn;
|
package/index.cjs
CHANGED
|
@@ -243,7 +243,6 @@ const splitterResizeTrigger = require('./splitter/splitter-resize-trigger.cjs');
|
|
|
243
243
|
const splitter = require('@zag-js/splitter');
|
|
244
244
|
const splitterContext = require('./splitter/splitter-context.cjs');
|
|
245
245
|
const switchControl = require('./switch/switch-control.cjs');
|
|
246
|
-
const switchInput = require('./switch/switch-input.cjs');
|
|
247
246
|
const switchLabel = require('./switch/switch-label.cjs');
|
|
248
247
|
const switchThumb = require('./switch/switch-thumb.cjs');
|
|
249
248
|
const zagSwitch = require('@zag-js/switch');
|
|
@@ -581,7 +580,6 @@ Object.defineProperty(exports, 'splitterAnatomy', {
|
|
|
581
580
|
});
|
|
582
581
|
exports.useSplitterContext = splitterContext.useSplitterContext;
|
|
583
582
|
exports.SwitchControl = switchControl.SwitchControl;
|
|
584
|
-
exports.SwitchInput = switchInput.SwitchInput;
|
|
585
583
|
exports.SwitchLabel = switchLabel.SwitchLabel;
|
|
586
584
|
exports.SwitchThumb = switchThumb.SwitchThumb;
|
|
587
585
|
Object.defineProperty(exports, 'switchAnatomy', {
|
package/index.mjs
CHANGED
|
@@ -239,7 +239,6 @@ export { SplitterResizeTrigger } from './splitter/splitter-resize-trigger.mjs';
|
|
|
239
239
|
export { anatomy as splitterAnatomy } from '@zag-js/splitter';
|
|
240
240
|
export { useSplitterContext } from './splitter/splitter-context.mjs';
|
|
241
241
|
export { SwitchControl } from './switch/switch-control.mjs';
|
|
242
|
-
export { SwitchInput } from './switch/switch-input.mjs';
|
|
243
242
|
export { SwitchLabel } from './switch/switch-label.mjs';
|
|
244
243
|
export { SwitchThumb } from './switch/switch-thumb.mjs';
|
|
245
244
|
export { anatomy as switchAnatomy } from '@zag-js/switch';
|
package/menu/index.cjs
CHANGED
package/menu/index.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ declare const Menu: ((props: MenuProps) => JSX.Element) & {
|
|
|
39
39
|
} & {
|
|
40
40
|
asChild?: boolean | undefined;
|
|
41
41
|
}, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
42
|
-
Item: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<
|
|
43
|
-
ref?: ((instance:
|
|
42
|
+
Item: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
43
|
+
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
44
44
|
} & {
|
|
45
45
|
asChild?: boolean | undefined;
|
|
46
46
|
}, "ref">, keyof ItemProps> & ItemProps & RefAttributes<HTMLDivElement>>;
|
package/menu/index.mjs
CHANGED
package/menu/menu-item.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { ItemProps } from '@zag-js/menu';
|
|
2
|
-
import { ForwardRefExoticComponent, DetailedHTMLProps,
|
|
1
|
+
import type { ItemProps } from '@zag-js/menu';
|
|
2
|
+
import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, RefAttributes, type ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
import { ark } from '../factory';
|
|
4
4
|
import { type Assign } from '../types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const MenuItem: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
9
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | RefObject<HTMLButtonElement> | null | undefined;
|
|
5
|
+
export type MenuItemProps = Assign<ComponentPropsWithoutRef<typeof ark.div>, ItemProps>;
|
|
6
|
+
export declare const MenuItem: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
|
+
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
10
8
|
} & {
|
|
11
9
|
asChild?: boolean | undefined;
|
|
12
10
|
}, "ref">, keyof ItemProps> & ItemProps & RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export {};
|
package/menu/use-menu.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { type Optional } from '../types';
|
|
|
3
3
|
export type UseMenuProps = Optional<menu.Context, 'id'>;
|
|
4
4
|
export type UseMenuReturn = {
|
|
5
5
|
machine: ReturnType<typeof menu.machine>;
|
|
6
|
-
api:
|
|
6
|
+
api: menu.Api;
|
|
7
7
|
};
|
|
8
8
|
export declare const useMenu: (props: UseMenuProps) => UseMenuReturn;
|
package/number-input/index.cjs
CHANGED
package/number-input/index.d.ts
CHANGED
|
@@ -14,14 +14,14 @@ declare const NumberInput: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTML
|
|
|
14
14
|
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
15
15
|
} & {
|
|
16
16
|
asChild?: boolean | undefined;
|
|
17
|
-
}, "ref">, "name" | "value" | "getRootNode" | "form" | "pattern" | "id" | "ids" | "disabled" | "
|
|
17
|
+
}, "ref">, "name" | "value" | "getRootNode" | "form" | "pattern" | "id" | "ids" | "disabled" | "defaultValue" | "dir" | "inputMode" | "onFocus" | "onBlur" | "onChange" | "onInvalid" | "max" | "min" | "readOnly" | "step" | "format" | "invalid" | "translations" | "parse" | "allowMouseWheel" | "allowOverflow" | "validateCharacter" | "clampValueOnBlur" | "focusInputOnChange" | "minFractionDigits" | "maxFractionDigits" | "spinOnPress"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
18
18
|
defaultValue?: string | undefined;
|
|
19
19
|
} & RefAttributes<HTMLDivElement>> & {
|
|
20
20
|
Root: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
21
|
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
22
22
|
} & {
|
|
23
23
|
asChild?: boolean | undefined;
|
|
24
|
-
}, "ref">, "name" | "value" | "getRootNode" | "form" | "pattern" | "id" | "ids" | "disabled" | "
|
|
24
|
+
}, "ref">, "name" | "value" | "getRootNode" | "form" | "pattern" | "id" | "ids" | "disabled" | "defaultValue" | "dir" | "inputMode" | "onFocus" | "onBlur" | "onChange" | "onInvalid" | "max" | "min" | "readOnly" | "step" | "format" | "invalid" | "translations" | "parse" | "allowMouseWheel" | "allowOverflow" | "validateCharacter" | "clampValueOnBlur" | "focusInputOnChange" | "minFractionDigits" | "maxFractionDigits" | "spinOnPress"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
25
25
|
defaultValue?: string | undefined;
|
|
26
26
|
} & RefAttributes<HTMLDivElement>>;
|
|
27
27
|
Control: ForwardRefExoticComponent<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
package/number-input/index.mjs
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Provider, HTMLAttributes, CSSProperties } from 'react';
|
|
1
|
+
import { Provider } from 'react';
|
|
3
2
|
/// <reference types="react" />
|
|
4
3
|
import { type UseNumberInputReturn } from './use-number-input';
|
|
5
4
|
export type NumberInputContext = UseNumberInputReturn;
|
|
6
|
-
export declare const NumberInputProvider: Provider<
|
|
7
|
-
element: HTMLAttributes<HTMLElement>;
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>>, useNumberInputContext: () => PublicApi<JSX.IntrinsicElements & {
|
|
10
|
-
element: HTMLAttributes<HTMLElement>;
|
|
11
|
-
style: CSSProperties;
|
|
12
|
-
}>;
|
|
5
|
+
export declare const NumberInputProvider: Provider<UseNumberInputReturn>, useNumberInputContext: () => UseNumberInputReturn;
|
|
@@ -8,6 +8,6 @@ export declare const NumberInput: ForwardRefExoticComponent<Omit<Omit<Omit<Detai
|
|
|
8
8
|
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
|
9
9
|
} & {
|
|
10
10
|
asChild?: boolean | undefined;
|
|
11
|
-
}, "ref">, "name" | "value" | "getRootNode" | "form" | "pattern" | "id" | "ids" | "disabled" | "
|
|
11
|
+
}, "ref">, "name" | "value" | "getRootNode" | "form" | "pattern" | "id" | "ids" | "disabled" | "defaultValue" | "dir" | "inputMode" | "onFocus" | "onBlur" | "onChange" | "onInvalid" | "max" | "min" | "readOnly" | "step" | "format" | "invalid" | "translations" | "parse" | "allowMouseWheel" | "allowOverflow" | "validateCharacter" | "clampValueOnBlur" | "focusInputOnChange" | "minFractionDigits" | "maxFractionDigits" | "spinOnPress"> & Pick<Partial<Context>, "id"> & Omit<Context, "id"> & {
|
|
12
12
|
defaultValue?: string | undefined;
|
|
13
13
|
} & RefAttributes<HTMLDivElement>>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { HTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
/// <reference types="react" />
|
|
3
1
|
import * as numberInput from '@zag-js/number-input';
|
|
4
2
|
import { type Optional } from '../types';
|
|
5
3
|
export type UseNumberInputProps = Optional<numberInput.Context, 'id'> & {
|
|
6
4
|
defaultValue?: numberInput.Context['value'];
|
|
7
5
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
style: CSSProperties;
|
|
11
|
-
}>;
|
|
12
|
-
export type UseNumberInputReturn = ReturnType<typeof useNumberInput>;
|
|
6
|
+
export type UseNumberInputReturn = numberInput.Api;
|
|
7
|
+
export declare const useNumberInput: (props: UseNumberInputProps) => UseNumberInputReturn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accordion",
|
|
@@ -60,74 +60,75 @@
|
|
|
60
60
|
"release-it": "release-it --config ../../release-it.json"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@zag-js/accordion": "0.
|
|
64
|
-
"@zag-js/anatomy": "0.
|
|
65
|
-
"@zag-js/avatar": "0.
|
|
66
|
-
"@zag-js/carousel": "0.
|
|
67
|
-
"@zag-js/checkbox": "0.
|
|
68
|
-
"@zag-js/color-picker": "0.
|
|
69
|
-
"@zag-js/color-utils": "0.
|
|
70
|
-
"@zag-js/combobox": "0.
|
|
71
|
-
"@zag-js/
|
|
72
|
-
"@zag-js/date-
|
|
73
|
-
"@zag-js/
|
|
74
|
-
"@zag-js/
|
|
75
|
-
"@zag-js/
|
|
76
|
-
"@zag-js/
|
|
77
|
-
"@zag-js/
|
|
78
|
-
"@zag-js/
|
|
79
|
-
"@zag-js/
|
|
80
|
-
"@zag-js/
|
|
81
|
-
"@zag-js/
|
|
82
|
-
"@zag-js/
|
|
83
|
-
"@zag-js/
|
|
84
|
-
"@zag-js/
|
|
85
|
-
"@zag-js/
|
|
86
|
-
"@zag-js/
|
|
87
|
-
"@zag-js/
|
|
88
|
-
"@zag-js/
|
|
89
|
-
"@zag-js/
|
|
90
|
-
"@zag-js/
|
|
91
|
-
"@zag-js/
|
|
92
|
-
"@zag-js/
|
|
93
|
-
"@zag-js/
|
|
94
|
-
"@zag-js/
|
|
95
|
-
"@zag-js/
|
|
63
|
+
"@zag-js/accordion": "0.17.0",
|
|
64
|
+
"@zag-js/anatomy": "0.17.0",
|
|
65
|
+
"@zag-js/avatar": "0.17.0",
|
|
66
|
+
"@zag-js/carousel": "0.17.0",
|
|
67
|
+
"@zag-js/checkbox": "0.17.0",
|
|
68
|
+
"@zag-js/color-picker": "0.17.0",
|
|
69
|
+
"@zag-js/color-utils": "0.17.0",
|
|
70
|
+
"@zag-js/combobox": "0.17.0",
|
|
71
|
+
"@zag-js/core": "0.17.0",
|
|
72
|
+
"@zag-js/date-picker": "0.17.0",
|
|
73
|
+
"@zag-js/date-utils": "0.17.0",
|
|
74
|
+
"@zag-js/dialog": "0.17.0",
|
|
75
|
+
"@zag-js/editable": "0.17.0",
|
|
76
|
+
"@zag-js/hover-card": "0.17.0",
|
|
77
|
+
"@zag-js/menu": "0.17.0",
|
|
78
|
+
"@zag-js/number-input": "0.17.0",
|
|
79
|
+
"@zag-js/pagination": "0.17.0",
|
|
80
|
+
"@zag-js/pin-input": "0.17.0",
|
|
81
|
+
"@zag-js/popover": "0.17.0",
|
|
82
|
+
"@zag-js/presence": "0.17.0",
|
|
83
|
+
"@zag-js/pressable": "0.17.0",
|
|
84
|
+
"@zag-js/radio-group": "0.17.0",
|
|
85
|
+
"@zag-js/range-slider": "0.17.0",
|
|
86
|
+
"@zag-js/rating-group": "0.17.0",
|
|
87
|
+
"@zag-js/react": "0.17.0",
|
|
88
|
+
"@zag-js/select": "0.17.0",
|
|
89
|
+
"@zag-js/slider": "0.17.0",
|
|
90
|
+
"@zag-js/splitter": "0.17.0",
|
|
91
|
+
"@zag-js/switch": "0.17.0",
|
|
92
|
+
"@zag-js/tabs": "0.17.0",
|
|
93
|
+
"@zag-js/tags-input": "0.17.0",
|
|
94
|
+
"@zag-js/toast": "0.17.0",
|
|
95
|
+
"@zag-js/tooltip": "0.17.0",
|
|
96
|
+
"@zag-js/types": "0.17.0"
|
|
96
97
|
},
|
|
97
98
|
"devDependencies": {
|
|
98
99
|
"@release-it/keep-a-changelog": "4.0.0",
|
|
99
|
-
"@storybook/addon-a11y": "7.
|
|
100
|
-
"@storybook/addon-essentials": "7.
|
|
101
|
-
"@storybook/addons": "7.
|
|
102
|
-
"@storybook/react": "7.
|
|
103
|
-
"@storybook/react-vite": "7.
|
|
100
|
+
"@storybook/addon-a11y": "7.3.2",
|
|
101
|
+
"@storybook/addon-essentials": "7.3.2",
|
|
102
|
+
"@storybook/addons": "7.3.2",
|
|
103
|
+
"@storybook/react": "7.3.2",
|
|
104
|
+
"@storybook/react-vite": "7.3.2",
|
|
104
105
|
"@testing-library/dom": "9.3.1",
|
|
105
106
|
"@testing-library/jest-dom": "5.17.0",
|
|
106
107
|
"@testing-library/react": "14.0.0",
|
|
107
108
|
"@testing-library/user-event": "14.4.3",
|
|
108
|
-
"@types/jsdom": "21.1.
|
|
109
|
+
"@types/jsdom": "21.1.2",
|
|
109
110
|
"@types/react": "18.2.17",
|
|
110
111
|
"@types/react-dom": "18.2.7",
|
|
111
112
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
112
113
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
113
114
|
"@typescript-eslint/parser": "5.62.0",
|
|
114
115
|
"@vitejs/plugin-react": "4.0.3",
|
|
115
|
-
"@vitest/coverage-v8": "0.34.
|
|
116
|
-
"eslint": "8.
|
|
117
|
-
"eslint-plugin-react": "7.33.
|
|
116
|
+
"@vitest/coverage-v8": "0.34.2",
|
|
117
|
+
"eslint": "8.48.0",
|
|
118
|
+
"eslint-plugin-react": "7.33.2",
|
|
118
119
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
119
120
|
"globby": "13.2.2",
|
|
120
121
|
"jsdom": "22.1.0",
|
|
121
122
|
"react": "18.2.0",
|
|
122
123
|
"react-dom": "18.2.0",
|
|
123
124
|
"react-frame-component": "5.2.6",
|
|
124
|
-
"release-it": "16.1.
|
|
125
|
+
"release-it": "16.1.5",
|
|
125
126
|
"resize-observer-polyfill": "1.5.1",
|
|
126
|
-
"storybook": "7.
|
|
127
|
-
"typescript": "5.
|
|
127
|
+
"storybook": "7.3.2",
|
|
128
|
+
"typescript": "5.2.2",
|
|
128
129
|
"vite": "4.4.9",
|
|
129
|
-
"vite-plugin-dts": "3.5.
|
|
130
|
-
"vitest": "0.34.
|
|
130
|
+
"vite-plugin-dts": "3.5.3",
|
|
131
|
+
"vitest": "0.34.2"
|
|
131
132
|
},
|
|
132
133
|
"peerDependencies": {
|
|
133
134
|
"react": ">=18.0.0",
|
package/pagination/index.cjs
CHANGED
package/pagination/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { UsePaginationProps } from './use-pagination';
|
|
1
|
+
import { EllipsisProps, PageTriggerProps } from '@zag-js/pagination';
|
|
2
|
+
import { UsePaginationProps, UsePaginationReturn } from './use-pagination';
|
|
3
3
|
import { Assign } from '../types';
|
|
4
|
-
import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode,
|
|
4
|
+
import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefObject, ReactNode, RefAttributes, LiHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
5
5
|
/// <reference types="react" />
|
|
6
6
|
import { type PaginationProps } from './pagination';
|
|
7
7
|
import { usePaginationContext } from './pagination-context';
|
|
@@ -17,20 +17,14 @@ declare const Pagination: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<Detail
|
|
|
17
17
|
} & {
|
|
18
18
|
asChild?: boolean | undefined;
|
|
19
19
|
}, "ref">, UsePaginationProps>, "children"> & {
|
|
20
|
-
children
|
|
21
|
-
element: HTMLAttributes<HTMLElement>;
|
|
22
|
-
style: CSSProperties;
|
|
23
|
-
}>) => ReactNode);
|
|
20
|
+
children?: ReactNode | ((pages: UsePaginationReturn) => ReactNode);
|
|
24
21
|
} & RefAttributes<HTMLElement>> & {
|
|
25
22
|
Root: ForwardRefExoticComponent<Omit<Assign<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
26
23
|
ref?: ((instance: HTMLElement | null) => void) | RefObject<HTMLElement> | null | undefined;
|
|
27
24
|
} & {
|
|
28
25
|
asChild?: boolean | undefined;
|
|
29
26
|
}, "ref">, UsePaginationProps>, "children"> & {
|
|
30
|
-
children
|
|
31
|
-
element: HTMLAttributes<HTMLElement>;
|
|
32
|
-
style: CSSProperties;
|
|
33
|
-
}>) => ReactNode);
|
|
27
|
+
children?: ReactNode | ((pages: UsePaginationReturn) => ReactNode);
|
|
34
28
|
} & RefAttributes<HTMLElement>>;
|
|
35
29
|
Ellipsis: ForwardRefExoticComponent<Omit<Omit<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
36
30
|
ref?: ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined;
|
package/pagination/index.mjs
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Provider, HTMLAttributes, CSSProperties } from 'react';
|
|
1
|
+
import { Provider } from 'react';
|
|
3
2
|
/// <reference types="react" />
|
|
4
3
|
import { type UsePaginationReturn } from './use-pagination';
|
|
5
4
|
export type PaginationContext = UsePaginationReturn;
|
|
6
|
-
export declare const PaginationProvider: Provider<
|
|
7
|
-
element: HTMLAttributes<HTMLElement>;
|
|
8
|
-
style: CSSProperties;
|
|
9
|
-
}>>, usePaginationContext: () => PublicApi<JSX.IntrinsicElements & {
|
|
10
|
-
element: HTMLAttributes<HTMLElement>;
|
|
11
|
-
style: CSSProperties;
|
|
12
|
-
}>;
|
|
5
|
+
export declare const PaginationProvider: Provider<UsePaginationReturn>, usePaginationContext: () => UsePaginationReturn;
|