@ark-ui/react 5.29.0 → 5.30.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/dist/components/anatomy.cjs +5 -0
- package/dist/components/anatomy.d.cts +1 -0
- package/dist/components/anatomy.d.ts +1 -0
- package/dist/components/anatomy.js +1 -0
- package/dist/components/checkbox/use-checkbox-group.cjs +11 -1
- package/dist/components/checkbox/use-checkbox-group.d.cts +2 -2
- package/dist/components/checkbox/use-checkbox-group.d.ts +2 -2
- package/dist/components/checkbox/use-checkbox-group.js +11 -1
- package/dist/components/date-picker/date-picker-root.cjs +4 -2
- package/dist/components/date-picker/date-picker-root.js +4 -2
- package/dist/components/fieldset/use-fieldset.cjs +37 -46
- package/dist/components/fieldset/use-fieldset.d.cts +5 -0
- package/dist/components/fieldset/use-fieldset.d.ts +5 -0
- package/dist/components/fieldset/use-fieldset.js +38 -47
- package/dist/components/index.cjs +41 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +20 -0
- package/dist/components/navigation-menu/index.cjs +44 -0
- package/dist/components/navigation-menu/index.d.cts +18 -0
- package/dist/components/navigation-menu/index.d.ts +18 -0
- package/dist/components/navigation-menu/index.js +18 -0
- package/dist/components/navigation-menu/navigation-menu-arrow.cjs +19 -0
- package/dist/components/navigation-menu/navigation-menu-arrow.d.cts +7 -0
- package/dist/components/navigation-menu/navigation-menu-arrow.d.ts +7 -0
- package/dist/components/navigation-menu/navigation-menu-arrow.js +15 -0
- package/dist/components/navigation-menu/navigation-menu-content.cjs +41 -0
- package/dist/components/navigation-menu/navigation-menu-content.d.cts +9 -0
- package/dist/components/navigation-menu/navigation-menu-content.d.ts +9 -0
- package/dist/components/navigation-menu/navigation-menu-content.js +37 -0
- package/dist/components/navigation-menu/navigation-menu-context.cjs +10 -0
- package/dist/components/navigation-menu/navigation-menu-context.d.cts +6 -0
- package/dist/components/navigation-menu/navigation-menu-context.d.ts +6 -0
- package/dist/components/navigation-menu/navigation-menu-context.js +6 -0
- package/dist/components/navigation-menu/navigation-menu-indicator.cjs +25 -0
- package/dist/components/navigation-menu/navigation-menu-indicator.d.cts +7 -0
- package/dist/components/navigation-menu/navigation-menu-indicator.d.ts +7 -0
- package/dist/components/navigation-menu/navigation-menu-indicator.js +21 -0
- package/dist/components/navigation-menu/navigation-menu-item-indicator.cjs +23 -0
- package/dist/components/navigation-menu/navigation-menu-item-indicator.d.cts +7 -0
- package/dist/components/navigation-menu/navigation-menu-item-indicator.d.ts +7 -0
- package/dist/components/navigation-menu/navigation-menu-item-indicator.js +19 -0
- package/dist/components/navigation-menu/navigation-menu-item.cjs +23 -0
- package/dist/components/navigation-menu/navigation-menu-item.d.cts +8 -0
- package/dist/components/navigation-menu/navigation-menu-item.d.ts +8 -0
- package/dist/components/navigation-menu/navigation-menu-item.js +19 -0
- package/dist/components/navigation-menu/navigation-menu-link.cjs +25 -0
- package/dist/components/navigation-menu/navigation-menu-link.d.cts +9 -0
- package/dist/components/navigation-menu/navigation-menu-link.d.ts +9 -0
- package/dist/components/navigation-menu/navigation-menu-link.js +21 -0
- package/dist/components/navigation-menu/navigation-menu-list.cjs +19 -0
- package/dist/components/navigation-menu/navigation-menu-list.d.cts +7 -0
- package/dist/components/navigation-menu/navigation-menu-list.d.ts +7 -0
- package/dist/components/navigation-menu/navigation-menu-list.js +15 -0
- package/dist/components/navigation-menu/navigation-menu-root-provider.cjs +23 -0
- package/dist/components/navigation-menu/navigation-menu-root-provider.d.cts +13 -0
- package/dist/components/navigation-menu/navigation-menu-root-provider.d.ts +13 -0
- package/dist/components/navigation-menu/navigation-menu-root-provider.js +19 -0
- package/dist/components/navigation-menu/navigation-menu-root.cjs +37 -0
- package/dist/components/navigation-menu/navigation-menu-root.d.cts +10 -0
- package/dist/components/navigation-menu/navigation-menu-root.d.ts +10 -0
- package/dist/components/navigation-menu/navigation-menu-root.js +33 -0
- package/dist/components/navigation-menu/navigation-menu-trigger.cjs +28 -0
- package/dist/components/navigation-menu/navigation-menu-trigger.d.cts +9 -0
- package/dist/components/navigation-menu/navigation-menu-trigger.d.ts +9 -0
- package/dist/components/navigation-menu/navigation-menu-trigger.js +24 -0
- package/dist/components/navigation-menu/navigation-menu-viewport-positioner.cjs +24 -0
- package/dist/components/navigation-menu/navigation-menu-viewport-positioner.d.cts +8 -0
- package/dist/components/navigation-menu/navigation-menu-viewport-positioner.d.ts +8 -0
- package/dist/components/navigation-menu/navigation-menu-viewport-positioner.js +20 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.cjs +32 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.d.cts +8 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.d.ts +8 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.js +28 -0
- package/dist/components/navigation-menu/navigation-menu.anatomy.d.cts +1 -0
- package/dist/components/navigation-menu/navigation-menu.anatomy.d.ts +1 -0
- package/dist/components/navigation-menu/navigation-menu.cjs +33 -0
- package/dist/components/navigation-menu/navigation-menu.d.cts +14 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu/navigation-menu.js +13 -0
- package/dist/components/navigation-menu/use-navigation-menu-context.cjs +15 -0
- package/dist/components/navigation-menu/use-navigation-menu-context.d.cts +5 -0
- package/dist/components/navigation-menu/use-navigation-menu-context.d.ts +5 -0
- package/dist/components/navigation-menu/use-navigation-menu-context.js +10 -0
- package/dist/components/navigation-menu/use-navigation-menu-item-props-context.cjs +16 -0
- package/dist/components/navigation-menu/use-navigation-menu-item-props-context.d.cts +3 -0
- package/dist/components/navigation-menu/use-navigation-menu-item-props-context.d.ts +3 -0
- package/dist/components/navigation-menu/use-navigation-menu-item-props-context.js +11 -0
- package/dist/components/navigation-menu/use-navigation-menu.cjs +45 -0
- package/dist/components/navigation-menu/use-navigation-menu.d.cts +8 -0
- package/dist/components/navigation-menu/use-navigation-menu.d.ts +8 -0
- package/dist/components/navigation-menu/use-navigation-menu.js +22 -0
- package/dist/components/number-input/number-input-root.cjs +1 -0
- package/dist/components/number-input/number-input-root.js +1 -0
- package/dist/components/pagination/index.cjs +4 -0
- package/dist/components/pagination/index.d.cts +2 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/pagination-first-trigger.cjs +19 -0
- package/dist/components/pagination/pagination-first-trigger.d.cts +7 -0
- package/dist/components/pagination/pagination-first-trigger.d.ts +7 -0
- package/dist/components/pagination/pagination-first-trigger.js +15 -0
- package/dist/components/pagination/pagination-last-trigger.cjs +19 -0
- package/dist/components/pagination/pagination-last-trigger.d.cts +7 -0
- package/dist/components/pagination/pagination-last-trigger.d.ts +7 -0
- package/dist/components/pagination/pagination-last-trigger.js +15 -0
- package/dist/components/pagination/pagination-root.cjs +1 -0
- package/dist/components/pagination/pagination-root.js +1 -0
- package/dist/components/pagination/pagination.cjs +4 -0
- package/dist/components/pagination/pagination.d.cts +2 -0
- package/dist/components/pagination/pagination.d.ts +2 -0
- package/dist/components/pagination/pagination.js +2 -0
- package/dist/components/radio-group/radio-group-root.cjs +2 -0
- package/dist/components/radio-group/radio-group-root.js +2 -0
- package/dist/components/radio-group/use-radio-group.cjs +7 -0
- package/dist/components/radio-group/use-radio-group.js +7 -0
- package/dist/components/segment-group/segment-group-root.cjs +2 -0
- package/dist/components/segment-group/segment-group-root.js +2 -0
- package/dist/components/tree-view/tree-view-root.cjs +1 -0
- package/dist/components/tree-view/tree-view-root.js +1 -0
- package/dist/index.cjs +41 -0
- package/dist/index.js +20 -0
- package/package.json +72 -71
|
@@ -0,0 +1,19 @@
|
|
|
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 { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';
|
|
7
|
+
import { ark } from '../factory.js';
|
|
8
|
+
import { NavigationMenuProvider } from './use-navigation-menu-context.js';
|
|
9
|
+
|
|
10
|
+
const splitRootProviderProps = createSplitProps();
|
|
11
|
+
const NavigationMenuRootProvider = forwardRef((props, ref) => {
|
|
12
|
+
const [renderStrategyProps, navigationMenuProps] = splitRenderStrategyProps(props);
|
|
13
|
+
const [{ value: navigationMenu }, localProps] = splitRootProviderProps(navigationMenuProps, ["value"]);
|
|
14
|
+
const mergedProps = mergeProps(navigationMenu.getRootProps(), localProps);
|
|
15
|
+
return /* @__PURE__ */ jsx(NavigationMenuProvider, { value: navigationMenu, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(ark.nav, { ...mergedProps, ref }) }) });
|
|
16
|
+
});
|
|
17
|
+
NavigationMenuRootProvider.displayName = "NavigationMenuRootProvider";
|
|
18
|
+
|
|
19
|
+
export { NavigationMenuRootProvider };
|
|
@@ -0,0 +1,37 @@
|
|
|
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 renderStrategy = require('../../utils/render-strategy.cjs');
|
|
11
|
+
const factory = require('../factory.cjs');
|
|
12
|
+
const useNavigationMenu = require('./use-navigation-menu.cjs');
|
|
13
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
14
|
+
|
|
15
|
+
const splitRootProps = createSplitProps.createSplitProps();
|
|
16
|
+
const NavigationMenuRoot = react.forwardRef((props, ref) => {
|
|
17
|
+
const [renderStrategyProps, navigationMenuProps] = renderStrategy.splitRenderStrategyProps(props);
|
|
18
|
+
const [useNavigationMenuProps, localProps] = splitRootProps(navigationMenuProps, [
|
|
19
|
+
"closeDelay",
|
|
20
|
+
"defaultValue",
|
|
21
|
+
"disableClickTrigger",
|
|
22
|
+
"disableHoverTrigger",
|
|
23
|
+
"disablePointerLeaveClose",
|
|
24
|
+
"id",
|
|
25
|
+
"ids",
|
|
26
|
+
"onValueChange",
|
|
27
|
+
"openDelay",
|
|
28
|
+
"orientation",
|
|
29
|
+
"value"
|
|
30
|
+
]);
|
|
31
|
+
const navigationMenu = useNavigationMenu.useNavigationMenu(useNavigationMenuProps);
|
|
32
|
+
const mergedProps = react$1.mergeProps(navigationMenu.getRootProps(), localProps);
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useNavigationMenuContext.NavigationMenuProvider, { value: navigationMenu, children: /* @__PURE__ */ jsxRuntime.jsx(renderStrategy.RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.nav, { ...mergedProps, ref }) }) });
|
|
34
|
+
});
|
|
35
|
+
NavigationMenuRoot.displayName = "NavigationMenuRoot";
|
|
36
|
+
|
|
37
|
+
exports.NavigationMenuRoot = NavigationMenuRoot;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Assign } from '../../types';
|
|
2
|
+
import { RenderStrategyProps } from '../../utils/render-strategy';
|
|
3
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
4
|
+
import { UseNavigationMenuProps } from './use-navigation-menu';
|
|
5
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
6
|
+
export interface NavigationMenuRootBaseProps extends UseNavigationMenuProps, RenderStrategyProps, PolymorphicProps {
|
|
7
|
+
}
|
|
8
|
+
export interface NavigationMenuRootProps extends Assign<HTMLProps<'nav'>, NavigationMenuRootBaseProps> {
|
|
9
|
+
}
|
|
10
|
+
export declare const NavigationMenuRoot: ForwardRefExoticComponent<NavigationMenuRootProps & RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Assign } from '../../types';
|
|
2
|
+
import { RenderStrategyProps } from '../../utils/render-strategy';
|
|
3
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
4
|
+
import { UseNavigationMenuProps } from './use-navigation-menu';
|
|
5
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
6
|
+
export interface NavigationMenuRootBaseProps extends UseNavigationMenuProps, RenderStrategyProps, PolymorphicProps {
|
|
7
|
+
}
|
|
8
|
+
export interface NavigationMenuRootProps extends Assign<HTMLProps<'nav'>, NavigationMenuRootBaseProps> {
|
|
9
|
+
}
|
|
10
|
+
export declare const NavigationMenuRoot: ForwardRefExoticComponent<NavigationMenuRootProps & RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { splitRenderStrategyProps, RenderStrategyPropsProvider } from '../../utils/render-strategy.js';
|
|
7
|
+
import { ark } from '../factory.js';
|
|
8
|
+
import { useNavigationMenu } from './use-navigation-menu.js';
|
|
9
|
+
import { NavigationMenuProvider } from './use-navigation-menu-context.js';
|
|
10
|
+
|
|
11
|
+
const splitRootProps = createSplitProps();
|
|
12
|
+
const NavigationMenuRoot = forwardRef((props, ref) => {
|
|
13
|
+
const [renderStrategyProps, navigationMenuProps] = splitRenderStrategyProps(props);
|
|
14
|
+
const [useNavigationMenuProps, localProps] = splitRootProps(navigationMenuProps, [
|
|
15
|
+
"closeDelay",
|
|
16
|
+
"defaultValue",
|
|
17
|
+
"disableClickTrigger",
|
|
18
|
+
"disableHoverTrigger",
|
|
19
|
+
"disablePointerLeaveClose",
|
|
20
|
+
"id",
|
|
21
|
+
"ids",
|
|
22
|
+
"onValueChange",
|
|
23
|
+
"openDelay",
|
|
24
|
+
"orientation",
|
|
25
|
+
"value"
|
|
26
|
+
]);
|
|
27
|
+
const navigationMenu = useNavigationMenu(useNavigationMenuProps);
|
|
28
|
+
const mergedProps = mergeProps(navigationMenu.getRootProps(), localProps);
|
|
29
|
+
return /* @__PURE__ */ jsx(NavigationMenuProvider, { value: navigationMenu, children: /* @__PURE__ */ jsx(RenderStrategyPropsProvider, { value: renderStrategyProps, children: /* @__PURE__ */ jsx(ark.nav, { ...mergedProps, ref }) }) });
|
|
30
|
+
});
|
|
31
|
+
NavigationMenuRoot.displayName = "NavigationMenuRoot";
|
|
32
|
+
|
|
33
|
+
export { NavigationMenuRoot };
|
|
@@ -0,0 +1,28 @@
|
|
|
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 utils = require('@zag-js/utils');
|
|
9
|
+
const react = require('react');
|
|
10
|
+
const factory = require('../factory.cjs');
|
|
11
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
12
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
13
|
+
const useNavigationMenuItemPropsContext = require('./use-navigation-menu-item-props-context.cjs');
|
|
14
|
+
|
|
15
|
+
const splitItemProps = createSplitProps.createSplitProps();
|
|
16
|
+
const NavigationMenuTrigger = react.forwardRef((props, ref) => {
|
|
17
|
+
const itemContext = useNavigationMenuItemPropsContext.useNavigationMenuItemPropsContext();
|
|
18
|
+
utils.ensure(itemContext, () => "NavigationMenu.Trigger must be used within NavigationMenu.Item");
|
|
19
|
+
const value = itemContext.value;
|
|
20
|
+
const disabled = props.disabled ?? itemContext.disabled;
|
|
21
|
+
const [triggerProps, localProps] = splitItemProps({ ...props, value, disabled }, ["value", "disabled"]);
|
|
22
|
+
const navigationMenu = useNavigationMenuContext.useNavigationMenuContext();
|
|
23
|
+
const mergedProps = react$1.mergeProps(navigationMenu.getTriggerProps(triggerProps), localProps);
|
|
24
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
|
|
25
|
+
});
|
|
26
|
+
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
|
|
27
|
+
|
|
28
|
+
exports.NavigationMenuTrigger = NavigationMenuTrigger;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemProps } from '@zag-js/navigation-menu';
|
|
2
|
+
import { Assign } from '../../types';
|
|
3
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
export interface NavigationMenuTriggerBaseProps extends Omit<ItemProps, 'value'>, PolymorphicProps {
|
|
6
|
+
}
|
|
7
|
+
export interface NavigationMenuTriggerProps extends Assign<HTMLProps<'button'>, NavigationMenuTriggerBaseProps> {
|
|
8
|
+
}
|
|
9
|
+
export declare const NavigationMenuTrigger: ForwardRefExoticComponent<NavigationMenuTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemProps } from '@zag-js/navigation-menu';
|
|
2
|
+
import { Assign } from '../../types';
|
|
3
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
4
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
5
|
+
export interface NavigationMenuTriggerBaseProps extends Omit<ItemProps, 'value'>, PolymorphicProps {
|
|
6
|
+
}
|
|
7
|
+
export interface NavigationMenuTriggerProps extends Assign<HTMLProps<'button'>, NavigationMenuTriggerBaseProps> {
|
|
8
|
+
}
|
|
9
|
+
export declare const NavigationMenuTrigger: ForwardRefExoticComponent<NavigationMenuTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { ensure } from '@zag-js/utils';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { ark } from '../factory.js';
|
|
7
|
+
import { useNavigationMenuContext } from './use-navigation-menu-context.js';
|
|
8
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
9
|
+
import { useNavigationMenuItemPropsContext } from './use-navigation-menu-item-props-context.js';
|
|
10
|
+
|
|
11
|
+
const splitItemProps = createSplitProps();
|
|
12
|
+
const NavigationMenuTrigger = forwardRef((props, ref) => {
|
|
13
|
+
const itemContext = useNavigationMenuItemPropsContext();
|
|
14
|
+
ensure(itemContext, () => "NavigationMenu.Trigger must be used within NavigationMenu.Item");
|
|
15
|
+
const value = itemContext.value;
|
|
16
|
+
const disabled = props.disabled ?? itemContext.disabled;
|
|
17
|
+
const [triggerProps, localProps] = splitItemProps({ ...props, value, disabled }, ["value", "disabled"]);
|
|
18
|
+
const navigationMenu = useNavigationMenuContext();
|
|
19
|
+
const mergedProps = mergeProps(navigationMenu.getTriggerProps(triggerProps), localProps);
|
|
20
|
+
return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
|
|
21
|
+
});
|
|
22
|
+
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
|
|
23
|
+
|
|
24
|
+
export { NavigationMenuTrigger };
|
|
@@ -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 useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
12
|
+
|
|
13
|
+
const splitViewportProps = createSplitProps.createSplitProps();
|
|
14
|
+
const NavigationMenuViewportPositioner = react.forwardRef(
|
|
15
|
+
(props, ref) => {
|
|
16
|
+
const [positionerProps, localProps] = splitViewportProps(props, ["align"]);
|
|
17
|
+
const navigationMenu = useNavigationMenuContext.useNavigationMenuContext();
|
|
18
|
+
const mergedProps = react$1.mergeProps(navigationMenu.getViewportPositionerProps(positionerProps), localProps);
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
NavigationMenuViewportPositioner.displayName = "NavigationMenuViewportPositioner";
|
|
23
|
+
|
|
24
|
+
exports.NavigationMenuViewportPositioner = NavigationMenuViewportPositioner;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewportProps } from '@zag-js/navigation-menu';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface NavigationMenuViewportPositionerBaseProps extends ViewportProps, PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface NavigationMenuViewportPositionerProps extends HTMLProps<'div'>, NavigationMenuViewportPositionerBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const NavigationMenuViewportPositioner: ForwardRefExoticComponent<NavigationMenuViewportPositionerProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewportProps } from '@zag-js/navigation-menu';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface NavigationMenuViewportPositionerBaseProps extends ViewportProps, PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface NavigationMenuViewportPositionerProps extends HTMLProps<'div'>, NavigationMenuViewportPositionerBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const NavigationMenuViewportPositioner: ForwardRefExoticComponent<NavigationMenuViewportPositionerProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -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 { useNavigationMenuContext } from './use-navigation-menu-context.js';
|
|
8
|
+
|
|
9
|
+
const splitViewportProps = createSplitProps();
|
|
10
|
+
const NavigationMenuViewportPositioner = forwardRef(
|
|
11
|
+
(props, ref) => {
|
|
12
|
+
const [positionerProps, localProps] = splitViewportProps(props, ["align"]);
|
|
13
|
+
const navigationMenu = useNavigationMenuContext();
|
|
14
|
+
const mergedProps = mergeProps(navigationMenu.getViewportPositionerProps(positionerProps), localProps);
|
|
15
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
NavigationMenuViewportPositioner.displayName = "NavigationMenuViewportPositioner";
|
|
19
|
+
|
|
20
|
+
export { NavigationMenuViewportPositioner };
|
|
@@ -0,0 +1,32 @@
|
|
|
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 composeRefs = require('../../utils/compose-refs.cjs');
|
|
10
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
11
|
+
const renderStrategy = require('../../utils/render-strategy.cjs');
|
|
12
|
+
const factory = require('../factory.cjs');
|
|
13
|
+
const usePresence = require('../presence/use-presence.cjs');
|
|
14
|
+
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
15
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
16
|
+
|
|
17
|
+
const splitViewportProps = createSplitProps.createSplitProps();
|
|
18
|
+
const NavigationMenuViewport = react.forwardRef((props, ref) => {
|
|
19
|
+
const [viewportProps, localProps] = splitViewportProps(props, ["align"]);
|
|
20
|
+
const navigationMenu = useNavigationMenuContext.useNavigationMenuContext();
|
|
21
|
+
const renderStrategyProps = renderStrategy.useRenderStrategyPropsContext();
|
|
22
|
+
const presence = usePresence.usePresence({ ...renderStrategyProps, present: navigationMenu.open });
|
|
23
|
+
const mergedProps = react$1.mergeProps(
|
|
24
|
+
navigationMenu.getViewportProps(viewportProps),
|
|
25
|
+
presence.getPresenceProps(),
|
|
26
|
+
localProps
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(usePresenceContext.PresenceProvider, { value: presence, children: presence.unmounted ? null : /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref: composeRefs.composeRefs(presence.ref, ref) }) });
|
|
29
|
+
});
|
|
30
|
+
NavigationMenuViewport.displayName = "NavigationMenuViewport";
|
|
31
|
+
|
|
32
|
+
exports.NavigationMenuViewport = NavigationMenuViewport;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewportProps } from '@zag-js/navigation-menu';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface NavigationMenuViewportBaseProps extends ViewportProps, PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface NavigationMenuViewportProps extends HTMLProps<'div'>, NavigationMenuViewportBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const NavigationMenuViewport: ForwardRefExoticComponent<NavigationMenuViewportProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ViewportProps } from '@zag-js/navigation-menu';
|
|
2
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
3
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
export interface NavigationMenuViewportBaseProps extends ViewportProps, PolymorphicProps {
|
|
5
|
+
}
|
|
6
|
+
export interface NavigationMenuViewportProps extends HTMLProps<'div'>, NavigationMenuViewportBaseProps {
|
|
7
|
+
}
|
|
8
|
+
export declare const NavigationMenuViewport: ForwardRefExoticComponent<NavigationMenuViewportProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { mergeProps } from '@zag-js/react';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { composeRefs } from '../../utils/compose-refs.js';
|
|
6
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
7
|
+
import { useRenderStrategyPropsContext } from '../../utils/render-strategy.js';
|
|
8
|
+
import { ark } from '../factory.js';
|
|
9
|
+
import { usePresence } from '../presence/use-presence.js';
|
|
10
|
+
import { PresenceProvider } from '../presence/use-presence-context.js';
|
|
11
|
+
import { useNavigationMenuContext } from './use-navigation-menu-context.js';
|
|
12
|
+
|
|
13
|
+
const splitViewportProps = createSplitProps();
|
|
14
|
+
const NavigationMenuViewport = forwardRef((props, ref) => {
|
|
15
|
+
const [viewportProps, localProps] = splitViewportProps(props, ["align"]);
|
|
16
|
+
const navigationMenu = useNavigationMenuContext();
|
|
17
|
+
const renderStrategyProps = useRenderStrategyPropsContext();
|
|
18
|
+
const presence = usePresence({ ...renderStrategyProps, present: navigationMenu.open });
|
|
19
|
+
const mergedProps = mergeProps(
|
|
20
|
+
navigationMenu.getViewportProps(viewportProps),
|
|
21
|
+
presence.getPresenceProps(),
|
|
22
|
+
localProps
|
|
23
|
+
);
|
|
24
|
+
return /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: presence.unmounted ? null : /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) }) });
|
|
25
|
+
});
|
|
26
|
+
NavigationMenuViewport.displayName = "NavigationMenuViewport";
|
|
27
|
+
|
|
28
|
+
export { NavigationMenuViewport };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as navigationMenuAnatomy } from '@zag-js/navigation-menu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as navigationMenuAnatomy } from '@zag-js/navigation-menu';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const navigationMenuArrow = require('./navigation-menu-arrow.cjs');
|
|
6
|
+
const navigationMenuContent = require('./navigation-menu-content.cjs');
|
|
7
|
+
const navigationMenuContext = require('./navigation-menu-context.cjs');
|
|
8
|
+
const navigationMenuIndicator = require('./navigation-menu-indicator.cjs');
|
|
9
|
+
const navigationMenuItem = require('./navigation-menu-item.cjs');
|
|
10
|
+
const navigationMenuItemIndicator = require('./navigation-menu-item-indicator.cjs');
|
|
11
|
+
const navigationMenuLink = require('./navigation-menu-link.cjs');
|
|
12
|
+
const navigationMenuList = require('./navigation-menu-list.cjs');
|
|
13
|
+
const navigationMenuRoot = require('./navigation-menu-root.cjs');
|
|
14
|
+
const navigationMenuRootProvider = require('./navigation-menu-root-provider.cjs');
|
|
15
|
+
const navigationMenuTrigger = require('./navigation-menu-trigger.cjs');
|
|
16
|
+
const navigationMenuViewport = require('./navigation-menu-viewport.cjs');
|
|
17
|
+
const navigationMenuViewportPositioner = require('./navigation-menu-viewport-positioner.cjs');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.Arrow = navigationMenuArrow.NavigationMenuArrow;
|
|
22
|
+
exports.Content = navigationMenuContent.NavigationMenuContent;
|
|
23
|
+
exports.Context = navigationMenuContext.NavigationMenuContext;
|
|
24
|
+
exports.Indicator = navigationMenuIndicator.NavigationMenuIndicator;
|
|
25
|
+
exports.Item = navigationMenuItem.NavigationMenuItem;
|
|
26
|
+
exports.ItemIndicator = navigationMenuItemIndicator.NavigationMenuItemIndicator;
|
|
27
|
+
exports.Link = navigationMenuLink.NavigationMenuLink;
|
|
28
|
+
exports.List = navigationMenuList.NavigationMenuList;
|
|
29
|
+
exports.Root = navigationMenuRoot.NavigationMenuRoot;
|
|
30
|
+
exports.RootProvider = navigationMenuRootProvider.NavigationMenuRootProvider;
|
|
31
|
+
exports.Trigger = navigationMenuTrigger.NavigationMenuTrigger;
|
|
32
|
+
exports.Viewport = navigationMenuViewport.NavigationMenuViewport;
|
|
33
|
+
exports.ViewportPositioner = navigationMenuViewportPositioner.NavigationMenuViewportPositioner;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { ValueChangeDetails } from '@zag-js/navigation-menu';
|
|
2
|
+
export { NavigationMenuArrow as Arrow, type NavigationMenuArrowBaseProps as ArrowBaseProps, type NavigationMenuArrowProps as ArrowProps, } from './navigation-menu-arrow';
|
|
3
|
+
export { NavigationMenuContent as Content, type NavigationMenuContentBaseProps as ContentBaseProps, type NavigationMenuContentProps as ContentProps, } from './navigation-menu-content';
|
|
4
|
+
export { NavigationMenuContext as Context, type NavigationMenuContextProps as ContextProps, } from './navigation-menu-context';
|
|
5
|
+
export { NavigationMenuIndicator as Indicator, type NavigationMenuIndicatorBaseProps as IndicatorBaseProps, type NavigationMenuIndicatorProps as IndicatorProps, } from './navigation-menu-indicator';
|
|
6
|
+
export { NavigationMenuItem as Item, type NavigationMenuItemBaseProps as ItemBaseProps, type NavigationMenuItemProps as ItemProps, } from './navigation-menu-item';
|
|
7
|
+
export { NavigationMenuItemIndicator as ItemIndicator, type NavigationMenuItemIndicatorBaseProps as ItemIndicatorBaseProps, type NavigationMenuItemIndicatorProps as ItemIndicatorProps, } from './navigation-menu-item-indicator';
|
|
8
|
+
export { NavigationMenuLink as Link, type NavigationMenuLinkBaseProps as LinkBaseProps, type NavigationMenuLinkProps as LinkProps, } from './navigation-menu-link';
|
|
9
|
+
export { NavigationMenuList as List, type NavigationMenuListBaseProps as ListBaseProps, type NavigationMenuListProps as ListProps, } from './navigation-menu-list';
|
|
10
|
+
export { NavigationMenuRoot as Root, type NavigationMenuRootBaseProps as RootBaseProps, type NavigationMenuRootProps as RootProps, } from './navigation-menu-root';
|
|
11
|
+
export { NavigationMenuRootProvider as RootProvider, type NavigationMenuRootProviderBaseProps as RootProviderBaseProps, type NavigationMenuRootProviderProps as RootProviderProps, } from './navigation-menu-root-provider';
|
|
12
|
+
export { NavigationMenuTrigger as Trigger, type NavigationMenuTriggerBaseProps as TriggerBaseProps, type NavigationMenuTriggerProps as TriggerProps, } from './navigation-menu-trigger';
|
|
13
|
+
export { NavigationMenuViewport as Viewport, type NavigationMenuViewportBaseProps as ViewportBaseProps, type NavigationMenuViewportProps as ViewportProps, } from './navigation-menu-viewport';
|
|
14
|
+
export { NavigationMenuViewportPositioner as ViewportPositioner, type NavigationMenuViewportPositionerBaseProps as ViewportPositionerBaseProps, type NavigationMenuViewportPositionerProps as ViewportPositionerProps, } from './navigation-menu-viewport-positioner';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { ValueChangeDetails } from '@zag-js/navigation-menu';
|
|
2
|
+
export { NavigationMenuArrow as Arrow, type NavigationMenuArrowBaseProps as ArrowBaseProps, type NavigationMenuArrowProps as ArrowProps, } from './navigation-menu-arrow';
|
|
3
|
+
export { NavigationMenuContent as Content, type NavigationMenuContentBaseProps as ContentBaseProps, type NavigationMenuContentProps as ContentProps, } from './navigation-menu-content';
|
|
4
|
+
export { NavigationMenuContext as Context, type NavigationMenuContextProps as ContextProps, } from './navigation-menu-context';
|
|
5
|
+
export { NavigationMenuIndicator as Indicator, type NavigationMenuIndicatorBaseProps as IndicatorBaseProps, type NavigationMenuIndicatorProps as IndicatorProps, } from './navigation-menu-indicator';
|
|
6
|
+
export { NavigationMenuItem as Item, type NavigationMenuItemBaseProps as ItemBaseProps, type NavigationMenuItemProps as ItemProps, } from './navigation-menu-item';
|
|
7
|
+
export { NavigationMenuItemIndicator as ItemIndicator, type NavigationMenuItemIndicatorBaseProps as ItemIndicatorBaseProps, type NavigationMenuItemIndicatorProps as ItemIndicatorProps, } from './navigation-menu-item-indicator';
|
|
8
|
+
export { NavigationMenuLink as Link, type NavigationMenuLinkBaseProps as LinkBaseProps, type NavigationMenuLinkProps as LinkProps, } from './navigation-menu-link';
|
|
9
|
+
export { NavigationMenuList as List, type NavigationMenuListBaseProps as ListBaseProps, type NavigationMenuListProps as ListProps, } from './navigation-menu-list';
|
|
10
|
+
export { NavigationMenuRoot as Root, type NavigationMenuRootBaseProps as RootBaseProps, type NavigationMenuRootProps as RootProps, } from './navigation-menu-root';
|
|
11
|
+
export { NavigationMenuRootProvider as RootProvider, type NavigationMenuRootProviderBaseProps as RootProviderBaseProps, type NavigationMenuRootProviderProps as RootProviderProps, } from './navigation-menu-root-provider';
|
|
12
|
+
export { NavigationMenuTrigger as Trigger, type NavigationMenuTriggerBaseProps as TriggerBaseProps, type NavigationMenuTriggerProps as TriggerProps, } from './navigation-menu-trigger';
|
|
13
|
+
export { NavigationMenuViewport as Viewport, type NavigationMenuViewportBaseProps as ViewportBaseProps, type NavigationMenuViewportProps as ViewportProps, } from './navigation-menu-viewport';
|
|
14
|
+
export { NavigationMenuViewportPositioner as ViewportPositioner, type NavigationMenuViewportPositionerBaseProps as ViewportPositionerBaseProps, type NavigationMenuViewportPositionerProps as ViewportPositionerProps, } from './navigation-menu-viewport-positioner';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { NavigationMenuArrow as Arrow } from './navigation-menu-arrow.js';
|
|
2
|
+
export { NavigationMenuContent as Content } from './navigation-menu-content.js';
|
|
3
|
+
export { NavigationMenuContext as Context } from './navigation-menu-context.js';
|
|
4
|
+
export { NavigationMenuIndicator as Indicator } from './navigation-menu-indicator.js';
|
|
5
|
+
export { NavigationMenuItem as Item } from './navigation-menu-item.js';
|
|
6
|
+
export { NavigationMenuItemIndicator as ItemIndicator } from './navigation-menu-item-indicator.js';
|
|
7
|
+
export { NavigationMenuLink as Link } from './navigation-menu-link.js';
|
|
8
|
+
export { NavigationMenuList as List } from './navigation-menu-list.js';
|
|
9
|
+
export { NavigationMenuRoot as Root } from './navigation-menu-root.js';
|
|
10
|
+
export { NavigationMenuRootProvider as RootProvider } from './navigation-menu-root-provider.js';
|
|
11
|
+
export { NavigationMenuTrigger as Trigger } from './navigation-menu-trigger.js';
|
|
12
|
+
export { NavigationMenuViewport as Viewport } from './navigation-menu-viewport.js';
|
|
13
|
+
export { NavigationMenuViewportPositioner as ViewportPositioner } from './navigation-menu-viewport-positioner.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
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 [NavigationMenuProvider, useNavigationMenuContext] = createContext.createContext({
|
|
9
|
+
name: "NavigationMenuContext",
|
|
10
|
+
hookName: "useNavigationMenuContext",
|
|
11
|
+
providerName: "<NavigationMenuProvider />"
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.NavigationMenuProvider = NavigationMenuProvider;
|
|
15
|
+
exports.useNavigationMenuContext = useNavigationMenuContext;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseNavigationMenuReturn } from './use-navigation-menu';
|
|
2
|
+
import { Provider } from 'react';
|
|
3
|
+
export interface UseNavigationMenuContext extends UseNavigationMenuReturn {
|
|
4
|
+
}
|
|
5
|
+
export declare const NavigationMenuProvider: Provider<UseNavigationMenuContext>, useNavigationMenuContext: () => UseNavigationMenuContext;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseNavigationMenuReturn } from './use-navigation-menu';
|
|
2
|
+
import { Provider } from 'react';
|
|
3
|
+
export interface UseNavigationMenuContext extends UseNavigationMenuReturn {
|
|
4
|
+
}
|
|
5
|
+
export declare const NavigationMenuProvider: Provider<UseNavigationMenuContext>, useNavigationMenuContext: () => UseNavigationMenuContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from '../../utils/create-context.js';
|
|
3
|
+
|
|
4
|
+
const [NavigationMenuProvider, useNavigationMenuContext] = createContext({
|
|
5
|
+
name: "NavigationMenuContext",
|
|
6
|
+
hookName: "useNavigationMenuContext",
|
|
7
|
+
providerName: "<NavigationMenuProvider />"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { NavigationMenuProvider, useNavigationMenuContext };
|
|
@@ -0,0 +1,16 @@
|
|
|
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 [NavigationMenuItemPropsProvider, useNavigationMenuItemPropsContext] = createContext.createContext({
|
|
9
|
+
name: "NavigationMenuItemPropsContext",
|
|
10
|
+
hookName: "useNavigationMenuItemPropsContext",
|
|
11
|
+
providerName: "<NavigationMenuItemPropsProvider />",
|
|
12
|
+
strict: false
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
exports.NavigationMenuItemPropsProvider = NavigationMenuItemPropsProvider;
|
|
16
|
+
exports.useNavigationMenuItemPropsContext = useNavigationMenuItemPropsContext;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { createContext } from '../../utils/create-context.js';
|
|
3
|
+
|
|
4
|
+
const [NavigationMenuItemPropsProvider, useNavigationMenuItemPropsContext] = createContext({
|
|
5
|
+
name: "NavigationMenuItemPropsContext",
|
|
6
|
+
hookName: "useNavigationMenuItemPropsContext",
|
|
7
|
+
providerName: "<NavigationMenuItemPropsProvider />",
|
|
8
|
+
strict: false
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { NavigationMenuItemPropsProvider, useNavigationMenuItemPropsContext };
|
|
@@ -0,0 +1,45 @@
|
|
|
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 navigationMenu = require('@zag-js/navigation-menu');
|
|
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
|
+
|
|
12
|
+
function _interopNamespaceDefault(e) {
|
|
13
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
14
|
+
if (e) {
|
|
15
|
+
for (const k in e) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: () => e[k]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const navigationMenu__namespace = /*#__PURE__*/_interopNamespaceDefault(navigationMenu);
|
|
30
|
+
|
|
31
|
+
const useNavigationMenu = (props) => {
|
|
32
|
+
const id = react.useId();
|
|
33
|
+
const { getRootNode } = useEnvironmentContext.useEnvironmentContext();
|
|
34
|
+
const { dir } = useLocaleContext.useLocaleContext();
|
|
35
|
+
const machineProps = {
|
|
36
|
+
id,
|
|
37
|
+
dir,
|
|
38
|
+
getRootNode,
|
|
39
|
+
...props
|
|
40
|
+
};
|
|
41
|
+
const service = react$1.useMachine(navigationMenu__namespace.machine, machineProps);
|
|
42
|
+
return navigationMenu__namespace.connect(service, react$1.normalizeProps);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.useNavigationMenu = useNavigationMenu;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropTypes } from '@zag-js/react';
|
|
2
|
+
import { Optional } from '../../types';
|
|
3
|
+
import * as navigationMenu from '@zag-js/navigation-menu';
|
|
4
|
+
export interface UseNavigationMenuProps extends Optional<Omit<navigationMenu.Props, 'dir' | 'getRootNode'>, 'id'> {
|
|
5
|
+
}
|
|
6
|
+
export interface UseNavigationMenuReturn extends navigationMenu.Api<PropTypes> {
|
|
7
|
+
}
|
|
8
|
+
export declare const useNavigationMenu: (props?: UseNavigationMenuProps) => UseNavigationMenuReturn;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropTypes } from '@zag-js/react';
|
|
2
|
+
import { Optional } from '../../types';
|
|
3
|
+
import * as navigationMenu from '@zag-js/navigation-menu';
|
|
4
|
+
export interface UseNavigationMenuProps extends Optional<Omit<navigationMenu.Props, 'dir' | 'getRootNode'>, 'id'> {
|
|
5
|
+
}
|
|
6
|
+
export interface UseNavigationMenuReturn extends navigationMenu.Api<PropTypes> {
|
|
7
|
+
}
|
|
8
|
+
export declare const useNavigationMenu: (props?: UseNavigationMenuProps) => UseNavigationMenuReturn;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useMachine, normalizeProps } from '@zag-js/react';
|
|
3
|
+
import * as navigationMenu from '@zag-js/navigation-menu';
|
|
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
|
+
|
|
8
|
+
const useNavigationMenu = (props) => {
|
|
9
|
+
const id = useId();
|
|
10
|
+
const { getRootNode } = useEnvironmentContext();
|
|
11
|
+
const { dir } = useLocaleContext();
|
|
12
|
+
const machineProps = {
|
|
13
|
+
id,
|
|
14
|
+
dir,
|
|
15
|
+
getRootNode,
|
|
16
|
+
...props
|
|
17
|
+
};
|
|
18
|
+
const service = useMachine(navigationMenu.machine, machineProps);
|
|
19
|
+
return navigationMenu.connect(service, normalizeProps);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { useNavigationMenu };
|