react-better-html 1.1.159 → 1.1.161
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 +13 -10
- package/dist/index.d.ts +13 -10
- package/dist/index.js +30 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -257,8 +257,9 @@ type VerticalDividerProps = DividerProps & {
|
|
|
257
257
|
};
|
|
258
258
|
type HorizontalDividerProps = DividerProps & {
|
|
259
259
|
text?: string;
|
|
260
|
+
textFontSize?: React.CSSProperties["fontSize"];
|
|
260
261
|
/** @default textSecondary */
|
|
261
|
-
textColor?:
|
|
262
|
+
textColor?: React.CSSProperties["color"];
|
|
262
263
|
};
|
|
263
264
|
type DividerComponentType = {
|
|
264
265
|
vertical: (props: ComponentPropWithRef<HTMLDivElement, VerticalDividerProps>) => React.ReactElement;
|
|
@@ -318,21 +319,20 @@ declare const Modal: typeof ModalComponent & {
|
|
|
318
319
|
type PageHolderProps = {
|
|
319
320
|
/** @default false */
|
|
320
321
|
noMaxContentWidth?: boolean;
|
|
321
|
-
backgroundColor?:
|
|
322
|
+
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
323
|
+
backgroundImage?: React.CSSProperties["backgroundImage"];
|
|
322
324
|
children?: React.ReactNode;
|
|
323
325
|
} & ComponentPaddingProps;
|
|
324
326
|
type PageHolderComponentType = {
|
|
325
327
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
326
328
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
327
|
-
pageBackgroundColor?:
|
|
329
|
+
pageBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
330
|
+
pageBackgroundImage?: React.CSSProperties["backgroundImage"];
|
|
328
331
|
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
behindComponent?: React.ReactNode;
|
|
333
|
+
sideComponent?: React.ReactNode;
|
|
331
334
|
/** @default "right" */
|
|
332
|
-
|
|
333
|
-
/** @default "center" */
|
|
334
|
-
sideImageAlignment?: "left" | "center" | "right";
|
|
335
|
-
sideImageFooter?: React.ReactNode;
|
|
335
|
+
sideComponentPosition?: "left" | "right";
|
|
336
336
|
}>) => React.ReactElement;
|
|
337
337
|
};
|
|
338
338
|
declare const PageHolderComponent: PageHolderComponentType;
|
|
@@ -405,7 +405,10 @@ type InputFieldComponentType = {
|
|
|
405
405
|
(props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>): React.ReactElement;
|
|
406
406
|
multiline: (props: ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>) => React.ReactElement;
|
|
407
407
|
email: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
408
|
-
password: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>
|
|
408
|
+
password: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "autoComplete"> & {
|
|
409
|
+
/** @default "current-password" */
|
|
410
|
+
autoComplete?: React.ComponentProps<"input">["autoComplete"];
|
|
411
|
+
}>) => React.ReactElement;
|
|
409
412
|
search: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
410
413
|
phoneNumber: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "type" | "prefix">>) => React.ReactElement;
|
|
411
414
|
date: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
|
package/dist/index.d.ts
CHANGED
|
@@ -257,8 +257,9 @@ type VerticalDividerProps = DividerProps & {
|
|
|
257
257
|
};
|
|
258
258
|
type HorizontalDividerProps = DividerProps & {
|
|
259
259
|
text?: string;
|
|
260
|
+
textFontSize?: React.CSSProperties["fontSize"];
|
|
260
261
|
/** @default textSecondary */
|
|
261
|
-
textColor?:
|
|
262
|
+
textColor?: React.CSSProperties["color"];
|
|
262
263
|
};
|
|
263
264
|
type DividerComponentType = {
|
|
264
265
|
vertical: (props: ComponentPropWithRef<HTMLDivElement, VerticalDividerProps>) => React.ReactElement;
|
|
@@ -318,21 +319,20 @@ declare const Modal: typeof ModalComponent & {
|
|
|
318
319
|
type PageHolderProps = {
|
|
319
320
|
/** @default false */
|
|
320
321
|
noMaxContentWidth?: boolean;
|
|
321
|
-
backgroundColor?:
|
|
322
|
+
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
323
|
+
backgroundImage?: React.CSSProperties["backgroundImage"];
|
|
322
324
|
children?: React.ReactNode;
|
|
323
325
|
} & ComponentPaddingProps;
|
|
324
326
|
type PageHolderComponentType = {
|
|
325
327
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
326
328
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
327
|
-
pageBackgroundColor?:
|
|
329
|
+
pageBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
330
|
+
pageBackgroundImage?: React.CSSProperties["backgroundImage"];
|
|
328
331
|
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
329
|
-
|
|
330
|
-
|
|
332
|
+
behindComponent?: React.ReactNode;
|
|
333
|
+
sideComponent?: React.ReactNode;
|
|
331
334
|
/** @default "right" */
|
|
332
|
-
|
|
333
|
-
/** @default "center" */
|
|
334
|
-
sideImageAlignment?: "left" | "center" | "right";
|
|
335
|
-
sideImageFooter?: React.ReactNode;
|
|
335
|
+
sideComponentPosition?: "left" | "right";
|
|
336
336
|
}>) => React.ReactElement;
|
|
337
337
|
};
|
|
338
338
|
declare const PageHolderComponent: PageHolderComponentType;
|
|
@@ -405,7 +405,10 @@ type InputFieldComponentType = {
|
|
|
405
405
|
(props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>): React.ReactElement;
|
|
406
406
|
multiline: (props: ComponentPropWithRef<HTMLTextAreaElement, TextareaFieldProps>) => React.ReactElement;
|
|
407
407
|
email: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
408
|
-
password: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>
|
|
408
|
+
password: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "autoComplete"> & {
|
|
409
|
+
/** @default "current-password" */
|
|
410
|
+
autoComplete?: React.ComponentProps<"input">["autoComplete"];
|
|
411
|
+
}>) => React.ReactElement;
|
|
409
412
|
search: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
|
|
410
413
|
phoneNumber: (props: ComponentPropWithRef<HTMLInputElement, OmitProps<InputFieldProps, "type" | "prefix">>) => React.ReactElement;
|
|
411
414
|
date: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
|
package/dist/index.js
CHANGED
|
@@ -3345,11 +3345,11 @@ var Divider_default = {
|
|
|
3345
3345
|
})
|
|
3346
3346
|
),
|
|
3347
3347
|
horizontal: (0, import_react12.memo)(
|
|
3348
|
-
(0, import_react12.forwardRef)(function Divider2({ width = 1, backgroundColor, text, textColor, ...props }, ref) {
|
|
3348
|
+
(0, import_react12.forwardRef)(function Divider2({ width = 1, backgroundColor, text, textFontSize, textColor, ...props }, ref) {
|
|
3349
3349
|
const theme2 = useTheme();
|
|
3350
3350
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: text ? theme2.styles.space : void 0, ...props, ref, children: [
|
|
3351
3351
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border }),
|
|
3352
|
-
text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { color: textColor ?? theme2.colors.textSecondary, children: text }),
|
|
3352
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { fontSize: textFontSize, color: textColor ?? theme2.colors.textSecondary, children: text }),
|
|
3353
3353
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border })
|
|
3354
3354
|
] });
|
|
3355
3355
|
})
|
|
@@ -3659,12 +3659,11 @@ var PageHolderComponent = (0, import_react14.forwardRef)(function PageHolder({ n
|
|
|
3659
3659
|
});
|
|
3660
3660
|
PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
|
|
3661
3661
|
pageBackgroundColor,
|
|
3662
|
+
pageBackgroundImage,
|
|
3662
3663
|
contentMaxWidth,
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
sideImageAlignment = "center",
|
|
3667
|
-
sideImageFooter,
|
|
3664
|
+
behindComponent,
|
|
3665
|
+
sideComponent,
|
|
3666
|
+
sideComponentPosition = "right",
|
|
3668
3667
|
noMaxContentWidth,
|
|
3669
3668
|
children,
|
|
3670
3669
|
...props
|
|
@@ -3673,21 +3672,36 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
|
|
|
3673
3672
|
const mediaQuery = useMediaQuery();
|
|
3674
3673
|
const { app } = useBetterHtmlContextInternal();
|
|
3675
3674
|
const breakingPoint = mediaQuery.size1000;
|
|
3676
|
-
const
|
|
3675
|
+
const withSideComponent = sideComponent && !breakingPoint;
|
|
3677
3676
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3678
3677
|
Div_default.row,
|
|
3679
3678
|
{
|
|
3679
|
+
position: "relative",
|
|
3680
3680
|
width: "100%",
|
|
3681
3681
|
minHeight: "100svh",
|
|
3682
3682
|
alignItems: "center",
|
|
3683
3683
|
justifyContent: "center",
|
|
3684
3684
|
backgroundColor: pageBackgroundColor,
|
|
3685
|
+
backgroundImage: pageBackgroundImage,
|
|
3685
3686
|
children: [
|
|
3686
|
-
|
|
3687
|
-
|
|
3687
|
+
behindComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3688
|
+
Div_default,
|
|
3689
|
+
{
|
|
3690
|
+
position: "fixed",
|
|
3691
|
+
width: `${withSideComponent ? 50 : 100}%`,
|
|
3692
|
+
height: "100svh",
|
|
3693
|
+
top: 0,
|
|
3694
|
+
left: sideComponentPosition === "right" ? 0 : "auto",
|
|
3695
|
+
right: sideComponentPosition === "left" ? 0 : "auto",
|
|
3696
|
+
zIndex: 1,
|
|
3697
|
+
children: behindComponent
|
|
3698
|
+
}
|
|
3699
|
+
),
|
|
3700
|
+
sideComponentPosition === "left" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { width: "50%" }),
|
|
3701
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default.column, { position: "relative", width: `${withSideComponent ? 50 : 100}%`, alignItems: "center", zIndex: 2, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3688
3702
|
Div_default.box,
|
|
3689
3703
|
{
|
|
3690
|
-
width: `calc(100% - ${theme2.styles.space
|
|
3704
|
+
width: `calc(100% - ${theme2.styles.space * 2}px)`,
|
|
3691
3705
|
maxWidth: !noMaxContentWidth ? contentMaxWidth ?? app.contentMaxWidth / 2 : void 0,
|
|
3692
3706
|
marginInline: theme2.styles.space,
|
|
3693
3707
|
marginBlock: theme2.styles.space,
|
|
@@ -3696,32 +3710,17 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
|
|
|
3696
3710
|
children
|
|
3697
3711
|
}
|
|
3698
3712
|
) }),
|
|
3699
|
-
|
|
3700
|
-
|
|
3713
|
+
sideComponentPosition === "right" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { width: "50%" }),
|
|
3714
|
+
withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3701
3715
|
Div_default,
|
|
3702
3716
|
{
|
|
3703
3717
|
position: "fixed",
|
|
3704
3718
|
width: "50%",
|
|
3705
3719
|
height: "100svh",
|
|
3706
3720
|
top: 0,
|
|
3707
|
-
left:
|
|
3708
|
-
right:
|
|
3709
|
-
children:
|
|
3710
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3711
|
-
Div_default.row,
|
|
3712
|
-
{
|
|
3713
|
-
position: "absolute",
|
|
3714
|
-
width: "100%",
|
|
3715
|
-
height: "100%",
|
|
3716
|
-
top: 0,
|
|
3717
|
-
left: 0,
|
|
3718
|
-
justifyContent: sideImageAlignment === "left" ? "flex-start" : sideImageAlignment === "right" ? "flex-end" : "center",
|
|
3719
|
-
overflow: "hidden",
|
|
3720
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Image_default, { name: sideImageName, height: "100%", src: sideImageSrc })
|
|
3721
|
-
}
|
|
3722
|
-
),
|
|
3723
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { position: "absolute", width: "100%", bottom: theme2.styles.space, children: sideImageFooter })
|
|
3724
|
-
]
|
|
3721
|
+
left: sideComponentPosition === "left" ? 0 : "auto",
|
|
3722
|
+
right: sideComponentPosition === "right" ? 0 : "auto",
|
|
3723
|
+
children: sideComponent
|
|
3725
3724
|
}
|
|
3726
3725
|
)
|
|
3727
3726
|
]
|