react-better-html 1.1.190 → 1.1.192
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 +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +49 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7584,6 +7584,7 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
|
|
|
7584
7584
|
titleFontSize,
|
|
7585
7585
|
description,
|
|
7586
7586
|
descriptionFontSize,
|
|
7587
|
+
required,
|
|
7587
7588
|
alignChildren = "flex-start",
|
|
7588
7589
|
isLoading,
|
|
7589
7590
|
withActions,
|
|
@@ -7601,7 +7602,13 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
|
|
|
7601
7602
|
/* @__PURE__ */ jsxs16(Div_default.row, { width: "100%", alignItems: "center", gap: titleGap, children: [
|
|
7602
7603
|
icon && /* @__PURE__ */ jsx20(Icon_default, { name: icon }),
|
|
7603
7604
|
/* @__PURE__ */ jsxs16(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
7604
|
-
/* @__PURE__ */
|
|
7605
|
+
/* @__PURE__ */ jsxs16(Text_default, { as: titleAs, fontSize: titleFontSize, children: [
|
|
7606
|
+
title,
|
|
7607
|
+
required && /* @__PURE__ */ jsxs16(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
|
|
7608
|
+
" ",
|
|
7609
|
+
"*"
|
|
7610
|
+
] })
|
|
7611
|
+
] }),
|
|
7605
7612
|
description && /* @__PURE__ */ jsx20(Text_default, { fontSize: descriptionFontSize, color: theme2.colors.textSecondary, children: description })
|
|
7606
7613
|
] }),
|
|
7607
7614
|
isLoading && /* @__PURE__ */ jsx20(Div_default, { width: 26 - titleGap })
|
|
@@ -9292,7 +9299,7 @@ var Foldable_default = Foldable2;
|
|
|
9292
9299
|
// src/components/SideMenu.tsx
|
|
9293
9300
|
import { memo as memo26, useCallback as useCallback15, useEffect as useEffect14, useMemo as useMemo11 } from "react";
|
|
9294
9301
|
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9295
|
-
var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
9302
|
+
var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundColor, onClick }) {
|
|
9296
9303
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
9297
9304
|
if (!reactRouterDomPlugin2) {
|
|
9298
9305
|
throw new Error(
|
|
@@ -9312,6 +9319,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9312
9319
|
}, [onClick, item]);
|
|
9313
9320
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9314
9321
|
const isActive = item.href ? location.pathname === "/" ? location.pathname === item.href : location.pathname.startsWith(item.href) && item.href !== "/" : false;
|
|
9322
|
+
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9315
9323
|
const iconSize = 16;
|
|
9316
9324
|
const paddingBlock = theme2.styles.gap;
|
|
9317
9325
|
const paddingLeft = theme2.styles.gap + 2;
|
|
@@ -9325,7 +9333,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9325
9333
|
alignItems: "center",
|
|
9326
9334
|
gap: iconGap,
|
|
9327
9335
|
whiteSpace: "nowrap",
|
|
9328
|
-
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor(theme2.colors.primary, 0.7) : lightenColor(theme2.colors.primary, 0.85) :
|
|
9336
|
+
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor(theme2.colors.primary, 0.7) : lightenColor(theme2.colors.primary, 0.85) : readyBackgroundColor,
|
|
9329
9337
|
borderRadius: theme2.styles.borderRadius,
|
|
9330
9338
|
paddingBlock,
|
|
9331
9339
|
paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
|
|
@@ -9382,7 +9390,15 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9382
9390
|
overflow: "hidden",
|
|
9383
9391
|
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
9384
9392
|
children: [
|
|
9385
|
-
item.children.map((child) => /* @__PURE__ */ jsx26(
|
|
9393
|
+
item.children.map((child) => /* @__PURE__ */ jsx26(
|
|
9394
|
+
MenuItemComponent2,
|
|
9395
|
+
{
|
|
9396
|
+
item: child,
|
|
9397
|
+
backgroundColor: readyBackgroundColor,
|
|
9398
|
+
onClick
|
|
9399
|
+
},
|
|
9400
|
+
child.text
|
|
9401
|
+
)),
|
|
9386
9402
|
/* @__PURE__ */ jsxs22(
|
|
9387
9403
|
Div_default,
|
|
9388
9404
|
{
|
|
@@ -9412,9 +9428,9 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, onClick }) {
|
|
|
9412
9428
|
left: 0,
|
|
9413
9429
|
border: `${lineWidth}px solid ${theme2.colors.border}`,
|
|
9414
9430
|
borderRadius: 999,
|
|
9415
|
-
borderTopColor:
|
|
9416
|
-
borderLeftColor:
|
|
9417
|
-
borderRightColor:
|
|
9431
|
+
borderTopColor: readyBackgroundColor,
|
|
9432
|
+
borderLeftColor: readyBackgroundColor,
|
|
9433
|
+
borderRightColor: readyBackgroundColor,
|
|
9418
9434
|
transform: "rotate(45deg)"
|
|
9419
9435
|
}
|
|
9420
9436
|
)
|
|
@@ -9436,7 +9452,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
9436
9452
|
logoFontFamily,
|
|
9437
9453
|
collapsable,
|
|
9438
9454
|
withCloseButton,
|
|
9439
|
-
widthMobileHandle
|
|
9455
|
+
widthMobileHandle,
|
|
9456
|
+
backgroundColor
|
|
9440
9457
|
}) {
|
|
9441
9458
|
const theme2 = useTheme();
|
|
9442
9459
|
const mediaQuery = useMediaQuery();
|
|
@@ -9450,7 +9467,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
9450
9467
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9451
9468
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
9452
9469
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
9453
|
-
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 +
|
|
9470
|
+
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9471
|
+
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9454
9472
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
9455
9473
|
return /* @__PURE__ */ jsxs22(
|
|
9456
9474
|
Div_default.column,
|
|
@@ -9460,7 +9478,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9460
9478
|
height: `calc(100svh - ${topSpace}px)`,
|
|
9461
9479
|
top: topSpace,
|
|
9462
9480
|
left: 0,
|
|
9463
|
-
backgroundColor:
|
|
9481
|
+
backgroundColor: readyBackgroundColor,
|
|
9464
9482
|
borderRight: `solid 1px ${theme2.colors.border}`,
|
|
9465
9483
|
transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
|
|
9466
9484
|
paddingTop: logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space,
|
|
@@ -9514,7 +9532,15 @@ var SideMenuComponent = function SideMenu({
|
|
|
9514
9532
|
overflowY: "auto",
|
|
9515
9533
|
paddingInline: theme2.styles.space,
|
|
9516
9534
|
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
9517
|
-
children: /* @__PURE__ */ jsx26(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9535
|
+
children: /* @__PURE__ */ jsx26(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9536
|
+
MenuItemComponent,
|
|
9537
|
+
{
|
|
9538
|
+
item,
|
|
9539
|
+
backgroundColor: readyBackgroundColor,
|
|
9540
|
+
onClick: onClickXButton
|
|
9541
|
+
},
|
|
9542
|
+
item.text
|
|
9543
|
+
)) })
|
|
9518
9544
|
}
|
|
9519
9545
|
),
|
|
9520
9546
|
readyBottomItems && /* @__PURE__ */ jsx26(
|
|
@@ -9526,7 +9552,15 @@ var SideMenuComponent = function SideMenu({
|
|
|
9526
9552
|
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
9527
9553
|
paddingInline: theme2.styles.space,
|
|
9528
9554
|
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
9529
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9555
|
+
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx26(
|
|
9556
|
+
MenuItemComponent,
|
|
9557
|
+
{
|
|
9558
|
+
item,
|
|
9559
|
+
backgroundColor: readyBackgroundColor,
|
|
9560
|
+
onClick: onClickXButton
|
|
9561
|
+
},
|
|
9562
|
+
item.text
|
|
9563
|
+
))
|
|
9530
9564
|
}
|
|
9531
9565
|
),
|
|
9532
9566
|
isCollapsable && /* @__PURE__ */ jsx26(
|
|
@@ -9541,7 +9575,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9541
9575
|
{
|
|
9542
9576
|
alignItems: "center",
|
|
9543
9577
|
justifyContent: "center",
|
|
9544
|
-
backgroundColor:
|
|
9578
|
+
backgroundColor: readyBackgroundColor,
|
|
9545
9579
|
borderRadius: theme2.styles.borderRadius,
|
|
9546
9580
|
cursor: "pointer",
|
|
9547
9581
|
filterHover: filterHover().z1,
|
|
@@ -9569,7 +9603,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9569
9603
|
position: "absolute",
|
|
9570
9604
|
top: theme2.styles.space,
|
|
9571
9605
|
left: "100%",
|
|
9572
|
-
backgroundColor:
|
|
9606
|
+
backgroundColor: readyBackgroundColor,
|
|
9573
9607
|
border: `solid 1px ${theme2.colors.border}`,
|
|
9574
9608
|
borderLeft: "none",
|
|
9575
9609
|
borderTopRightRadius: theme2.styles.borderRadius,
|
|
@@ -9604,7 +9638,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
9604
9638
|
const mediaQuery = useMediaQuery();
|
|
9605
9639
|
const { components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9606
9640
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
9607
|
-
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 +
|
|
9641
|
+
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9608
9642
|
return /* @__PURE__ */ jsxs22(
|
|
9609
9643
|
Div_default,
|
|
9610
9644
|
{
|