react-better-html 1.1.186 → 1.1.187

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 CHANGED
@@ -942,6 +942,7 @@ type SideMenuItem = {
942
942
  };
943
943
  type SideMenuProps = {
944
944
  items: SideMenuItem[];
945
+ bottomItems?: SideMenuItem[];
945
946
  topSpace?: number;
946
947
  logoAssetName?: AssetName | AnyOtherString;
947
948
  logoUrl?: string;
package/dist/index.d.ts CHANGED
@@ -942,6 +942,7 @@ type SideMenuItem = {
942
942
  };
943
943
  type SideMenuProps = {
944
944
  items: SideMenuItem[];
945
+ bottomItems?: SideMenuItem[];
945
946
  topSpace?: number;
946
947
  logoAssetName?: AssetName | AnyOtherString;
947
948
  logoUrl?: string;
package/dist/index.js CHANGED
@@ -9512,6 +9512,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
9512
9512
  });
9513
9513
  var SideMenuComponent = function SideMenu({
9514
9514
  items,
9515
+ bottomItems,
9515
9516
  topSpace = 0,
9516
9517
  logoAssetName,
9517
9518
  logoUrl,
@@ -9528,6 +9529,8 @@ var SideMenuComponent = function SideMenu({
9528
9529
  setSideMenuIsOpenMobile.setFalse();
9529
9530
  }, []);
9530
9531
  const readyItems = (0, import_react29.useMemo)(() => items.filter((item) => !item.hidden), [items]);
9532
+ const readyBottomItems = (0, import_react29.useMemo)(() => bottomItems?.filter((item) => !item.hidden), [bottomItems]);
9533
+ const isCollapsable = collapsable && !mediaQuery.size1000;
9531
9534
  const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
9532
9535
  const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
9533
9536
  const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
@@ -9544,15 +9547,13 @@ var SideMenuComponent = function SideMenu({
9544
9547
  backgroundColor: theme2.colors.backgroundContent,
9545
9548
  borderRight: `solid 1px ${theme2.colors.border}`,
9546
9549
  transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
9547
- paddingInline: theme2.styles.space,
9548
9550
  paddingTop: logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space,
9549
- paddingBottom: theme2.styles.space,
9550
9551
  transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${theme2.styles.transition}` : "none" : theme2.styles.transition,
9551
9552
  userSelect: "none",
9552
- zIndex: 11,
9553
+ zIndex: 10,
9553
9554
  children: [
9554
9555
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
9555
- (logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.row, { alignItems: "center", children: [
9556
+ (logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
9556
9557
  (logoAssetName || logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
9557
9558
  Div_default.row,
9558
9559
  {
@@ -9589,28 +9590,58 @@ var SideMenuComponent = function SideMenu({
9589
9590
  ) }),
9590
9591
  withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
9591
9592
  ] }),
9592
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuItemComponent, { item, onClick: onClickXButton }, item.text)) }),
9593
- collapsable && !mediaQuery.size1000 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
9594
- Div_default.row,
9593
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
9594
+ Div_default.column,
9595
9595
  {
9596
- alignItems: "center",
9597
- justifyContent: "center",
9598
- backgroundColor: theme2.colors.backgroundContent,
9599
- borderRadius: theme2.styles.borderRadius,
9596
+ width: "100%",
9597
+ height: "100%",
9598
+ overflowY: "auto",
9599
+ paddingInline: theme2.styles.space,
9600
+ paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
9601
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuItemComponent, { item, onClick: onClickXButton }, item.text)) })
9602
+ }
9603
+ ),
9604
+ readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
9605
+ Div_default.column,
9606
+ {
9607
+ borderTop: `solid 1px ${theme2.colors.border}`,
9608
+ gap: theme2.styles.gap / 2,
9600
9609
  marginTop: "auto",
9601
- cursor: "pointer",
9602
- filterHover: filterHover().z1,
9603
- paddingBlock: theme2.styles.gap,
9604
- isTabAccessed: true,
9605
- onClick: setSideMenuIsCollapsed.toggle,
9610
+ paddingTop: theme2.styles.space,
9611
+ paddingInline: theme2.styles.space,
9612
+ paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
9613
+ children: readyBottomItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuItemComponent, { item, onClick: onClickXButton }, item.text))
9614
+ }
9615
+ ),
9616
+ isCollapsable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
9617
+ Div_default,
9618
+ {
9619
+ borderTop: `solid 1px ${theme2.colors.border}`,
9620
+ marginTop: !readyBottomItems ? "auto" : void 0,
9621
+ paddingInline: theme2.styles.space,
9622
+ paddingBlock: theme2.styles.space,
9606
9623
  children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
9607
- Icon_default,
9624
+ Div_default.row,
9608
9625
  {
9609
- name: "chevronRight",
9610
- size: 20,
9611
- color: theme2.colors.textSecondary,
9612
- transform: `rotate(${isCollapsed ? 0 : 180}deg)`,
9613
- transition: theme2.styles.transition
9626
+ alignItems: "center",
9627
+ justifyContent: "center",
9628
+ backgroundColor: theme2.colors.backgroundContent,
9629
+ borderRadius: theme2.styles.borderRadius,
9630
+ cursor: "pointer",
9631
+ filterHover: filterHover().z1,
9632
+ isTabAccessed: true,
9633
+ paddingBlock: theme2.styles.gap,
9634
+ onClick: setSideMenuIsCollapsed.toggle,
9635
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
9636
+ Icon_default,
9637
+ {
9638
+ name: "chevronRight",
9639
+ size: 20,
9640
+ color: theme2.colors.textSecondary,
9641
+ transform: `rotate(${isCollapsed ? 0 : 180}deg)`,
9642
+ transition: theme2.styles.transition
9643
+ }
9644
+ )
9614
9645
  }
9615
9646
  )
9616
9647
  }