react-better-html 1.1.272 → 1.1.274

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
@@ -1091,6 +1091,7 @@ type SideMenuItem = {
1091
1091
  onClick?: (item: SideMenuItem) => void;
1092
1092
  } | {
1093
1093
  type: "divider";
1094
+ shortText?: string;
1094
1095
  });
1095
1096
  type SideMenuProps = {
1096
1097
  items: SideMenuItem[];
package/dist/index.d.ts CHANGED
@@ -1091,6 +1091,7 @@ type SideMenuItem = {
1091
1091
  onClick?: (item: SideMenuItem) => void;
1092
1092
  } | {
1093
1093
  type: "divider";
1094
+ shortText?: string;
1094
1095
  });
1095
1096
  type SideMenuProps = {
1096
1097
  items: SideMenuItem[];
package/dist/index.js CHANGED
@@ -1606,7 +1606,11 @@ var IconElement = import_styled_components3.default.svg.withConfig({
1606
1606
  var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = 16, ...props }, ref) {
1607
1607
  const theme2 = (0, import_react_better_core5.useTheme)();
1608
1608
  const { icons: icons2 } = (0, import_react_better_core5.useBetterCoreContext)();
1609
- const { style, hoverStyle, restProps } = useComponentPropsGrouper(props);
1609
+ const {
1610
+ style: { fill, stroke, strokeColor, ...restStyle },
1611
+ hoverStyle,
1612
+ restProps
1613
+ } = useComponentPropsGrouper(props);
1610
1614
  const dataProps = useComponentPropsWithPrefix(restProps, "data");
1611
1615
  const ariaProps = useComponentPropsWithPrefix(restProps, "aria");
1612
1616
  const svgColor = props.color ?? theme2.colors.textPrimary;
@@ -1627,7 +1631,7 @@ var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = 16, ...pr
1627
1631
  xmlns: "http://www.w3.org/2000/svg",
1628
1632
  theme: theme2,
1629
1633
  hoverColor: svgHoverColorColor,
1630
- style,
1634
+ style: restStyle,
1631
1635
  hoverStyle,
1632
1636
  ...restProps,
1633
1637
  ...dataProps,
@@ -1638,8 +1642,8 @@ var Icon = (0, import_react5.forwardRef)(function Icon2({ name, size = 16, ...pr
1638
1642
  {
1639
1643
  ...path,
1640
1644
  className: path.type === "fill" ? "react-better-html-icon-path-with-fill" : "react-better-html-icon-path-with-stroke",
1641
- fill: path.type === "fill" ? svgColor : void 0,
1642
- stroke: path.type === "stroke" ? svgColor : void 0,
1645
+ fill: path.type === "fill" ? fill ?? svgColor : void 0,
1646
+ stroke: path.type === "stroke" ? strokeColor ?? stroke ?? svgColor : void 0,
1643
1647
  key: path.d
1644
1648
  }
1645
1649
  ))
@@ -8103,7 +8107,31 @@ var MenuItemTypeItem = (0, import_react31.memo)(function MenuItemTypeItem2({
8103
8107
  });
8104
8108
  var MenuItemTypeDivider = (0, import_react31.memo)(function MenuItemTypeDivider2({ item }) {
8105
8109
  const theme2 = (0, import_react_better_core29.useTheme)();
8106
- 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 }) });
8110
+ const { sideMenuIsCollapsed } = useBetterHtmlContextInternal();
8111
+ const isCollapsed = sideMenuIsCollapsed && !item.shortText;
8112
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8113
+ Div_default.row,
8114
+ {
8115
+ maxHeight: !isCollapsed ? 30 : 0,
8116
+ paddingTop: !isCollapsed ? theme2.styles.space : theme2.styles.gap / 2,
8117
+ paddingInline: theme2.styles.gap,
8118
+ overflow: "hidden",
8119
+ transition: `max-height ${theme2.styles.transition}, padding-top ${theme2.styles.transition}`,
8120
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
8121
+ Text_default,
8122
+ {
8123
+ width: "100%",
8124
+ fontSize: 12,
8125
+ fontWeight: 700,
8126
+ textTransform: "uppercase",
8127
+ textAlign: sideMenuIsCollapsed ? "center" : void 0,
8128
+ color: theme2.colors.textSecondary,
8129
+ whiteSpace: "nowrap",
8130
+ children: sideMenuIsCollapsed ? item.shortText : item.text
8131
+ }
8132
+ )
8133
+ }
8134
+ );
8107
8135
  });
8108
8136
  var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ item, ...props }) {
8109
8137
  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 });