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 CHANGED
@@ -164,7 +164,7 @@ declare const InputField: typeof InputFieldComponent & {
164
164
  color: typeof InputFieldComponent.color;
165
165
  };
166
166
 
167
- type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label";
167
+ type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label" | "li";
168
168
  type TextProps<As extends TextAs = "p"> = {
169
169
  /** @default "p" */
170
170
  as?: As;
@@ -1076,16 +1076,20 @@ declare const Foldable: typeof FoldableComponent & {
1076
1076
 
1077
1077
  type SideMenuItem = {
1078
1078
  text: string;
1079
+ hidden?: boolean;
1080
+ } & ({
1081
+ type: "item";
1079
1082
  iconName: IconName | AnyOtherString;
1080
1083
  href?: string;
1081
1084
  disabled?: boolean;
1082
- hidden?: boolean;
1083
1085
  withDot?: boolean;
1084
1086
  children?: SideMenuItem[];
1085
1087
  /** @default true */
1086
1088
  onClickCloseSideMenu?: boolean;
1087
1089
  onClick?: (item: SideMenuItem) => void;
1088
- };
1090
+ } | {
1091
+ type: "divider";
1092
+ });
1089
1093
  type SideMenuProps = {
1090
1094
  items: SideMenuItem[];
1091
1095
  bottomItems?: SideMenuItem[];
package/dist/index.d.ts CHANGED
@@ -164,7 +164,7 @@ declare const InputField: typeof InputFieldComponent & {
164
164
  color: typeof InputFieldComponent.color;
165
165
  };
166
166
 
167
- type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label";
167
+ type TextAs = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label" | "li";
168
168
  type TextProps<As extends TextAs = "p"> = {
169
169
  /** @default "p" */
170
170
  as?: As;
@@ -1076,16 +1076,20 @@ declare const Foldable: typeof FoldableComponent & {
1076
1076
 
1077
1077
  type SideMenuItem = {
1078
1078
  text: string;
1079
+ hidden?: boolean;
1080
+ } & ({
1081
+ type: "item";
1079
1082
  iconName: IconName | AnyOtherString;
1080
1083
  href?: string;
1081
1084
  disabled?: boolean;
1082
- hidden?: boolean;
1083
1085
  withDot?: boolean;
1084
1086
  children?: SideMenuItem[];
1085
1087
  /** @default true */
1086
1088
  onClickCloseSideMenu?: boolean;
1087
1089
  onClick?: (item: SideMenuItem) => void;
1088
- };
1090
+ } | {
1091
+ type: "divider";
1092
+ });
1089
1093
  type SideMenuProps = {
1090
1094
  items: SideMenuItem[];
1091
1095
  bottomItems?: SideMenuItem[];
package/dist/index.js CHANGED
@@ -7620,12 +7620,13 @@ var TabsComponent = (0, import_react29.forwardRef)(function Tabs({ tabs, name, a
7620
7620
  className: `react-better-html-tabs-tab${selected ? " react-better-html-tabs-tab-selected" : ""}`,
7621
7621
  position: "relative",
7622
7622
  width: "fit-content",
7623
- backgroundColor: style === "box" ? selected ? theme2.colors.primary : theme2.colors.backgroundContent : theme2.colors.backgroundBase,
7623
+ backgroundColor: style === "box" ? selected ? accentColor ?? theme2.colors.primary : theme2.colors.backgroundContent : theme2.colors.backgroundBase,
7624
7624
  borderRadius: style === "box" ? theme2.styles.borderRadius : void 0,
7625
7625
  borderTopLeftRadius: style === "borderRadiusTop" ? theme2.styles.borderRadius : void 0,
7626
7626
  borderTopRightRadius: style === "borderRadiusTop" ? theme2.styles.borderRadius : void 0,
7627
7627
  border: style === "box" ? `${theme2.styles.borderWidth}px solid ${selected ? "transparent" : theme2.colors.border}` : void 0,
7628
- filterHover: colorTheme === "dark" ? style === "box" ? "brightness(1.2)" : "brightness(2)" : "brightness(0.9)",
7628
+ borderColorHover: style === "box" ? accentColor ?? theme2.colors.primary : void 0,
7629
+ filterHover: style !== "box" ? filterHover().z1 : void 0,
7629
7630
  paddingInline: theme2.styles.space,
7630
7631
  paddingBlock: theme2.styles.gap,
7631
7632
  value: tab.id,
@@ -7877,7 +7878,7 @@ var useSideMenuContext = () => {
7877
7878
  }
7878
7879
  return context;
7879
7880
  };
7880
- var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
7881
+ var MenuItemTypeItem = (0, import_react31.memo)(function MenuItemTypeItem2({
7881
7882
  item,
7882
7883
  backgroundColor,
7883
7884
  activeItemColor,
@@ -7905,8 +7906,8 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
7905
7906
  }
7906
7907
  }, [onClick, item, isCollapsed]);
7907
7908
  const childrenHaveDot = (0, import_react31.useMemo)(
7908
- () => item.children?.some((child) => child.withDot) ?? false,
7909
- [item.children]
7909
+ () => item.children?.some((child) => child.type === "item" && child.withDot) ?? false,
7910
+ [item]
7910
7911
  );
7911
7912
  const isActive = activeItem && item.href && activeItem.href === item.href;
7912
7913
  const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
@@ -8011,7 +8012,7 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
8011
8012
  (0, import_react31.useEffect)(() => {
8012
8013
  if (!item.children) return;
8013
8014
  const toBeOpened = item.children.some(
8014
- (child) => child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false
8015
+ (child) => child.type === "item" ? child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false : false
8015
8016
  );
8016
8017
  if (!isCollapsed) setIsOpened.setState(toBeOpened);
8017
8018
  }, [item, isCollapsed]);
@@ -8020,7 +8021,7 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
8020
8021
  setIsOpened.setFalse();
8021
8022
  }, [isCollapsed]);
8022
8023
  const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
8023
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default, { width: "100%", children: [
8024
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
8024
8025
  item.href ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkComponentTag, { to: item.href, href: item.href, onClick: onClickElement, children: content }) : content,
8025
8026
  item.children && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
8026
8027
  Div_default.column,
@@ -8034,7 +8035,7 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
8034
8035
  transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
8035
8036
  children: [
8036
8037
  item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8037
- MenuItemComponent2,
8038
+ MenuItemComponent,
8038
8039
  {
8039
8040
  item: child,
8040
8041
  backgroundColor: readyBackgroundColor,
@@ -8086,6 +8087,13 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
8086
8087
  )
8087
8088
  ] });
8088
8089
  });
8090
+ var MenuItemTypeDivider = (0, import_react31.memo)(function MenuItemTypeDivider2({ item }) {
8091
+ const theme2 = (0, import_react_better_core29.useTheme)();
8092
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default.row, { paddingTop: theme2.styles.space, paddingInline: theme2.styles.gap, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { fontSize: 12, fontWeight: 700, textTransform: "uppercase", color: theme2.colors.textSecondary, children: item.text }) });
8093
+ });
8094
+ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ item, ...props }) {
8095
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default, { width: "100%", children: item.type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MenuItemTypeItem, { item, ...props }) : item.type === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(MenuItemTypeDivider, { item }) : void 0 });
8096
+ });
8089
8097
  var SideMenuComponent = function SideMenu({
8090
8098
  items,
8091
8099
  bottomItems,