react-better-html 1.1.191 → 1.1.192
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/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +41 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9299,7 +9299,7 @@ var Foldable_default = Foldable2;
|
|
|
9299
9299
|
// src/components/SideMenu.tsx
|
|
9300
9300
|
import { memo as memo26, useCallback as useCallback15, useEffect as useEffect14, useMemo as useMemo11 } from "react";
|
|
9301
9301
|
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9302
|
-
var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
9302
|
+
var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundColor, onClick }) {
|
|
9303
9303
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
9304
9304
|
if (!reactRouterDomPlugin2) {
|
|
9305
9305
|
throw new Error(
|
|
@@ -9319,6 +9319,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9319
9319
|
}, [onClick, item]);
|
|
9320
9320
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9321
9321
|
const isActive = item.href ? location.pathname === "/" ? location.pathname === item.href : location.pathname.startsWith(item.href) && item.href !== "/" : false;
|
|
9322
|
+
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9322
9323
|
const iconSize = 16;
|
|
9323
9324
|
const paddingBlock = theme2.styles.gap;
|
|
9324
9325
|
const paddingLeft = theme2.styles.gap + 2;
|
|
@@ -9332,7 +9333,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9332
9333
|
alignItems: "center",
|
|
9333
9334
|
gap: iconGap,
|
|
9334
9335
|
whiteSpace: "nowrap",
|
|
9335
|
-
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor(theme2.colors.primary, 0.7) : lightenColor(theme2.colors.primary, 0.85) :
|
|
9336
|
+
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor(theme2.colors.primary, 0.7) : lightenColor(theme2.colors.primary, 0.85) : readyBackgroundColor,
|
|
9336
9337
|
borderRadius: theme2.styles.borderRadius,
|
|
9337
9338
|
paddingBlock,
|
|
9338
9339
|
paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
|
|
@@ -9389,7 +9390,15 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9389
9390
|
overflow: "hidden",
|
|
9390
9391
|
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
9391
9392
|
children: [
|
|
9392
|
-
item.children.map((child) => /* @__PURE__ */ jsx26(
|
|
9393
|
+
item.children.map((child) => /* @__PURE__ */ jsx26(
|
|
9394
|
+
MenuItemComponent2,
|
|
9395
|
+
{
|
|
9396
|
+
item: child,
|
|
9397
|
+
backgroundColor: readyBackgroundColor,
|
|
9398
|
+
onClick
|
|
9399
|
+
},
|
|
9400
|
+
child.text
|
|
9401
|
+
)),
|
|
9393
9402
|
/* @__PURE__ */ jsxs22(
|
|
9394
9403
|
Div_default,
|
|
9395
9404
|
{
|
|
@@ -9419,9 +9428,9 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9419
9428
|
left: 0,
|
|
9420
9429
|
border: `${lineWidth}px solid ${theme2.colors.border}`,
|
|
9421
9430
|
borderRadius: 999,
|
|
9422
|
-
borderTopColor:
|
|
9423
|
-
borderLeftColor:
|
|
9424
|
-
borderRightColor:
|
|
9431
|
+
borderTopColor: readyBackgroundColor,
|
|
9432
|
+
borderLeftColor: readyBackgroundColor,
|
|
9433
|
+
borderRightColor: readyBackgroundColor,
|
|
9425
9434
|
transform: "rotate(45deg)"
|
|
9426
9435
|
}
|
|
9427
9436
|
)
|
|
@@ -9443,7 +9452,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
9443
9452
|
logoFontFamily,
|
|
9444
9453
|
collapsable,
|
|
9445
9454
|
withCloseButton,
|
|
9446
|
-
widthMobileHandle
|
|
9455
|
+
widthMobileHandle,
|
|
9456
|
+
backgroundColor
|
|
9447
9457
|
}) {
|
|
9448
9458
|
const theme2 = useTheme();
|
|
9449
9459
|
const mediaQuery = useMediaQuery();
|
|
@@ -9457,7 +9467,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
9457
9467
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9458
9468
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
9459
9469
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
9460
|
-
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 +
|
|
9470
|
+
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9471
|
+
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9461
9472
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
9462
9473
|
return /* @__PURE__ */ jsxs22(
|
|
9463
9474
|
Div_default.column,
|
|
@@ -9467,7 +9478,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9467
9478
|
height: `calc(100svh - ${topSpace}px)`,
|
|
9468
9479
|
top: topSpace,
|
|
9469
9480
|
left: 0,
|
|
9470
|
-
backgroundColor:
|
|
9481
|
+
backgroundColor: readyBackgroundColor,
|
|
9471
9482
|
borderRight: `solid 1px ${theme2.colors.border}`,
|
|
9472
9483
|
transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
|
|
9473
9484
|
paddingTop: logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space,
|
|
@@ -9521,7 +9532,15 @@ var SideMenuComponent = function SideMenu({
|
|
|
9521
9532
|
overflowY: "auto",
|
|
9522
9533
|
paddingInline: theme2.styles.space,
|
|
9523
9534
|
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
9524
|
-
children: /* @__PURE__ */ jsx26(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9535
|
+
children: /* @__PURE__ */ jsx26(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9536
|
+
MenuItemComponent,
|
|
9537
|
+
{
|
|
9538
|
+
item,
|
|
9539
|
+
backgroundColor: readyBackgroundColor,
|
|
9540
|
+
onClick: onClickXButton
|
|
9541
|
+
},
|
|
9542
|
+
item.text
|
|
9543
|
+
)) })
|
|
9525
9544
|
}
|
|
9526
9545
|
),
|
|
9527
9546
|
readyBottomItems && /* @__PURE__ */ jsx26(
|
|
@@ -9533,7 +9552,15 @@ var SideMenuComponent = function SideMenu({
|
|
|
9533
9552
|
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
9534
9553
|
paddingInline: theme2.styles.space,
|
|
9535
9554
|
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
9536
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9555
|
+
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9556
|
+
MenuItemComponent,
|
|
9557
|
+
{
|
|
9558
|
+
item,
|
|
9559
|
+
backgroundColor: readyBackgroundColor,
|
|
9560
|
+
onClick: onClickXButton
|
|
9561
|
+
},
|
|
9562
|
+
item.text
|
|
9563
|
+
))
|
|
9537
9564
|
}
|
|
9538
9565
|
),
|
|
9539
9566
|
isCollapsable && /* @__PURE__ */ jsx26(
|
|
@@ -9548,7 +9575,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9548
9575
|
{
|
|
9549
9576
|
alignItems: "center",
|
|
9550
9577
|
justifyContent: "center",
|
|
9551
|
-
backgroundColor:
|
|
9578
|
+
backgroundColor: readyBackgroundColor,
|
|
9552
9579
|
borderRadius: theme2.styles.borderRadius,
|
|
9553
9580
|
cursor: "pointer",
|
|
9554
9581
|
filterHover: filterHover().z1,
|
|
@@ -9576,7 +9603,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9576
9603
|
position: "absolute",
|
|
9577
9604
|
top: theme2.styles.space,
|
|
9578
9605
|
left: "100%",
|
|
9579
|
-
backgroundColor:
|
|
9606
|
+
backgroundColor: readyBackgroundColor,
|
|
9580
9607
|
border: `solid 1px ${theme2.colors.border}`,
|
|
9581
9608
|
borderLeft: "none",
|
|
9582
9609
|
borderTopRightRadius: theme2.styles.borderRadius,
|
|
@@ -9611,7 +9638,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
9611
9638
|
const mediaQuery = useMediaQuery();
|
|
9612
9639
|
const { components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9613
9640
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
9614
|
-
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 +
|
|
9641
|
+
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9615
9642
|
return /* @__PURE__ */ jsxs22(
|
|
9616
9643
|
Div_default,
|
|
9617
9644
|
{
|