@yamada-ui/menu 1.2.1-dev-20240524124123 → 1.3.0-dev-20240527094142
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-XC57KMED.mjs → chunk-4TCOEKCC.mjs} +2 -2
- package/dist/{chunk-JVRMLEOK.mjs → chunk-AOZIU76G.mjs} +2 -2
- package/dist/{chunk-66RA5MSJ.mjs → chunk-COK5BGV5.mjs} +3 -3
- package/dist/{chunk-74RMGTSQ.mjs → chunk-HWCJQOGH.mjs} +2 -2
- package/dist/{chunk-UTYWCSIS.mjs → chunk-LNHCNVHB.mjs} +49 -25
- package/dist/chunk-LNHCNVHB.mjs.map +1 -0
- package/dist/chunk-Q4PSHEXP.mjs +46 -0
- package/dist/chunk-Q4PSHEXP.mjs.map +1 -0
- package/dist/{chunk-YBDOCC7O.mjs → chunk-TCN4S66S.mjs} +2 -2
- package/dist/context-menu-trigger.d.mts +7 -0
- package/dist/context-menu-trigger.d.ts +7 -0
- package/dist/context-menu-trigger.js +79 -0
- package/dist/context-menu-trigger.js.map +1 -0
- package/dist/context-menu-trigger.mjs +9 -0
- package/dist/context-menu-trigger.mjs.map +1 -0
- package/dist/context-menu.d.mts +21 -0
- package/dist/context-menu.d.ts +21 -0
- package/dist/context-menu.js +500 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/context-menu.mjs +10 -0
- package/dist/context-menu.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +165 -104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -10
- package/dist/menu-button.js.map +1 -1
- package/dist/menu-button.mjs +2 -2
- package/dist/menu-divider.js.map +1 -1
- package/dist/menu-divider.mjs +2 -2
- package/dist/menu-group.js.map +1 -1
- package/dist/menu-group.mjs +2 -2
- package/dist/menu-item.js.map +1 -1
- package/dist/menu-item.mjs +1 -1
- package/dist/menu-list.js.map +1 -1
- package/dist/menu-list.mjs +2 -2
- package/dist/menu-option-group.js.map +1 -1
- package/dist/menu-option-group.mjs +3 -3
- package/dist/menu.js +64 -49
- package/dist/menu.js.map +1 -1
- package/dist/menu.mjs +1 -1
- package/package.json +7 -7
- package/dist/chunk-UTYWCSIS.mjs.map +0 -1
- /package/dist/{chunk-XC57KMED.mjs.map → chunk-4TCOEKCC.mjs.map} +0 -0
- /package/dist/{chunk-JVRMLEOK.mjs.map → chunk-AOZIU76G.mjs.map} +0 -0
- /package/dist/{chunk-66RA5MSJ.mjs.map → chunk-COK5BGV5.mjs.map} +0 -0
- /package/dist/{chunk-74RMGTSQ.mjs.map → chunk-HWCJQOGH.mjs.map} +0 -0
- /package/dist/{chunk-YBDOCC7O.mjs.map → chunk-TCN4S66S.mjs.map} +0 -0
@@ -2,7 +2,7 @@
|
|
2
2
|
import {
|
3
3
|
useMenu,
|
4
4
|
useMenuDescendantsContext
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-LNHCNVHB.mjs";
|
6
6
|
|
7
7
|
// src/menu-list.tsx
|
8
8
|
import { forwardRef } from "@yamada-ui/core";
|
@@ -72,4 +72,4 @@ var MenuList = forwardRef(
|
|
72
72
|
export {
|
73
73
|
MenuList
|
74
74
|
};
|
75
|
-
//# sourceMappingURL=chunk-
|
75
|
+
//# sourceMappingURL=chunk-4TCOEKCC.mjs.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useMenu
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-LNHCNVHB.mjs";
|
5
5
|
|
6
6
|
// src/menu-group.tsx
|
7
7
|
import { ui, forwardRef } from "@yamada-ui/core";
|
@@ -38,4 +38,4 @@ var MenuGroup = forwardRef(
|
|
38
38
|
export {
|
39
39
|
MenuGroup
|
40
40
|
};
|
41
|
-
//# sourceMappingURL=chunk-
|
41
|
+
//# sourceMappingURL=chunk-AOZIU76G.mjs.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
MenuGroup
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-AOZIU76G.mjs";
|
5
5
|
import {
|
6
6
|
MenuOptionItem
|
7
|
-
} from "./chunk-
|
7
|
+
} from "./chunk-LNHCNVHB.mjs";
|
8
8
|
|
9
9
|
// src/menu-option-group.tsx
|
10
10
|
import { useControllableState } from "@yamada-ui/use-controllable-state";
|
@@ -67,4 +67,4 @@ MenuOptionGroup.displayName = "MenuOptionGroup";
|
|
67
67
|
export {
|
68
68
|
MenuOptionGroup
|
69
69
|
};
|
70
|
-
//# sourceMappingURL=chunk-
|
70
|
+
//# sourceMappingURL=chunk-COK5BGV5.mjs.map
|
@@ -3,7 +3,7 @@ import {
|
|
3
3
|
MenuIcon,
|
4
4
|
useMenu,
|
5
5
|
useUpstreamMenuItem
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-LNHCNVHB.mjs";
|
7
7
|
|
8
8
|
// src/menu-button.tsx
|
9
9
|
import { ui, forwardRef } from "@yamada-ui/core";
|
@@ -96,4 +96,4 @@ export {
|
|
96
96
|
MenuButton,
|
97
97
|
MenuItemButton
|
98
98
|
};
|
99
|
-
//# sourceMappingURL=chunk-
|
99
|
+
//# sourceMappingURL=chunk-HWCJQOGH.mjs.map
|
@@ -5,7 +5,7 @@ import { ui, forwardRef } from "@yamada-ui/core";
|
|
5
5
|
import { useClickable } from "@yamada-ui/use-clickable";
|
6
6
|
import {
|
7
7
|
ariaAttr,
|
8
|
-
createContext as
|
8
|
+
createContext as createContext3,
|
9
9
|
cx,
|
10
10
|
funcAll as funcAll2,
|
11
11
|
handlerAll,
|
@@ -17,35 +17,57 @@ import {
|
|
17
17
|
import { useCallback as useCallback2, useRef as useRef2, useState as useState2 } from "react";
|
18
18
|
|
19
19
|
// src/menu.tsx
|
20
|
-
import { useMultiComponentStyle, omitThemeProps } from "@yamada-ui/core";
|
20
|
+
import { useMultiComponentStyle as useMultiComponentStyle2, omitThemeProps as omitThemeProps2 } from "@yamada-ui/core";
|
21
21
|
import { Popover } from "@yamada-ui/popover";
|
22
22
|
import { createDescendant } from "@yamada-ui/use-descendant";
|
23
23
|
import { useDisclosure } from "@yamada-ui/use-disclosure";
|
24
24
|
import {
|
25
|
-
createContext,
|
25
|
+
createContext as createContext2,
|
26
26
|
funcAll,
|
27
27
|
useUnmountEffect,
|
28
28
|
useUpdateEffect
|
29
29
|
} from "@yamada-ui/utils";
|
30
30
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
31
|
+
|
32
|
+
// src/context-menu.tsx
|
33
|
+
import { useMultiComponentStyle, omitThemeProps } from "@yamada-ui/core";
|
34
|
+
import { createContext } from "@yamada-ui/utils";
|
31
35
|
import { jsx } from "react/jsx-runtime";
|
36
|
+
var [ContextMenuProvider, useContextMenu] = createContext(
|
37
|
+
{
|
38
|
+
strict: false,
|
39
|
+
name: "ContextMenuContext"
|
40
|
+
}
|
41
|
+
);
|
42
|
+
var ContextMenu = (props) => {
|
43
|
+
const [styles, mergedProps] = useMultiComponentStyle("ContextMenu", props);
|
44
|
+
const { ...rest } = omitThemeProps(mergedProps);
|
45
|
+
return /* @__PURE__ */ jsx(ContextMenuProvider, { value: { styles }, children: /* @__PURE__ */ jsx(Menu, { trigger: "contextmenu", ...rest }) });
|
46
|
+
};
|
47
|
+
|
48
|
+
// src/menu.tsx
|
49
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
32
50
|
var {
|
33
51
|
DescendantsContextProvider,
|
34
52
|
useDescendantsContext: useMenuDescendantsContext,
|
35
53
|
useDescendants,
|
36
54
|
useDescendant: useMenuDescendant
|
37
55
|
} = createDescendant();
|
38
|
-
var [MenuProvider, useMenu] =
|
56
|
+
var [MenuProvider, useMenu] = createContext2({
|
39
57
|
name: "MenuContext",
|
40
58
|
errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />"`
|
41
59
|
});
|
42
|
-
var [UpstreamMenuProvider, useUpstreamMenu] =
|
60
|
+
var [UpstreamMenuProvider, useUpstreamMenu] = createContext2({
|
43
61
|
strict: false,
|
44
62
|
name: "UpstreamMenuContext"
|
45
63
|
});
|
46
64
|
var Menu = (props) => {
|
47
|
-
var _a, _b;
|
48
|
-
const
|
65
|
+
var _a, _b, _c;
|
66
|
+
const { styles: contextMenuStyles } = (_a = useContextMenu()) != null ? _a : {};
|
67
|
+
const [styles, mergedProps] = useMultiComponentStyle2("Menu", props, {
|
68
|
+
isProcessSkip: !!contextMenuStyles,
|
69
|
+
styles: contextMenuStyles
|
70
|
+
});
|
49
71
|
let {
|
50
72
|
initialFocusRef,
|
51
73
|
closeOnSelect = true,
|
@@ -56,9 +78,9 @@ var Menu = (props) => {
|
|
56
78
|
onOpen: onOpenProp,
|
57
79
|
onClose: onCloseProp,
|
58
80
|
...rest
|
59
|
-
} =
|
60
|
-
const { relatedRef, onUpstreamClose, onDownstreamCloseMapRef } = (
|
61
|
-
const { setDownstreamOpen, hasDownstreamRef } = (
|
81
|
+
} = omitThemeProps2(mergedProps);
|
82
|
+
const { relatedRef, onUpstreamClose, onDownstreamCloseMapRef } = (_b = useUpstreamMenu()) != null ? _b : {};
|
83
|
+
const { setDownstreamOpen, hasDownstreamRef } = (_c = useUpstreamMenuItem()) != null ? _c : {};
|
62
84
|
const isNested = !!relatedRef;
|
63
85
|
if (isNested) {
|
64
86
|
placement != null ? placement : placement = "right-start";
|
@@ -145,7 +167,7 @@ var Menu = (props) => {
|
|
145
167
|
timeoutIds.current.forEach((id2) => clearTimeout(id2));
|
146
168
|
timeoutIds.current.clear();
|
147
169
|
});
|
148
|
-
return /* @__PURE__ */
|
170
|
+
return /* @__PURE__ */ jsx2(DescendantsContextProvider, { value: descendants, children: /* @__PURE__ */ jsx2(
|
149
171
|
UpstreamMenuProvider,
|
150
172
|
{
|
151
173
|
value: {
|
@@ -153,7 +175,7 @@ var Menu = (props) => {
|
|
153
175
|
onDownstreamCloseMapRef: onCloseMapRef,
|
154
176
|
onUpstreamClose: funcAll(onUpstreamClose, onClose)
|
155
177
|
},
|
156
|
-
children: /* @__PURE__ */
|
178
|
+
children: /* @__PURE__ */ jsx2(
|
157
179
|
MenuProvider,
|
158
180
|
{
|
159
181
|
value: {
|
@@ -171,7 +193,7 @@ var Menu = (props) => {
|
|
171
193
|
isNested,
|
172
194
|
styles
|
173
195
|
},
|
174
|
-
children: /* @__PURE__ */
|
196
|
+
children: /* @__PURE__ */ jsx2(
|
175
197
|
Popover,
|
176
198
|
{
|
177
199
|
...{
|
@@ -197,8 +219,8 @@ var Menu = (props) => {
|
|
197
219
|
};
|
198
220
|
|
199
221
|
// src/menu-item.tsx
|
200
|
-
import { jsx as
|
201
|
-
var [UpstreamMenuItemProvider, useUpstreamMenuItem] =
|
222
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
223
|
+
var [UpstreamMenuItemProvider, useUpstreamMenuItem] = createContext3({
|
202
224
|
strict: false,
|
203
225
|
name: "UpstreamMenuItemContext"
|
204
226
|
});
|
@@ -354,7 +376,7 @@ var MenuItem = forwardRef(
|
|
354
376
|
};
|
355
377
|
}, [isFocused, trulyDisabled, menuRef, isOpen]);
|
356
378
|
type = as || type ? type != null ? type : void 0 : "button";
|
357
|
-
children = icon || command ? /* @__PURE__ */
|
379
|
+
children = icon || command ? /* @__PURE__ */ jsx3(ui.span, { style: { flex: 1 }, children }) : children;
|
358
380
|
const css = {
|
359
381
|
textDecoration: "none",
|
360
382
|
color: "inherit",
|
@@ -368,7 +390,7 @@ var MenuItem = forwardRef(
|
|
368
390
|
gap: "0.75rem",
|
369
391
|
...styles.item
|
370
392
|
};
|
371
|
-
return /* @__PURE__ */
|
393
|
+
return /* @__PURE__ */ jsx3(
|
372
394
|
UpstreamMenuItemProvider,
|
373
395
|
{
|
374
396
|
value: {
|
@@ -389,9 +411,9 @@ var MenuItem = forwardRef(
|
|
389
411
|
className: cx("ui-menu__item", className),
|
390
412
|
__css: css,
|
391
413
|
children: [
|
392
|
-
icon ? /* @__PURE__ */
|
414
|
+
icon ? /* @__PURE__ */ jsx3(MenuIcon, { children: icon }) : null,
|
393
415
|
children,
|
394
|
-
command ? /* @__PURE__ */
|
416
|
+
command ? /* @__PURE__ */ jsx3(MenuCommand, { children: command }) : null
|
395
417
|
]
|
396
418
|
}
|
397
419
|
)
|
@@ -410,7 +432,7 @@ var MenuOptionItem = forwardRef(
|
|
410
432
|
closeOnSelect,
|
411
433
|
...rest,
|
412
434
|
children: [
|
413
|
-
icon !== null ? /* @__PURE__ */
|
435
|
+
icon !== null ? /* @__PURE__ */ jsx3(MenuIcon, { opacity: isChecked ? 1 : 0, children: icon || /* @__PURE__ */ jsx3(CheckIcon, {}) }) : null,
|
414
436
|
children
|
415
437
|
]
|
416
438
|
}
|
@@ -428,7 +450,7 @@ var MenuIcon = forwardRef(
|
|
428
450
|
fontSize: "0.85em",
|
429
451
|
...styles.icon
|
430
452
|
};
|
431
|
-
return /* @__PURE__ */
|
453
|
+
return /* @__PURE__ */ jsx3(
|
432
454
|
ui.span,
|
433
455
|
{
|
434
456
|
ref,
|
@@ -443,7 +465,7 @@ var MenuCommand = forwardRef(
|
|
443
465
|
({ className, ...rest }, ref) => {
|
444
466
|
const { styles } = useMenu();
|
445
467
|
const css = { ...styles.command };
|
446
|
-
return /* @__PURE__ */
|
468
|
+
return /* @__PURE__ */ jsx3(
|
447
469
|
ui.span,
|
448
470
|
{
|
449
471
|
ref,
|
@@ -454,7 +476,7 @@ var MenuCommand = forwardRef(
|
|
454
476
|
);
|
455
477
|
}
|
456
478
|
);
|
457
|
-
var CheckIcon = () => /* @__PURE__ */
|
479
|
+
var CheckIcon = () => /* @__PURE__ */ jsx3("svg", { viewBox: "0 0 14 14", width: "1em", height: "1em", children: /* @__PURE__ */ jsx3(
|
458
480
|
"polygon",
|
459
481
|
{
|
460
482
|
fill: "currentColor",
|
@@ -474,6 +496,8 @@ export {
|
|
474
496
|
useMenu,
|
475
497
|
UpstreamMenuProvider,
|
476
498
|
useUpstreamMenu,
|
477
|
-
Menu
|
499
|
+
Menu,
|
500
|
+
useContextMenu,
|
501
|
+
ContextMenu
|
478
502
|
};
|
479
|
-
//# sourceMappingURL=chunk-
|
503
|
+
//# sourceMappingURL=chunk-LNHCNVHB.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/menu-item.tsx","../src/menu.tsx","../src/context-menu.tsx"],"sourcesContent":["import type { HTMLUIProps, CSSUIObject } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { useClickable } from \"@yamada-ui/use-clickable\"\nimport {\n ariaAttr,\n createContext,\n cx,\n funcAll,\n handlerAll,\n isActiveElement,\n isHTMLElement,\n mergeRefs,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport type {\n Dispatch,\n FC,\n FocusEvent,\n KeyboardEvent,\n KeyboardEventHandler,\n MouseEvent,\n MutableRefObject,\n ReactElement,\n RefObject,\n SetStateAction,\n} from \"react\"\nimport { useCallback, useRef, useState } from \"react\"\nimport { useMenu, useMenuDescendant } from \"./menu\"\n\ntype UpstreamMenuItemContext = {\n onUpstreamRestoreFocus: () => void\n onKeyDownRef: RefObject<KeyboardEventHandler<HTMLButtonElement>>\n setDownstreamOpen: Dispatch<SetStateAction<boolean>>\n hasDownstreamRef: MutableRefObject<boolean>\n}\n\nexport const [UpstreamMenuItemProvider, useUpstreamMenuItem] =\n createContext<UpstreamMenuItemContext>({\n strict: false,\n name: \"UpstreamMenuItemContext\",\n })\n\nconst isTargetMenuItem = (target: EventTarget | null) => {\n return (\n isHTMLElement(target) &&\n !!target?.getAttribute(\"role\")?.startsWith(\"menu-item\")\n )\n}\n\ntype MenuItemOptions = {\n /**\n * If `true`, the menu item will be disabled.\n *\n * @default false\n */\n isDisabled?: boolean\n /**\n * If `true`, the menu item will be focusable.\n *\n * @default false\n */\n isFocusable?: boolean\n /**\n * If `true`, the list element will be closed when selected.\n *\n * @default false\n */\n closeOnSelect?: boolean\n /**\n * The menu item icon to use.\n */\n icon?: ReactElement\n /**\n * Right-aligned label text content, useful for displaying hotkeys.\n */\n command?: string\n}\n\nexport type MenuItemProps = HTMLUIProps<\"button\"> & MenuItemOptions\n\nexport const MenuItem = forwardRef<MenuItemProps, \"button\">(\n (\n {\n as,\n className,\n type,\n isDisabled,\n isFocusable,\n closeOnSelect: customCloseOnSelect,\n icon,\n command,\n children,\n onClick: onClickProp,\n onFocus: onFocusProp,\n onMouseEnter: onMouseEnterProp,\n onMouseMove: onMouseMoveProp,\n onMouseLeave: onMouseLeaveProp,\n onKeyDown: onKeyDownProp,\n ...props\n },\n ref,\n ) => {\n const {\n focusedIndex,\n setFocusedIndex,\n isOpen,\n onClose,\n onUpstreamClose,\n closeOnSelect: generalCloseOnSelect,\n menuRef,\n requestAnimationFrameId,\n isNested,\n styles,\n } = useMenu()\n const { onUpstreamRestoreFocus } = useUpstreamMenuItem() ?? {}\n\n const trulyDisabled = isDisabled && !isFocusable\n\n const buttonRef = useRef<HTMLButtonElement>(null)\n const hasDownstreamRef = useRef<boolean>(false)\n const onKeyDownRef = useRef<KeyboardEventHandler<HTMLButtonElement>>(\n () => void 0,\n )\n const { index, register } = useMenuDescendant({ disabled: trulyDisabled })\n const [isDownstreamOpen, setDownstreamOpen] = useState<boolean>(false)\n\n const isFocused = index === focusedIndex\n\n const onMouseEnter = useCallback(\n (event: any) => {\n onMouseEnterProp?.(event)\n\n if (isDisabled) return\n\n setFocusedIndex(index)\n },\n [setFocusedIndex, index, isDisabled, onMouseEnterProp],\n )\n\n const onMouseMove = useCallback(\n (event: any) => {\n onMouseMoveProp?.(event)\n\n if (buttonRef.current && !isActiveElement(buttonRef.current))\n onMouseEnter(event)\n },\n [onMouseEnter, onMouseMoveProp],\n )\n\n const onMouseLeave = useCallback(\n (event: any) => {\n onMouseLeaveProp?.(event)\n\n if (isDisabled) return\n\n setFocusedIndex(-1)\n },\n [setFocusedIndex, isDisabled, onMouseLeaveProp],\n )\n\n const onClick = useCallback(\n (ev: MouseEvent<HTMLButtonElement>) => {\n onClickProp?.(ev)\n\n if (!isTargetMenuItem(ev.currentTarget)) return\n\n const hasDownstream = hasDownstreamRef.current\n\n if (customCloseOnSelect ?? (!hasDownstream && generalCloseOnSelect)) {\n onClose()\n onUpstreamClose?.()\n }\n },\n [\n onClickProp,\n customCloseOnSelect,\n generalCloseOnSelect,\n onClose,\n onUpstreamClose,\n ],\n )\n\n const onFocus = useCallback(\n (ev: FocusEvent<HTMLButtonElement>) => {\n onFocusProp?.(ev)\n\n setFocusedIndex(index)\n },\n [onFocusProp, setFocusedIndex, index],\n )\n\n const onRestoreFocus = useCallback(() => {\n buttonRef.current?.focus()\n\n setFocusedIndex(index)\n }, [setFocusedIndex, index])\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLButtonElement>) => {\n onKeyDownProp?.(ev)\n\n const actions: Record<string, Function | undefined> = {\n ArrowLeft: isNested\n ? funcAll(onUpstreamRestoreFocus, onClose)\n : undefined,\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action()\n },\n [onKeyDownProp, onUpstreamRestoreFocus, onClose, isNested],\n )\n\n const rest = useClickable<HTMLButtonElement>({\n focusOnClick: false,\n ...props,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseMove,\n onMouseLeave,\n onKeyDown: handlerAll(onKeyDown, onKeyDownRef.current),\n ref: mergeRefs(register, buttonRef, ref),\n isDisabled,\n isFocusable,\n })\n\n useUpdateEffect(() => {\n if (!isOpen) return\n\n const id = requestAnimationFrameId.current\n\n if (isFocused && !trulyDisabled && buttonRef.current) {\n if (id) cancelAnimationFrame(id)\n\n requestAnimationFrameId.current = requestAnimationFrame(() => {\n buttonRef.current?.focus({ preventScroll: true })\n\n requestAnimationFrameId.current = null\n })\n } else if (menuRef.current && !isActiveElement(menuRef.current)) {\n menuRef.current.focus({ preventScroll: true })\n }\n\n return () => {\n if (id) cancelAnimationFrame(id)\n }\n }, [isFocused, trulyDisabled, menuRef, isOpen])\n\n type = as || type ? type ?? undefined : \"button\"\n\n children =\n icon || command ? (\n <ui.span style={{ flex: 1 }}>{children}</ui.span>\n ) : (\n children\n )\n\n const css: CSSUIObject = {\n textDecoration: \"none\",\n color: \"inherit\",\n userSelect: \"none\",\n display: \"flex\",\n width: \"100%\",\n alignItems: \"center\",\n textAlign: \"start\",\n flex: \"0 0 auto\",\n outline: 0,\n gap: \"0.75rem\",\n ...styles.item,\n }\n\n return (\n <UpstreamMenuItemProvider\n value={{\n onKeyDownRef,\n onUpstreamRestoreFocus: onRestoreFocus,\n setDownstreamOpen,\n hasDownstreamRef,\n }}\n >\n <ui.li\n {...rest}\n {...(isDownstreamOpen ? { \"data-active\": \"\" } : {})}\n as={as}\n type={type}\n role=\"menu-item\"\n tabIndex={isFocused ? 0 : -1}\n className={cx(\"ui-menu__item\", className)}\n __css={css}\n >\n {icon ? <MenuIcon>{icon}</MenuIcon> : null}\n {children}\n {command ? <MenuCommand>{command}</MenuCommand> : null}\n </ui.li>\n </UpstreamMenuItemProvider>\n )\n },\n)\n\ntype MenuOptionItemOptions = {\n /**\n * The menu option item icon to use.\n */\n icon?: ReactElement | null\n /**\n * The value of the menu option item.\n */\n value?: string\n /**\n * If `true`, the checkbox or radio will be checked.\n *\n * @default false\n */\n isChecked?: boolean\n /**\n * The type of the menu option item.\n */\n type?: \"radio\" | \"checkbox\"\n}\n\nexport type MenuOptionItemProps = Omit<MenuItemProps, \"icon\" | \"command\"> &\n MenuOptionItemOptions\n\nexport const MenuOptionItem = forwardRef<MenuOptionItemProps, \"button\">(\n (\n { className, icon, isChecked, closeOnSelect = false, children, ...rest },\n ref,\n ) => {\n return (\n <MenuItem\n ref={ref}\n className={cx(\"ui-menu__item--option\", className)}\n aria-checked={ariaAttr(isChecked)}\n closeOnSelect={closeOnSelect}\n {...rest}\n >\n {icon !== null ? (\n <MenuIcon opacity={isChecked ? 1 : 0}>\n {icon || <CheckIcon />}\n </MenuIcon>\n ) : null}\n {children}\n </MenuItem>\n )\n },\n)\n\nexport type MenuIconProps = HTMLUIProps<\"span\">\n\nexport const MenuIcon = forwardRef<MenuIconProps, \"span\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useMenu()\n\n const css: CSSUIObject = {\n flexShrink: 0,\n display: \"inline-flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n fontSize: \"0.85em\",\n ...styles.icon,\n }\n\n return (\n <ui.span\n ref={ref}\n className={cx(\"ui-menu__item__icon\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type MenuCommandProps = HTMLUIProps<\"span\">\n\nexport const MenuCommand = forwardRef<MenuCommandProps, \"span\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useMenu()\n\n const css: CSSUIObject = { ...styles.command }\n\n return (\n <ui.span\n ref={ref}\n className={cx(\"ui-menu__item__command\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nconst CheckIcon: FC = () => (\n <svg viewBox=\"0 0 14 14\" width=\"1em\" height=\"1em\">\n <polygon\n fill=\"currentColor\"\n points=\"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039\"\n />\n </svg>\n)\n","import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport { useMultiComponentStyle, omitThemeProps } from \"@yamada-ui/core\"\nimport type { PopoverProps } from \"@yamada-ui/popover\"\nimport { Popover } from \"@yamada-ui/popover\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { useDisclosure } from \"@yamada-ui/use-disclosure\"\nimport {\n createContext,\n funcAll,\n useUnmountEffect,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport type {\n Dispatch,\n FC,\n MutableRefObject,\n RefObject,\n SetStateAction,\n} from \"react\"\nimport { useCallback, useEffect, useId, useRef, useState } from \"react\"\nimport { useContextMenu } from \"./context-menu\"\nimport { useUpstreamMenuItem } from \"./menu-item\"\n\nconst {\n DescendantsContextProvider,\n useDescendantsContext: useMenuDescendantsContext,\n useDescendants,\n useDescendant: useMenuDescendant,\n} = createDescendant<HTMLElement>()\n\nexport { useMenuDescendantsContext, useMenuDescendant }\n\ntype MenuContext = MenuOptions & {\n isOpen: boolean\n onOpen: () => void\n onClose: () => void\n onUpstreamClose?: () => void\n onFocusFirstItem: () => void\n onFocusLastItem: () => void\n focusedIndex: number\n setFocusedIndex: Dispatch<SetStateAction<number>>\n menuRef: RefObject<HTMLDivElement>\n requestAnimationFrameId: MutableRefObject<number | null>\n isNested: boolean\n styles: Record<string, CSSUIObject>\n}\n\nconst [MenuProvider, useMenu] = createContext<MenuContext>({\n name: \"MenuContext\",\n errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in \"<Menu />\"`,\n})\n\ntype UpstreamMenuContext = {\n relatedRef: RefObject<HTMLElement>\n onDownstreamCloseMapRef: MutableRefObject<Map<string, () => void>>\n onUpstreamClose: () => void\n}\n\nexport const [UpstreamMenuProvider, useUpstreamMenu] =\n createContext<UpstreamMenuContext>({\n strict: false,\n name: \"UpstreamMenuContext\",\n })\n\nexport { useMenu }\n\ntype MenuOptions = {\n /**\n * If `true`, the list element will be closed when value is selected.\n *\n * @default true\n */\n closeOnSelect?: boolean\n}\n\nexport type MenuProps = ThemeProps<\"Menu\"> &\n Omit<PopoverProps, \"closeOnButton\" | \"relatedRef\"> &\n MenuOptions\n\n/**\n * `Menu` is a component that displays a common dropdown menu.\n *\n * @see Docs https://yamada-ui.com/components/overlay/menu\n */\nexport const Menu: FC<MenuProps> = (props) => {\n const { styles: contextMenuStyles } = useContextMenu() ?? {}\n const [styles, mergedProps] = useMultiComponentStyle(\"Menu\", props, {\n isProcessSkip: !!contextMenuStyles,\n styles: contextMenuStyles,\n })\n let {\n initialFocusRef,\n closeOnSelect = true,\n closeOnBlur,\n placement,\n duration = 0.2,\n offset,\n onOpen: onOpenProp,\n onClose: onCloseProp,\n ...rest\n } = omitThemeProps(mergedProps)\n const { relatedRef, onUpstreamClose, onDownstreamCloseMapRef } =\n useUpstreamMenu() ?? {}\n const { setDownstreamOpen, hasDownstreamRef } = useUpstreamMenuItem() ?? {}\n const isNested = !!relatedRef\n\n if (isNested) {\n placement ??= \"right-start\"\n offset ??= [-8, 8]\n closeOnBlur ??= false\n } else {\n placement ??= \"bottom-start\"\n }\n\n const descendants = useDescendants()\n\n const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n\n const menuRef = useRef<HTMLDivElement>(null)\n const timeoutIds = useRef<Set<any>>(new Set([]))\n const requestAnimationFrameId = useRef<number | null>(null)\n const onCloseMapRef = useRef<Map<string, () => void>>(new Map())\n\n const onFocusMenu = useCallback(() => {\n requestAnimationFrame(() =>\n menuRef.current?.focus({ preventScroll: false }),\n )\n }, [])\n\n const onFocusFirstItem = useCallback(() => {\n const id = setTimeout(() => {\n if (initialFocusRef) return\n\n const first = descendants.enabledFirstValue()\n\n if (first) setFocusedIndex(first.index)\n })\n\n timeoutIds.current.add(id)\n }, [descendants, initialFocusRef])\n\n const onFocusLastItem = useCallback(() => {\n const id = setTimeout(() => {\n if (initialFocusRef) return\n\n const last = descendants.enabledLastValue()\n\n if (last) setFocusedIndex(last.index)\n })\n\n timeoutIds.current.add(id)\n }, [descendants, initialFocusRef])\n\n const onOpenInternal = useCallback(() => {\n onOpenProp?.()\n\n if (!isNested) onFocusMenu()\n }, [onOpenProp, isNested, onFocusMenu])\n\n const onCloseInternal = useCallback(() => {\n onCloseProp?.()\n\n for (const onClose of onCloseMapRef.current.values()) {\n onClose()\n }\n }, [onCloseProp])\n\n const id = useId()\n const { isOpen, onOpen, onClose } = useDisclosure({\n ...props,\n onOpen: onOpenInternal,\n onClose: onCloseInternal,\n })\n\n useEffect(() => {\n const onCloseMap = onDownstreamCloseMapRef?.current\n\n onCloseMap?.set(id, onClose)\n\n return () => {\n onCloseMap?.delete(id)\n }\n }, [id, onClose, onDownstreamCloseMapRef])\n\n useEffect(() => {\n if (setDownstreamOpen) setDownstreamOpen(isOpen)\n }, [setDownstreamOpen, isOpen])\n\n useEffect(() => {\n if (hasDownstreamRef) hasDownstreamRef.current = true\n\n return () => {\n if (hasDownstreamRef) hasDownstreamRef.current = false\n }\n })\n\n useUpdateEffect(() => {\n if (!isOpen) setFocusedIndex(-1)\n }, [isOpen])\n\n useUnmountEffect(() => {\n timeoutIds.current.forEach((id) => clearTimeout(id))\n timeoutIds.current.clear()\n })\n\n return (\n <DescendantsContextProvider value={descendants}>\n <UpstreamMenuProvider\n value={{\n relatedRef: menuRef,\n onDownstreamCloseMapRef: onCloseMapRef,\n onUpstreamClose: funcAll(onUpstreamClose, onClose),\n }}\n >\n <MenuProvider\n value={{\n isOpen,\n onOpen,\n onClose,\n onUpstreamClose,\n onFocusFirstItem,\n onFocusLastItem,\n closeOnSelect,\n focusedIndex,\n setFocusedIndex,\n menuRef,\n requestAnimationFrameId,\n isNested,\n styles,\n }}\n >\n <Popover\n {...{\n trigger: isNested ? \"hover\" : \"click\",\n ...rest,\n isOpen,\n onOpen,\n onClose,\n placement,\n offset,\n duration,\n initialFocusRef,\n relatedRef,\n closeOnButton: false,\n closeOnBlur,\n }}\n />\n </MenuProvider>\n </UpstreamMenuProvider>\n </DescendantsContextProvider>\n )\n}\n","import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport { useMultiComponentStyle, omitThemeProps } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\nimport type { MenuProps } from \"./menu\"\nimport { Menu } from \"./menu\"\n\ntype ContextMenuContext = {\n styles: Record<string, CSSUIObject>\n}\n\nconst [ContextMenuProvider, useContextMenu] = createContext<ContextMenuContext>(\n {\n strict: false,\n name: \"ContextMenuContext\",\n },\n)\n\nexport { useContextMenu }\n\ntype ContextMenuOptions = {}\n\nexport type ContextMenuProps = Omit<MenuProps, \"trigger\"> &\n ThemeProps<\"ContextMenu\"> &\n ContextMenuOptions\n\n/**\n * `ContextMenu` is displays a menu to the user such as a set of actions or functions triggered by a button.\n *\n * @see Docs https://yamada-ui.com/components/overlay/context-menu\n */\nexport const ContextMenu: FC<ContextMenuProps> = (props) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"ContextMenu\", props)\n const { ...rest } = omitThemeProps(mergedProps)\n\n return (\n <ContextMenuProvider value={{ styles }}>\n <Menu trigger=\"contextmenu\" {...rest} />\n </ContextMenuProvider>\n )\n}\n"],"mappings":";;;AACA,SAAS,IAAI,kBAAkB;AAC/B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA,iBAAAA;AAAA,EACA;AAAA,EACA,WAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAAC;AAAA,OACK;AAaP,SAAS,eAAAC,cAAa,UAAAC,SAAQ,YAAAC,iBAAgB;;;ACzB9C,SAAS,0BAAAC,yBAAwB,kBAAAC,uBAAsB;AAEvD,SAAS,eAAe;AACxB,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B;AAAA,EACE,iBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,aAAa,WAAW,OAAO,QAAQ,gBAAgB;;;AClBhE,SAAS,wBAAwB,sBAAsB;AACvD,SAAS,qBAAqB;AAmCxB;AA1BN,IAAM,CAAC,qBAAqB,cAAc,IAAI;AAAA,EAC5C;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AACF;AAeO,IAAM,cAAoC,CAAC,UAAU;AAC1D,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,eAAe,KAAK;AACzE,QAAM,EAAE,GAAG,KAAK,IAAI,eAAe,WAAW;AAE9C,SACE,oBAAC,uBAAoB,OAAO,EAAE,OAAO,GACnC,8BAAC,QAAK,SAAQ,eAAe,GAAG,MAAM,GACxC;AAEJ;;;AD+LU,gBAAAC,YAAA;AAhNV,IAAM;AAAA,EACJ;AAAA,EACA,uBAAuB;AAAA,EACvB;AAAA,EACA,eAAe;AACjB,IAAI,iBAA8B;AAmBlC,IAAM,CAAC,cAAc,OAAO,IAAIC,eAA2B;AAAA,EAC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B,UAAM,EAAE,OAAO,IAAI,QAAQ;AAE3B,UAAM,MAAmB,EAAE,GAAG,OAAO,QAAQ;AAE7C,WACE,gBAAAA;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,0BAA0B,SAAS;AAAA,QACjD,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,IAAM,YAAgB,MACpB,gBAAAA,KAAC,SAAI,SAAQ,aAAY,OAAM,OAAM,QAAO,OAC1C,0BAAAA;AAAA,EAAC;AAAA;AAAA,IACC,MAAK;AAAA,IACL,QAAO;AAAA;AACT,GACF;","names":["createContext","funcAll","useUpdateEffect","useCallback","useRef","useState","useMultiComponentStyle","omitThemeProps","createContext","jsx","createContext","useMultiComponentStyle","omitThemeProps","_a","id","onClose","jsx","jsx","createContext","useRef","useState","useCallback","_a","funcAll","useUpdateEffect"]}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use client"
|
2
|
+
import {
|
3
|
+
useContextMenu
|
4
|
+
} from "./chunk-LNHCNVHB.mjs";
|
5
|
+
|
6
|
+
// src/context-menu-trigger.tsx
|
7
|
+
import { ui, forwardRef } from "@yamada-ui/core";
|
8
|
+
import { PopoverAnchor, PopoverTrigger } from "@yamada-ui/popover";
|
9
|
+
import { cx, handlerAll } from "@yamada-ui/utils";
|
10
|
+
import { useState } from "react";
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
12
|
+
var ContextMenuTrigger = forwardRef(
|
13
|
+
({ children, className, ...rest }, ref) => {
|
14
|
+
const { styles } = useContextMenu();
|
15
|
+
const [position, setPosition] = useState({ top: 0, left: 0 });
|
16
|
+
const css = { ...styles.container };
|
17
|
+
const onContextMenu = (ev) => {
|
18
|
+
setPosition({ top: ev.clientY, left: ev.clientX });
|
19
|
+
};
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
21
|
+
/* @__PURE__ */ jsx(PopoverAnchor, { children: /* @__PURE__ */ jsx(
|
22
|
+
ui.div,
|
23
|
+
{
|
24
|
+
className: "ui-context-menu__anchor",
|
25
|
+
style: { position: "fixed", ...position }
|
26
|
+
}
|
27
|
+
) }),
|
28
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { children: /* @__PURE__ */ jsx(
|
29
|
+
ui.div,
|
30
|
+
{
|
31
|
+
ref,
|
32
|
+
className: cx("ui-context-menu", className),
|
33
|
+
__css: css,
|
34
|
+
...rest,
|
35
|
+
onContextMenu: handlerAll(rest.onContextMenu, onContextMenu),
|
36
|
+
children
|
37
|
+
}
|
38
|
+
) })
|
39
|
+
] });
|
40
|
+
}
|
41
|
+
);
|
42
|
+
|
43
|
+
export {
|
44
|
+
ContextMenuTrigger
|
45
|
+
};
|
46
|
+
//# sourceMappingURL=chunk-Q4PSHEXP.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/context-menu-trigger.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { PopoverAnchor, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport type { MouseEvent } from \"react\"\nimport { useState } from \"react\"\nimport { useContextMenu } from \"./context-menu\"\n\ntype Position = { top: number; left: number }\n\nexport type ContextMenuTriggerProps = HTMLUIProps<\"div\">\n\nexport const ContextMenuTrigger = forwardRef<ContextMenuTriggerProps, \"div\">(\n ({ children, className, ...rest }, ref) => {\n const { styles } = useContextMenu()\n const [position, setPosition] = useState<Position>({ top: 0, left: 0 })\n\n const css: CSSUIObject = { ...styles.container }\n\n const onContextMenu = (ev: MouseEvent) => {\n setPosition({ top: ev.clientY, left: ev.clientX })\n }\n\n return (\n <>\n <PopoverAnchor>\n <ui.div\n className=\"ui-context-menu__anchor\"\n style={{ position: \"fixed\", ...position }}\n />\n </PopoverAnchor>\n\n <PopoverTrigger>\n <ui.div\n ref={ref}\n className={cx(\"ui-context-menu\", className)}\n __css={css}\n {...rest}\n onContextMenu={handlerAll(rest.onContextMenu, onContextMenu)}\n >\n {children}\n </ui.div>\n </PopoverTrigger>\n </>\n )\n },\n)\n"],"mappings":";;;;;;AACA,SAAS,IAAI,kBAAkB;AAC/B,SAAS,eAAe,sBAAsB;AAC9C,SAAS,IAAI,kBAAkB;AAE/B,SAAS,gBAAgB;AAmBnB,mBAEI,KAFJ;AAZC,IAAM,qBAAqB;AAAA,EAChC,CAAC,EAAE,UAAU,WAAW,GAAG,KAAK,GAAG,QAAQ;AACzC,UAAM,EAAE,OAAO,IAAI,eAAe;AAClC,UAAM,CAAC,UAAU,WAAW,IAAI,SAAmB,EAAE,KAAK,GAAG,MAAM,EAAE,CAAC;AAEtE,UAAM,MAAmB,EAAE,GAAG,OAAO,UAAU;AAE/C,UAAM,gBAAgB,CAAC,OAAmB;AACxC,kBAAY,EAAE,KAAK,GAAG,SAAS,MAAM,GAAG,QAAQ,CAAC;AAAA,IACnD;AAEA,WACE,iCACE;AAAA,0BAAC,iBACC;AAAA,QAAC,GAAG;AAAA,QAAH;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,UAAU,SAAS,GAAG,SAAS;AAAA;AAAA,MAC1C,GACF;AAAA,MAEA,oBAAC,kBACC;AAAA,QAAC,GAAG;AAAA,QAAH;AAAA,UACC;AAAA,UACA,WAAW,GAAG,mBAAmB,SAAS;AAAA,UAC1C,OAAO;AAAA,UACN,GAAG;AAAA,UACJ,eAAe,WAAW,KAAK,eAAe,aAAa;AAAA,UAE1D;AAAA;AAAA,MACH,GACF;AAAA,OACF;AAAA,EAEJ;AACF;","names":[]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useMenu
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-LNHCNVHB.mjs";
|
5
5
|
|
6
6
|
// src/menu-divider.tsx
|
7
7
|
import { ui, forwardRef } from "@yamada-ui/core";
|
@@ -24,4 +24,4 @@ var MenuDivider = forwardRef(({ className, ...rest }, ref) => {
|
|
24
24
|
export {
|
25
25
|
MenuDivider
|
26
26
|
};
|
27
|
-
//# sourceMappingURL=chunk-
|
27
|
+
//# sourceMappingURL=chunk-TCN4S66S.mjs.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
3
|
+
|
4
|
+
type ContextMenuTriggerProps = HTMLUIProps<"div">;
|
5
|
+
declare const ContextMenuTrigger: _yamada_ui_core.Component<"div", ContextMenuTriggerProps>;
|
6
|
+
|
7
|
+
export { ContextMenuTrigger, type ContextMenuTriggerProps };
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
3
|
+
|
4
|
+
type ContextMenuTriggerProps = HTMLUIProps<"div">;
|
5
|
+
declare const ContextMenuTrigger: _yamada_ui_core.Component<"div", ContextMenuTriggerProps>;
|
6
|
+
|
7
|
+
export { ContextMenuTrigger, type ContextMenuTriggerProps };
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use client"
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/context-menu-trigger.tsx
|
22
|
+
var context_menu_trigger_exports = {};
|
23
|
+
__export(context_menu_trigger_exports, {
|
24
|
+
ContextMenuTrigger: () => ContextMenuTrigger
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(context_menu_trigger_exports);
|
27
|
+
var import_core2 = require("@yamada-ui/core");
|
28
|
+
var import_popover = require("@yamada-ui/popover");
|
29
|
+
var import_utils2 = require("@yamada-ui/utils");
|
30
|
+
var import_react = require("react");
|
31
|
+
|
32
|
+
// src/context-menu.tsx
|
33
|
+
var import_core = require("@yamada-ui/core");
|
34
|
+
var import_utils = require("@yamada-ui/utils");
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var [ContextMenuProvider, useContextMenu] = (0, import_utils.createContext)(
|
37
|
+
{
|
38
|
+
strict: false,
|
39
|
+
name: "ContextMenuContext"
|
40
|
+
}
|
41
|
+
);
|
42
|
+
|
43
|
+
// src/context-menu-trigger.tsx
|
44
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
45
|
+
var ContextMenuTrigger = (0, import_core2.forwardRef)(
|
46
|
+
({ children, className, ...rest }, ref) => {
|
47
|
+
const { styles } = useContextMenu();
|
48
|
+
const [position, setPosition] = (0, import_react.useState)({ top: 0, left: 0 });
|
49
|
+
const css = { ...styles.container };
|
50
|
+
const onContextMenu = (ev) => {
|
51
|
+
setPosition({ top: ev.clientY, left: ev.clientX });
|
52
|
+
};
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.PopoverAnchor, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
55
|
+
import_core2.ui.div,
|
56
|
+
{
|
57
|
+
className: "ui-context-menu__anchor",
|
58
|
+
style: { position: "fixed", ...position }
|
59
|
+
}
|
60
|
+
) }),
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover.PopoverTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
62
|
+
import_core2.ui.div,
|
63
|
+
{
|
64
|
+
ref,
|
65
|
+
className: (0, import_utils2.cx)("ui-context-menu", className),
|
66
|
+
__css: css,
|
67
|
+
...rest,
|
68
|
+
onContextMenu: (0, import_utils2.handlerAll)(rest.onContextMenu, onContextMenu),
|
69
|
+
children
|
70
|
+
}
|
71
|
+
) })
|
72
|
+
] });
|
73
|
+
}
|
74
|
+
);
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
76
|
+
0 && (module.exports = {
|
77
|
+
ContextMenuTrigger
|
78
|
+
});
|
79
|
+
//# sourceMappingURL=context-menu-trigger.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/context-menu-trigger.tsx","../src/context-menu.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { ui, forwardRef } from \"@yamada-ui/core\"\nimport { PopoverAnchor, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { cx, handlerAll } from \"@yamada-ui/utils\"\nimport type { MouseEvent } from \"react\"\nimport { useState } from \"react\"\nimport { useContextMenu } from \"./context-menu\"\n\ntype Position = { top: number; left: number }\n\nexport type ContextMenuTriggerProps = HTMLUIProps<\"div\">\n\nexport const ContextMenuTrigger = forwardRef<ContextMenuTriggerProps, \"div\">(\n ({ children, className, ...rest }, ref) => {\n const { styles } = useContextMenu()\n const [position, setPosition] = useState<Position>({ top: 0, left: 0 })\n\n const css: CSSUIObject = { ...styles.container }\n\n const onContextMenu = (ev: MouseEvent) => {\n setPosition({ top: ev.clientY, left: ev.clientX })\n }\n\n return (\n <>\n <PopoverAnchor>\n <ui.div\n className=\"ui-context-menu__anchor\"\n style={{ position: \"fixed\", ...position }}\n />\n </PopoverAnchor>\n\n <PopoverTrigger>\n <ui.div\n ref={ref}\n className={cx(\"ui-context-menu\", className)}\n __css={css}\n {...rest}\n onContextMenu={handlerAll(rest.onContextMenu, onContextMenu)}\n >\n {children}\n </ui.div>\n </PopoverTrigger>\n </>\n )\n },\n)\n","import type { CSSUIObject, ThemeProps } from \"@yamada-ui/core\"\nimport { useMultiComponentStyle, omitThemeProps } from \"@yamada-ui/core\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { FC } from \"react\"\nimport type { MenuProps } from \"./menu\"\nimport { Menu } from \"./menu\"\n\ntype ContextMenuContext = {\n styles: Record<string, CSSUIObject>\n}\n\nconst [ContextMenuProvider, useContextMenu] = createContext<ContextMenuContext>(\n {\n strict: false,\n name: \"ContextMenuContext\",\n },\n)\n\nexport { useContextMenu }\n\ntype ContextMenuOptions = {}\n\nexport type ContextMenuProps = Omit<MenuProps, \"trigger\"> &\n ThemeProps<\"ContextMenu\"> &\n ContextMenuOptions\n\n/**\n * `ContextMenu` is displays a menu to the user such as a set of actions or functions triggered by a button.\n *\n * @see Docs https://yamada-ui.com/components/overlay/context-menu\n */\nexport const ContextMenu: FC<ContextMenuProps> = (props) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"ContextMenu\", props)\n const { ...rest } = omitThemeProps(mergedProps)\n\n return (\n <ContextMenuProvider value={{ styles }}>\n <Menu trigger=\"contextmenu\" {...rest} />\n </ContextMenuProvider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,eAA+B;AAC/B,qBAA8C;AAC9C,IAAAC,gBAA+B;AAE/B,mBAAyB;;;ACJzB,kBAAuD;AACvD,mBAA8B;AAmCxB;AA1BN,IAAM,CAAC,qBAAqB,cAAc,QAAI;AAAA,EAC5C;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AACF;;;ADQM,IAAAC,sBAAA;AAZC,IAAM,yBAAqB;AAAA,EAChC,CAAC,EAAE,UAAU,WAAW,GAAG,KAAK,GAAG,QAAQ;AACzC,UAAM,EAAE,OAAO,IAAI,eAAe;AAClC,UAAM,CAAC,UAAU,WAAW,QAAI,uBAAmB,EAAE,KAAK,GAAG,MAAM,EAAE,CAAC;AAEtE,UAAM,MAAmB,EAAE,GAAG,OAAO,UAAU;AAE/C,UAAM,gBAAgB,CAAC,OAAmB;AACxC,kBAAY,EAAE,KAAK,GAAG,SAAS,MAAM,GAAG,QAAQ,CAAC;AAAA,IACnD;AAEA,WACE,8EACE;AAAA,mDAAC,gCACC;AAAA,QAAC,gBAAG;AAAA,QAAH;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,UAAU,SAAS,GAAG,SAAS;AAAA;AAAA,MAC1C,GACF;AAAA,MAEA,6CAAC,iCACC;AAAA,QAAC,gBAAG;AAAA,QAAH;AAAA,UACC;AAAA,UACA,eAAW,kBAAG,mBAAmB,SAAS;AAAA,UAC1C,OAAO;AAAA,UACN,GAAG;AAAA,UACJ,mBAAe,0BAAW,KAAK,eAAe,aAAa;AAAA,UAE1D;AAAA;AAAA,MACH,GACF;AAAA,OACF;AAAA,EAEJ;AACF;","names":["import_core","import_utils","import_jsx_runtime"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
2
|
+
import { FC } from 'react';
|
3
|
+
import { MenuProps } from './menu.mjs';
|
4
|
+
import '@yamada-ui/use-descendant';
|
5
|
+
import '@yamada-ui/popover';
|
6
|
+
|
7
|
+
type ContextMenuContext = {
|
8
|
+
styles: Record<string, CSSUIObject>;
|
9
|
+
};
|
10
|
+
declare const useContextMenu: () => ContextMenuContext;
|
11
|
+
|
12
|
+
type ContextMenuOptions = {};
|
13
|
+
type ContextMenuProps = Omit<MenuProps, "trigger"> & ThemeProps<"ContextMenu"> & ContextMenuOptions;
|
14
|
+
/**
|
15
|
+
* `ContextMenu` is displays a menu to the user such as a set of actions or functions triggered by a button.
|
16
|
+
*
|
17
|
+
* @see Docs https://yamada-ui.com/components/overlay/context-menu
|
18
|
+
*/
|
19
|
+
declare const ContextMenu: FC<ContextMenuProps>;
|
20
|
+
|
21
|
+
export { ContextMenu, type ContextMenuProps, useContextMenu };
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
2
|
+
import { FC } from 'react';
|
3
|
+
import { MenuProps } from './menu.js';
|
4
|
+
import '@yamada-ui/use-descendant';
|
5
|
+
import '@yamada-ui/popover';
|
6
|
+
|
7
|
+
type ContextMenuContext = {
|
8
|
+
styles: Record<string, CSSUIObject>;
|
9
|
+
};
|
10
|
+
declare const useContextMenu: () => ContextMenuContext;
|
11
|
+
|
12
|
+
type ContextMenuOptions = {};
|
13
|
+
type ContextMenuProps = Omit<MenuProps, "trigger"> & ThemeProps<"ContextMenu"> & ContextMenuOptions;
|
14
|
+
/**
|
15
|
+
* `ContextMenu` is displays a menu to the user such as a set of actions or functions triggered by a button.
|
16
|
+
*
|
17
|
+
* @see Docs https://yamada-ui.com/components/overlay/context-menu
|
18
|
+
*/
|
19
|
+
declare const ContextMenu: FC<ContextMenuProps>;
|
20
|
+
|
21
|
+
export { ContextMenu, type ContextMenuProps, useContextMenu };
|