@yamada-ui/menu 0.3.26 → 0.4.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/{chunk-6SM4RQW7.mjs → chunk-24W2CY4C.mjs} +1 -1
- package/dist/{chunk-5Z2EB7TV.mjs → chunk-BWTIFRBL.mjs} +2 -2
- package/dist/{chunk-ODNTILJT.mjs → chunk-NLESVCUN.mjs} +4 -3
- package/dist/{chunk-GRQXVFCA.mjs → chunk-P6NJA644.mjs} +2 -2
- package/dist/{chunk-2LCKA3H7.mjs → chunk-SL5MYZ26.mjs} +9 -9
- package/dist/{chunk-OSDFT3UO.mjs → chunk-W5VK56XL.mjs} +2 -2
- package/dist/{chunk-VXUAK4GR.mjs → chunk-XPNC6U52.mjs} +1 -1
- package/dist/index.js +14 -13
- package/dist/index.mjs +7 -7
- package/dist/menu-button.d.mts +1 -1
- package/dist/menu-button.d.ts +1 -1
- package/dist/menu-button.mjs +2 -2
- package/dist/menu-divider.d.mts +1 -1
- package/dist/menu-divider.d.ts +1 -1
- package/dist/menu-divider.mjs +2 -2
- package/dist/menu-group.d.mts +7 -2
- package/dist/menu-group.d.ts +7 -2
- package/dist/menu-group.js +8 -8
- package/dist/menu-group.mjs +2 -2
- package/dist/menu-item.d.mts +1 -1
- package/dist/menu-item.d.ts +1 -1
- package/dist/menu-item.js +1 -1
- package/dist/menu-item.mjs +2 -2
- package/dist/menu-list.d.mts +1 -1
- package/dist/menu-list.d.ts +1 -1
- package/dist/menu-list.js +3 -2
- package/dist/menu-list.mjs +2 -2
- package/dist/menu-option-group.d.mts +5 -1
- package/dist/menu-option-group.d.ts +5 -1
- package/dist/menu-option-group.js +9 -9
- package/dist/menu-option-group.mjs +4 -4
- package/dist/menu.d.mts +5 -5
- package/dist/menu.d.ts +5 -5
- package/dist/menu.js +2 -2
- package/dist/menu.mjs +1 -1
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMenu,
|
|
4
4
|
useMenuDescendant
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W5VK56XL.mjs";
|
|
6
6
|
|
|
7
7
|
// src/menu-item.tsx
|
|
8
8
|
import { ui, forwardRef } from "@yamada-ui/core";
|
|
@@ -101,7 +101,7 @@ var MenuItem = forwardRef(
|
|
|
101
101
|
...styles.item
|
|
102
102
|
};
|
|
103
103
|
return /* @__PURE__ */ jsxs(
|
|
104
|
-
ui.
|
|
104
|
+
ui.li,
|
|
105
105
|
{
|
|
106
106
|
...props,
|
|
107
107
|
...rest,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMenu,
|
|
4
4
|
useMenuDescendantsContext
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W5VK56XL.mjs";
|
|
6
6
|
|
|
7
7
|
// src/menu-list.tsx
|
|
8
8
|
import { forwardRef } from "@yamada-ui/core";
|
|
@@ -25,12 +25,12 @@ var MenuList = forwardRef(
|
|
|
25
25
|
setFocusedIndex(prev.index);
|
|
26
26
|
}, [descendants, focusedIndex, setFocusedIndex]);
|
|
27
27
|
const onFirst = useCallback(() => {
|
|
28
|
-
const first = descendants.
|
|
28
|
+
const first = descendants.enabledFirstValue();
|
|
29
29
|
if (first)
|
|
30
30
|
setFocusedIndex(first.index);
|
|
31
31
|
}, [descendants, setFocusedIndex]);
|
|
32
32
|
const onLast = useCallback(() => {
|
|
33
|
-
const last = descendants.
|
|
33
|
+
const last = descendants.enabledLastValue();
|
|
34
34
|
if (last)
|
|
35
35
|
setFocusedIndex(last.index);
|
|
36
36
|
}, [descendants, setFocusedIndex]);
|
|
@@ -56,6 +56,7 @@ var MenuList = forwardRef(
|
|
|
56
56
|
return /* @__PURE__ */ jsx(
|
|
57
57
|
PopoverContent,
|
|
58
58
|
{
|
|
59
|
+
as: "ul",
|
|
59
60
|
ref: mergeRefs(menuRef, ref),
|
|
60
61
|
className: cx("ui-menu__list", className),
|
|
61
62
|
role: "menu",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MenuGroup
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SL5MYZ26.mjs";
|
|
5
5
|
import {
|
|
6
6
|
MenuOptionItem
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BWTIFRBL.mjs";
|
|
8
8
|
|
|
9
9
|
// src/menu-option-group.tsx
|
|
10
10
|
import { useControllableState } from "@yamada-ui/use-controllable-state";
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
useMenu
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W5VK56XL.mjs";
|
|
5
5
|
|
|
6
6
|
// src/menu-group.tsx
|
|
7
7
|
import { ui, forwardRef } from "@yamada-ui/core";
|
|
8
8
|
import { cx } from "@yamada-ui/utils";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
var MenuGroup = forwardRef(
|
|
11
|
-
({ className,
|
|
11
|
+
({ className, label, children, ...rest }, ref) => {
|
|
12
12
|
const { styles } = useMenu();
|
|
13
13
|
const css = { ...styles.group };
|
|
14
14
|
return /* @__PURE__ */ jsxs(
|
|
15
|
-
ui.
|
|
15
|
+
ui.li,
|
|
16
16
|
{
|
|
17
17
|
ref,
|
|
18
|
-
className: cx("ui-menu__item--group", className),
|
|
18
|
+
className: cx("ui-menu__item", "ui-menu__item--group", className),
|
|
19
19
|
role: "group",
|
|
20
20
|
__css: css,
|
|
21
21
|
...rest,
|
|
22
22
|
children: [
|
|
23
|
-
|
|
23
|
+
label ? /* @__PURE__ */ jsx(
|
|
24
24
|
ui.span,
|
|
25
25
|
{
|
|
26
|
-
className: cx("ui-menu__item--group-
|
|
27
|
-
__css: styles.
|
|
28
|
-
children:
|
|
26
|
+
className: cx("ui-menu__item--group-label"),
|
|
27
|
+
__css: styles.groupLabel,
|
|
28
|
+
children: label
|
|
29
29
|
}
|
|
30
30
|
) : null,
|
|
31
|
-
children
|
|
31
|
+
/* @__PURE__ */ jsx(ui.ul, { className: "ui-menu__item__group", children })
|
|
32
32
|
]
|
|
33
33
|
}
|
|
34
34
|
);
|
|
@@ -47,7 +47,7 @@ var Menu = (props) => {
|
|
|
47
47
|
const id = setTimeout(() => {
|
|
48
48
|
if (initialFocusRef)
|
|
49
49
|
return;
|
|
50
|
-
const first = descendants.
|
|
50
|
+
const first = descendants.enabledFirstValue();
|
|
51
51
|
if (first)
|
|
52
52
|
setFocusedIndex(first.index);
|
|
53
53
|
});
|
|
@@ -57,7 +57,7 @@ var Menu = (props) => {
|
|
|
57
57
|
const id = setTimeout(() => {
|
|
58
58
|
if (initialFocusRef)
|
|
59
59
|
return;
|
|
60
|
-
const last = descendants.
|
|
60
|
+
const last = descendants.enabledLastValue();
|
|
61
61
|
if (last)
|
|
62
62
|
setFocusedIndex(last.index);
|
|
63
63
|
});
|
package/dist/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var Menu = (props) => {
|
|
|
75
75
|
const id = setTimeout(() => {
|
|
76
76
|
if (initialFocusRef)
|
|
77
77
|
return;
|
|
78
|
-
const first = descendants.
|
|
78
|
+
const first = descendants.enabledFirstValue();
|
|
79
79
|
if (first)
|
|
80
80
|
setFocusedIndex(first.index);
|
|
81
81
|
});
|
|
@@ -85,7 +85,7 @@ var Menu = (props) => {
|
|
|
85
85
|
const id = setTimeout(() => {
|
|
86
86
|
if (initialFocusRef)
|
|
87
87
|
return;
|
|
88
|
-
const last = descendants.
|
|
88
|
+
const last = descendants.enabledLastValue();
|
|
89
89
|
if (last)
|
|
90
90
|
setFocusedIndex(last.index);
|
|
91
91
|
});
|
|
@@ -215,12 +215,12 @@ var MenuList = (0, import_core3.forwardRef)(
|
|
|
215
215
|
setFocusedIndex(prev.index);
|
|
216
216
|
}, [descendants, focusedIndex, setFocusedIndex]);
|
|
217
217
|
const onFirst = (0, import_react3.useCallback)(() => {
|
|
218
|
-
const first = descendants.
|
|
218
|
+
const first = descendants.enabledFirstValue();
|
|
219
219
|
if (first)
|
|
220
220
|
setFocusedIndex(first.index);
|
|
221
221
|
}, [descendants, setFocusedIndex]);
|
|
222
222
|
const onLast = (0, import_react3.useCallback)(() => {
|
|
223
|
-
const last = descendants.
|
|
223
|
+
const last = descendants.enabledLastValue();
|
|
224
224
|
if (last)
|
|
225
225
|
setFocusedIndex(last.index);
|
|
226
226
|
}, [descendants, setFocusedIndex]);
|
|
@@ -246,6 +246,7 @@ var MenuList = (0, import_core3.forwardRef)(
|
|
|
246
246
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
247
247
|
import_popover3.PopoverContent,
|
|
248
248
|
{
|
|
249
|
+
as: "ul",
|
|
249
250
|
ref: (0, import_utils3.mergeRefs)(menuRef, ref),
|
|
250
251
|
className: (0, import_utils3.cx)("ui-menu__list", className),
|
|
251
252
|
role: "menu",
|
|
@@ -348,7 +349,7 @@ var MenuItem = (0, import_core4.forwardRef)(
|
|
|
348
349
|
...styles.item
|
|
349
350
|
};
|
|
350
351
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
351
|
-
import_core4.ui.
|
|
352
|
+
import_core4.ui.li,
|
|
352
353
|
{
|
|
353
354
|
...props,
|
|
354
355
|
...rest,
|
|
@@ -435,27 +436,27 @@ var import_core5 = require("@yamada-ui/core");
|
|
|
435
436
|
var import_utils5 = require("@yamada-ui/utils");
|
|
436
437
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
437
438
|
var MenuGroup = (0, import_core5.forwardRef)(
|
|
438
|
-
({ className,
|
|
439
|
+
({ className, label, children, ...rest }, ref) => {
|
|
439
440
|
const { styles } = useMenu();
|
|
440
441
|
const css = { ...styles.group };
|
|
441
442
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
442
|
-
import_core5.ui.
|
|
443
|
+
import_core5.ui.li,
|
|
443
444
|
{
|
|
444
445
|
ref,
|
|
445
|
-
className: (0, import_utils5.cx)("ui-menu__item--group", className),
|
|
446
|
+
className: (0, import_utils5.cx)("ui-menu__item", "ui-menu__item--group", className),
|
|
446
447
|
role: "group",
|
|
447
448
|
__css: css,
|
|
448
449
|
...rest,
|
|
449
450
|
children: [
|
|
450
|
-
|
|
451
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
451
452
|
import_core5.ui.span,
|
|
452
453
|
{
|
|
453
|
-
className: (0, import_utils5.cx)("ui-menu__item--group-
|
|
454
|
-
__css: styles.
|
|
455
|
-
children:
|
|
454
|
+
className: (0, import_utils5.cx)("ui-menu__item--group-label"),
|
|
455
|
+
__css: styles.groupLabel,
|
|
456
|
+
children: label
|
|
456
457
|
}
|
|
457
458
|
) : null,
|
|
458
|
-
children
|
|
459
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.ui.ul, { className: "ui-menu__item__group", children })
|
|
459
460
|
]
|
|
460
461
|
}
|
|
461
462
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MenuButton
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XPNC6U52.mjs";
|
|
5
5
|
import {
|
|
6
6
|
MenuDivider
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-24W2CY4C.mjs";
|
|
8
8
|
import {
|
|
9
9
|
MenuList
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NLESVCUN.mjs";
|
|
11
11
|
import {
|
|
12
12
|
MenuOptionGroup
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-P6NJA644.mjs";
|
|
14
14
|
import {
|
|
15
15
|
MenuGroup
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SL5MYZ26.mjs";
|
|
17
17
|
import {
|
|
18
18
|
MenuItem,
|
|
19
19
|
MenuOptionItem
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BWTIFRBL.mjs";
|
|
21
21
|
import {
|
|
22
22
|
Menu
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-W5VK56XL.mjs";
|
|
24
24
|
export {
|
|
25
25
|
Menu,
|
|
26
26
|
MenuButton,
|
package/dist/menu-button.d.mts
CHANGED
package/dist/menu-button.d.ts
CHANGED
package/dist/menu-button.mjs
CHANGED
package/dist/menu-divider.d.mts
CHANGED
package/dist/menu-divider.d.ts
CHANGED
package/dist/menu-divider.mjs
CHANGED
package/dist/menu-group.d.mts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
2
|
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
3
|
|
|
4
|
-
type MenuGroupProps = HTMLUIProps<"div"
|
|
4
|
+
type MenuGroupProps = HTMLUIProps<"div"> & {
|
|
5
|
+
/**
|
|
6
|
+
* The label of the group.
|
|
7
|
+
*/
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
5
10
|
declare const MenuGroup: _yamada_ui_core.Component<"div", MenuGroupProps>;
|
|
6
11
|
|
|
7
|
-
export { MenuGroup, MenuGroupProps };
|
|
12
|
+
export { MenuGroup, type MenuGroupProps };
|
package/dist/menu-group.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
2
|
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
3
|
|
|
4
|
-
type MenuGroupProps = HTMLUIProps<"div"
|
|
4
|
+
type MenuGroupProps = HTMLUIProps<"div"> & {
|
|
5
|
+
/**
|
|
6
|
+
* The label of the group.
|
|
7
|
+
*/
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
5
10
|
declare const MenuGroup: _yamada_ui_core.Component<"div", MenuGroupProps>;
|
|
6
11
|
|
|
7
|
-
export { MenuGroup, MenuGroupProps };
|
|
12
|
+
export { MenuGroup, type MenuGroupProps };
|
package/dist/menu-group.js
CHANGED
|
@@ -49,27 +49,27 @@ var [MenuProvider, useMenu] = (0, import_utils.createContext)({
|
|
|
49
49
|
// src/menu-group.tsx
|
|
50
50
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
51
51
|
var MenuGroup = (0, import_core2.forwardRef)(
|
|
52
|
-
({ className,
|
|
52
|
+
({ className, label, children, ...rest }, ref) => {
|
|
53
53
|
const { styles } = useMenu();
|
|
54
54
|
const css = { ...styles.group };
|
|
55
55
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
56
|
-
import_core2.ui.
|
|
56
|
+
import_core2.ui.li,
|
|
57
57
|
{
|
|
58
58
|
ref,
|
|
59
|
-
className: (0, import_utils2.cx)("ui-menu__item--group", className),
|
|
59
|
+
className: (0, import_utils2.cx)("ui-menu__item", "ui-menu__item--group", className),
|
|
60
60
|
role: "group",
|
|
61
61
|
__css: css,
|
|
62
62
|
...rest,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
64
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
65
65
|
import_core2.ui.span,
|
|
66
66
|
{
|
|
67
|
-
className: (0, import_utils2.cx)("ui-menu__item--group-
|
|
68
|
-
__css: styles.
|
|
69
|
-
children:
|
|
67
|
+
className: (0, import_utils2.cx)("ui-menu__item--group-label"),
|
|
68
|
+
__css: styles.groupLabel,
|
|
69
|
+
children: label
|
|
70
70
|
}
|
|
71
71
|
) : null,
|
|
72
|
-
children
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ui.ul, { className: "ui-menu__item__group", children })
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
);
|
package/dist/menu-group.mjs
CHANGED
package/dist/menu-item.d.mts
CHANGED
|
@@ -55,4 +55,4 @@ type MenuOptionItemOptions = {
|
|
|
55
55
|
type MenuOptionItemProps = Omit<MenuItemProps, "icon" | "command"> & MenuOptionItemOptions;
|
|
56
56
|
declare const MenuOptionItem: _yamada_ui_core.Component<"button", MenuOptionItemProps>;
|
|
57
57
|
|
|
58
|
-
export { MenuItem, MenuItemProps, MenuOptionItem, MenuOptionItemProps };
|
|
58
|
+
export { MenuItem, type MenuItemProps, MenuOptionItem, type MenuOptionItemProps };
|
package/dist/menu-item.d.ts
CHANGED
|
@@ -55,4 +55,4 @@ type MenuOptionItemOptions = {
|
|
|
55
55
|
type MenuOptionItemProps = Omit<MenuItemProps, "icon" | "command"> & MenuOptionItemOptions;
|
|
56
56
|
declare const MenuOptionItem: _yamada_ui_core.Component<"button", MenuOptionItemProps>;
|
|
57
57
|
|
|
58
|
-
export { MenuItem, MenuItemProps, MenuOptionItem, MenuOptionItemProps };
|
|
58
|
+
export { MenuItem, type MenuItemProps, MenuOptionItem, type MenuOptionItemProps };
|
package/dist/menu-item.js
CHANGED
package/dist/menu-item.mjs
CHANGED
package/dist/menu-list.d.mts
CHANGED
package/dist/menu-list.d.ts
CHANGED
package/dist/menu-list.js
CHANGED
|
@@ -65,12 +65,12 @@ var MenuList = (0, import_core2.forwardRef)(
|
|
|
65
65
|
setFocusedIndex(prev.index);
|
|
66
66
|
}, [descendants, focusedIndex, setFocusedIndex]);
|
|
67
67
|
const onFirst = (0, import_react2.useCallback)(() => {
|
|
68
|
-
const first = descendants.
|
|
68
|
+
const first = descendants.enabledFirstValue();
|
|
69
69
|
if (first)
|
|
70
70
|
setFocusedIndex(first.index);
|
|
71
71
|
}, [descendants, setFocusedIndex]);
|
|
72
72
|
const onLast = (0, import_react2.useCallback)(() => {
|
|
73
|
-
const last = descendants.
|
|
73
|
+
const last = descendants.enabledLastValue();
|
|
74
74
|
if (last)
|
|
75
75
|
setFocusedIndex(last.index);
|
|
76
76
|
}, [descendants, setFocusedIndex]);
|
|
@@ -96,6 +96,7 @@ var MenuList = (0, import_core2.forwardRef)(
|
|
|
96
96
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
97
97
|
import_popover2.PopoverContent,
|
|
98
98
|
{
|
|
99
|
+
as: "ul",
|
|
99
100
|
ref: (0, import_utils2.mergeRefs)(menuRef, ref),
|
|
100
101
|
className: (0, import_utils2.cx)("ui-menu__list", className),
|
|
101
102
|
role: "menu",
|
package/dist/menu-list.mjs
CHANGED
|
@@ -2,6 +2,10 @@ import { HTMLUIProps, ComponentArgs } from '@yamada-ui/core';
|
|
|
2
2
|
import { Ref } from 'react';
|
|
3
3
|
|
|
4
4
|
type MenuOptionGroupOptions<Y extends string | string[] = string> = {
|
|
5
|
+
/**
|
|
6
|
+
* The label of the option group.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
5
9
|
/**
|
|
6
10
|
* The value of the menu item group.
|
|
7
11
|
*/
|
|
@@ -26,4 +30,4 @@ declare const MenuOptionGroup: (<Y extends string | string[] = string>(props: Om
|
|
|
26
30
|
ref?: Ref<HTMLDivElement> | undefined;
|
|
27
31
|
}) => JSX.Element) & ComponentArgs;
|
|
28
32
|
|
|
29
|
-
export { MenuOptionGroup, MenuOptionGroupProps };
|
|
33
|
+
export { MenuOptionGroup, type MenuOptionGroupProps };
|
|
@@ -2,6 +2,10 @@ import { HTMLUIProps, ComponentArgs } from '@yamada-ui/core';
|
|
|
2
2
|
import { Ref } from 'react';
|
|
3
3
|
|
|
4
4
|
type MenuOptionGroupOptions<Y extends string | string[] = string> = {
|
|
5
|
+
/**
|
|
6
|
+
* The label of the option group.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
5
9
|
/**
|
|
6
10
|
* The value of the menu item group.
|
|
7
11
|
*/
|
|
@@ -26,4 +30,4 @@ declare const MenuOptionGroup: (<Y extends string | string[] = string>(props: Om
|
|
|
26
30
|
ref?: Ref<HTMLDivElement> | undefined;
|
|
27
31
|
}) => JSX.Element) & ComponentArgs;
|
|
28
32
|
|
|
29
|
-
export { MenuOptionGroup, MenuOptionGroupProps };
|
|
33
|
+
export { MenuOptionGroup, type MenuOptionGroupProps };
|
|
@@ -54,27 +54,27 @@ var [MenuProvider, useMenu] = (0, import_utils.createContext)({
|
|
|
54
54
|
// src/menu-group.tsx
|
|
55
55
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
56
56
|
var MenuGroup = (0, import_core2.forwardRef)(
|
|
57
|
-
({ className,
|
|
57
|
+
({ className, label, children, ...rest }, ref) => {
|
|
58
58
|
const { styles } = useMenu();
|
|
59
59
|
const css = { ...styles.group };
|
|
60
60
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
61
|
-
import_core2.ui.
|
|
61
|
+
import_core2.ui.li,
|
|
62
62
|
{
|
|
63
63
|
ref,
|
|
64
|
-
className: (0, import_utils2.cx)("ui-menu__item--group", className),
|
|
64
|
+
className: (0, import_utils2.cx)("ui-menu__item", "ui-menu__item--group", className),
|
|
65
65
|
role: "group",
|
|
66
66
|
__css: css,
|
|
67
67
|
...rest,
|
|
68
68
|
children: [
|
|
69
|
-
|
|
69
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
70
70
|
import_core2.ui.span,
|
|
71
71
|
{
|
|
72
|
-
className: (0, import_utils2.cx)("ui-menu__item--group-
|
|
73
|
-
__css: styles.
|
|
74
|
-
children:
|
|
72
|
+
className: (0, import_utils2.cx)("ui-menu__item--group-label"),
|
|
73
|
+
__css: styles.groupLabel,
|
|
74
|
+
children: label
|
|
75
75
|
}
|
|
76
76
|
) : null,
|
|
77
|
-
children
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.ui.ul, { className: "ui-menu__item__group", children })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
);
|
|
@@ -171,7 +171,7 @@ var MenuItem = (0, import_core3.forwardRef)(
|
|
|
171
171
|
...styles.item
|
|
172
172
|
};
|
|
173
173
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
174
|
-
import_core3.ui.
|
|
174
|
+
import_core3.ui.li,
|
|
175
175
|
{
|
|
176
176
|
...props,
|
|
177
177
|
...rest,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MenuOptionGroup
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-P6NJA644.mjs";
|
|
5
|
+
import "./chunk-SL5MYZ26.mjs";
|
|
6
|
+
import "./chunk-BWTIFRBL.mjs";
|
|
7
|
+
import "./chunk-W5VK56XL.mjs";
|
|
8
8
|
export {
|
|
9
9
|
MenuOptionGroup
|
|
10
10
|
};
|
package/dist/menu.d.mts
CHANGED
|
@@ -438,7 +438,7 @@ declare const useMenuDescendantsContext: () => {
|
|
|
438
438
|
node: HTMLElement;
|
|
439
439
|
index: number;
|
|
440
440
|
})[]) => boolean) | undefined) => number;
|
|
441
|
-
|
|
441
|
+
enabledFirstValue: (filter?: ((value: {
|
|
442
442
|
disabled?: boolean | undefined;
|
|
443
443
|
id?: string | undefined;
|
|
444
444
|
filter?: ((value: any & {
|
|
@@ -478,7 +478,7 @@ declare const useMenuDescendantsContext: () => {
|
|
|
478
478
|
node: HTMLElement;
|
|
479
479
|
index: number;
|
|
480
480
|
}) | undefined;
|
|
481
|
-
|
|
481
|
+
enabledLastValue: (filter?: ((value: {
|
|
482
482
|
disabled?: boolean | undefined;
|
|
483
483
|
id?: string | undefined;
|
|
484
484
|
filter?: ((value: any & {
|
|
@@ -1706,7 +1706,7 @@ declare const useMenuDescendant: (options?: {
|
|
|
1706
1706
|
node: HTMLElement;
|
|
1707
1707
|
index: number;
|
|
1708
1708
|
})[]) => boolean) | undefined) => number;
|
|
1709
|
-
|
|
1709
|
+
enabledFirstValue: (filter?: ((value: {
|
|
1710
1710
|
disabled?: boolean | undefined;
|
|
1711
1711
|
id?: string | undefined;
|
|
1712
1712
|
filter?: ((value: {
|
|
@@ -1806,7 +1806,7 @@ declare const useMenuDescendant: (options?: {
|
|
|
1806
1806
|
node: HTMLElement;
|
|
1807
1807
|
index: number;
|
|
1808
1808
|
}) | undefined;
|
|
1809
|
-
|
|
1809
|
+
enabledLastValue: (filter?: ((value: {
|
|
1810
1810
|
disabled?: boolean | undefined;
|
|
1811
1811
|
id?: string | undefined;
|
|
1812
1812
|
filter?: ((value: {
|
|
@@ -2136,4 +2136,4 @@ type MenuOptions = {
|
|
|
2136
2136
|
type MenuProps = ThemeProps<"Menu"> & Omit<PopoverProps, "closeOnButton"> & MenuOptions;
|
|
2137
2137
|
declare const Menu: FC<MenuProps>;
|
|
2138
2138
|
|
|
2139
|
-
export { Menu, MenuProps, useMenu, useMenuDescendant, useMenuDescendantsContext };
|
|
2139
|
+
export { Menu, type MenuProps, useMenu, useMenuDescendant, useMenuDescendantsContext };
|
package/dist/menu.d.ts
CHANGED
|
@@ -438,7 +438,7 @@ declare const useMenuDescendantsContext: () => {
|
|
|
438
438
|
node: HTMLElement;
|
|
439
439
|
index: number;
|
|
440
440
|
})[]) => boolean) | undefined) => number;
|
|
441
|
-
|
|
441
|
+
enabledFirstValue: (filter?: ((value: {
|
|
442
442
|
disabled?: boolean | undefined;
|
|
443
443
|
id?: string | undefined;
|
|
444
444
|
filter?: ((value: any & {
|
|
@@ -478,7 +478,7 @@ declare const useMenuDescendantsContext: () => {
|
|
|
478
478
|
node: HTMLElement;
|
|
479
479
|
index: number;
|
|
480
480
|
}) | undefined;
|
|
481
|
-
|
|
481
|
+
enabledLastValue: (filter?: ((value: {
|
|
482
482
|
disabled?: boolean | undefined;
|
|
483
483
|
id?: string | undefined;
|
|
484
484
|
filter?: ((value: any & {
|
|
@@ -1706,7 +1706,7 @@ declare const useMenuDescendant: (options?: {
|
|
|
1706
1706
|
node: HTMLElement;
|
|
1707
1707
|
index: number;
|
|
1708
1708
|
})[]) => boolean) | undefined) => number;
|
|
1709
|
-
|
|
1709
|
+
enabledFirstValue: (filter?: ((value: {
|
|
1710
1710
|
disabled?: boolean | undefined;
|
|
1711
1711
|
id?: string | undefined;
|
|
1712
1712
|
filter?: ((value: {
|
|
@@ -1806,7 +1806,7 @@ declare const useMenuDescendant: (options?: {
|
|
|
1806
1806
|
node: HTMLElement;
|
|
1807
1807
|
index: number;
|
|
1808
1808
|
}) | undefined;
|
|
1809
|
-
|
|
1809
|
+
enabledLastValue: (filter?: ((value: {
|
|
1810
1810
|
disabled?: boolean | undefined;
|
|
1811
1811
|
id?: string | undefined;
|
|
1812
1812
|
filter?: ((value: {
|
|
@@ -2136,4 +2136,4 @@ type MenuOptions = {
|
|
|
2136
2136
|
type MenuProps = ThemeProps<"Menu"> & Omit<PopoverProps, "closeOnButton"> & MenuOptions;
|
|
2137
2137
|
declare const Menu: FC<MenuProps>;
|
|
2138
2138
|
|
|
2139
|
-
export { Menu, MenuProps, useMenu, useMenuDescendant, useMenuDescendantsContext };
|
|
2139
|
+
export { Menu, type MenuProps, useMenu, useMenuDescendant, useMenuDescendantsContext };
|
package/dist/menu.js
CHANGED
|
@@ -69,7 +69,7 @@ var Menu = (props) => {
|
|
|
69
69
|
const id = setTimeout(() => {
|
|
70
70
|
if (initialFocusRef)
|
|
71
71
|
return;
|
|
72
|
-
const first = descendants.
|
|
72
|
+
const first = descendants.enabledFirstValue();
|
|
73
73
|
if (first)
|
|
74
74
|
setFocusedIndex(first.index);
|
|
75
75
|
});
|
|
@@ -79,7 +79,7 @@ var Menu = (props) => {
|
|
|
79
79
|
const id = setTimeout(() => {
|
|
80
80
|
if (initialFocusRef)
|
|
81
81
|
return;
|
|
82
|
-
const last = descendants.
|
|
82
|
+
const last = descendants.enabledLastValue();
|
|
83
83
|
if (last)
|
|
84
84
|
setFocusedIndex(last.index);
|
|
85
85
|
});
|
package/dist/menu.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/menu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Yamada UI menu component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.
|
|
38
|
+
"@yamada-ui/core": "0.13.0",
|
|
39
39
|
"@yamada-ui/utils": "0.3.3",
|
|
40
|
-
"@yamada-ui/popover": "0.3.
|
|
41
|
-
"@yamada-ui/transitions": "0.3.
|
|
40
|
+
"@yamada-ui/popover": "0.3.26",
|
|
41
|
+
"@yamada-ui/transitions": "0.3.21",
|
|
42
42
|
"@yamada-ui/use-disclosure": "0.4.3",
|
|
43
|
-
"@yamada-ui/use-descendant": "0.2.
|
|
43
|
+
"@yamada-ui/use-descendant": "0.2.7",
|
|
44
44
|
"@yamada-ui/use-clickable": "0.3.6",
|
|
45
45
|
"@yamada-ui/use-controllable-state": "0.4.0"
|
|
46
46
|
},
|