react-better-html 1.1.268 → 1.1.270
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 +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7581,12 +7581,13 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
7581
7581
|
className: `react-better-html-tabs-tab${selected ? " react-better-html-tabs-tab-selected" : ""}`,
|
|
7582
7582
|
position: "relative",
|
|
7583
7583
|
width: "fit-content",
|
|
7584
|
-
backgroundColor: style === "box" ? selected ? theme2.colors.primary : theme2.colors.backgroundContent : theme2.colors.backgroundBase,
|
|
7584
|
+
backgroundColor: style === "box" ? selected ? accentColor ?? theme2.colors.primary : theme2.colors.backgroundContent : theme2.colors.backgroundBase,
|
|
7585
7585
|
borderRadius: style === "box" ? theme2.styles.borderRadius : void 0,
|
|
7586
7586
|
borderTopLeftRadius: style === "borderRadiusTop" ? theme2.styles.borderRadius : void 0,
|
|
7587
7587
|
borderTopRightRadius: style === "borderRadiusTop" ? theme2.styles.borderRadius : void 0,
|
|
7588
7588
|
border: style === "box" ? `${theme2.styles.borderWidth}px solid ${selected ? "transparent" : theme2.colors.border}` : void 0,
|
|
7589
|
-
|
|
7589
|
+
borderColorHover: style === "box" ? accentColor ?? theme2.colors.primary : void 0,
|
|
7590
|
+
filterHover: style !== "box" ? filterHover().z1 : void 0,
|
|
7590
7591
|
paddingInline: theme2.styles.space,
|
|
7591
7592
|
paddingBlock: theme2.styles.gap,
|
|
7592
7593
|
value: tab.id,
|
|
@@ -7844,7 +7845,7 @@ var useSideMenuContext = () => {
|
|
|
7844
7845
|
}
|
|
7845
7846
|
return context;
|
|
7846
7847
|
};
|
|
7847
|
-
var
|
|
7848
|
+
var MenuItemTypeItem = memo27(function MenuItemTypeItem2({
|
|
7848
7849
|
item,
|
|
7849
7850
|
backgroundColor,
|
|
7850
7851
|
activeItemColor,
|
|
@@ -7872,8 +7873,8 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7872
7873
|
}
|
|
7873
7874
|
}, [onClick, item, isCollapsed]);
|
|
7874
7875
|
const childrenHaveDot = useMemo12(
|
|
7875
|
-
() => item.children?.some((child) => child.withDot) ?? false,
|
|
7876
|
-
[item
|
|
7876
|
+
() => item.children?.some((child) => child.type === "item" && child.withDot) ?? false,
|
|
7877
|
+
[item]
|
|
7877
7878
|
);
|
|
7878
7879
|
const isActive = activeItem && item.href && activeItem.href === item.href;
|
|
7879
7880
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
@@ -7978,7 +7979,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7978
7979
|
useEffect16(() => {
|
|
7979
7980
|
if (!item.children) return;
|
|
7980
7981
|
const toBeOpened = item.children.some(
|
|
7981
|
-
(child) => child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false
|
|
7982
|
+
(child) => child.type === "item" ? child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false : false
|
|
7982
7983
|
);
|
|
7983
7984
|
if (!isCollapsed) setIsOpened.setState(toBeOpened);
|
|
7984
7985
|
}, [item, isCollapsed]);
|
|
@@ -7987,7 +7988,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
7987
7988
|
setIsOpened.setFalse();
|
|
7988
7989
|
}, [isCollapsed]);
|
|
7989
7990
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
7990
|
-
return /* @__PURE__ */ jsxs24(
|
|
7991
|
+
return /* @__PURE__ */ jsxs24(Fragment8, { children: [
|
|
7991
7992
|
item.href ? /* @__PURE__ */ jsx27(LinkComponentTag, { to: item.href, href: item.href, onClick: onClickElement, children: content }) : content,
|
|
7992
7993
|
item.children && /* @__PURE__ */ jsxs24(
|
|
7993
7994
|
Div_default.column,
|
|
@@ -8001,7 +8002,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
8001
8002
|
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
8002
8003
|
children: [
|
|
8003
8004
|
item.children.map((child) => /* @__PURE__ */ jsx27(
|
|
8004
|
-
|
|
8005
|
+
MenuItemComponent,
|
|
8005
8006
|
{
|
|
8006
8007
|
item: child,
|
|
8007
8008
|
backgroundColor: readyBackgroundColor,
|
|
@@ -8053,6 +8054,13 @@ var MenuItemComponent = memo27(function MenuItemComponent2({
|
|
|
8053
8054
|
)
|
|
8054
8055
|
] });
|
|
8055
8056
|
});
|
|
8057
|
+
var MenuItemTypeDivider = memo27(function MenuItemTypeDivider2({ item }) {
|
|
8058
|
+
const theme2 = useTheme29();
|
|
8059
|
+
return /* @__PURE__ */ jsx27(Div_default.row, { paddingTop: theme2.styles.space, paddingInline: theme2.styles.gap, children: /* @__PURE__ */ jsx27(Text_default, { fontSize: 12, fontWeight: 700, textTransform: "uppercase", color: theme2.colors.textSecondary, children: item.text }) });
|
|
8060
|
+
});
|
|
8061
|
+
var MenuItemComponent = memo27(function MenuItemComponent2({ item, ...props }) {
|
|
8062
|
+
return /* @__PURE__ */ jsx27(Div_default, { width: "100%", children: item.type === "item" ? /* @__PURE__ */ jsx27(MenuItemTypeItem, { item, ...props }) : item.type === "divider" ? /* @__PURE__ */ jsx27(MenuItemTypeDivider, { item }) : void 0 });
|
|
8063
|
+
});
|
|
8056
8064
|
var SideMenuComponent = function SideMenu({
|
|
8057
8065
|
items,
|
|
8058
8066
|
bottomItems,
|