react-better-html 1.1.237 → 1.1.239
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 +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color, BetterCoreProviderConfig, DeepPartialRecord, OmitProps, BetterCoreConfig, IconName, AnyOtherString, PartialRecord, AssetName, LoaderName, PickValue, Country } from 'react-better-core';
|
|
2
|
-
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
2
|
+
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, calculateColorContrast, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ComponentProps, ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -582,6 +582,7 @@ type PageHolderProps = {
|
|
|
582
582
|
type PageHolderComponentType = {
|
|
583
583
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
584
584
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
585
|
+
height?: React.CSSProperties["height"];
|
|
585
586
|
pageBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
586
587
|
pageBackgroundImage?: React.CSSProperties["backgroundImage"];
|
|
587
588
|
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
@@ -591,7 +592,7 @@ type PageHolderComponentType = {
|
|
|
591
592
|
sideComponent?: React.ReactNode;
|
|
592
593
|
/** @default "right" */
|
|
593
594
|
sideComponentPosition?: "left" | "right";
|
|
594
|
-
}>) => React.ReactElement;
|
|
595
|
+
} & ComponentMarginProps>) => React.ReactElement;
|
|
595
596
|
};
|
|
596
597
|
declare const PageHolderComponent: PageHolderComponentType;
|
|
597
598
|
declare const PageHolder: typeof PageHolderComponent & {
|
|
@@ -1036,6 +1037,9 @@ type SideMenuProps = {
|
|
|
1036
1037
|
isLoading?: boolean;
|
|
1037
1038
|
/** @default backgroundContent */
|
|
1038
1039
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1040
|
+
/** @default primary */
|
|
1041
|
+
activeItemColor?: string;
|
|
1042
|
+
hoverItemColor?: string;
|
|
1039
1043
|
gap?: React.CSSProperties["gap"];
|
|
1040
1044
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1041
1045
|
paddingBottom?: React.CSSProperties["paddingBottom"];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color, BetterCoreProviderConfig, DeepPartialRecord, OmitProps, BetterCoreConfig, IconName, AnyOtherString, PartialRecord, AssetName, LoaderName, PickValue, Country } from 'react-better-core';
|
|
2
|
-
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
2
|
+
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, calculateColorContrast, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ComponentProps, ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -582,6 +582,7 @@ type PageHolderProps = {
|
|
|
582
582
|
type PageHolderComponentType = {
|
|
583
583
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
584
584
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
585
|
+
height?: React.CSSProperties["height"];
|
|
585
586
|
pageBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
586
587
|
pageBackgroundImage?: React.CSSProperties["backgroundImage"];
|
|
587
588
|
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
@@ -591,7 +592,7 @@ type PageHolderComponentType = {
|
|
|
591
592
|
sideComponent?: React.ReactNode;
|
|
592
593
|
/** @default "right" */
|
|
593
594
|
sideComponentPosition?: "left" | "right";
|
|
594
|
-
}>) => React.ReactElement;
|
|
595
|
+
} & ComponentMarginProps>) => React.ReactElement;
|
|
595
596
|
};
|
|
596
597
|
declare const PageHolderComponent: PageHolderComponentType;
|
|
597
598
|
declare const PageHolder: typeof PageHolderComponent & {
|
|
@@ -1036,6 +1037,9 @@ type SideMenuProps = {
|
|
|
1036
1037
|
isLoading?: boolean;
|
|
1037
1038
|
/** @default backgroundContent */
|
|
1038
1039
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1040
|
+
/** @default primary */
|
|
1041
|
+
activeItemColor?: string;
|
|
1042
|
+
hoverItemColor?: string;
|
|
1039
1043
|
gap?: React.CSSProperties["gap"];
|
|
1040
1044
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1041
1045
|
paddingBottom?: React.CSSProperties["paddingBottom"];
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
Tooltip: () => Tooltip_default,
|
|
58
58
|
alertControls: () => alertControls,
|
|
59
59
|
alertsPlugin: () => alertsPlugin,
|
|
60
|
+
calculateColorContrast: () => import_react_better_core30.calculateColorContrast,
|
|
60
61
|
colorThemeControls: () => import_react_better_core30.colorThemeControls,
|
|
61
62
|
countries: () => import_react_better_core30.countries,
|
|
62
63
|
darkenColor: () => import_react_better_core30.darkenColor,
|
|
@@ -3356,6 +3357,7 @@ var PageHolderComponent = (0, import_react15.forwardRef)(function PageHolder({ n
|
|
|
3356
3357
|
);
|
|
3357
3358
|
});
|
|
3358
3359
|
PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
|
|
3360
|
+
height,
|
|
3359
3361
|
pageBackgroundColor,
|
|
3360
3362
|
pageBackgroundImage,
|
|
3361
3363
|
contentMaxWidth,
|
|
@@ -3379,7 +3381,7 @@ PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
|
|
|
3379
3381
|
position: "relative",
|
|
3380
3382
|
width: "100%",
|
|
3381
3383
|
minHeight: "100svh",
|
|
3382
|
-
alignItems: "center",
|
|
3384
|
+
alignItems: height !== "100%" ? "center" : void 0,
|
|
3383
3385
|
justifyContent: "center",
|
|
3384
3386
|
backgroundColor: pageBackgroundColor,
|
|
3385
3387
|
backgroundImage: pageBackgroundImage,
|
|
@@ -3401,8 +3403,9 @@ PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
|
|
|
3401
3403
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Div_default.column, { position: "relative", width: `${withSideComponent ? 50 : 100}%`, alignItems: "center", zIndex: 2, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3402
3404
|
ContentTag,
|
|
3403
3405
|
{
|
|
3404
|
-
width: `calc(100% - ${theme2.styles.space * 2}px)`,
|
|
3406
|
+
width: `calc(100% - ${((props.margin ?? props.marginInline) !== void 0 ? parseFloat((props.margin ?? props.marginInline)?.toString() ?? "") : theme2.styles.space) * 2}px)`,
|
|
3405
3407
|
maxWidth: !noMaxContentWidth ? contentMaxWidth ?? app.contentMaxWidth / 2 : void 0,
|
|
3408
|
+
height,
|
|
3406
3409
|
marginInline: theme2.styles.space,
|
|
3407
3410
|
marginBlock: theme2.styles.space,
|
|
3408
3411
|
...props,
|
|
@@ -7398,7 +7401,13 @@ var useSideMenuContext = () => {
|
|
|
7398
7401
|
}
|
|
7399
7402
|
return context;
|
|
7400
7403
|
};
|
|
7401
|
-
var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
|
|
7404
|
+
var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
|
|
7405
|
+
item,
|
|
7406
|
+
backgroundColor,
|
|
7407
|
+
activeItemColor,
|
|
7408
|
+
hoverItemColor,
|
|
7409
|
+
onClick
|
|
7410
|
+
}) {
|
|
7402
7411
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
7403
7412
|
if (!reactRouterDomPlugin2) {
|
|
7404
7413
|
throw new Error(
|
|
@@ -7439,6 +7448,7 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
|
|
|
7439
7448
|
const lineHeight = 20;
|
|
7440
7449
|
const lineWidth = 2;
|
|
7441
7450
|
const lineEndRadius = iconSize / 2 + iconGap * 2;
|
|
7451
|
+
const backgroundColorContrast = activeItemColor ? (0, import_react_better_core29.calculateColorContrast)(activeItemColor, theme2.colors.primary) : 21;
|
|
7442
7452
|
const content = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7443
7453
|
Tooltip_default,
|
|
7444
7454
|
{
|
|
@@ -7457,24 +7467,33 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
|
|
|
7457
7467
|
alignItems: "center",
|
|
7458
7468
|
gap: iconGap,
|
|
7459
7469
|
whiteSpace: "nowrap",
|
|
7460
|
-
backgroundColor: isActive ? colorTheme === "dark" ? (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.7) : (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.85) : readyBackgroundColor,
|
|
7470
|
+
backgroundColor: isActive ? activeItemColor ?? (colorTheme === "dark" ? (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.7) : (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.85)) : readyBackgroundColor,
|
|
7471
|
+
backgroundColorHover: isActive && activeItemColor ? void 0 : hoverItemColor,
|
|
7461
7472
|
borderRadius: theme2.styles.borderRadius,
|
|
7462
7473
|
paddingBlock,
|
|
7463
7474
|
paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
|
|
7464
7475
|
paddingRight: theme2.styles.space,
|
|
7465
|
-
filterHover: `brightness(${colorTheme === "dark" ? isActive ? 0.8 : 1.3 : isActive ? 0.8 : 0.95})
|
|
7476
|
+
filterHover: !hoverItemColor || isActive ? `brightness(${colorTheme === "dark" ? isActive ? 0.8 : 1.3 : isActive ? 0.8 : 0.95})` : void 0,
|
|
7466
7477
|
overflow: isCollapsed ? "hidden" : void 0,
|
|
7467
7478
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
7468
7479
|
opacity: item.disabled ? 0.6 : void 0,
|
|
7469
7480
|
onClick: onClickElement,
|
|
7470
7481
|
children: [
|
|
7471
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7482
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7483
|
+
Icon_default,
|
|
7484
|
+
{
|
|
7485
|
+
name: item.iconName,
|
|
7486
|
+
color: isActive && backgroundColorContrast < 7 ? theme2.colors.base : theme2.colors.primary,
|
|
7487
|
+
size: iconSize,
|
|
7488
|
+
flexShrink: 0
|
|
7489
|
+
}
|
|
7490
|
+
),
|
|
7472
7491
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7473
7492
|
Text_default,
|
|
7474
7493
|
{
|
|
7475
7494
|
flex: 1,
|
|
7476
7495
|
lineHeight: `${lineHeight}px`,
|
|
7477
|
-
color: isActive ? theme2.colors.primary : theme2.colors.textPrimary,
|
|
7496
|
+
color: isActive ? backgroundColorContrast < 7 ? theme2.colors.base : theme2.colors.primary : theme2.colors.textPrimary,
|
|
7478
7497
|
opacity: isCollapsed ? 0 : void 0,
|
|
7479
7498
|
transition: theme2.styles.transition,
|
|
7480
7499
|
children: item.text
|
|
@@ -7614,6 +7633,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
7614
7633
|
bottomItemsAdditionalComponent,
|
|
7615
7634
|
isLoading,
|
|
7616
7635
|
backgroundColor,
|
|
7636
|
+
activeItemColor,
|
|
7637
|
+
hoverItemColor,
|
|
7617
7638
|
gap,
|
|
7618
7639
|
paddingTop,
|
|
7619
7640
|
paddingBottom,
|
|
@@ -7656,6 +7677,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
7656
7677
|
{
|
|
7657
7678
|
item,
|
|
7658
7679
|
backgroundColor: readyBackgroundColor,
|
|
7680
|
+
activeItemColor,
|
|
7681
|
+
hoverItemColor,
|
|
7659
7682
|
onClick: onClickXButton
|
|
7660
7683
|
},
|
|
7661
7684
|
item.text
|
|
@@ -7676,6 +7699,8 @@ var SideMenuComponent = function SideMenu({
|
|
|
7676
7699
|
{
|
|
7677
7700
|
item,
|
|
7678
7701
|
backgroundColor: readyBackgroundColor,
|
|
7702
|
+
activeItemColor,
|
|
7703
|
+
hoverItemColor,
|
|
7679
7704
|
onClick: onClickXButton
|
|
7680
7705
|
},
|
|
7681
7706
|
item.text
|
|
@@ -7933,6 +7958,7 @@ var SideMenu_default = SideMenu2;
|
|
|
7933
7958
|
Tooltip,
|
|
7934
7959
|
alertControls,
|
|
7935
7960
|
alertsPlugin,
|
|
7961
|
+
calculateColorContrast,
|
|
7936
7962
|
colorThemeControls,
|
|
7937
7963
|
countries,
|
|
7938
7964
|
darkenColor,
|