@ark-ui/react 3.2.1 → 3.3.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/README.md +21 -17
- package/dist/components/checkbox/checkbox-group.cjs +27 -0
- package/dist/components/checkbox/checkbox-group.d.cts +8 -0
- package/dist/components/checkbox/checkbox-group.d.ts +8 -0
- package/dist/components/checkbox/checkbox-group.js +23 -0
- package/dist/components/checkbox/checkbox.cjs +2 -0
- package/dist/components/checkbox/checkbox.d.cts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +1 -0
- package/dist/components/checkbox/checkbox.js +1 -0
- package/dist/components/checkbox/index.cjs +6 -0
- package/dist/components/checkbox/index.d.cts +3 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.js +3 -0
- package/dist/components/checkbox/use-checkbox-group-context.cjs +16 -0
- package/dist/components/checkbox/use-checkbox-group-context.d.cts +6 -0
- package/dist/components/checkbox/use-checkbox-group-context.d.ts +6 -0
- package/dist/components/checkbox/use-checkbox-group-context.js +11 -0
- package/dist/components/checkbox/use-checkbox-group.cjs +60 -0
- package/dist/components/checkbox/use-checkbox-group.d.cts +41 -0
- package/dist/components/checkbox/use-checkbox-group.d.ts +41 -0
- package/dist/components/checkbox/use-checkbox-group.js +56 -0
- package/dist/components/checkbox/use-checkbox.cjs +6 -1
- package/dist/components/checkbox/use-checkbox.d.cts +1 -1
- package/dist/components/checkbox/use-checkbox.d.ts +1 -1
- package/dist/components/checkbox/use-checkbox.js +8 -3
- package/dist/components/hover-card/use-hover-card.cjs +1 -1
- package/dist/components/hover-card/use-hover-card.js +1 -1
- package/dist/components/index.cjs +48 -0
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +26 -0
- package/dist/components/menu/use-menu-item-group-context.d.cts +0 -1
- package/dist/components/menu/use-menu-item-group-context.d.ts +0 -1
- package/dist/components/popover/use-popover.cjs +1 -1
- package/dist/components/popover/use-popover.js +1 -1
- package/dist/components/presence/split-presence-props.cjs +1 -0
- package/dist/components/presence/split-presence-props.d.cts +1 -1
- package/dist/components/presence/split-presence-props.d.ts +1 -1
- package/dist/components/presence/split-presence-props.js +1 -0
- package/dist/components/qr-code/index.cjs +25 -0
- package/dist/components/qr-code/index.d.cts +10 -0
- package/dist/components/qr-code/index.d.ts +10 -0
- package/dist/components/qr-code/index.js +10 -0
- package/dist/components/qr-code/qr-code-context.cjs +10 -0
- package/dist/components/qr-code/qr-code-context.d.cts +7 -0
- package/dist/components/qr-code/qr-code-context.d.ts +7 -0
- package/dist/components/qr-code/qr-code-context.js +6 -0
- package/dist/components/qr-code/qr-code-frame.cjs +19 -0
- package/dist/components/qr-code/qr-code-frame.d.cts +6 -0
- package/dist/components/qr-code/qr-code-frame.d.ts +6 -0
- package/dist/components/qr-code/qr-code-frame.js +15 -0
- package/dist/components/qr-code/qr-code-overlay.cjs +19 -0
- package/dist/components/qr-code/qr-code-overlay.d.cts +6 -0
- package/dist/components/qr-code/qr-code-overlay.d.ts +6 -0
- package/dist/components/qr-code/qr-code-overlay.js +15 -0
- package/dist/components/qr-code/qr-code-pattern.cjs +19 -0
- package/dist/components/qr-code/qr-code-pattern.d.cts +6 -0
- package/dist/components/qr-code/qr-code-pattern.d.ts +6 -0
- package/dist/components/qr-code/qr-code-pattern.js +15 -0
- package/dist/components/qr-code/qr-code-root-provider.cjs +22 -0
- package/dist/components/qr-code/qr-code-root-provider.d.cts +11 -0
- package/dist/components/qr-code/qr-code-root-provider.d.ts +11 -0
- package/dist/components/qr-code/qr-code-root-provider.js +18 -0
- package/dist/components/qr-code/qr-code-root.cjs +27 -0
- package/dist/components/qr-code/qr-code-root.d.cts +8 -0
- package/dist/components/qr-code/qr-code-root.d.ts +8 -0
- package/dist/components/qr-code/qr-code-root.js +23 -0
- package/dist/components/qr-code/qr-code.cjs +19 -0
- package/dist/components/qr-code/qr-code.d.cts +7 -0
- package/dist/components/qr-code/qr-code.d.ts +7 -0
- package/dist/components/qr-code/qr-code.js +6 -0
- package/dist/components/qr-code/use-qr-code-context.cjs +15 -0
- package/dist/components/qr-code/use-qr-code-context.d.cts +6 -0
- package/dist/components/qr-code/use-qr-code-context.d.ts +6 -0
- package/dist/components/qr-code/use-qr-code-context.js +10 -0
- package/dist/components/qr-code/use-qr-code.cjs +44 -0
- package/dist/components/qr-code/use-qr-code.d.cts +8 -0
- package/dist/components/qr-code/use-qr-code.d.ts +8 -0
- package/dist/components/qr-code/use-qr-code.js +21 -0
- package/dist/components/select/index.cjs +2 -0
- package/dist/components/select/index.d.cts +1 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/select-list.cjs +19 -0
- package/dist/components/select/select-list.d.cts +6 -0
- package/dist/components/select/select-list.d.ts +6 -0
- package/dist/components/select/select-list.js +15 -0
- package/dist/components/select/select.cjs +2 -0
- package/dist/components/select/select.d.cts +1 -0
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +1 -0
- package/dist/components/signature-pad/index.cjs +29 -0
- package/dist/components/signature-pad/index.d.cts +12 -0
- package/dist/components/signature-pad/index.d.ts +12 -0
- package/dist/components/signature-pad/index.js +12 -0
- package/dist/components/signature-pad/signature-pad-clear-trigger.cjs +19 -0
- package/dist/components/signature-pad/signature-pad-clear-trigger.d.cts +6 -0
- package/dist/components/signature-pad/signature-pad-clear-trigger.d.ts +6 -0
- package/dist/components/signature-pad/signature-pad-clear-trigger.js +15 -0
- package/dist/components/signature-pad/signature-pad-context.cjs +10 -0
- package/dist/components/signature-pad/signature-pad-context.d.cts +7 -0
- package/dist/components/signature-pad/signature-pad-context.d.ts +7 -0
- package/dist/components/signature-pad/signature-pad-context.js +6 -0
- package/dist/components/signature-pad/signature-pad-control.cjs +21 -0
- package/dist/components/signature-pad/signature-pad-control.d.cts +6 -0
- package/dist/components/signature-pad/signature-pad-control.d.ts +6 -0
- package/dist/components/signature-pad/signature-pad-control.js +17 -0
- package/dist/components/signature-pad/signature-pad-guide.cjs +21 -0
- package/dist/components/signature-pad/signature-pad-guide.d.cts +6 -0
- package/dist/components/signature-pad/signature-pad-guide.d.ts +6 -0
- package/dist/components/signature-pad/signature-pad-guide.js +17 -0
- package/dist/components/signature-pad/signature-pad-label.cjs +21 -0
- package/dist/components/signature-pad/signature-pad-label.d.cts +6 -0
- package/dist/components/signature-pad/signature-pad-label.d.ts +6 -0
- package/dist/components/signature-pad/signature-pad-label.js +17 -0
- package/dist/components/signature-pad/signature-pad-root-provider.cjs +24 -0
- package/dist/components/signature-pad/signature-pad-root-provider.d.cts +11 -0
- package/dist/components/signature-pad/signature-pad-root-provider.d.ts +11 -0
- package/dist/components/signature-pad/signature-pad-root-provider.js +20 -0
- package/dist/components/signature-pad/signature-pad-root.cjs +31 -0
- package/dist/components/signature-pad/signature-pad-root.d.cts +8 -0
- package/dist/components/signature-pad/signature-pad-root.d.ts +8 -0
- package/dist/components/signature-pad/signature-pad-root.js +27 -0
- package/dist/components/signature-pad/signature-pad-segment.cjs +25 -0
- package/dist/components/signature-pad/signature-pad-segment.d.cts +6 -0
- package/dist/components/signature-pad/signature-pad-segment.d.ts +6 -0
- package/dist/components/signature-pad/signature-pad-segment.js +21 -0
- package/dist/components/signature-pad/signature-pad.cjs +23 -0
- package/dist/components/signature-pad/signature-pad.d.cts +9 -0
- package/dist/components/signature-pad/signature-pad.d.ts +9 -0
- package/dist/components/signature-pad/signature-pad.js +8 -0
- package/dist/components/signature-pad/use-signature-pad-context.cjs +17 -0
- package/dist/components/signature-pad/use-signature-pad-context.d.cts +6 -0
- package/dist/components/signature-pad/use-signature-pad-context.d.ts +6 -0
- package/dist/components/signature-pad/use-signature-pad-context.js +12 -0
- package/dist/components/signature-pad/use-signature-pad.cjs +51 -0
- package/dist/components/signature-pad/use-signature-pad.d.cts +9 -0
- package/dist/components/signature-pad/use-signature-pad.d.ts +9 -0
- package/dist/components/signature-pad/use-signature-pad.js +28 -0
- package/dist/components/tabs/tab-content.cjs +2 -1
- package/dist/components/tabs/tab-content.js +2 -1
- package/dist/components/tree-view/use-tree-view-depth-context.d.cts +0 -1
- package/dist/components/tree-view/use-tree-view-depth-context.d.ts +0 -1
- package/dist/components/tree-view/use-tree-view.cjs +2 -0
- package/dist/components/tree-view/use-tree-view.js +2 -0
- package/dist/index.cjs +48 -0
- package/dist/index.js +26 -0
- package/dist/providers/environment/use-environment-context.d.cts +0 -1
- package/dist/providers/environment/use-environment-context.d.ts +0 -1
- package/dist/utils/compose-refs.d.cts +0 -1
- package/dist/utils/compose-refs.d.ts +0 -1
- package/dist/utils/create-context.d.cts +0 -1
- package/dist/utils/create-context.d.ts +0 -1
- package/dist/utils/render-strategy.d.cts +0 -1
- package/dist/utils/render-strategy.d.ts +0 -1
- package/dist/utils/use-controllable-state.cjs +26 -0
- package/dist/utils/use-controllable-state.d.cts +1 -1
- package/dist/utils/use-controllable-state.d.ts +1 -1
- package/dist/utils/use-controllable-state.js +22 -0
- package/package.json +74 -49
|
@@ -0,0 +1,17 @@
|
|
|
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.js';
|
|
6
|
+
import { useSignaturePadContext } from './use-signature-pad-context.js';
|
|
7
|
+
|
|
8
|
+
const SignaturePadGuide = forwardRef(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const signaturePad = useSignaturePadContext();
|
|
11
|
+
const mergedProps = mergeProps(signaturePad.getGuideProps(), props);
|
|
12
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
SignaturePadGuide.displayName = "SignaturePadGuide";
|
|
16
|
+
|
|
17
|
+
export { SignaturePadGuide };
|
|
@@ -0,0 +1,21 @@
|
|
|
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$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const useSignaturePadContext = require('./use-signature-pad-context.cjs');
|
|
11
|
+
|
|
12
|
+
const SignaturePadLabel = react.forwardRef(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
const signaturePad = useSignaturePadContext.useSignaturePadContext();
|
|
15
|
+
const mergedProps = react$1.mergeProps(signaturePad.getLabelProps(), props);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.label, { ...mergedProps, ref });
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
SignaturePadLabel.displayName = "SignaturePadLabel";
|
|
20
|
+
|
|
21
|
+
exports.SignaturePadLabel = SignaturePadLabel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLArkProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface SignaturePadLabelProps extends HTMLArkProps<'label'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const SignaturePadLabel: ForwardRefExoticComponent<SignaturePadLabelProps & RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLArkProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface SignaturePadLabelProps extends HTMLArkProps<'label'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const SignaturePadLabel: ForwardRefExoticComponent<SignaturePadLabelProps & RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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.js';
|
|
6
|
+
import { useSignaturePadContext } from './use-signature-pad-context.js';
|
|
7
|
+
|
|
8
|
+
const SignaturePadLabel = forwardRef(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const signaturePad = useSignaturePadContext();
|
|
11
|
+
const mergedProps = mergeProps(signaturePad.getLabelProps(), props);
|
|
12
|
+
return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
SignaturePadLabel.displayName = "SignaturePadLabel";
|
|
16
|
+
|
|
17
|
+
export { SignaturePadLabel };
|
|
@@ -0,0 +1,24 @@
|
|
|
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$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
10
|
+
const factory = require('../factory.cjs');
|
|
11
|
+
const useSignaturePadContext = require('./use-signature-pad-context.cjs');
|
|
12
|
+
|
|
13
|
+
const SignaturePadRootProvider = react.forwardRef(
|
|
14
|
+
(props, ref) => {
|
|
15
|
+
const [{ value: signaturePad }, localProps] = createSplitProps.createSplitProps()(props, [
|
|
16
|
+
"value"
|
|
17
|
+
]);
|
|
18
|
+
const mergedProps = react$1.mergeProps(signaturePad.getRootProps(), localProps);
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useSignaturePadContext.SignaturePadProvider, { value: signaturePad, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
SignaturePadRootProvider.displayName = "SignaturePadRootProvider";
|
|
23
|
+
|
|
24
|
+
exports.SignaturePadRootProvider = SignaturePadRootProvider;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLArkProps } from '../factory';
|
|
2
|
+
import { UseSignaturePadReturn } from './use-signature-pad';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
|
|
5
|
+
interface RootProviderProps {
|
|
6
|
+
value: UseSignaturePadReturn;
|
|
7
|
+
}
|
|
8
|
+
export interface SignaturePadRootProviderProps extends HTMLArkProps<'div'>, RootProviderProps {
|
|
9
|
+
}
|
|
10
|
+
export declare const SignaturePadRootProvider: ForwardRefExoticComponent<SignaturePadRootProviderProps & RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLArkProps } from '../factory';
|
|
2
|
+
import { UseSignaturePadReturn } from './use-signature-pad';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
|
|
5
|
+
interface RootProviderProps {
|
|
6
|
+
value: UseSignaturePadReturn;
|
|
7
|
+
}
|
|
8
|
+
export interface SignaturePadRootProviderProps extends HTMLArkProps<'div'>, RootProviderProps {
|
|
9
|
+
}
|
|
10
|
+
export declare const SignaturePadRootProvider: ForwardRefExoticComponent<SignaturePadRootProviderProps & RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
6
|
+
import { ark } from '../factory.js';
|
|
7
|
+
import { SignaturePadProvider } from './use-signature-pad-context.js';
|
|
8
|
+
|
|
9
|
+
const SignaturePadRootProvider = forwardRef(
|
|
10
|
+
(props, ref) => {
|
|
11
|
+
const [{ value: signaturePad }, localProps] = createSplitProps()(props, [
|
|
12
|
+
"value"
|
|
13
|
+
]);
|
|
14
|
+
const mergedProps = mergeProps(signaturePad.getRootProps(), localProps);
|
|
15
|
+
return /* @__PURE__ */ jsx(SignaturePadProvider, { value: signaturePad, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
SignaturePadRootProvider.displayName = "SignaturePadRootProvider";
|
|
19
|
+
|
|
20
|
+
export { SignaturePadRootProvider };
|
|
@@ -0,0 +1,31 @@
|
|
|
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$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
10
|
+
const factory = require('../factory.cjs');
|
|
11
|
+
const useSignaturePad = require('./use-signature-pad.cjs');
|
|
12
|
+
const useSignaturePadContext = require('./use-signature-pad-context.cjs');
|
|
13
|
+
|
|
14
|
+
const SignaturePadRoot = react.forwardRef((props, ref) => {
|
|
15
|
+
const [useSignaturePadProps, localProps] = createSplitProps.createSplitProps()(props, [
|
|
16
|
+
"id",
|
|
17
|
+
"ids",
|
|
18
|
+
"drawing",
|
|
19
|
+
"disabled",
|
|
20
|
+
"readOnly",
|
|
21
|
+
"name",
|
|
22
|
+
"onDraw",
|
|
23
|
+
"onDrawEnd"
|
|
24
|
+
]);
|
|
25
|
+
const signaturePad = useSignaturePad.useSignaturePad(useSignaturePadProps);
|
|
26
|
+
const mergedProps = react$1.mergeProps(signaturePad.getRootProps(), localProps);
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useSignaturePadContext.SignaturePadProvider, { value: signaturePad, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
|
|
28
|
+
});
|
|
29
|
+
SignaturePadRoot.displayName = "SignaturePadRoot";
|
|
30
|
+
|
|
31
|
+
exports.SignaturePadRoot = SignaturePadRoot;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Assign } from '../../types';
|
|
2
|
+
import { HTMLArkProps } from '../factory';
|
|
3
|
+
import { UseSignaturePadProps } from './use-signature-pad';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
|
|
6
|
+
export interface SignaturePadRootProps extends Assign<HTMLArkProps<'div'>, UseSignaturePadProps> {
|
|
7
|
+
}
|
|
8
|
+
export declare const SignaturePadRoot: ForwardRefExoticComponent<SignaturePadRootProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Assign } from '../../types';
|
|
2
|
+
import { HTMLArkProps } from '../factory';
|
|
3
|
+
import { UseSignaturePadProps } from './use-signature-pad';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
|
|
6
|
+
export interface SignaturePadRootProps extends Assign<HTMLArkProps<'div'>, UseSignaturePadProps> {
|
|
7
|
+
}
|
|
8
|
+
export declare const SignaturePadRoot: ForwardRefExoticComponent<SignaturePadRootProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
6
|
+
import { ark } from '../factory.js';
|
|
7
|
+
import { useSignaturePad } from './use-signature-pad.js';
|
|
8
|
+
import { SignaturePadProvider } from './use-signature-pad-context.js';
|
|
9
|
+
|
|
10
|
+
const SignaturePadRoot = forwardRef((props, ref) => {
|
|
11
|
+
const [useSignaturePadProps, localProps] = createSplitProps()(props, [
|
|
12
|
+
"id",
|
|
13
|
+
"ids",
|
|
14
|
+
"drawing",
|
|
15
|
+
"disabled",
|
|
16
|
+
"readOnly",
|
|
17
|
+
"name",
|
|
18
|
+
"onDraw",
|
|
19
|
+
"onDrawEnd"
|
|
20
|
+
]);
|
|
21
|
+
const signaturePad = useSignaturePad(useSignaturePadProps);
|
|
22
|
+
const mergedProps = mergeProps(signaturePad.getRootProps(), localProps);
|
|
23
|
+
return /* @__PURE__ */ jsx(SignaturePadProvider, { value: signaturePad, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
|
|
24
|
+
});
|
|
25
|
+
SignaturePadRoot.displayName = "SignaturePadRoot";
|
|
26
|
+
|
|
27
|
+
export { SignaturePadRoot };
|
|
@@ -0,0 +1,25 @@
|
|
|
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$1 = require('@zag-js/react');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const useSignaturePadContext = require('./use-signature-pad-context.cjs');
|
|
11
|
+
|
|
12
|
+
const SignaturePadSegment = react.forwardRef(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
const signaturePad = useSignaturePadContext.useSignaturePadContext();
|
|
15
|
+
const mergedProps = react$1.mergeProps(signaturePad.getSegmentProps(), props);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(factory.ark.svg, { ...mergedProps, ref, children: [
|
|
17
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Signature" }),
|
|
18
|
+
signaturePad.paths.map((path, i) => /* @__PURE__ */ jsxRuntime.jsx("path", { ...signaturePad.getSegmentPathProps({ path }) }, i)),
|
|
19
|
+
signaturePad.currentPath && /* @__PURE__ */ jsxRuntime.jsx("path", { ...signaturePad.getSegmentPathProps({ path: signaturePad.currentPath }) })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
SignaturePadSegment.displayName = "SignaturePadSegment";
|
|
24
|
+
|
|
25
|
+
exports.SignaturePadSegment = SignaturePadSegment;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLArkProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface SignaturePadSegmentProps extends HTMLArkProps<'svg'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const SignaturePadSegment: ForwardRefExoticComponent<SignaturePadSegmentProps & RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLArkProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface SignaturePadSegmentProps extends HTMLArkProps<'svg'> {
|
|
5
|
+
}
|
|
6
|
+
export declare const SignaturePadSegment: ForwardRefExoticComponent<SignaturePadSegmentProps & RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { useSignaturePadContext } from './use-signature-pad-context.js';
|
|
7
|
+
|
|
8
|
+
const SignaturePadSegment = forwardRef(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const signaturePad = useSignaturePadContext();
|
|
11
|
+
const mergedProps = mergeProps(signaturePad.getSegmentProps(), props);
|
|
12
|
+
return /* @__PURE__ */ jsxs(ark.svg, { ...mergedProps, ref, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("title", { children: "Signature" }),
|
|
14
|
+
signaturePad.paths.map((path, i) => /* @__PURE__ */ jsx("path", { ...signaturePad.getSegmentPathProps({ path }) }, i)),
|
|
15
|
+
signaturePad.currentPath && /* @__PURE__ */ jsx("path", { ...signaturePad.getSegmentPathProps({ path: signaturePad.currentPath }) })
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
SignaturePadSegment.displayName = "SignaturePadSegment";
|
|
20
|
+
|
|
21
|
+
export { SignaturePadSegment };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const signaturePadClearTrigger = require('./signature-pad-clear-trigger.cjs');
|
|
6
|
+
const signaturePadContext = require('./signature-pad-context.cjs');
|
|
7
|
+
const signaturePadControl = require('./signature-pad-control.cjs');
|
|
8
|
+
const signaturePadGuide = require('./signature-pad-guide.cjs');
|
|
9
|
+
const signaturePadLabel = require('./signature-pad-label.cjs');
|
|
10
|
+
const signaturePadRoot = require('./signature-pad-root.cjs');
|
|
11
|
+
const signaturePadRootProvider = require('./signature-pad-root-provider.cjs');
|
|
12
|
+
const signaturePadSegment = require('./signature-pad-segment.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.ClearTrigger = signaturePadClearTrigger.SignaturePadClearTrigger;
|
|
17
|
+
exports.Context = signaturePadContext.SignaturePadContext;
|
|
18
|
+
exports.Control = signaturePadControl.SignaturePadControl;
|
|
19
|
+
exports.Guide = signaturePadGuide.SignaturePadGuide;
|
|
20
|
+
exports.Label = signaturePadLabel.SignaturePadLabel;
|
|
21
|
+
exports.Root = signaturePadRoot.SignaturePadRoot;
|
|
22
|
+
exports.RootProvider = signaturePadRootProvider.SignaturePadRootProvider;
|
|
23
|
+
exports.Segment = signaturePadSegment.SignaturePadSegment;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { DrawDetails, DrawEndDetails, DrawingOptions } from '@zag-js/signature-pad';
|
|
2
|
+
export { SignaturePadClearTrigger as ClearTrigger, type SignaturePadClearTriggerProps as ClearTriggerProps, } from './signature-pad-clear-trigger';
|
|
3
|
+
export { SignaturePadContext as Context, type SignaturePadContextProps as ContextProps, } from './signature-pad-context';
|
|
4
|
+
export { SignaturePadControl as Control, type SignaturePadControlProps as ControlProps, } from './signature-pad-control';
|
|
5
|
+
export { SignaturePadGuide as Guide, type SignaturePadGuideProps as GuideProps, } from './signature-pad-guide';
|
|
6
|
+
export { SignaturePadLabel as Label, type SignaturePadLabelProps as LabelProps, } from './signature-pad-label';
|
|
7
|
+
export { SignaturePadRoot as Root, type SignaturePadRootProps as RootProps, } from './signature-pad-root';
|
|
8
|
+
export { SignaturePadRootProvider as RootProvider, type SignaturePadRootProviderProps as RootProviderProps, } from './signature-pad-root-provider';
|
|
9
|
+
export { SignaturePadSegment as Segment, type SignaturePadSegmentProps as SegmentProps, } from './signature-pad-segment';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { DrawDetails, DrawEndDetails, DrawingOptions } from '@zag-js/signature-pad';
|
|
2
|
+
export { SignaturePadClearTrigger as ClearTrigger, type SignaturePadClearTriggerProps as ClearTriggerProps, } from './signature-pad-clear-trigger';
|
|
3
|
+
export { SignaturePadContext as Context, type SignaturePadContextProps as ContextProps, } from './signature-pad-context';
|
|
4
|
+
export { SignaturePadControl as Control, type SignaturePadControlProps as ControlProps, } from './signature-pad-control';
|
|
5
|
+
export { SignaturePadGuide as Guide, type SignaturePadGuideProps as GuideProps, } from './signature-pad-guide';
|
|
6
|
+
export { SignaturePadLabel as Label, type SignaturePadLabelProps as LabelProps, } from './signature-pad-label';
|
|
7
|
+
export { SignaturePadRoot as Root, type SignaturePadRootProps as RootProps, } from './signature-pad-root';
|
|
8
|
+
export { SignaturePadRootProvider as RootProvider, type SignaturePadRootProviderProps as RootProviderProps, } from './signature-pad-root-provider';
|
|
9
|
+
export { SignaturePadSegment as Segment, type SignaturePadSegmentProps as SegmentProps, } from './signature-pad-segment';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { SignaturePadClearTrigger as ClearTrigger } from './signature-pad-clear-trigger.js';
|
|
2
|
+
export { SignaturePadContext as Context } from './signature-pad-context.js';
|
|
3
|
+
export { SignaturePadControl as Control } from './signature-pad-control.js';
|
|
4
|
+
export { SignaturePadGuide as Guide } from './signature-pad-guide.js';
|
|
5
|
+
export { SignaturePadLabel as Label } from './signature-pad-label.js';
|
|
6
|
+
export { SignaturePadRoot as Root } from './signature-pad-root.js';
|
|
7
|
+
export { SignaturePadRootProvider as RootProvider } from './signature-pad-root-provider.js';
|
|
8
|
+
export { SignaturePadSegment as Segment } from './signature-pad-segment.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const createContext = require('../../utils/create-context.cjs');
|
|
7
|
+
|
|
8
|
+
const [SignaturePadProvider, useSignaturePadContext] = createContext.createContext(
|
|
9
|
+
{
|
|
10
|
+
name: "SignaturePadContext",
|
|
11
|
+
hookName: "useSignaturePadContext",
|
|
12
|
+
providerName: "<SignaturePadProvider />"
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
exports.SignaturePadProvider = SignaturePadProvider;
|
|
17
|
+
exports.useSignaturePadContext = useSignaturePadContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseSignaturePadReturn } from './use-signature-pad';
|
|
2
|
+
import { Provider } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface UseSignaturePadContext extends UseSignaturePadReturn {
|
|
5
|
+
}
|
|
6
|
+
export declare const SignaturePadProvider: Provider<UseSignaturePadContext>, useSignaturePadContext: () => UseSignaturePadContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UseSignaturePadReturn } from './use-signature-pad';
|
|
2
|
+
import { Provider } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface UseSignaturePadContext extends UseSignaturePadReturn {
|
|
5
|
+
}
|
|
6
|
+
export declare const SignaturePadProvider: Provider<UseSignaturePadContext>, useSignaturePadContext: () => UseSignaturePadContext;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from '../../utils/create-context.js';
|
|
3
|
+
|
|
4
|
+
const [SignaturePadProvider, useSignaturePadContext] = createContext(
|
|
5
|
+
{
|
|
6
|
+
name: "SignaturePadContext",
|
|
7
|
+
hookName: "useSignaturePadContext",
|
|
8
|
+
providerName: "<SignaturePadProvider />"
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export { SignaturePadProvider, useSignaturePadContext };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const react$1 = require('@zag-js/react');
|
|
7
|
+
const signaturePad = require('@zag-js/signature-pad');
|
|
8
|
+
const react = require('react');
|
|
9
|
+
const useEnvironmentContext = require('../../providers/environment/use-environment-context.cjs');
|
|
10
|
+
const useLocaleContext = require('../../providers/locale/use-locale-context.cjs');
|
|
11
|
+
const useEvent = require('../../utils/use-event.cjs');
|
|
12
|
+
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
15
|
+
if (e) {
|
|
16
|
+
for (const k in e) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: () => e[k]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const signaturePad__namespace = /*#__PURE__*/_interopNamespaceDefault(signaturePad);
|
|
31
|
+
|
|
32
|
+
const useSignaturePad = (props) => {
|
|
33
|
+
const { getRootNode } = useEnvironmentContext.useEnvironmentContext();
|
|
34
|
+
const { dir } = useLocaleContext.useLocaleContext();
|
|
35
|
+
const initialContext = {
|
|
36
|
+
id: react.useId(),
|
|
37
|
+
dir,
|
|
38
|
+
getRootNode,
|
|
39
|
+
...props
|
|
40
|
+
};
|
|
41
|
+
const context = {
|
|
42
|
+
...initialContext,
|
|
43
|
+
drawing: props.drawing,
|
|
44
|
+
onDraw: useEvent.useEvent(props.onDraw),
|
|
45
|
+
onDrawEnd: useEvent.useEvent(props.onDrawEnd)
|
|
46
|
+
};
|
|
47
|
+
const [state, send] = react$1.useMachine(signaturePad__namespace.machine(initialContext), { context });
|
|
48
|
+
return signaturePad__namespace.connect(state, send, react$1.normalizeProps);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.useSignaturePad = useSignaturePad;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropTypes } from '@zag-js/react';
|
|
2
|
+
import { Optional } from '../../types';
|
|
3
|
+
|
|
4
|
+
import * as signaturePad from '@zag-js/signature-pad';
|
|
5
|
+
export interface UseSignaturePadProps extends Optional<Omit<signaturePad.Context, 'dir' | 'getRootNode'>, 'id'> {
|
|
6
|
+
}
|
|
7
|
+
export interface UseSignaturePadReturn extends signaturePad.Api<PropTypes> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useSignaturePad: (props: UseSignaturePadProps) => UseSignaturePadReturn;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropTypes } from '@zag-js/react';
|
|
2
|
+
import { Optional } from '../../types';
|
|
3
|
+
|
|
4
|
+
import * as signaturePad from '@zag-js/signature-pad';
|
|
5
|
+
export interface UseSignaturePadProps extends Optional<Omit<signaturePad.Context, 'dir' | 'getRootNode'>, 'id'> {
|
|
6
|
+
}
|
|
7
|
+
export interface UseSignaturePadReturn extends signaturePad.Api<PropTypes> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useSignaturePad: (props: UseSignaturePadProps) => UseSignaturePadReturn;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMachine, normalizeProps } from '@zag-js/react';
|
|
3
|
+
import * as signaturePad from '@zag-js/signature-pad';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { useEnvironmentContext } from '../../providers/environment/use-environment-context.js';
|
|
6
|
+
import { useLocaleContext } from '../../providers/locale/use-locale-context.js';
|
|
7
|
+
import { useEvent } from '../../utils/use-event.js';
|
|
8
|
+
|
|
9
|
+
const useSignaturePad = (props) => {
|
|
10
|
+
const { getRootNode } = useEnvironmentContext();
|
|
11
|
+
const { dir } = useLocaleContext();
|
|
12
|
+
const initialContext = {
|
|
13
|
+
id: useId(),
|
|
14
|
+
dir,
|
|
15
|
+
getRootNode,
|
|
16
|
+
...props
|
|
17
|
+
};
|
|
18
|
+
const context = {
|
|
19
|
+
...initialContext,
|
|
20
|
+
drawing: props.drawing,
|
|
21
|
+
onDraw: useEvent(props.onDraw),
|
|
22
|
+
onDrawEnd: useEvent(props.onDrawEnd)
|
|
23
|
+
};
|
|
24
|
+
const [state, send] = useMachine(signaturePad.machine(initialContext), { context });
|
|
25
|
+
return signaturePad.connect(state, send, normalizeProps);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { useSignaturePad };
|
|
@@ -19,7 +19,8 @@ const TabContent = react.forwardRef((props, ref) => {
|
|
|
19
19
|
const renderStrategyProps = renderStrategy.useRenderStrategyPropsContext();
|
|
20
20
|
const presence = usePresence.usePresence({
|
|
21
21
|
...renderStrategyProps,
|
|
22
|
-
present: tabs.value === props.value
|
|
22
|
+
present: tabs.value === props.value,
|
|
23
|
+
immediate: true
|
|
23
24
|
});
|
|
24
25
|
const mergedProps = react$1.mergeProps(
|
|
25
26
|
tabs.getContentProps(contentProps),
|
|
@@ -15,7 +15,8 @@ const TabContent = forwardRef((props, ref) => {
|
|
|
15
15
|
const renderStrategyProps = useRenderStrategyPropsContext();
|
|
16
16
|
const presence = usePresence({
|
|
17
17
|
...renderStrategyProps,
|
|
18
|
-
present: tabs.value === props.value
|
|
18
|
+
present: tabs.value === props.value,
|
|
19
|
+
immediate: true
|
|
19
20
|
});
|
|
20
21
|
const mergedProps = mergeProps(
|
|
21
22
|
tabs.getContentProps(contentProps),
|
|
@@ -42,6 +42,8 @@ const useTreeView = (props = {}) => {
|
|
|
42
42
|
};
|
|
43
43
|
const context = {
|
|
44
44
|
...initialContext,
|
|
45
|
+
selectedValue: props.selectedValue,
|
|
46
|
+
expandedValue: props.expandedValue,
|
|
45
47
|
onFocusChange: useEvent.useEvent(props.onFocusChange, { sync: true }),
|
|
46
48
|
onExpandedChange: useEvent.useEvent(props.onExpandedChange),
|
|
47
49
|
onSelectionChange: useEvent.useEvent(props.onSelectionChange)
|
|
@@ -19,6 +19,8 @@ const useTreeView = (props = {}) => {
|
|
|
19
19
|
};
|
|
20
20
|
const context = {
|
|
21
21
|
...initialContext,
|
|
22
|
+
selectedValue: props.selectedValue,
|
|
23
|
+
expandedValue: props.expandedValue,
|
|
22
24
|
onFocusChange: useEvent(props.onFocusChange, { sync: true }),
|
|
23
25
|
onExpandedChange: useEvent(props.onExpandedChange),
|
|
24
26
|
onSelectionChange: useEvent(props.onSelectionChange)
|