analytica-frontend-lib 1.1.43 → 1.1.44
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/Menu/index.d.mts +1 -0
- package/dist/Menu/index.d.ts +1 -0
- package/dist/Menu/index.js +15 -2
- package/dist/Menu/index.js.map +1 -1
- package/dist/Menu/index.mjs +15 -2
- package/dist/Menu/index.mjs.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6408,6 +6408,18 @@ var MenuContent = forwardRef17(
|
|
|
6408
6408
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
6409
6409
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
6410
6410
|
const variantClasses = variant === "menu2" ? "overflow-x-auto scroll-smooth" : "";
|
|
6411
|
+
const childrenArray = Children5.toArray(children);
|
|
6412
|
+
const menuItemCount = childrenArray.filter(
|
|
6413
|
+
(child) => isValidElement5(child) && child.type === MenuItem
|
|
6414
|
+
).length;
|
|
6415
|
+
const enhancedChildren = variant === "menu2" ? Children5.map(children, (child) => {
|
|
6416
|
+
if (isValidElement5(child) && child.type === MenuItem) {
|
|
6417
|
+
return cloneElement5(child, {
|
|
6418
|
+
itemCount: menuItemCount
|
|
6419
|
+
});
|
|
6420
|
+
}
|
|
6421
|
+
return child;
|
|
6422
|
+
}) : children;
|
|
6411
6423
|
return /* @__PURE__ */ jsx33(
|
|
6412
6424
|
"ul",
|
|
6413
6425
|
{
|
|
@@ -6420,7 +6432,7 @@ var MenuContent = forwardRef17(
|
|
|
6420
6432
|
`,
|
|
6421
6433
|
style: variant === "menu2" ? { scrollbarWidth: "none", msOverflowStyle: "none" } : void 0,
|
|
6422
6434
|
...props,
|
|
6423
|
-
children
|
|
6435
|
+
children: enhancedChildren
|
|
6424
6436
|
}
|
|
6425
6437
|
);
|
|
6426
6438
|
}
|
|
@@ -6435,6 +6447,7 @@ var MenuItem = forwardRef17(
|
|
|
6435
6447
|
store: externalStore,
|
|
6436
6448
|
variant = "menu",
|
|
6437
6449
|
separator = false,
|
|
6450
|
+
itemCount = 1,
|
|
6438
6451
|
...props
|
|
6439
6452
|
}, ref) => {
|
|
6440
6453
|
const store = useMenuStore(externalStore);
|
|
@@ -6480,7 +6493,7 @@ var MenuItem = forwardRef17(
|
|
|
6480
6493
|
{
|
|
6481
6494
|
"data-variant": "menu2",
|
|
6482
6495
|
className: `
|
|
6483
|
-
w-fit flex flex-col items-center px-2 pt-4 gap-3 cursor-pointer focus:rounded-sm justify-center hover:bg-background-100 rounded-lg
|
|
6496
|
+
${itemCount === 1 ? "w-fit" : "w-full"} flex flex-col items-center px-2 pt-4 gap-3 cursor-pointer focus:rounded-sm justify-center hover:bg-background-100 rounded-lg
|
|
6484
6497
|
focus:outline-none focus:border-indicator-info focus:border-2
|
|
6485
6498
|
${selectedValue === value ? "" : "pb-4"}
|
|
6486
6499
|
`,
|