react-better-html 1.1.184 → 1.1.185

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.mjs CHANGED
@@ -5509,6 +5509,10 @@ var sideMenuControls = {
5509
5509
  if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.collapse")) return;
5510
5510
  externalBetterHtmlContextValue.setSideMenuIsCollapsed.setTrue();
5511
5511
  },
5512
+ toggleExpanded: () => {
5513
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleExpanded")) return;
5514
+ externalBetterHtmlContextValue.setSideMenuIsCollapsed.toggle();
5515
+ },
5512
5516
  open: () => {
5513
5517
  if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.open")) return;
5514
5518
  externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setTrue();
@@ -5516,6 +5520,10 @@ var sideMenuControls = {
5516
5520
  close: () => {
5517
5521
  if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.close")) return;
5518
5522
  externalBetterHtmlContextValue.setSideMenuIsOpenMobile.setFalse();
5523
+ },
5524
+ toggleOpened: () => {
5525
+ if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "sideMenuControls.toggleOpened")) return;
5526
+ externalBetterHtmlContextValue.setSideMenuIsOpenMobile.toggle();
5519
5527
  }
5520
5528
  };
5521
5529
  var colorThemeControls = {
@@ -9315,7 +9323,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
9315
9323
  alignItems: "center",
9316
9324
  gap: iconGap,
9317
9325
  whiteSpace: "nowrap",
9318
- backgroundColor: isActive ? `${theme2.colors.primary}20` : theme2.colors.backgroundBase,
9326
+ backgroundColor: isActive ? colorTheme === "dark" ? lightenColor(theme2.colors.primary, 0.7) : lightenColor(theme2.colors.primary, 0.85) : theme2.colors.backgroundContent,
9319
9327
  borderRadius: theme2.styles.borderRadius,
9320
9328
  paddingBlock,
9321
9329
  paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
@@ -9402,9 +9410,9 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
9402
9410
  left: 0,
9403
9411
  border: `${lineWidth}px solid ${theme2.colors.border}`,
9404
9412
  borderRadius: 999,
9405
- borderTopColor: theme2.colors.backgroundBase,
9406
- borderLeftColor: theme2.colors.backgroundBase,
9407
- borderRightColor: theme2.colors.backgroundBase,
9413
+ borderTopColor: theme2.colors.backgroundContent,
9414
+ borderLeftColor: theme2.colors.backgroundContent,
9415
+ borderRightColor: theme2.colors.backgroundContent,
9408
9416
  transform: "rotate(45deg)"
9409
9417
  }
9410
9418
  )
@@ -9446,7 +9454,7 @@ var SideMenuComponent = function SideMenu({
9446
9454
  height: `calc(100svh - ${topSpace}px)`,
9447
9455
  top: topSpace,
9448
9456
  left: 0,
9449
- backgroundColor: theme2.colors.backgroundBase,
9457
+ backgroundColor: theme2.colors.backgroundContent,
9450
9458
  borderRight: `solid 1px ${theme2.colors.border}`,
9451
9459
  transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
9452
9460
  paddingInline: theme2.styles.space,
@@ -9500,7 +9508,7 @@ var SideMenuComponent = function SideMenu({
9500
9508
  {
9501
9509
  alignItems: "center",
9502
9510
  justifyContent: "center",
9503
- backgroundColor: theme2.colors.backgroundBase,
9511
+ backgroundColor: theme2.colors.backgroundContent,
9504
9512
  borderRadius: theme2.styles.borderRadius,
9505
9513
  marginTop: "auto",
9506
9514
  cursor: "pointer",
@@ -9527,7 +9535,7 @@ var SideMenuComponent = function SideMenu({
9527
9535
  position: "absolute",
9528
9536
  top: theme2.styles.space,
9529
9537
  left: "100%",
9530
- backgroundColor: theme2.colors.backgroundBase,
9538
+ backgroundColor: theme2.colors.backgroundContent,
9531
9539
  border: `solid 1px ${theme2.colors.border}`,
9532
9540
  borderLeft: "none",
9533
9541
  borderTopRightRadius: theme2.styles.borderRadius,
@@ -9577,8 +9585,73 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
9577
9585
  }
9578
9586
  );
9579
9587
  };
9588
+ SideMenuComponent.burgerButton = function BurgerButton() {
9589
+ const theme2 = useTheme();
9590
+ const { sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
9591
+ const [isHovered, setIsHovered] = useBooleanState();
9592
+ const width = 2;
9593
+ return /* @__PURE__ */ jsxs22(
9594
+ Div_default,
9595
+ {
9596
+ position: "relative",
9597
+ width: 32,
9598
+ height: 20,
9599
+ cursor: "pointer",
9600
+ onMouseOver: setIsHovered.setTrue,
9601
+ onMouseLeave: setIsHovered.setFalse,
9602
+ onMouseOut: setIsHovered.setFalse,
9603
+ onClick: setSideMenuIsOpenMobile.toggle,
9604
+ children: [
9605
+ /* @__PURE__ */ jsx26(
9606
+ Div_default,
9607
+ {
9608
+ position: "absolute",
9609
+ width: isHovered || sideMenuIsOpenMobile ? "100%" : "50%",
9610
+ height: width,
9611
+ top: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
9612
+ left: 0,
9613
+ backgroundColor: theme2.colors.border,
9614
+ borderRadius: 999,
9615
+ transform: sideMenuIsOpenMobile ? "rotate(45deg)" : void 0,
9616
+ transition: theme2.styles.transition
9617
+ }
9618
+ ),
9619
+ /* @__PURE__ */ jsx26(
9620
+ Div_default,
9621
+ {
9622
+ position: "absolute",
9623
+ width: isHovered ? "100%" : "100%",
9624
+ height: width,
9625
+ top: "50%",
9626
+ left: 0,
9627
+ backgroundColor: theme2.colors.border,
9628
+ borderRadius: 999,
9629
+ transform: "translateY(-50%)",
9630
+ opacity: sideMenuIsOpenMobile ? 0 : void 0,
9631
+ transition: theme2.styles.transition
9632
+ }
9633
+ ),
9634
+ /* @__PURE__ */ jsx26(
9635
+ Div_default,
9636
+ {
9637
+ position: "absolute",
9638
+ width: isHovered || sideMenuIsOpenMobile ? "100%" : "75%",
9639
+ height: width,
9640
+ bottom: sideMenuIsOpenMobile ? `calc(50% - ${width / 2}px)` : 0,
9641
+ left: 0,
9642
+ backgroundColor: theme2.colors.border,
9643
+ borderRadius: 999,
9644
+ transform: sideMenuIsOpenMobile ? "rotate(-45deg)" : void 0,
9645
+ transition: theme2.styles.transition
9646
+ }
9647
+ )
9648
+ ]
9649
+ }
9650
+ );
9651
+ };
9580
9652
  var SideMenu2 = memo26(SideMenuComponent);
9581
9653
  SideMenu2.pageHolder = SideMenuComponent.pageHolder;
9654
+ SideMenu2.burgerButton = SideMenuComponent.burgerButton;
9582
9655
  var SideMenu_default = SideMenu2;
9583
9656
 
9584
9657
  // src/utils/localStorage.ts