react-better-html 1.1.235 → 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.mjs CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  loaderControls,
20
20
  colorThemeControls as colorThemeControls2,
21
21
  generateApi,
22
+ isApiError,
22
23
  generateEventEmitter,
23
24
  log
24
25
  } from "react-better-core";
@@ -5513,7 +5514,12 @@ var FormComponent = forwardRef13(function Form({
5513
5514
  return /* @__PURE__ */ jsx19(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs16("form", { name, onSubmit: onSubmit ?? form?.onSubmit, ref, children: [
5514
5515
  gap !== void 0 || withDividers ? /* @__PURE__ */ jsx19(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs16(Fragment5, { children: [
5515
5516
  child,
5516
- index < Children.toArray(children).length - 1 && /* @__PURE__ */ jsx19(Divider_default.horizontal, { width: theme2.styles.borderWidth })
5517
+ index < Children.toArray(children).length - 1 && /* @__PURE__ */ jsx19(
5518
+ Divider_default.horizontal,
5519
+ {
5520
+ width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth
5521
+ }
5522
+ )
5517
5523
  ] }, index)) : children }) : children,
5518
5524
  submitButtonText && /* @__PURE__ */ jsxs16(
5519
5525
  Div_default.row,
@@ -6966,7 +6972,15 @@ TooltipComponent.item = forwardRef16(function Item({
6966
6972
  });
6967
6973
  TooltipComponent.divider = forwardRef16(function DividerComponent(props, ref) {
6968
6974
  const theme2 = useTheme26();
6969
- return /* @__PURE__ */ jsx24(Divider_default.horizontal, { width: theme2.styles.borderWidth, marginBlock: theme2.styles.gap, ...props, ref });
6975
+ return /* @__PURE__ */ jsx24(
6976
+ Divider_default.horizontal,
6977
+ {
6978
+ width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth,
6979
+ marginBlock: theme2.styles.gap,
6980
+ ...props,
6981
+ ref
6982
+ }
6983
+ );
6970
6984
  });
6971
6985
  TooltipComponent.sectionTitle = forwardRef16(function SectionTitle({ text, ...props }, ref) {
6972
6986
  const theme2 = useTheme26();
@@ -7297,7 +7311,7 @@ var FoldableComponent = forwardRef18(function Foldable({
7297
7311
  ]
7298
7312
  }
7299
7313
  ),
7300
- /* @__PURE__ */ jsx26(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ jsx26(Divider_default.horizontal, { width: theme2.styles.borderWidth }) }),
7314
+ /* @__PURE__ */ jsx26(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ jsx26(Divider_default.horizontal, { width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth }) }),
7301
7315
  /* @__PURE__ */ jsx26(
7302
7316
  Div_default,
7303
7317
  {
@@ -7561,10 +7575,16 @@ var SideMenuComponent = function SideMenu({
7561
7575
  withCloseButton,
7562
7576
  widthMobileHandle,
7563
7577
  absoluteComponent,
7564
- additionalComponent,
7578
+ itemsAdditionalComponent,
7579
+ betweenItemsAdditionalComponent,
7580
+ bottomItemsAdditionalComponent,
7565
7581
  isLoading,
7566
7582
  backgroundColor,
7567
- paddingTop
7583
+ gap,
7584
+ paddingTop,
7585
+ paddingBottom,
7586
+ renderItemsHolder,
7587
+ renderBottomItemsHolder
7568
7588
  }) {
7569
7589
  const theme2 = useTheme29();
7570
7590
  const mediaQuery = useMediaQuery();
@@ -7589,9 +7609,49 @@ var SideMenuComponent = function SideMenu({
7589
7609
  const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
7590
7610
  const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
7591
7611
  const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
7612
+ const itemsComponent = /* @__PURE__ */ jsx27(
7613
+ Div_default.column,
7614
+ {
7615
+ width: "100%",
7616
+ height: "100%",
7617
+ overflowY: !isCollapsed ? "auto" : void 0,
7618
+ paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
7619
+ paddingBottom: !renderItemsHolder ? !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0 : void 0,
7620
+ children: /* @__PURE__ */ jsx27(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx27(
7621
+ MenuItemComponent,
7622
+ {
7623
+ item,
7624
+ backgroundColor: readyBackgroundColor,
7625
+ onClick: onClickXButton
7626
+ },
7627
+ item.text
7628
+ )) })
7629
+ }
7630
+ );
7631
+ const bottomItemsComponent = /* @__PURE__ */ jsx27(
7632
+ Div_default.column,
7633
+ {
7634
+ borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
7635
+ gap: theme2.styles.gap / 2,
7636
+ marginTop: "auto",
7637
+ paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
7638
+ paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
7639
+ paddingBottom: !renderItemsHolder ? !isCollapsable ? theme2.styles.space : void 0 : void 0,
7640
+ children: readyBottomItems?.map((item) => /* @__PURE__ */ jsx27(
7641
+ MenuItemComponent,
7642
+ {
7643
+ item,
7644
+ backgroundColor: readyBackgroundColor,
7645
+ onClick: onClickXButton
7646
+ },
7647
+ item.text
7648
+ ))
7649
+ }
7650
+ );
7592
7651
  return /* @__PURE__ */ jsx27(SideMenuContextProvider, { value: contextValue, children: /* @__PURE__ */ jsxs24(
7593
7652
  Div_default.column,
7594
7653
  {
7654
+ as: "aside",
7595
7655
  position: "fixed",
7596
7656
  width: mediaQuery.size1000 ? "100%" : isCollapsed ? sideMenuCollapsedWidth : sideMenuWidth,
7597
7657
  height: `calc(100svh - ${topSpace}px)`,
@@ -7601,11 +7661,12 @@ var SideMenuComponent = function SideMenu({
7601
7661
  borderRight: `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}`,
7602
7662
  transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
7603
7663
  paddingTop: paddingTop ?? (logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space),
7664
+ paddingBottom,
7604
7665
  transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${theme2.styles.transition}` : "none" : theme2.styles.transition,
7605
7666
  userSelect: "none",
7606
7667
  zIndex: 10,
7607
7668
  children: [
7608
- /* @__PURE__ */ jsxs24(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
7669
+ /* @__PURE__ */ jsxs24(Div_default.column, { width: "100%", height: "100%", gap: gap ?? theme2.styles.space, children: [
7609
7670
  (logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ jsxs24(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
7610
7671
  (logoAssetName || logoUrl) && /* @__PURE__ */ jsx27(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ jsxs24(
7611
7672
  Div_default.row,
@@ -7643,48 +7704,13 @@ var SideMenuComponent = function SideMenu({
7643
7704
  ) }),
7644
7705
  withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ jsx27(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
7645
7706
  ] }),
7707
+ itemsAdditionalComponent,
7646
7708
  !isLoading ? /* @__PURE__ */ jsxs24(Fragment8, { children: [
7647
- /* @__PURE__ */ jsx27(
7648
- Div_default.column,
7649
- {
7650
- width: "100%",
7651
- height: "100%",
7652
- overflowY: !isCollapsed ? "auto" : void 0,
7653
- paddingInline: theme2.styles.space,
7654
- paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
7655
- children: /* @__PURE__ */ jsx27(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx27(
7656
- MenuItemComponent,
7657
- {
7658
- item,
7659
- backgroundColor: readyBackgroundColor,
7660
- onClick: onClickXButton
7661
- },
7662
- item.text
7663
- )) })
7664
- }
7665
- ),
7666
- readyBottomItems && /* @__PURE__ */ jsx27(
7667
- Div_default.column,
7668
- {
7669
- borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
7670
- gap: theme2.styles.gap / 2,
7671
- marginTop: "auto",
7672
- paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
7673
- paddingInline: theme2.styles.space,
7674
- paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
7675
- children: readyBottomItems.map((item) => /* @__PURE__ */ jsx27(
7676
- MenuItemComponent,
7677
- {
7678
- item,
7679
- backgroundColor: readyBackgroundColor,
7680
- onClick: onClickXButton
7681
- },
7682
- item.text
7683
- ))
7684
- }
7685
- )
7709
+ renderItemsHolder ? renderItemsHolder(itemsComponent) : itemsComponent,
7710
+ betweenItemsAdditionalComponent,
7711
+ readyBottomItems && /* @__PURE__ */ jsx27(Fragment8, { children: renderBottomItemsHolder ? renderBottomItemsHolder(bottomItemsComponent) : bottomItemsComponent })
7686
7712
  ] }) : /* @__PURE__ */ jsx27(Div_default, { flex: 1, children: /* @__PURE__ */ jsx27(Loader_default.box, { text: isCollapsed ? "" : void 0 }) }),
7687
- additionalComponent,
7713
+ bottomItemsAdditionalComponent,
7688
7714
  isCollapsable && /* @__PURE__ */ jsx27(
7689
7715
  Div_default,
7690
7716
  {
@@ -7891,6 +7917,7 @@ export {
7891
7917
  getBrowser,
7892
7918
  getFormErrorObject,
7893
7919
  getPluralWord2 as getPluralWord,
7920
+ isApiError,
7894
7921
  isMobileDevice,
7895
7922
  lightenColor4 as lightenColor,
7896
7923
  loaderControls,