react-better-html 1.1.236 → 1.1.237
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 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +71 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1030,11 +1030,17 @@ type SideMenuProps = {
|
|
|
1030
1030
|
withCloseButton?: boolean;
|
|
1031
1031
|
widthMobileHandle?: boolean;
|
|
1032
1032
|
absoluteComponent?: React.ReactNode;
|
|
1033
|
-
|
|
1033
|
+
itemsAdditionalComponent?: React.ReactNode;
|
|
1034
|
+
betweenItemsAdditionalComponent?: React.ReactNode;
|
|
1035
|
+
bottomItemsAdditionalComponent?: React.ReactNode;
|
|
1034
1036
|
isLoading?: boolean;
|
|
1035
1037
|
/** @default backgroundContent */
|
|
1036
1038
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1039
|
+
gap?: React.CSSProperties["gap"];
|
|
1037
1040
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1041
|
+
paddingBottom?: React.CSSProperties["paddingBottom"];
|
|
1042
|
+
renderItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1043
|
+
renderBottomItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1038
1044
|
};
|
|
1039
1045
|
type SideMenuComponentType = {
|
|
1040
1046
|
(props: SideMenuProps): React.ReactElement;
|
package/dist/index.d.ts
CHANGED
|
@@ -1030,11 +1030,17 @@ type SideMenuProps = {
|
|
|
1030
1030
|
withCloseButton?: boolean;
|
|
1031
1031
|
widthMobileHandle?: boolean;
|
|
1032
1032
|
absoluteComponent?: React.ReactNode;
|
|
1033
|
-
|
|
1033
|
+
itemsAdditionalComponent?: React.ReactNode;
|
|
1034
|
+
betweenItemsAdditionalComponent?: React.ReactNode;
|
|
1035
|
+
bottomItemsAdditionalComponent?: React.ReactNode;
|
|
1034
1036
|
isLoading?: boolean;
|
|
1035
1037
|
/** @default backgroundContent */
|
|
1036
1038
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1039
|
+
gap?: React.CSSProperties["gap"];
|
|
1037
1040
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1041
|
+
paddingBottom?: React.CSSProperties["paddingBottom"];
|
|
1042
|
+
renderItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1043
|
+
renderBottomItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1038
1044
|
};
|
|
1039
1045
|
type SideMenuComponentType = {
|
|
1040
1046
|
(props: SideMenuProps): React.ReactElement;
|
package/dist/index.js
CHANGED
|
@@ -5563,7 +5563,12 @@ var FormComponent = (0, import_react23.forwardRef)(function Form({
|
|
|
5563
5563
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { name, onSubmit: onSubmit ?? form?.onSubmit, ref, children: [
|
|
5564
5564
|
gap !== void 0 || withDividers ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? import_react23.Children.toArray(children).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react23.Fragment, { children: [
|
|
5565
5565
|
child,
|
|
5566
|
-
index < import_react23.Children.toArray(children).length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5566
|
+
index < import_react23.Children.toArray(children).length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5567
|
+
Divider_default.horizontal,
|
|
5568
|
+
{
|
|
5569
|
+
width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth
|
|
5570
|
+
}
|
|
5571
|
+
)
|
|
5567
5572
|
] }, index)) : children }) : children,
|
|
5568
5573
|
submitButtonText && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
5569
5574
|
Div_default.row,
|
|
@@ -7006,7 +7011,15 @@ TooltipComponent.item = (0, import_react28.forwardRef)(function Item({
|
|
|
7006
7011
|
});
|
|
7007
7012
|
TooltipComponent.divider = (0, import_react28.forwardRef)(function DividerComponent(props, ref) {
|
|
7008
7013
|
const theme2 = (0, import_react_better_core26.useTheme)();
|
|
7009
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7015
|
+
Divider_default.horizontal,
|
|
7016
|
+
{
|
|
7017
|
+
width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth,
|
|
7018
|
+
marginBlock: theme2.styles.gap,
|
|
7019
|
+
...props,
|
|
7020
|
+
ref
|
|
7021
|
+
}
|
|
7022
|
+
);
|
|
7010
7023
|
});
|
|
7011
7024
|
TooltipComponent.sectionTitle = (0, import_react28.forwardRef)(function SectionTitle({ text, ...props }, ref) {
|
|
7012
7025
|
const theme2 = (0, import_react_better_core26.useTheme)();
|
|
@@ -7337,7 +7350,7 @@ var FoldableComponent = (0, import_react30.forwardRef)(function Foldable({
|
|
|
7337
7350
|
]
|
|
7338
7351
|
}
|
|
7339
7352
|
),
|
|
7340
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Divider_default.horizontal, { width: theme2.styles.borderWidth }) }),
|
|
7353
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Divider_default.horizontal, { width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth }) }),
|
|
7341
7354
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
7342
7355
|
Div_default,
|
|
7343
7356
|
{
|
|
@@ -7596,10 +7609,16 @@ var SideMenuComponent = function SideMenu({
|
|
|
7596
7609
|
withCloseButton,
|
|
7597
7610
|
widthMobileHandle,
|
|
7598
7611
|
absoluteComponent,
|
|
7599
|
-
|
|
7612
|
+
itemsAdditionalComponent,
|
|
7613
|
+
betweenItemsAdditionalComponent,
|
|
7614
|
+
bottomItemsAdditionalComponent,
|
|
7600
7615
|
isLoading,
|
|
7601
7616
|
backgroundColor,
|
|
7602
|
-
|
|
7617
|
+
gap,
|
|
7618
|
+
paddingTop,
|
|
7619
|
+
paddingBottom,
|
|
7620
|
+
renderItemsHolder,
|
|
7621
|
+
renderBottomItemsHolder
|
|
7603
7622
|
}) {
|
|
7604
7623
|
const theme2 = (0, import_react_better_core29.useTheme)();
|
|
7605
7624
|
const mediaQuery = useMediaQuery();
|
|
@@ -7624,9 +7643,49 @@ var SideMenuComponent = function SideMenu({
|
|
|
7624
7643
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
7625
7644
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
7626
7645
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
7646
|
+
const itemsComponent = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7647
|
+
Div_default.column,
|
|
7648
|
+
{
|
|
7649
|
+
width: "100%",
|
|
7650
|
+
height: "100%",
|
|
7651
|
+
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7652
|
+
paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
|
|
7653
|
+
paddingBottom: !renderItemsHolder ? !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0 : void 0,
|
|
7654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7655
|
+
MenuItemComponent,
|
|
7656
|
+
{
|
|
7657
|
+
item,
|
|
7658
|
+
backgroundColor: readyBackgroundColor,
|
|
7659
|
+
onClick: onClickXButton
|
|
7660
|
+
},
|
|
7661
|
+
item.text
|
|
7662
|
+
)) })
|
|
7663
|
+
}
|
|
7664
|
+
);
|
|
7665
|
+
const bottomItemsComponent = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7666
|
+
Div_default.column,
|
|
7667
|
+
{
|
|
7668
|
+
borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
|
|
7669
|
+
gap: theme2.styles.gap / 2,
|
|
7670
|
+
marginTop: "auto",
|
|
7671
|
+
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7672
|
+
paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
|
|
7673
|
+
paddingBottom: !renderItemsHolder ? !isCollapsable ? theme2.styles.space : void 0 : void 0,
|
|
7674
|
+
children: readyBottomItems?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7675
|
+
MenuItemComponent,
|
|
7676
|
+
{
|
|
7677
|
+
item,
|
|
7678
|
+
backgroundColor: readyBackgroundColor,
|
|
7679
|
+
onClick: onClickXButton
|
|
7680
|
+
},
|
|
7681
|
+
item.text
|
|
7682
|
+
))
|
|
7683
|
+
}
|
|
7684
|
+
);
|
|
7627
7685
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SideMenuContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7628
7686
|
Div_default.column,
|
|
7629
7687
|
{
|
|
7688
|
+
as: "aside",
|
|
7630
7689
|
position: "fixed",
|
|
7631
7690
|
width: mediaQuery.size1000 ? "100%" : isCollapsed ? sideMenuCollapsedWidth : sideMenuWidth,
|
|
7632
7691
|
height: `calc(100svh - ${topSpace}px)`,
|
|
@@ -7636,11 +7695,12 @@ var SideMenuComponent = function SideMenu({
|
|
|
7636
7695
|
borderRight: `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}`,
|
|
7637
7696
|
transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
|
|
7638
7697
|
paddingTop: paddingTop ?? (logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space),
|
|
7698
|
+
paddingBottom,
|
|
7639
7699
|
transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${theme2.styles.transition}` : "none" : theme2.styles.transition,
|
|
7640
7700
|
userSelect: "none",
|
|
7641
7701
|
zIndex: 10,
|
|
7642
7702
|
children: [
|
|
7643
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
|
|
7703
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: gap ?? theme2.styles.space, children: [
|
|
7644
7704
|
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
|
|
7645
7705
|
(logoAssetName || logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7646
7706
|
Div_default.row,
|
|
@@ -7678,48 +7738,13 @@ var SideMenuComponent = function SideMenu({
|
|
|
7678
7738
|
) }),
|
|
7679
7739
|
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
|
|
7680
7740
|
] }),
|
|
7741
|
+
itemsAdditionalComponent,
|
|
7681
7742
|
!isLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
width: "100%",
|
|
7686
|
-
height: "100%",
|
|
7687
|
-
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7688
|
-
paddingInline: theme2.styles.space,
|
|
7689
|
-
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
7690
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7691
|
-
MenuItemComponent,
|
|
7692
|
-
{
|
|
7693
|
-
item,
|
|
7694
|
-
backgroundColor: readyBackgroundColor,
|
|
7695
|
-
onClick: onClickXButton
|
|
7696
|
-
},
|
|
7697
|
-
item.text
|
|
7698
|
-
)) })
|
|
7699
|
-
}
|
|
7700
|
-
),
|
|
7701
|
-
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7702
|
-
Div_default.column,
|
|
7703
|
-
{
|
|
7704
|
-
borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
|
|
7705
|
-
gap: theme2.styles.gap / 2,
|
|
7706
|
-
marginTop: "auto",
|
|
7707
|
-
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7708
|
-
paddingInline: theme2.styles.space,
|
|
7709
|
-
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
7710
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7711
|
-
MenuItemComponent,
|
|
7712
|
-
{
|
|
7713
|
-
item,
|
|
7714
|
-
backgroundColor: readyBackgroundColor,
|
|
7715
|
-
onClick: onClickXButton
|
|
7716
|
-
},
|
|
7717
|
-
item.text
|
|
7718
|
-
))
|
|
7719
|
-
}
|
|
7720
|
-
)
|
|
7743
|
+
renderItemsHolder ? renderItemsHolder(itemsComponent) : itemsComponent,
|
|
7744
|
+
betweenItemsAdditionalComponent,
|
|
7745
|
+
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: renderBottomItemsHolder ? renderBottomItemsHolder(bottomItemsComponent) : bottomItemsComponent })
|
|
7721
7746
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default, { flex: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Loader_default.box, { text: isCollapsed ? "" : void 0 }) }),
|
|
7722
|
-
|
|
7747
|
+
bottomItemsAdditionalComponent,
|
|
7723
7748
|
isCollapsable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7724
7749
|
Div_default,
|
|
7725
7750
|
{
|