@ark-ui/react 5.29.1 → 5.31.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/accordion/accordion-item.cjs +1 -0
- package/dist/components/accordion/accordion-item.js +1 -0
- package/dist/components/accordion/index.cjs +4 -4
- 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/angle-slider/index.cjs +4 -4
- package/dist/components/avatar/index.cjs +4 -4
- package/dist/components/bottom-sheet/index.cjs +4 -4
- 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/checkbox/use-checkbox.cjs +1 -1
- package/dist/components/checkbox/use-checkbox.js +1 -1
- package/dist/components/clipboard/index.cjs +4 -4
- package/dist/components/collapsible/index.cjs +4 -4
- package/dist/components/collection/tree-collection.js +1 -1
- package/dist/components/color-picker/index.cjs +4 -4
- package/dist/components/date-picker/date-picker-root.cjs +5 -2
- package/dist/components/date-picker/date-picker-root.js +5 -2
- package/dist/components/date-picker/date-picker-value-text.cjs +30 -0
- package/dist/components/date-picker/date-picker-value-text.d.cts +29 -0
- package/dist/components/date-picker/date-picker-value-text.d.ts +29 -0
- package/dist/components/date-picker/date-picker-value-text.js +26 -0
- package/dist/components/date-picker/date-picker.anatomy.cjs +1 -1
- package/dist/components/date-picker/date-picker.anatomy.d.cts +1 -1
- package/dist/components/date-picker/date-picker.anatomy.d.ts +1 -1
- package/dist/components/date-picker/date-picker.anatomy.js +1 -1
- package/dist/components/date-picker/date-picker.cjs +2 -0
- package/dist/components/date-picker/date-picker.d.cts +1 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.js +1 -0
- package/dist/components/date-picker/index.cjs +6 -4
- package/dist/components/date-picker/index.d.cts +1 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/dialog/index.cjs +4 -4
- package/dist/components/editable/index.cjs +4 -4
- package/dist/components/fieldset/use-fieldset.cjs +5 -0
- 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 +5 -0
- package/dist/components/file-upload/file-upload-root.cjs +1 -0
- package/dist/components/file-upload/file-upload-root.js +1 -0
- package/dist/components/file-upload/index.cjs +4 -4
- package/dist/components/floating-panel/index.cjs +4 -4
- package/dist/components/hover-card/index.cjs +4 -4
- package/dist/components/image-cropper/index.cjs +4 -4
- package/dist/components/index.cjs +199 -141
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +23 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.cjs +4 -1
- package/dist/components/json-tree-view/json-tree-view-root-provider.d.cts +3 -1
- package/dist/components/json-tree-view/json-tree-view-root-provider.d.ts +3 -1
- package/dist/components/json-tree-view/json-tree-view-root-provider.js +4 -1
- package/dist/components/json-tree-view/use-json-tree-view.cjs +12 -2
- package/dist/components/json-tree-view/use-json-tree-view.d.cts +4 -2
- package/dist/components/json-tree-view/use-json-tree-view.d.ts +4 -2
- package/dist/components/json-tree-view/use-json-tree-view.js +13 -3
- package/dist/components/marquee/index.cjs +4 -4
- package/dist/components/menu/index.cjs +4 -4
- 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 +25 -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 +21 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.cjs +34 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.d.cts +7 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.d.ts +7 -0
- package/dist/components/navigation-menu/navigation-menu-viewport.js +30 -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-viewport-props-context.cjs +16 -0
- package/dist/components/navigation-menu/use-navigation-menu-viewport-props-context.d.cts +3 -0
- package/dist/components/navigation-menu/use-navigation-menu-viewport-props-context.d.ts +3 -0
- package/dist/components/navigation-menu/use-navigation-menu-viewport-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/index.cjs +4 -4
- 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 +8 -4
- 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/password-input/index.cjs +4 -4
- package/dist/components/pin-input/index.cjs +4 -4
- package/dist/components/popover/index.cjs +4 -4
- package/dist/components/progress/examples/circular/with-label.d.cts +1 -0
- package/dist/components/progress/examples/circular/with-label.d.ts +1 -0
- package/dist/components/progress/index.cjs +4 -4
- 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/scroll-area/index.cjs +4 -4
- 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/select/index.cjs +4 -4
- package/dist/components/signature-pad/index.cjs +4 -4
- package/dist/components/slider/index.cjs +4 -4
- package/dist/components/slider/slider-root.cjs +1 -1
- package/dist/components/slider/slider-root.js +1 -1
- package/dist/components/splitter/index.cjs +5 -5
- package/dist/components/steps/index.cjs +4 -4
- package/dist/components/steps/steps-root.cjs +4 -1
- package/dist/components/steps/steps-root.js +4 -1
- package/dist/components/tabs/index.cjs +4 -4
- package/dist/components/tags-input/index.cjs +4 -4
- package/dist/components/tags-input/tags-input-root.cjs +1 -0
- package/dist/components/tags-input/tags-input-root.js +1 -0
- package/dist/components/timer/index.cjs +4 -4
- package/dist/components/toast/index.cjs +4 -4
- package/dist/components/toggle-group/index.cjs +4 -4
- package/dist/components/tooltip/index.cjs +4 -4
- package/dist/components/tour/index.cjs +15 -0
- package/dist/components/tour/index.d.cts +3 -1
- package/dist/components/tour/index.d.ts +3 -1
- package/dist/components/tour/index.js +2 -0
- package/dist/components/tour/wait-for-event.cjs +26 -0
- package/dist/components/tour/wait-for-event.d.cts +6 -0
- package/dist/components/tour/wait-for-event.d.ts +6 -0
- package/dist/components/tour/wait-for-event.js +22 -0
- package/dist/components/tree-view/index.cjs +4 -4
- 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 +199 -141
- package/dist/index.js +23 -0
- package/package.json +80 -78
- package/dist/components/progress/examples/circular/value-text.d.cts +0 -1
- package/dist/components/progress/examples/circular/value-text.d.ts +0 -1
|
@@ -28,6 +28,7 @@ export * from './json-tree-view';
|
|
|
28
28
|
export * from './listbox';
|
|
29
29
|
export * from './marquee';
|
|
30
30
|
export * from './menu';
|
|
31
|
+
export * from './navigation-menu';
|
|
31
32
|
export * from './number-input';
|
|
32
33
|
export * from './pagination';
|
|
33
34
|
export * from './password-input';
|
|
@@ -28,6 +28,7 @@ export * from './json-tree-view';
|
|
|
28
28
|
export * from './listbox';
|
|
29
29
|
export * from './marquee';
|
|
30
30
|
export * from './menu';
|
|
31
|
+
export * from './navigation-menu';
|
|
31
32
|
export * from './number-input';
|
|
32
33
|
export * from './pagination';
|
|
33
34
|
export * from './password-input';
|
package/dist/components/index.js
CHANGED
|
@@ -181,6 +181,7 @@ export { DatePickerPositioner } from './date-picker/date-picker-positioner.js';
|
|
|
181
181
|
export { DatePickerPresetTrigger } from './date-picker/date-picker-preset-trigger.js';
|
|
182
182
|
export { DatePickerPrevTrigger } from './date-picker/date-picker-prev-trigger.js';
|
|
183
183
|
export { DatePickerRangeText } from './date-picker/date-picker-range-text.js';
|
|
184
|
+
export { DatePickerValueText } from './date-picker/date-picker-value-text.js';
|
|
184
185
|
export { DatePickerRoot } from './date-picker/date-picker-root.js';
|
|
185
186
|
export { DatePickerRootProvider } from './date-picker/date-picker-root-provider.js';
|
|
186
187
|
export { DatePickerTable } from './date-picker/date-picker-table.js';
|
|
@@ -390,6 +391,23 @@ export { useMenuContext } from './menu/use-menu-context.js';
|
|
|
390
391
|
export { useMenuItemContext } from './menu/use-menu-item-context.js';
|
|
391
392
|
import * as menu from './menu/menu.js';
|
|
392
393
|
export { menu as Menu };
|
|
394
|
+
export { NavigationMenuArrow } from './navigation-menu/navigation-menu-arrow.js';
|
|
395
|
+
export { NavigationMenuContent } from './navigation-menu/navigation-menu-content.js';
|
|
396
|
+
export { NavigationMenuContext } from './navigation-menu/navigation-menu-context.js';
|
|
397
|
+
export { NavigationMenuIndicator } from './navigation-menu/navigation-menu-indicator.js';
|
|
398
|
+
export { NavigationMenuItem } from './navigation-menu/navigation-menu-item.js';
|
|
399
|
+
export { NavigationMenuItemIndicator } from './navigation-menu/navigation-menu-item-indicator.js';
|
|
400
|
+
export { NavigationMenuLink } from './navigation-menu/navigation-menu-link.js';
|
|
401
|
+
export { NavigationMenuList } from './navigation-menu/navigation-menu-list.js';
|
|
402
|
+
export { NavigationMenuRoot } from './navigation-menu/navigation-menu-root.js';
|
|
403
|
+
export { NavigationMenuRootProvider } from './navigation-menu/navigation-menu-root-provider.js';
|
|
404
|
+
export { NavigationMenuTrigger } from './navigation-menu/navigation-menu-trigger.js';
|
|
405
|
+
export { NavigationMenuViewport } from './navigation-menu/navigation-menu-viewport.js';
|
|
406
|
+
export { NavigationMenuViewportPositioner } from './navigation-menu/navigation-menu-viewport-positioner.js';
|
|
407
|
+
export { useNavigationMenu } from './navigation-menu/use-navigation-menu.js';
|
|
408
|
+
export { useNavigationMenuContext } from './navigation-menu/use-navigation-menu-context.js';
|
|
409
|
+
import * as navigationMenu from './navigation-menu/navigation-menu.js';
|
|
410
|
+
export { navigationMenu as NavigationMenu };
|
|
393
411
|
export { NumberInputContext } from './number-input/number-input-context.js';
|
|
394
412
|
export { NumberInputControl } from './number-input/number-input-control.js';
|
|
395
413
|
export { NumberInputDecrementTrigger } from './number-input/number-input-decrement-trigger.js';
|
|
@@ -406,7 +424,9 @@ import * as numberInput from './number-input/number-input.js';
|
|
|
406
424
|
export { numberInput as NumberInput };
|
|
407
425
|
export { PaginationContext } from './pagination/pagination-context.js';
|
|
408
426
|
export { PaginationEllipsis } from './pagination/pagination-ellipsis.js';
|
|
427
|
+
export { PaginationFirstTrigger } from './pagination/pagination-first-trigger.js';
|
|
409
428
|
export { PaginationItem } from './pagination/pagination-item.js';
|
|
429
|
+
export { PaginationLastTrigger } from './pagination/pagination-last-trigger.js';
|
|
410
430
|
export { PaginationNextTrigger } from './pagination/pagination-next-trigger.js';
|
|
411
431
|
export { PaginationPrevTrigger } from './pagination/pagination-prev-trigger.js';
|
|
412
432
|
export { PaginationRoot } from './pagination/pagination-root.js';
|
|
@@ -718,6 +738,8 @@ export { useTooltip } from './tooltip/use-tooltip.js';
|
|
|
718
738
|
export { useTooltipContext } from './tooltip/use-tooltip-context.js';
|
|
719
739
|
import * as tooltip from './tooltip/tooltip.js';
|
|
720
740
|
export { tooltip as Tooltip };
|
|
741
|
+
export { waitForElement, waitForElementValue, waitForPromise } from '@zag-js/tour';
|
|
742
|
+
export { waitForEvent } from './tour/wait-for-event.js';
|
|
721
743
|
export { TourActionTrigger } from './tour/tour-action-trigger.js';
|
|
722
744
|
export { TourActions } from './tour/tour-actions.js';
|
|
723
745
|
export { TourArrow } from './tour/tour-arrow.js';
|
|
@@ -777,6 +799,7 @@ export { anatomy as hoverCardAnatomy } from '@zag-js/hover-card';
|
|
|
777
799
|
export { anatomy as imageCropperAnatomy } from '@zag-js/image-cropper';
|
|
778
800
|
export { anatomy as marqueeAnatomy } from '@zag-js/marquee';
|
|
779
801
|
export { anatomy as menuAnatomy } from '@zag-js/menu';
|
|
802
|
+
export { anatomy as navigationMenuAnatomy } from '@zag-js/navigation-menu';
|
|
780
803
|
export { anatomy as numberInputAnatomy } from '@zag-js/number-input';
|
|
781
804
|
export { anatomy as paginationAnatomy } from '@zag-js/pagination';
|
|
782
805
|
export { anatomy as passwordInputAnatomy } from '@zag-js/password-input';
|
|
@@ -6,9 +6,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
6
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
const react = require('react');
|
|
8
8
|
const treeViewRootProvider = require('../tree-view/tree-view-root-provider.cjs');
|
|
9
|
+
const jsonTreeViewPropsContext = require('./json-tree-view-props-context.cjs');
|
|
9
10
|
|
|
10
11
|
const JsonTreeViewRootProvider = react.forwardRef((props, ref) => {
|
|
11
|
-
|
|
12
|
+
const { value, ...restProps } = props;
|
|
13
|
+
const { options, ...treeView$1 } = value;
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsonTreeViewPropsContext.JsonTreeViewPropsProvider, { value: options, children: /* @__PURE__ */ jsxRuntime.jsx(treeViewRootProvider.TreeViewRootProvider, { "data-scope": "json-tree-view", value: treeView$1, ...restProps, ref }) });
|
|
12
15
|
});
|
|
13
16
|
JsonTreeViewRootProvider.displayName = "JsonTreeViewRootProvider";
|
|
14
17
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
2
|
import { TreeView } from '../tree-view';
|
|
3
|
+
import { UseJsonTreeViewReturn } from './use-json-tree-view';
|
|
3
4
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
-
export interface JsonTreeViewRootProviderProps extends TreeView.RootProviderProps<JsonNode> {
|
|
5
|
+
export interface JsonTreeViewRootProviderProps extends Omit<TreeView.RootProviderProps<JsonNode>, 'value'> {
|
|
6
|
+
value: UseJsonTreeViewReturn;
|
|
5
7
|
}
|
|
6
8
|
export declare const JsonTreeViewRootProvider: ForwardRefExoticComponent<JsonTreeViewRootProviderProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
2
|
import { TreeView } from '../tree-view';
|
|
3
|
+
import { UseJsonTreeViewReturn } from './use-json-tree-view';
|
|
3
4
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
-
export interface JsonTreeViewRootProviderProps extends TreeView.RootProviderProps<JsonNode> {
|
|
5
|
+
export interface JsonTreeViewRootProviderProps extends Omit<TreeView.RootProviderProps<JsonNode>, 'value'> {
|
|
6
|
+
value: UseJsonTreeViewReturn;
|
|
5
7
|
}
|
|
6
8
|
export declare const JsonTreeViewRootProvider: ForwardRefExoticComponent<JsonTreeViewRootProviderProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { TreeViewRootProvider } from '../tree-view/tree-view-root-provider.js';
|
|
5
|
+
import { JsonTreeViewPropsProvider } from './json-tree-view-props-context.js';
|
|
5
6
|
|
|
6
7
|
const JsonTreeViewRootProvider = forwardRef((props, ref) => {
|
|
7
|
-
|
|
8
|
+
const { value, ...restProps } = props;
|
|
9
|
+
const { options, ...treeView$1 } = value;
|
|
10
|
+
return /* @__PURE__ */ jsx(JsonTreeViewPropsProvider, { value: options, children: /* @__PURE__ */ jsx(TreeViewRootProvider, { "data-scope": "json-tree-view", value: treeView$1, ...restProps, ref }) });
|
|
8
11
|
});
|
|
9
12
|
JsonTreeViewRootProvider.displayName = "JsonTreeViewRootProvider";
|
|
10
13
|
|
|
@@ -5,12 +5,21 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
|
|
6
6
|
const jsonTreeUtils = require('@zag-js/json-tree-utils');
|
|
7
7
|
const react = require('react');
|
|
8
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
8
9
|
const treeCollection = require('../collection/tree-collection.cjs');
|
|
9
10
|
const useTreeView = require('../tree-view/use-tree-view.cjs');
|
|
10
11
|
const getBranchValue = require('./get-branch-value.cjs');
|
|
11
12
|
|
|
13
|
+
const splitJsonTreeViewProps = createSplitProps.createSplitProps();
|
|
12
14
|
const useJsonTreeView = (props) => {
|
|
13
|
-
const
|
|
15
|
+
const [jsonTreeProps, localProps] = splitJsonTreeViewProps(props, [
|
|
16
|
+
"maxPreviewItems",
|
|
17
|
+
"collapseStringsAfterLength",
|
|
18
|
+
"quotesOnKeys",
|
|
19
|
+
"groupArraysAfterLength",
|
|
20
|
+
"showNonenumerable"
|
|
21
|
+
]);
|
|
22
|
+
const { data, defaultExpandedDepth = 1, ...restProps } = localProps;
|
|
14
23
|
const collection = react.useMemo(() => {
|
|
15
24
|
return treeCollection.createTreeCollection({
|
|
16
25
|
nodeToValue: jsonTreeUtils.nodeToValue,
|
|
@@ -21,12 +30,13 @@ const useJsonTreeView = (props) => {
|
|
|
21
30
|
const defaultExpandedValue = react.useMemo(() => {
|
|
22
31
|
return defaultExpandedDepth != null ? getBranchValue.getBranchValues(collection, defaultExpandedDepth) : void 0;
|
|
23
32
|
}, [collection, defaultExpandedDepth]);
|
|
24
|
-
|
|
33
|
+
const treeView = useTreeView.useTreeView({
|
|
25
34
|
defaultExpandedValue,
|
|
26
35
|
...restProps,
|
|
27
36
|
collection,
|
|
28
37
|
typeahead: false
|
|
29
38
|
});
|
|
39
|
+
return { ...treeView, options: jsonTreeProps };
|
|
30
40
|
};
|
|
31
41
|
|
|
32
42
|
exports.useJsonTreeView = useJsonTreeView;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
2
|
import { UseTreeViewProps, UseTreeViewReturn } from '../tree-view';
|
|
3
|
-
|
|
3
|
+
import { JsonTreeViewOptions } from './json-tree-view-props-context';
|
|
4
|
+
export interface UseJsonTreeViewProps extends Omit<UseTreeViewProps<JsonNode>, 'collection'>, JsonTreeViewOptions {
|
|
4
5
|
data: unknown;
|
|
5
6
|
defaultExpandedDepth?: number;
|
|
6
7
|
}
|
|
7
8
|
export interface UseJsonTreeViewReturn extends UseTreeViewReturn<JsonNode> {
|
|
9
|
+
options: JsonTreeViewOptions;
|
|
8
10
|
}
|
|
9
|
-
export declare const useJsonTreeView: (props: UseJsonTreeViewProps) =>
|
|
11
|
+
export declare const useJsonTreeView: (props: UseJsonTreeViewProps) => UseJsonTreeViewReturn;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
2
|
import { UseTreeViewProps, UseTreeViewReturn } from '../tree-view';
|
|
3
|
-
|
|
3
|
+
import { JsonTreeViewOptions } from './json-tree-view-props-context';
|
|
4
|
+
export interface UseJsonTreeViewProps extends Omit<UseTreeViewProps<JsonNode>, 'collection'>, JsonTreeViewOptions {
|
|
4
5
|
data: unknown;
|
|
5
6
|
defaultExpandedDepth?: number;
|
|
6
7
|
}
|
|
7
8
|
export interface UseJsonTreeViewReturn extends UseTreeViewReturn<JsonNode> {
|
|
9
|
+
options: JsonTreeViewOptions;
|
|
8
10
|
}
|
|
9
|
-
export declare const useJsonTreeView: (props: UseJsonTreeViewProps) =>
|
|
11
|
+
export declare const useJsonTreeView: (props: UseJsonTreeViewProps) => UseJsonTreeViewReturn;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { nodeToString, nodeToValue, getRootNode } from '@zag-js/json-tree-utils';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
4
5
|
import { createTreeCollection } from '../collection/tree-collection.js';
|
|
5
6
|
import { useTreeView } from '../tree-view/use-tree-view.js';
|
|
6
7
|
import { getBranchValues } from './get-branch-value.js';
|
|
7
8
|
|
|
9
|
+
const splitJsonTreeViewProps = createSplitProps();
|
|
8
10
|
const useJsonTreeView = (props) => {
|
|
9
|
-
const
|
|
11
|
+
const [jsonTreeProps, localProps] = splitJsonTreeViewProps(props, [
|
|
12
|
+
"maxPreviewItems",
|
|
13
|
+
"collapseStringsAfterLength",
|
|
14
|
+
"quotesOnKeys",
|
|
15
|
+
"groupArraysAfterLength",
|
|
16
|
+
"showNonenumerable"
|
|
17
|
+
]);
|
|
18
|
+
const { data, defaultExpandedDepth = 1, ...restProps } = localProps;
|
|
10
19
|
const collection = useMemo(() => {
|
|
11
20
|
return createTreeCollection({
|
|
12
21
|
nodeToValue,
|
|
@@ -17,12 +26,13 @@ const useJsonTreeView = (props) => {
|
|
|
17
26
|
const defaultExpandedValue = useMemo(() => {
|
|
18
27
|
return defaultExpandedDepth != null ? getBranchValues(collection, defaultExpandedDepth) : void 0;
|
|
19
28
|
}, [collection, defaultExpandedDepth]);
|
|
20
|
-
|
|
29
|
+
const treeView = useTreeView({
|
|
21
30
|
defaultExpandedValue,
|
|
22
31
|
...restProps,
|
|
23
32
|
collection,
|
|
24
33
|
typeahead: false
|
|
25
34
|
});
|
|
35
|
+
return { ...treeView, options: jsonTreeProps };
|
|
26
36
|
};
|
|
27
37
|
|
|
28
38
|
export { useJsonTreeView };
|
|
@@ -11,8 +11,8 @@ const marqueeRootProvider = require('./marquee-root-provider.cjs');
|
|
|
11
11
|
const marqueeViewport = require('./marquee-viewport.cjs');
|
|
12
12
|
const useMarquee = require('./use-marquee.cjs');
|
|
13
13
|
const useMarqueeContext = require('./use-marquee-context.cjs');
|
|
14
|
-
const marquee
|
|
15
|
-
const marquee = require('@zag-js/marquee');
|
|
14
|
+
const marquee = require('./marquee.cjs');
|
|
15
|
+
const marquee$1 = require('@zag-js/marquee');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -25,8 +25,8 @@ exports.MarqueeRootProvider = marqueeRootProvider.MarqueeRootProvider;
|
|
|
25
25
|
exports.MarqueeViewport = marqueeViewport.MarqueeViewport;
|
|
26
26
|
exports.useMarquee = useMarquee.useMarquee;
|
|
27
27
|
exports.useMarqueeContext = useMarqueeContext.useMarqueeContext;
|
|
28
|
-
exports.Marquee = marquee
|
|
28
|
+
exports.Marquee = marquee;
|
|
29
29
|
Object.defineProperty(exports, "marqueeAnatomy", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: () => marquee.anatomy
|
|
31
|
+
get: () => marquee$1.anatomy
|
|
32
32
|
});
|
|
@@ -26,8 +26,8 @@ const menuTriggerItem = require('./menu-trigger-item.cjs');
|
|
|
26
26
|
const useMenu = require('./use-menu.cjs');
|
|
27
27
|
const useMenuContext = require('./use-menu-context.cjs');
|
|
28
28
|
const useMenuItemContext = require('./use-menu-item-context.cjs');
|
|
29
|
-
const menu
|
|
30
|
-
const menu = require('@zag-js/menu');
|
|
29
|
+
const menu = require('./menu.cjs');
|
|
30
|
+
const menu$1 = require('@zag-js/menu');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -55,8 +55,8 @@ exports.MenuTriggerItem = menuTriggerItem.MenuTriggerItem;
|
|
|
55
55
|
exports.useMenu = useMenu.useMenu;
|
|
56
56
|
exports.useMenuContext = useMenuContext.useMenuContext;
|
|
57
57
|
exports.useMenuItemContext = useMenuItemContext.useMenuItemContext;
|
|
58
|
-
exports.Menu = menu
|
|
58
|
+
exports.Menu = menu;
|
|
59
59
|
Object.defineProperty(exports, "menuAnatomy", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: () => menu.anatomy
|
|
61
|
+
get: () => menu$1.anatomy
|
|
62
62
|
});
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
const useNavigationMenu = require('./use-navigation-menu.cjs');
|
|
19
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
20
|
+
const navigationMenu = require('./navigation-menu.cjs');
|
|
21
|
+
const navigationMenu$1 = require('@zag-js/navigation-menu');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.NavigationMenuArrow = navigationMenuArrow.NavigationMenuArrow;
|
|
26
|
+
exports.NavigationMenuContent = navigationMenuContent.NavigationMenuContent;
|
|
27
|
+
exports.NavigationMenuContext = navigationMenuContext.NavigationMenuContext;
|
|
28
|
+
exports.NavigationMenuIndicator = navigationMenuIndicator.NavigationMenuIndicator;
|
|
29
|
+
exports.NavigationMenuItem = navigationMenuItem.NavigationMenuItem;
|
|
30
|
+
exports.NavigationMenuItemIndicator = navigationMenuItemIndicator.NavigationMenuItemIndicator;
|
|
31
|
+
exports.NavigationMenuLink = navigationMenuLink.NavigationMenuLink;
|
|
32
|
+
exports.NavigationMenuList = navigationMenuList.NavigationMenuList;
|
|
33
|
+
exports.NavigationMenuRoot = navigationMenuRoot.NavigationMenuRoot;
|
|
34
|
+
exports.NavigationMenuRootProvider = navigationMenuRootProvider.NavigationMenuRootProvider;
|
|
35
|
+
exports.NavigationMenuTrigger = navigationMenuTrigger.NavigationMenuTrigger;
|
|
36
|
+
exports.NavigationMenuViewport = navigationMenuViewport.NavigationMenuViewport;
|
|
37
|
+
exports.NavigationMenuViewportPositioner = navigationMenuViewportPositioner.NavigationMenuViewportPositioner;
|
|
38
|
+
exports.useNavigationMenu = useNavigationMenu.useNavigationMenu;
|
|
39
|
+
exports.useNavigationMenuContext = useNavigationMenuContext.useNavigationMenuContext;
|
|
40
|
+
exports.NavigationMenu = navigationMenu;
|
|
41
|
+
Object.defineProperty(exports, "navigationMenuAnatomy", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: () => navigationMenu$1.anatomy
|
|
44
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { ValueChangeDetails as NavigationMenuValueChangeDetails } from '@zag-js/navigation-menu';
|
|
2
|
+
export { NavigationMenuArrow, type NavigationMenuArrowBaseProps, type NavigationMenuArrowProps, } from './navigation-menu-arrow';
|
|
3
|
+
export { NavigationMenuContent, type NavigationMenuContentBaseProps, type NavigationMenuContentProps, } from './navigation-menu-content';
|
|
4
|
+
export { NavigationMenuContext, type NavigationMenuContextProps } from './navigation-menu-context';
|
|
5
|
+
export { NavigationMenuIndicator, type NavigationMenuIndicatorBaseProps, type NavigationMenuIndicatorProps, } from './navigation-menu-indicator';
|
|
6
|
+
export { NavigationMenuItem, type NavigationMenuItemBaseProps, type NavigationMenuItemProps, } from './navigation-menu-item';
|
|
7
|
+
export { NavigationMenuItemIndicator, type NavigationMenuItemIndicatorBaseProps, type NavigationMenuItemIndicatorProps, } from './navigation-menu-item-indicator';
|
|
8
|
+
export { NavigationMenuLink, type NavigationMenuLinkBaseProps, type NavigationMenuLinkProps, } from './navigation-menu-link';
|
|
9
|
+
export { NavigationMenuList, type NavigationMenuListBaseProps, type NavigationMenuListProps, } from './navigation-menu-list';
|
|
10
|
+
export { NavigationMenuRoot, type NavigationMenuRootBaseProps, type NavigationMenuRootProps, } from './navigation-menu-root';
|
|
11
|
+
export { NavigationMenuRootProvider, type NavigationMenuRootProviderBaseProps, type NavigationMenuRootProviderProps, } from './navigation-menu-root-provider';
|
|
12
|
+
export { NavigationMenuTrigger, type NavigationMenuTriggerBaseProps, type NavigationMenuTriggerProps, } from './navigation-menu-trigger';
|
|
13
|
+
export { NavigationMenuViewport, type NavigationMenuViewportBaseProps, type NavigationMenuViewportProps, } from './navigation-menu-viewport';
|
|
14
|
+
export { NavigationMenuViewportPositioner, type NavigationMenuViewportPositionerBaseProps, type NavigationMenuViewportPositionerProps, } from './navigation-menu-viewport-positioner';
|
|
15
|
+
export { navigationMenuAnatomy } from './navigation-menu.anatomy';
|
|
16
|
+
export { useNavigationMenu, type UseNavigationMenuProps, type UseNavigationMenuReturn } from './use-navigation-menu';
|
|
17
|
+
export { useNavigationMenuContext, type UseNavigationMenuContext } from './use-navigation-menu-context';
|
|
18
|
+
export * as NavigationMenu from './navigation-menu';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { ValueChangeDetails as NavigationMenuValueChangeDetails } from '@zag-js/navigation-menu';
|
|
2
|
+
export { NavigationMenuArrow, type NavigationMenuArrowBaseProps, type NavigationMenuArrowProps, } from './navigation-menu-arrow';
|
|
3
|
+
export { NavigationMenuContent, type NavigationMenuContentBaseProps, type NavigationMenuContentProps, } from './navigation-menu-content';
|
|
4
|
+
export { NavigationMenuContext, type NavigationMenuContextProps } from './navigation-menu-context';
|
|
5
|
+
export { NavigationMenuIndicator, type NavigationMenuIndicatorBaseProps, type NavigationMenuIndicatorProps, } from './navigation-menu-indicator';
|
|
6
|
+
export { NavigationMenuItem, type NavigationMenuItemBaseProps, type NavigationMenuItemProps, } from './navigation-menu-item';
|
|
7
|
+
export { NavigationMenuItemIndicator, type NavigationMenuItemIndicatorBaseProps, type NavigationMenuItemIndicatorProps, } from './navigation-menu-item-indicator';
|
|
8
|
+
export { NavigationMenuLink, type NavigationMenuLinkBaseProps, type NavigationMenuLinkProps, } from './navigation-menu-link';
|
|
9
|
+
export { NavigationMenuList, type NavigationMenuListBaseProps, type NavigationMenuListProps, } from './navigation-menu-list';
|
|
10
|
+
export { NavigationMenuRoot, type NavigationMenuRootBaseProps, type NavigationMenuRootProps, } from './navigation-menu-root';
|
|
11
|
+
export { NavigationMenuRootProvider, type NavigationMenuRootProviderBaseProps, type NavigationMenuRootProviderProps, } from './navigation-menu-root-provider';
|
|
12
|
+
export { NavigationMenuTrigger, type NavigationMenuTriggerBaseProps, type NavigationMenuTriggerProps, } from './navigation-menu-trigger';
|
|
13
|
+
export { NavigationMenuViewport, type NavigationMenuViewportBaseProps, type NavigationMenuViewportProps, } from './navigation-menu-viewport';
|
|
14
|
+
export { NavigationMenuViewportPositioner, type NavigationMenuViewportPositionerBaseProps, type NavigationMenuViewportPositionerProps, } from './navigation-menu-viewport-positioner';
|
|
15
|
+
export { navigationMenuAnatomy } from './navigation-menu.anatomy';
|
|
16
|
+
export { useNavigationMenu, type UseNavigationMenuProps, type UseNavigationMenuReturn } from './use-navigation-menu';
|
|
17
|
+
export { useNavigationMenuContext, type UseNavigationMenuContext } from './use-navigation-menu-context';
|
|
18
|
+
export * as NavigationMenu from './navigation-menu';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { NavigationMenuArrow } from './navigation-menu-arrow.js';
|
|
2
|
+
export { NavigationMenuContent } from './navigation-menu-content.js';
|
|
3
|
+
export { NavigationMenuContext } from './navigation-menu-context.js';
|
|
4
|
+
export { NavigationMenuIndicator } from './navigation-menu-indicator.js';
|
|
5
|
+
export { NavigationMenuItem } from './navigation-menu-item.js';
|
|
6
|
+
export { NavigationMenuItemIndicator } from './navigation-menu-item-indicator.js';
|
|
7
|
+
export { NavigationMenuLink } from './navigation-menu-link.js';
|
|
8
|
+
export { NavigationMenuList } from './navigation-menu-list.js';
|
|
9
|
+
export { NavigationMenuRoot } from './navigation-menu-root.js';
|
|
10
|
+
export { NavigationMenuRootProvider } from './navigation-menu-root-provider.js';
|
|
11
|
+
export { NavigationMenuTrigger } from './navigation-menu-trigger.js';
|
|
12
|
+
export { NavigationMenuViewport } from './navigation-menu-viewport.js';
|
|
13
|
+
export { NavigationMenuViewportPositioner } from './navigation-menu-viewport-positioner.js';
|
|
14
|
+
export { useNavigationMenu } from './use-navigation-menu.js';
|
|
15
|
+
export { useNavigationMenuContext } from './use-navigation-menu-context.js';
|
|
16
|
+
import * as navigationMenu from './navigation-menu.js';
|
|
17
|
+
export { navigationMenu as NavigationMenu };
|
|
18
|
+
export { anatomy as navigationMenuAnatomy } from '@zag-js/navigation-menu';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
11
|
+
|
|
12
|
+
const NavigationMenuArrow = react.forwardRef((props, ref) => {
|
|
13
|
+
const navigationMenu = useNavigationMenuContext.useNavigationMenuContext();
|
|
14
|
+
const mergedProps = react$1.mergeProps(navigationMenu.getArrowProps(), props);
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
|
|
16
|
+
});
|
|
17
|
+
NavigationMenuArrow.displayName = "NavigationMenuArrow";
|
|
18
|
+
|
|
19
|
+
exports.NavigationMenuArrow = NavigationMenuArrow;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface NavigationMenuArrowBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface NavigationMenuArrowProps extends HTMLProps<'div'>, NavigationMenuArrowBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const NavigationMenuArrow: ForwardRefExoticComponent<NavigationMenuArrowProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface NavigationMenuArrowBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface NavigationMenuArrowProps extends HTMLProps<'div'>, NavigationMenuArrowBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const NavigationMenuArrow: ForwardRefExoticComponent<NavigationMenuArrowProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { useNavigationMenuContext } from './use-navigation-menu-context.js';
|
|
7
|
+
|
|
8
|
+
const NavigationMenuArrow = forwardRef((props, ref) => {
|
|
9
|
+
const navigationMenu = useNavigationMenuContext();
|
|
10
|
+
const mergedProps = mergeProps(navigationMenu.getArrowProps(), props);
|
|
11
|
+
return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
|
|
12
|
+
});
|
|
13
|
+
NavigationMenuArrow.displayName = "NavigationMenuArrow";
|
|
14
|
+
|
|
15
|
+
export { NavigationMenuArrow };
|
|
@@ -0,0 +1,41 @@
|
|
|
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 portal = require('../portal/portal.cjs');
|
|
14
|
+
const usePresence = require('../presence/use-presence.cjs');
|
|
15
|
+
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
16
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
17
|
+
const useNavigationMenuItemPropsContext = require('./use-navigation-menu-item-props-context.cjs');
|
|
18
|
+
|
|
19
|
+
const splitContentProps = createSplitProps.createSplitProps();
|
|
20
|
+
const NavigationMenuContent = react.forwardRef((props, ref) => {
|
|
21
|
+
const api = useNavigationMenuContext.useNavigationMenuContext();
|
|
22
|
+
const itemContext = useNavigationMenuItemPropsContext.useNavigationMenuItemPropsContext();
|
|
23
|
+
const value = props.value ?? itemContext?.value;
|
|
24
|
+
const [contentProps, localProps] = splitContentProps({ ...props, value }, ["value"]);
|
|
25
|
+
const renderStrategyProps = renderStrategy.useRenderStrategyPropsContext();
|
|
26
|
+
const presence = usePresence.usePresence({ ...renderStrategyProps, present: api.value === value });
|
|
27
|
+
const mergedProps = react$1.mergeProps(api.getContentProps(contentProps), presence.getPresenceProps(), localProps);
|
|
28
|
+
const content = /* @__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
|
+
const viewportNode = api.getViewportNode();
|
|
30
|
+
if (api.isViewportRendered && viewportNode) {
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ...api.getViewportProxyProps(contentProps) }),
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ...api.getTriggerProxyProps(contentProps) }),
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx(portal.Portal, { container: { current: viewportNode }, children: content })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
return content;
|
|
38
|
+
});
|
|
39
|
+
NavigationMenuContent.displayName = "NavigationMenuContent";
|
|
40
|
+
|
|
41
|
+
exports.NavigationMenuContent = NavigationMenuContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContentProps } 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 NavigationMenuContentBaseProps extends Partial<ContentProps>, PolymorphicProps {
|
|
6
|
+
}
|
|
7
|
+
export interface NavigationMenuContentProps extends Assign<HTMLProps<'div'>, NavigationMenuContentBaseProps> {
|
|
8
|
+
}
|
|
9
|
+
export declare const NavigationMenuContent: ForwardRefExoticComponent<NavigationMenuContentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContentProps } 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 NavigationMenuContentBaseProps extends Partial<ContentProps>, PolymorphicProps {
|
|
6
|
+
}
|
|
7
|
+
export interface NavigationMenuContentProps extends Assign<HTMLProps<'div'>, NavigationMenuContentBaseProps> {
|
|
8
|
+
}
|
|
9
|
+
export declare const NavigationMenuContent: ForwardRefExoticComponent<NavigationMenuContentProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs, Fragment } 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 { Portal } from '../portal/portal.js';
|
|
10
|
+
import { usePresence } from '../presence/use-presence.js';
|
|
11
|
+
import { PresenceProvider } from '../presence/use-presence-context.js';
|
|
12
|
+
import { useNavigationMenuContext } from './use-navigation-menu-context.js';
|
|
13
|
+
import { useNavigationMenuItemPropsContext } from './use-navigation-menu-item-props-context.js';
|
|
14
|
+
|
|
15
|
+
const splitContentProps = createSplitProps();
|
|
16
|
+
const NavigationMenuContent = forwardRef((props, ref) => {
|
|
17
|
+
const api = useNavigationMenuContext();
|
|
18
|
+
const itemContext = useNavigationMenuItemPropsContext();
|
|
19
|
+
const value = props.value ?? itemContext?.value;
|
|
20
|
+
const [contentProps, localProps] = splitContentProps({ ...props, value }, ["value"]);
|
|
21
|
+
const renderStrategyProps = useRenderStrategyPropsContext();
|
|
22
|
+
const presence = usePresence({ ...renderStrategyProps, present: api.value === value });
|
|
23
|
+
const mergedProps = mergeProps(api.getContentProps(contentProps), presence.getPresenceProps(), localProps);
|
|
24
|
+
const content = /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children: presence.unmounted ? null : /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref: composeRefs(presence.ref, ref) }) });
|
|
25
|
+
const viewportNode = api.getViewportNode();
|
|
26
|
+
if (api.isViewportRendered && viewportNode) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx("div", { ...api.getViewportProxyProps(contentProps) }),
|
|
29
|
+
/* @__PURE__ */ jsx("div", { ...api.getTriggerProxyProps(contentProps) }),
|
|
30
|
+
/* @__PURE__ */ jsx(Portal, { container: { current: viewportNode }, children: content })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
return content;
|
|
34
|
+
});
|
|
35
|
+
NavigationMenuContent.displayName = "NavigationMenuContent";
|
|
36
|
+
|
|
37
|
+
export { NavigationMenuContent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
7
|
+
|
|
8
|
+
const NavigationMenuContext = (props) => props.children(useNavigationMenuContext.useNavigationMenuContext());
|
|
9
|
+
|
|
10
|
+
exports.NavigationMenuContext = NavigationMenuContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseNavigationMenuContext } from './use-navigation-menu-context';
|
|
3
|
+
export interface NavigationMenuContextProps {
|
|
4
|
+
children: (context: UseNavigationMenuContext) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const NavigationMenuContext: (props: NavigationMenuContextProps) => ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseNavigationMenuContext } from './use-navigation-menu-context';
|
|
3
|
+
export interface NavigationMenuContextProps {
|
|
4
|
+
children: (context: UseNavigationMenuContext) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const NavigationMenuContext: (props: NavigationMenuContextProps) => ReactNode;
|
|
@@ -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 composeRefs = require('../../utils/compose-refs.cjs');
|
|
10
|
+
const renderStrategy = require('../../utils/render-strategy.cjs');
|
|
11
|
+
const factory = require('../factory.cjs');
|
|
12
|
+
const usePresence = require('../presence/use-presence.cjs');
|
|
13
|
+
const usePresenceContext = require('../presence/use-presence-context.cjs');
|
|
14
|
+
const useNavigationMenuContext = require('./use-navigation-menu-context.cjs');
|
|
15
|
+
|
|
16
|
+
const NavigationMenuIndicator = react.forwardRef((props, ref) => {
|
|
17
|
+
const navigationMenu = useNavigationMenuContext.useNavigationMenuContext();
|
|
18
|
+
const renderStrategyProps = renderStrategy.useRenderStrategyPropsContext();
|
|
19
|
+
const presence = usePresence.usePresence({ ...renderStrategyProps, present: navigationMenu.open });
|
|
20
|
+
const mergedProps = react$1.mergeProps(navigationMenu.getIndicatorProps(), presence.getPresenceProps(), props);
|
|
21
|
+
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) }) });
|
|
22
|
+
});
|
|
23
|
+
NavigationMenuIndicator.displayName = "NavigationMenuIndicator";
|
|
24
|
+
|
|
25
|
+
exports.NavigationMenuIndicator = NavigationMenuIndicator;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLProps, PolymorphicProps } from '../factory';
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
export interface NavigationMenuIndicatorBaseProps extends PolymorphicProps {
|
|
4
|
+
}
|
|
5
|
+
export interface NavigationMenuIndicatorProps extends HTMLProps<'div'>, NavigationMenuIndicatorBaseProps {
|
|
6
|
+
}
|
|
7
|
+
export declare const NavigationMenuIndicator: ForwardRefExoticComponent<NavigationMenuIndicatorProps & RefAttributes<HTMLDivElement>>;
|