@yamada-ui/menu 1.3.15-dev-20241005224505 → 1.3.15-dev-20241006032009
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-ZUOFHOX6.mjs → chunk-EJHOFPF4.mjs} +11 -11
- package/dist/chunk-EJHOFPF4.mjs.map +1 -0
- package/dist/{chunk-ZV73JKM5.mjs → chunk-ELQD4RMJ.mjs} +4 -4
- package/dist/{chunk-ZV73JKM5.mjs.map → chunk-ELQD4RMJ.mjs.map} +1 -1
- package/dist/{chunk-T7CXLEBW.mjs → chunk-HEDZYLPX.mjs} +35 -35
- package/dist/chunk-HEDZYLPX.mjs.map +1 -0
- package/dist/{chunk-NNSVX2GX.mjs → chunk-I2KIZ6OI.mjs} +28 -28
- package/dist/{chunk-NNSVX2GX.mjs.map → chunk-I2KIZ6OI.mjs.map} +1 -1
- package/dist/{chunk-O5D4LR5P.mjs → chunk-I473RINV.mjs} +8 -8
- package/dist/{chunk-O5D4LR5P.mjs.map → chunk-I473RINV.mjs.map} +1 -1
- package/dist/{chunk-OFCEMPQW.mjs → chunk-KZAACFSL.mjs} +3 -3
- package/dist/{chunk-OFCEMPQW.mjs.map → chunk-KZAACFSL.mjs.map} +1 -1
- package/dist/{chunk-HVOHR2NQ.mjs → chunk-O7MHNHWF.mjs} +4 -4
- package/dist/{chunk-HVOHR2NQ.mjs.map → chunk-O7MHNHWF.mjs.map} +1 -1
- package/dist/{chunk-SI3WI4AI.mjs → chunk-OETJECD3.mjs} +8 -8
- package/dist/chunk-OETJECD3.mjs.map +1 -0
- package/dist/{chunk-WQ626PSA.mjs → chunk-T4SSYCLG.mjs} +9 -8
- package/dist/chunk-T4SSYCLG.mjs.map +1 -0
- package/dist/{chunk-M4PPRRRC.mjs → chunk-TM7BAARA.mjs} +14 -14
- package/dist/chunk-TM7BAARA.mjs.map +1 -0
- package/dist/context-menu-trigger.js +14 -13
- package/dist/context-menu-trigger.js.map +1 -1
- package/dist/context-menu-trigger.mjs +2 -2
- package/dist/context-menu.js +33 -33
- package/dist/context-menu.js.map +1 -1
- package/dist/context-menu.mjs +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +275 -272
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/menu-button.d.mts +2 -2
- package/dist/menu-button.d.ts +2 -2
- package/dist/menu-button.js +50 -50
- package/dist/menu-button.js.map +1 -1
- package/dist/menu-button.mjs +3 -3
- package/dist/menu-context.d.mts +116 -116
- package/dist/menu-context.d.ts +116 -116
- package/dist/menu-context.js +8 -8
- package/dist/menu-context.js.map +1 -1
- package/dist/menu-context.mjs +1 -1
- package/dist/menu-divider.js +8 -8
- package/dist/menu-divider.js.map +1 -1
- package/dist/menu-divider.mjs +2 -2
- package/dist/menu-group.js +9 -9
- package/dist/menu-group.js.map +1 -1
- package/dist/menu-group.mjs +2 -2
- package/dist/menu-item.d.mts +21 -21
- package/dist/menu-item.d.ts +21 -21
- package/dist/menu-item.js +40 -40
- package/dist/menu-item.js.map +1 -1
- package/dist/menu-item.mjs +2 -2
- package/dist/menu-list.js +14 -14
- package/dist/menu-list.js.map +1 -1
- package/dist/menu-list.mjs +2 -2
- package/dist/menu-option-group.d.mts +8 -8
- package/dist/menu-option-group.d.ts +8 -8
- package/dist/menu-option-group.js +46 -46
- package/dist/menu-option-group.js.map +1 -1
- package/dist/menu-option-group.mjs +4 -4
- package/dist/menu.js +33 -33
- package/dist/menu.js.map +1 -1
- package/dist/menu.mjs +2 -2
- package/package.json +11 -11
- package/dist/chunk-M4PPRRRC.mjs.map +0 -1
- package/dist/chunk-SI3WI4AI.mjs.map +0 -1
- package/dist/chunk-T7CXLEBW.mjs.map +0 -1
- package/dist/chunk-WQ626PSA.mjs.map +0 -1
- package/dist/chunk-ZUOFHOX6.mjs.map +0 -1
package/dist/menu-context.d.ts
CHANGED
@@ -1,210 +1,210 @@
|
|
1
1
|
import * as react from 'react';
|
2
|
-
import {
|
2
|
+
import { RefObject, MutableRefObject, Dispatch, SetStateAction, KeyboardEventHandler } from 'react';
|
3
3
|
import * as _yamada_ui_use_descendant from '@yamada-ui/use-descendant';
|
4
4
|
import { CSSUIObject } from '@yamada-ui/core';
|
5
5
|
import { MenuOptions } from './menu.js';
|
6
6
|
import '@yamada-ui/popover';
|
7
7
|
|
8
8
|
declare const DescendantsContextProvider: react.Provider<{
|
9
|
-
register: (nodeOrOptions: HTMLElement | {
|
10
|
-
disabled?: boolean;
|
11
|
-
id?: string;
|
12
|
-
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
13
|
-
} | null) => void | ((node: HTMLElement | null) => void);
|
14
|
-
unregister: (node: HTMLElement) => void;
|
15
|
-
destroy: () => void;
|
16
9
|
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
17
|
-
|
18
|
-
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
19
|
-
indexOf: (node: HTMLElement | null) => number;
|
20
|
-
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
21
|
-
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
22
|
-
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
23
|
-
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
10
|
+
destroy: () => void;
|
24
11
|
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
25
|
-
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
26
|
-
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
27
|
-
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
28
12
|
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
13
|
+
enabledIndexOf: (node?: HTMLElement | null | undefined, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
29
14
|
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
30
|
-
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
31
15
|
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
disabled?: boolean;
|
36
|
-
id?: string;
|
37
|
-
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
38
|
-
} | null) => void | ((node: HTMLElement | null) => void);
|
39
|
-
unregister: (node: HTMLElement) => void;
|
40
|
-
destroy: () => void;
|
41
|
-
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
42
|
-
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
43
|
-
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
44
|
-
indexOf: (node: HTMLElement | null) => number;
|
16
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
17
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
18
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
45
19
|
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
20
|
+
indexOf: (node?: HTMLElement | null | undefined) => number;
|
46
21
|
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
47
|
-
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
48
22
|
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
49
|
-
|
50
|
-
|
51
|
-
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
52
|
-
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
53
|
-
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
54
|
-
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
55
|
-
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
56
|
-
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
57
|
-
};
|
58
|
-
declare const useDescendants: () => {
|
59
|
-
register: (nodeOrOptions: HTMLElement | {
|
60
|
-
disabled?: boolean;
|
23
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
24
|
+
register: (nodeOrOptions?: HTMLElement | {
|
61
25
|
id?: string;
|
26
|
+
disabled?: boolean;
|
62
27
|
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
63
|
-
} | null) => void | ((node: HTMLElement | null) => void);
|
64
|
-
unregister: (node
|
65
|
-
destroy: () => void;
|
66
|
-
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
67
|
-
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
28
|
+
} | null | undefined) => void | ((node: HTMLElement | null) => void);
|
29
|
+
unregister: (node?: HTMLElement | undefined) => void;
|
68
30
|
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
69
|
-
|
70
|
-
|
71
|
-
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
72
|
-
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
73
|
-
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
74
|
-
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
75
|
-
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
76
|
-
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
77
|
-
enabledIndexOf: (node: HTMLElement | null, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
78
|
-
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
79
|
-
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
80
|
-
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
81
|
-
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
82
|
-
};
|
31
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
32
|
+
}>;
|
83
33
|
declare const useMenuDescendant: (options?: {
|
84
|
-
disabled?: boolean;
|
85
34
|
id?: string;
|
35
|
+
disabled?: boolean;
|
86
36
|
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
87
37
|
} | undefined) => {
|
88
38
|
descendants: {
|
89
|
-
register: (nodeOrOptions: HTMLElement | _yamada_ui_use_descendant.DescendantOptions<HTMLElement, {
|
90
|
-
[key: string]: any;
|
91
|
-
}> | null) => void | ((node: HTMLElement | null) => void);
|
92
|
-
unregister: (node: HTMLElement) => void;
|
93
|
-
destroy: () => void;
|
94
39
|
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
95
40
|
[key: string]: any;
|
96
41
|
}> | undefined) => number;
|
97
|
-
|
98
|
-
|
99
|
-
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
42
|
+
destroy: () => void;
|
43
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
100
44
|
[key: string]: any;
|
101
|
-
}>
|
102
|
-
|
45
|
+
}> | undefined) => number;
|
46
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
103
47
|
[key: string]: any;
|
104
48
|
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
105
49
|
[key: string]: any;
|
106
50
|
}> | undefined;
|
107
|
-
|
108
|
-
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
51
|
+
enabledIndexOf: (node?: HTMLElement | null | undefined, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
109
52
|
[key: string]: any;
|
110
|
-
}> | undefined) =>
|
111
|
-
|
112
|
-
}> | undefined;
|
113
|
-
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
53
|
+
}> | undefined) => number;
|
54
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
114
55
|
[key: string]: any;
|
115
56
|
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
116
57
|
[key: string]: any;
|
117
58
|
}> | undefined;
|
118
|
-
|
59
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
119
60
|
[key: string]: any;
|
120
61
|
}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
121
62
|
[key: string]: any;
|
122
63
|
}> | undefined;
|
123
|
-
|
64
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
124
65
|
[key: string]: any;
|
125
66
|
}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
126
67
|
[key: string]: any;
|
127
68
|
}> | undefined;
|
128
|
-
|
69
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
129
70
|
[key: string]: any;
|
130
|
-
}> | undefined) =>
|
71
|
+
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
72
|
+
[key: string]: any;
|
73
|
+
}> | undefined;
|
131
74
|
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
132
75
|
[key: string]: any;
|
133
76
|
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
134
77
|
[key: string]: any;
|
135
78
|
}>[];
|
136
|
-
|
79
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
137
80
|
[key: string]: any;
|
138
81
|
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
139
82
|
[key: string]: any;
|
140
83
|
}> | undefined;
|
141
|
-
|
142
|
-
|
143
|
-
}> | undefined) => number;
|
144
|
-
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
84
|
+
indexOf: (node?: HTMLElement | null | undefined) => number;
|
85
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
145
86
|
[key: string]: any;
|
146
87
|
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
147
88
|
[key: string]: any;
|
148
89
|
}> | undefined;
|
149
|
-
|
90
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
150
91
|
[key: string]: any;
|
151
|
-
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
92
|
+
}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
152
93
|
[key: string]: any;
|
153
94
|
}> | undefined;
|
154
|
-
|
95
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
155
96
|
[key: string]: any;
|
156
97
|
}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
157
98
|
[key: string]: any;
|
158
99
|
}> | undefined;
|
159
|
-
|
100
|
+
register: (nodeOrOptions?: HTMLElement | _yamada_ui_use_descendant.DescendantOptions<HTMLElement, {
|
160
101
|
[key: string]: any;
|
161
|
-
}> |
|
102
|
+
}> | null | undefined) => void | ((node: HTMLElement | null) => void);
|
103
|
+
unregister: (node?: HTMLElement | undefined) => void;
|
104
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
105
|
+
[key: string]: any;
|
106
|
+
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
162
107
|
[key: string]: any;
|
163
108
|
}> | undefined;
|
109
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {
|
110
|
+
[key: string]: any;
|
111
|
+
}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {
|
112
|
+
[key: string]: any;
|
113
|
+
}>[];
|
164
114
|
};
|
165
|
-
index: number;
|
166
115
|
enabledIndex: number;
|
116
|
+
index: number;
|
167
117
|
register: (node: HTMLElement | null) => void;
|
168
118
|
};
|
119
|
+
declare const useDescendants: () => {
|
120
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
121
|
+
destroy: () => void;
|
122
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
123
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
124
|
+
enabledIndexOf: (node?: HTMLElement | null | undefined, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
125
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
126
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
127
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
128
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
129
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
130
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
131
|
+
indexOf: (node?: HTMLElement | null | undefined) => number;
|
132
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
133
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
134
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
135
|
+
register: (nodeOrOptions?: HTMLElement | {
|
136
|
+
id?: string;
|
137
|
+
disabled?: boolean;
|
138
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
139
|
+
} | null | undefined) => void | ((node: HTMLElement | null) => void);
|
140
|
+
unregister: (node?: HTMLElement | undefined) => void;
|
141
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
142
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
143
|
+
};
|
144
|
+
declare const useMenuDescendantsContext: () => {
|
145
|
+
count: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
146
|
+
destroy: () => void;
|
147
|
+
enabledCount: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
148
|
+
enabledFirstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
149
|
+
enabledIndexOf: (node?: HTMLElement | null | undefined, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => number;
|
150
|
+
enabledLastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
151
|
+
enabledNextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
152
|
+
enabledPrevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
153
|
+
enabledValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
154
|
+
enabledValues: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
155
|
+
firstValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
156
|
+
indexOf: (node?: HTMLElement | null | undefined) => number;
|
157
|
+
lastValue: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
158
|
+
nextValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
159
|
+
prevValue: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined, loop?: boolean) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
160
|
+
register: (nodeOrOptions?: HTMLElement | {
|
161
|
+
id?: string;
|
162
|
+
disabled?: boolean;
|
163
|
+
filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined;
|
164
|
+
} | null | undefined) => void | ((node: HTMLElement | null) => void);
|
165
|
+
unregister: (node?: HTMLElement | undefined) => void;
|
166
|
+
value: (index: number, filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}> | undefined;
|
167
|
+
values: (filter?: _yamada_ui_use_descendant.FilterDescendant<HTMLElement, {}> | undefined) => _yamada_ui_use_descendant.Descendant<HTMLElement, {}>[];
|
168
|
+
};
|
169
169
|
interface MenuContext extends MenuOptions {
|
170
|
-
isOpen: boolean;
|
171
|
-
onOpen: () => void;
|
172
|
-
onClose: () => void;
|
173
|
-
onUpstreamClose?: () => void;
|
174
|
-
onFocusFirstItem: () => void;
|
175
|
-
onFocusLastItem: () => void;
|
176
170
|
focusedIndex: number;
|
177
|
-
setFocusedIndex: Dispatch<SetStateAction<number>>;
|
178
|
-
menuRef: RefObject<HTMLDivElement>;
|
179
|
-
requestAnimationFrameId: MutableRefObject<number | null>;
|
180
171
|
isNested: boolean;
|
172
|
+
isOpen: boolean;
|
173
|
+
menuRef: RefObject<HTMLDivElement>;
|
174
|
+
requestAnimationFrameId: MutableRefObject<null | number>;
|
175
|
+
setFocusedIndex: Dispatch<SetStateAction<number>>;
|
181
176
|
styles: {
|
182
|
-
[key: string]: CSSUIObject;
|
177
|
+
[key: string]: CSSUIObject | undefined;
|
183
178
|
};
|
179
|
+
onClose: () => void;
|
180
|
+
onFocusFirstItem: () => void;
|
181
|
+
onFocusLastItem: () => void;
|
182
|
+
onOpen: () => void;
|
183
|
+
onUpstreamClose?: () => void;
|
184
184
|
}
|
185
185
|
declare const MenuProvider: react.Provider<MenuContext>;
|
186
186
|
declare const useMenu: () => MenuContext;
|
187
187
|
interface ContextMenuContext {
|
188
188
|
styles: {
|
189
|
-
[key: string]: CSSUIObject;
|
189
|
+
[key: string]: CSSUIObject | undefined;
|
190
190
|
};
|
191
191
|
}
|
192
|
-
declare const ContextMenuProvider: react.Provider<ContextMenuContext>;
|
193
|
-
declare const useContextMenu: () => ContextMenuContext;
|
192
|
+
declare const ContextMenuProvider: react.Provider<ContextMenuContext | undefined>;
|
193
|
+
declare const useContextMenu: () => ContextMenuContext | undefined;
|
194
194
|
interface UpstreamMenuContext {
|
195
195
|
relatedRef: RefObject<HTMLElement>;
|
196
196
|
onDownstreamCloseMapRef: MutableRefObject<Map<string, () => void>>;
|
197
197
|
onUpstreamClose: () => void;
|
198
198
|
}
|
199
|
-
declare const UpstreamMenuProvider: react.Provider<UpstreamMenuContext>;
|
200
|
-
declare const useUpstreamMenu: () => UpstreamMenuContext;
|
199
|
+
declare const UpstreamMenuProvider: react.Provider<UpstreamMenuContext | undefined>;
|
200
|
+
declare const useUpstreamMenu: () => UpstreamMenuContext | undefined;
|
201
201
|
interface UpstreamMenuItemContext {
|
202
|
-
onUpstreamRestoreFocus: () => void;
|
203
|
-
onKeyDownRef: RefObject<KeyboardEventHandler<HTMLLIElement>>;
|
204
|
-
setDownstreamOpen: Dispatch<SetStateAction<boolean>>;
|
205
202
|
hasDownstreamRef: MutableRefObject<boolean>;
|
203
|
+
setDownstreamOpen: Dispatch<SetStateAction<boolean>>;
|
204
|
+
onKeyDownRef: RefObject<KeyboardEventHandler<HTMLLIElement>>;
|
205
|
+
onUpstreamRestoreFocus: () => void;
|
206
206
|
}
|
207
|
-
declare const UpstreamMenuItemProvider: react.Provider<UpstreamMenuItemContext>;
|
208
|
-
declare const useUpstreamMenuItem: () => UpstreamMenuItemContext;
|
207
|
+
declare const UpstreamMenuItemProvider: react.Provider<UpstreamMenuItemContext | undefined>;
|
208
|
+
declare const useUpstreamMenuItem: () => UpstreamMenuItemContext | undefined;
|
209
209
|
|
210
210
|
export { ContextMenuProvider, DescendantsContextProvider, MenuProvider, UpstreamMenuItemProvider, UpstreamMenuProvider, useContextMenu, useDescendants, useMenu, useMenuDescendant, useMenuDescendantsContext, useUpstreamMenu, useUpstreamMenuItem };
|
package/dist/menu-context.js
CHANGED
@@ -39,25 +39,25 @@ var import_use_descendant = require("@yamada-ui/use-descendant");
|
|
39
39
|
var import_utils = require("@yamada-ui/utils");
|
40
40
|
var {
|
41
41
|
DescendantsContextProvider,
|
42
|
-
|
42
|
+
useDescendant: useMenuDescendant,
|
43
43
|
useDescendants,
|
44
|
-
|
44
|
+
useDescendantsContext: useMenuDescendantsContext
|
45
45
|
} = (0, import_use_descendant.createDescendant)();
|
46
46
|
var [MenuProvider, useMenu] = (0, import_utils.createContext)({
|
47
47
|
name: "MenuContext",
|
48
48
|
errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />"`
|
49
49
|
});
|
50
50
|
var [ContextMenuProvider, useContextMenu] = (0, import_utils.createContext)({
|
51
|
-
|
52
|
-
|
51
|
+
name: "ContextMenuContext",
|
52
|
+
strict: false
|
53
53
|
});
|
54
54
|
var [UpstreamMenuProvider, useUpstreamMenu] = (0, import_utils.createContext)({
|
55
|
-
|
56
|
-
|
55
|
+
name: "UpstreamMenuContext",
|
56
|
+
strict: false
|
57
57
|
});
|
58
58
|
var [UpstreamMenuItemProvider, useUpstreamMenuItem] = (0, import_utils.createContext)({
|
59
|
-
|
60
|
-
|
59
|
+
name: "UpstreamMenuItemContext",
|
60
|
+
strict: false
|
61
61
|
});
|
62
62
|
// Annotate the CommonJS export names for ESM import in node:
|
63
63
|
0 && (module.exports = {
|
package/dist/menu-context.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/menu-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport
|
1
|
+
{"version":3,"sources":["../src/menu-context.ts"],"sourcesContent":["import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type {\n Dispatch,\n KeyboardEventHandler,\n MutableRefObject,\n RefObject,\n SetStateAction,\n} from \"react\"\nimport type { MenuOptions } from \"./menu\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\n\nexport const {\n DescendantsContextProvider,\n useDescendant: useMenuDescendant,\n useDescendants,\n useDescendantsContext: useMenuDescendantsContext,\n} = createDescendant()\n\ninterface MenuContext extends MenuOptions {\n focusedIndex: number\n isNested: boolean\n isOpen: boolean\n menuRef: RefObject<HTMLDivElement>\n requestAnimationFrameId: MutableRefObject<null | number>\n setFocusedIndex: Dispatch<SetStateAction<number>>\n styles: { [key: string]: CSSUIObject | undefined }\n onClose: () => void\n onFocusFirstItem: () => void\n onFocusLastItem: () => void\n onOpen: () => void\n onUpstreamClose?: () => void\n}\n\nexport const [MenuProvider, useMenu] = createContext<MenuContext>({\n name: \"MenuContext\",\n errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in \"<Menu />\"`,\n})\n\ninterface ContextMenuContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ContextMenuProvider, useContextMenu] =\n createContext<ContextMenuContext>({\n name: \"ContextMenuContext\",\n strict: false,\n })\n\ninterface UpstreamMenuContext {\n relatedRef: RefObject<HTMLElement>\n onDownstreamCloseMapRef: MutableRefObject<Map<string, () => void>>\n onUpstreamClose: () => void\n}\n\nexport const [UpstreamMenuProvider, useUpstreamMenu] =\n createContext<UpstreamMenuContext>({\n name: \"UpstreamMenuContext\",\n strict: false,\n })\n\ninterface UpstreamMenuItemContext {\n hasDownstreamRef: MutableRefObject<boolean>\n setDownstreamOpen: Dispatch<SetStateAction<boolean>>\n onKeyDownRef: RefObject<KeyboardEventHandler<HTMLLIElement>>\n onUpstreamRestoreFocus: () => void\n}\n\nexport const [UpstreamMenuItemProvider, useUpstreamMenuItem] =\n createContext<UpstreamMenuItemContext>({\n name: \"UpstreamMenuItemContext\",\n strict: false,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,4BAAiC;AACjC,mBAA8B;AAEvB,IAAM;AAAA,EACX;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,uBAAuB;AACzB,QAAI,wCAAiB;AAiBd,IAAM,CAAC,cAAc,OAAO,QAAI,4BAA2B;AAAA,EAChE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,qBAAqB,cAAc,QAC/C,4BAAkC;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AAQI,IAAM,CAAC,sBAAsB,eAAe,QACjD,4BAAmC;AAAA,EACjC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AASI,IAAM,CAAC,0BAA0B,mBAAmB,QACzD,4BAAuC;AAAA,EACrC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;","names":[]}
|
package/dist/menu-context.mjs
CHANGED
package/dist/menu-divider.js
CHANGED
@@ -32,25 +32,25 @@ var import_use_descendant = require("@yamada-ui/use-descendant");
|
|
32
32
|
var import_utils = require("@yamada-ui/utils");
|
33
33
|
var {
|
34
34
|
DescendantsContextProvider,
|
35
|
-
|
35
|
+
useDescendant: useMenuDescendant,
|
36
36
|
useDescendants,
|
37
|
-
|
37
|
+
useDescendantsContext: useMenuDescendantsContext
|
38
38
|
} = (0, import_use_descendant.createDescendant)();
|
39
39
|
var [MenuProvider, useMenu] = (0, import_utils.createContext)({
|
40
40
|
name: "MenuContext",
|
41
41
|
errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />"`
|
42
42
|
});
|
43
43
|
var [ContextMenuProvider, useContextMenu] = (0, import_utils.createContext)({
|
44
|
-
|
45
|
-
|
44
|
+
name: "ContextMenuContext",
|
45
|
+
strict: false
|
46
46
|
});
|
47
47
|
var [UpstreamMenuProvider, useUpstreamMenu] = (0, import_utils.createContext)({
|
48
|
-
|
49
|
-
|
48
|
+
name: "UpstreamMenuContext",
|
49
|
+
strict: false
|
50
50
|
});
|
51
51
|
var [UpstreamMenuItemProvider, useUpstreamMenuItem] = (0, import_utils.createContext)({
|
52
|
-
|
53
|
-
|
52
|
+
name: "UpstreamMenuItemContext",
|
53
|
+
strict: false
|
54
54
|
});
|
55
55
|
|
56
56
|
// src/menu-divider.tsx
|
package/dist/menu-divider.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/menu-divider.tsx","../src/menu-context.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"sources":["../src/menu-divider.tsx","../src/menu-context.ts"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMenu } from \"./menu-context\"\n\nexport interface MenuDividerProps extends HTMLUIProps<\"hr\"> {}\n\nexport const MenuDivider = forwardRef<MenuDividerProps, \"hr\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useMenu()\n\n const css: CSSUIObject = { ...styles.divider }\n\n return (\n <ui.hr\n ref={ref}\n className={cx(\"ui-menu__divider\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type {\n Dispatch,\n KeyboardEventHandler,\n MutableRefObject,\n RefObject,\n SetStateAction,\n} from \"react\"\nimport type { MenuOptions } from \"./menu\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\n\nexport const {\n DescendantsContextProvider,\n useDescendant: useMenuDescendant,\n useDescendants,\n useDescendantsContext: useMenuDescendantsContext,\n} = createDescendant()\n\ninterface MenuContext extends MenuOptions {\n focusedIndex: number\n isNested: boolean\n isOpen: boolean\n menuRef: RefObject<HTMLDivElement>\n requestAnimationFrameId: MutableRefObject<null | number>\n setFocusedIndex: Dispatch<SetStateAction<number>>\n styles: { [key: string]: CSSUIObject | undefined }\n onClose: () => void\n onFocusFirstItem: () => void\n onFocusLastItem: () => void\n onOpen: () => void\n onUpstreamClose?: () => void\n}\n\nexport const [MenuProvider, useMenu] = createContext<MenuContext>({\n name: \"MenuContext\",\n errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in \"<Menu />\"`,\n})\n\ninterface ContextMenuContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ContextMenuProvider, useContextMenu] =\n createContext<ContextMenuContext>({\n name: \"ContextMenuContext\",\n strict: false,\n })\n\ninterface UpstreamMenuContext {\n relatedRef: RefObject<HTMLElement>\n onDownstreamCloseMapRef: MutableRefObject<Map<string, () => void>>\n onUpstreamClose: () => void\n}\n\nexport const [UpstreamMenuProvider, useUpstreamMenu] =\n createContext<UpstreamMenuContext>({\n name: \"UpstreamMenuContext\",\n strict: false,\n })\n\ninterface UpstreamMenuItemContext {\n hasDownstreamRef: MutableRefObject<boolean>\n setDownstreamOpen: Dispatch<SetStateAction<boolean>>\n onKeyDownRef: RefObject<KeyboardEventHandler<HTMLLIElement>>\n onUpstreamRestoreFocus: () => void\n}\n\nexport const [UpstreamMenuItemProvider, useUpstreamMenuItem] =\n createContext<UpstreamMenuItemContext>({\n name: \"UpstreamMenuItemContext\",\n strict: false,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACOnB,4BAAiC;AACjC,mBAA8B;AAEvB,IAAM;AAAA,EACX;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,uBAAuB;AACzB,QAAI,wCAAiB;AAiBd,IAAM,CAAC,cAAc,OAAO,QAAI,4BAA2B;AAAA,EAChE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,qBAAqB,cAAc,QAC/C,4BAAkC;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AAQI,IAAM,CAAC,sBAAsB,eAAe,QACjD,4BAAmC;AAAA,EACjC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AASI,IAAM,CAAC,0BAA0B,mBAAmB,QACzD,4BAAuC;AAAA,EACrC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;;;AD1DG;AAPC,IAAM,kBAAc;AAAA,EACzB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,EAAE,OAAO,IAAI,QAAQ;AAE3B,UAAM,MAAmB,EAAE,GAAG,OAAO,QAAQ;AAE7C,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,oBAAoB,SAAS;AAAA,QAC3C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":["import_utils"]}
|
package/dist/menu-divider.mjs
CHANGED
package/dist/menu-group.js
CHANGED
@@ -32,31 +32,31 @@ var import_use_descendant = require("@yamada-ui/use-descendant");
|
|
32
32
|
var import_utils = require("@yamada-ui/utils");
|
33
33
|
var {
|
34
34
|
DescendantsContextProvider,
|
35
|
-
|
35
|
+
useDescendant: useMenuDescendant,
|
36
36
|
useDescendants,
|
37
|
-
|
37
|
+
useDescendantsContext: useMenuDescendantsContext
|
38
38
|
} = (0, import_use_descendant.createDescendant)();
|
39
39
|
var [MenuProvider, useMenu] = (0, import_utils.createContext)({
|
40
40
|
name: "MenuContext",
|
41
41
|
errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />"`
|
42
42
|
});
|
43
43
|
var [ContextMenuProvider, useContextMenu] = (0, import_utils.createContext)({
|
44
|
-
|
45
|
-
|
44
|
+
name: "ContextMenuContext",
|
45
|
+
strict: false
|
46
46
|
});
|
47
47
|
var [UpstreamMenuProvider, useUpstreamMenu] = (0, import_utils.createContext)({
|
48
|
-
|
49
|
-
|
48
|
+
name: "UpstreamMenuContext",
|
49
|
+
strict: false
|
50
50
|
});
|
51
51
|
var [UpstreamMenuItemProvider, useUpstreamMenuItem] = (0, import_utils.createContext)({
|
52
|
-
|
53
|
-
|
52
|
+
name: "UpstreamMenuItemContext",
|
53
|
+
strict: false
|
54
54
|
});
|
55
55
|
|
56
56
|
// src/menu-group.tsx
|
57
57
|
var import_jsx_runtime = require("react/jsx-runtime");
|
58
58
|
var MenuGroup = (0, import_core.forwardRef)(
|
59
|
-
({ className,
|
59
|
+
({ className, children, label, labelProps, ...rest }, ref) => {
|
60
60
|
const { styles } = useMenu();
|
61
61
|
const css = { ...styles.group };
|
62
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
package/dist/menu-group.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/menu-group.tsx","../src/menu-context.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"sources":["../src/menu-group.tsx","../src/menu-context.ts"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMenu } from \"./menu-context\"\n\nexport interface MenuGroupProps extends HTMLUIProps<\"li\"> {\n /**\n * The label of the group.\n */\n label?: string\n /**\n * Props for menu group element.\n */\n labelProps?: HTMLUIProps<\"span\">\n}\n\nexport const MenuGroup = forwardRef<MenuGroupProps, \"li\">(\n ({ className, children, label, labelProps, ...rest }, ref) => {\n const { styles } = useMenu()\n\n const css: CSSUIObject = { ...styles.group }\n\n return (\n <ui.li\n ref={ref}\n className={cx(\"ui-menu__item\", \"ui-menu__item--group\", className)}\n role=\"group\"\n __css={css}\n {...rest}\n >\n {label ? (\n <ui.span\n className={cx(\"ui-menu__item--group-label\")}\n __css={styles.groupLabel}\n {...labelProps}\n >\n {label}\n </ui.span>\n ) : null}\n\n <ui.ul className=\"ui-menu__item__group\">{children}</ui.ul>\n </ui.li>\n )\n },\n)\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport type {\n Dispatch,\n KeyboardEventHandler,\n MutableRefObject,\n RefObject,\n SetStateAction,\n} from \"react\"\nimport type { MenuOptions } from \"./menu\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { createContext } from \"@yamada-ui/utils\"\n\nexport const {\n DescendantsContextProvider,\n useDescendant: useMenuDescendant,\n useDescendants,\n useDescendantsContext: useMenuDescendantsContext,\n} = createDescendant()\n\ninterface MenuContext extends MenuOptions {\n focusedIndex: number\n isNested: boolean\n isOpen: boolean\n menuRef: RefObject<HTMLDivElement>\n requestAnimationFrameId: MutableRefObject<null | number>\n setFocusedIndex: Dispatch<SetStateAction<number>>\n styles: { [key: string]: CSSUIObject | undefined }\n onClose: () => void\n onFocusFirstItem: () => void\n onFocusLastItem: () => void\n onOpen: () => void\n onUpstreamClose?: () => void\n}\n\nexport const [MenuProvider, useMenu] = createContext<MenuContext>({\n name: \"MenuContext\",\n errorMessage: `useMenu returned is 'undefined'. Seems you forgot to wrap the components in \"<Menu />\"`,\n})\n\ninterface ContextMenuContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nexport const [ContextMenuProvider, useContextMenu] =\n createContext<ContextMenuContext>({\n name: \"ContextMenuContext\",\n strict: false,\n })\n\ninterface UpstreamMenuContext {\n relatedRef: RefObject<HTMLElement>\n onDownstreamCloseMapRef: MutableRefObject<Map<string, () => void>>\n onUpstreamClose: () => void\n}\n\nexport const [UpstreamMenuProvider, useUpstreamMenu] =\n createContext<UpstreamMenuContext>({\n name: \"UpstreamMenuContext\",\n strict: false,\n })\n\ninterface UpstreamMenuItemContext {\n hasDownstreamRef: MutableRefObject<boolean>\n setDownstreamOpen: Dispatch<SetStateAction<boolean>>\n onKeyDownRef: RefObject<KeyboardEventHandler<HTMLLIElement>>\n onUpstreamRestoreFocus: () => void\n}\n\nexport const [UpstreamMenuItemProvider, useUpstreamMenuItem] =\n createContext<UpstreamMenuItemContext>({\n name: \"UpstreamMenuItemContext\",\n strict: false,\n })\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA+B;AAC/B,IAAAA,gBAAmB;;;ACOnB,4BAAiC;AACjC,mBAA8B;AAEvB,IAAM;AAAA,EACX;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,uBAAuB;AACzB,QAAI,wCAAiB;AAiBd,IAAM,CAAC,cAAc,OAAO,QAAI,4BAA2B;AAAA,EAChE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAMM,IAAM,CAAC,qBAAqB,cAAc,QAC/C,4BAAkC;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AAQI,IAAM,CAAC,sBAAsB,eAAe,QACjD,4BAAmC;AAAA,EACjC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;AASI,IAAM,CAAC,0BAA0B,mBAAmB,QACzD,4BAAuC;AAAA,EACrC,MAAM;AAAA,EACN,QAAQ;AACV,CAAC;;;ADjDG;AAPC,IAAM,gBAAY;AAAA,EACvB,CAAC,EAAE,WAAW,UAAU,OAAO,YAAY,GAAG,KAAK,GAAG,QAAQ;AAC5D,UAAM,EAAE,OAAO,IAAI,QAAQ;AAE3B,UAAM,MAAmB,EAAE,GAAG,OAAO,MAAM;AAE3C,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,iBAAiB,wBAAwB,SAAS;AAAA,QAChE,MAAK;AAAA,QACL,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA,kBACC;AAAA,YAAC,eAAG;AAAA,YAAH;AAAA,cACC,eAAW,kBAAG,4BAA4B;AAAA,cAC1C,OAAO,OAAO;AAAA,cACb,GAAG;AAAA,cAEH;AAAA;AAAA,UACH,IACE;AAAA,UAEJ,4CAAC,eAAG,IAAH,EAAM,WAAU,wBAAwB,UAAS;AAAA;AAAA;AAAA,IACpD;AAAA,EAEJ;AACF;","names":["import_utils"]}
|