@diwauhris/ui 1.7.28 → 1.7.29
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/lib/index.cjs +3 -1
- package/lib/index.mjs +3 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -4088,10 +4088,12 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right", open: contr
|
|
|
4088
4088
|
right: Math.max(MARGIN, window.innerWidth - rect.right),
|
|
4089
4089
|
left: "auto"
|
|
4090
4090
|
};
|
|
4091
|
+
const maxHeight = flipUp ? Math.max(120, rect.top - GAP - MARGIN) : Math.max(120, spaceBelow - GAP - MARGIN);
|
|
4091
4092
|
setPanelStyle({
|
|
4092
4093
|
position: "fixed",
|
|
4093
4094
|
...flipUp ? { bottom: Math.max(MARGIN, window.innerHeight - rect.top + GAP) } : { top: rect.bottom + GAP },
|
|
4094
4095
|
...horizontal,
|
|
4096
|
+
maxHeight,
|
|
4095
4097
|
zIndex: 9999,
|
|
4096
4098
|
minWidth: PANEL_MIN_WIDTH,
|
|
4097
4099
|
maxWidth: available
|
|
@@ -4202,7 +4204,7 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right", open: contr
|
|
|
4202
4204
|
role: "menu",
|
|
4203
4205
|
"aria-label": ariaLabel,
|
|
4204
4206
|
style: panelStyle,
|
|
4205
|
-
className: cn("overflow-
|
|
4207
|
+
className: cn("overflow-y-auto overscroll-contain rounded-xl border border-slate-200 bg-white py-1 shadow-xl", panelClassName),
|
|
4206
4208
|
children: items.map((item, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
4207
4209
|
ref: (node) => {
|
|
4208
4210
|
itemRefs.current[index] = node;
|
package/lib/index.mjs
CHANGED
|
@@ -4064,10 +4064,12 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right", open: contr
|
|
|
4064
4064
|
right: Math.max(MARGIN, window.innerWidth - rect.right),
|
|
4065
4065
|
left: "auto"
|
|
4066
4066
|
};
|
|
4067
|
+
const maxHeight = flipUp ? Math.max(120, rect.top - GAP - MARGIN) : Math.max(120, spaceBelow - GAP - MARGIN);
|
|
4067
4068
|
setPanelStyle({
|
|
4068
4069
|
position: "fixed",
|
|
4069
4070
|
...flipUp ? { bottom: Math.max(MARGIN, window.innerHeight - rect.top + GAP) } : { top: rect.bottom + GAP },
|
|
4070
4071
|
...horizontal,
|
|
4072
|
+
maxHeight,
|
|
4071
4073
|
zIndex: 9999,
|
|
4072
4074
|
minWidth: PANEL_MIN_WIDTH,
|
|
4073
4075
|
maxWidth: available
|
|
@@ -4178,7 +4180,7 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right", open: contr
|
|
|
4178
4180
|
role: "menu",
|
|
4179
4181
|
"aria-label": ariaLabel,
|
|
4180
4182
|
style: panelStyle,
|
|
4181
|
-
className: cn("overflow-
|
|
4183
|
+
className: cn("overflow-y-auto overscroll-contain rounded-xl border border-slate-200 bg-white py-1 shadow-xl", panelClassName),
|
|
4182
4184
|
children: items.map((item, index) => /* @__PURE__ */ jsxs("button", {
|
|
4183
4185
|
ref: (node) => {
|
|
4184
4186
|
itemRefs.current[index] = node;
|