react-better-html 1.1.139 → 1.1.141
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 +46 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -114,7 +114,7 @@ type LoaderProps = {
|
|
|
114
114
|
width?: number;
|
|
115
115
|
/** @default false */
|
|
116
116
|
disabled?: boolean;
|
|
117
|
-
} & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName">;
|
|
117
|
+
} & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
|
|
118
118
|
type LoaderComponentType = {
|
|
119
119
|
(props: LoaderProps): React.ReactElement;
|
|
120
120
|
box: (props: OmitProps<LoaderProps, "size"> & {
|
|
@@ -614,6 +614,11 @@ type FormRowProps = {
|
|
|
614
614
|
* @default false
|
|
615
615
|
*/
|
|
616
616
|
noBreakingPoint?: boolean;
|
|
617
|
+
/**
|
|
618
|
+
* @description Weather to render the children as a column or not
|
|
619
|
+
* @default false
|
|
620
|
+
*/
|
|
621
|
+
asColumn?: boolean;
|
|
617
622
|
gap?: React.CSSProperties["gap"];
|
|
618
623
|
children?: React.ReactNode;
|
|
619
624
|
} & ComponentMarginProps;
|
|
@@ -623,6 +628,7 @@ type FormRowComponentType = {
|
|
|
623
628
|
icon?: IconName | AnyOtherString;
|
|
624
629
|
title?: string;
|
|
625
630
|
description?: string;
|
|
631
|
+
isLoading?: boolean;
|
|
626
632
|
withActions?: boolean;
|
|
627
633
|
saveButtonLoaderName?: LoaderName | AnyOtherString;
|
|
628
634
|
resetButtonLoaderName?: LoaderName | AnyOtherString;
|
package/dist/index.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ type LoaderProps = {
|
|
|
114
114
|
width?: number;
|
|
115
115
|
/** @default false */
|
|
116
116
|
disabled?: boolean;
|
|
117
|
-
} & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName">;
|
|
117
|
+
} & OmitProps<DivProps, "width" | "height" | "color" | "background" | "borderRadius" | "mask" | "WebkitMask" | "padding" | "animation" | "animationName" | "transform" | "clipPath">;
|
|
118
118
|
type LoaderComponentType = {
|
|
119
119
|
(props: LoaderProps): React.ReactElement;
|
|
120
120
|
box: (props: OmitProps<LoaderProps, "size"> & {
|
|
@@ -614,6 +614,11 @@ type FormRowProps = {
|
|
|
614
614
|
* @default false
|
|
615
615
|
*/
|
|
616
616
|
noBreakingPoint?: boolean;
|
|
617
|
+
/**
|
|
618
|
+
* @description Weather to render the children as a column or not
|
|
619
|
+
* @default false
|
|
620
|
+
*/
|
|
621
|
+
asColumn?: boolean;
|
|
617
622
|
gap?: React.CSSProperties["gap"];
|
|
618
623
|
children?: React.ReactNode;
|
|
619
624
|
} & ComponentMarginProps;
|
|
@@ -623,6 +628,7 @@ type FormRowComponentType = {
|
|
|
623
628
|
icon?: IconName | AnyOtherString;
|
|
624
629
|
title?: string;
|
|
625
630
|
description?: string;
|
|
631
|
+
isLoading?: boolean;
|
|
626
632
|
withActions?: boolean;
|
|
627
633
|
saveButtonLoaderName?: LoaderName | AnyOtherString;
|
|
628
634
|
resetButtonLoaderName?: LoaderName | AnyOtherString;
|
package/dist/index.js
CHANGED
|
@@ -2434,6 +2434,7 @@ function AlertsHolder() {
|
|
|
2434
2434
|
gap: theme2.styles.gap,
|
|
2435
2435
|
alignItems: pluginConfig.align === "center" ? "center" : pluginConfig.align === "right" ? "flex-end" : void 0,
|
|
2436
2436
|
transform: pluginConfig.align === "center" ? "translateX(-50%)" : void 0,
|
|
2437
|
+
zIndex: 1e3,
|
|
2437
2438
|
children: alerts.map((alert) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Alert_default, { alert }, alert.id))
|
|
2438
2439
|
}
|
|
2439
2440
|
);
|
|
@@ -7207,10 +7208,10 @@ var Form_default = Form2;
|
|
|
7207
7208
|
// src/components/FormRow.tsx
|
|
7208
7209
|
var import_react23 = require("react");
|
|
7209
7210
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7210
|
-
var FormRowComponent = (0, import_react23.forwardRef)(function FormRow({ oneItemOnly, noBreakingPoint, gap, children, ...props }, ref) {
|
|
7211
|
+
var FormRowComponent = (0, import_react23.forwardRef)(function FormRow({ oneItemOnly, noBreakingPoint, asColumn, gap, children, ...props }, ref) {
|
|
7211
7212
|
const theme2 = useTheme();
|
|
7212
7213
|
const mediaQuery = useMediaQuery();
|
|
7213
|
-
const breakingPoint = !noBreakingPoint ? mediaQuery.size900 : false;
|
|
7214
|
+
const breakingPoint = asColumn ?? (!noBreakingPoint ? mediaQuery.size900 : false);
|
|
7214
7215
|
const readyGap = breakingPoint || noBreakingPoint && mediaQuery.size900 ? theme2.styles.gap : theme2.styles.space * 2;
|
|
7215
7216
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
|
|
7216
7217
|
children,
|
|
@@ -7221,6 +7222,7 @@ FormRowComponent.withTitle = (0, import_react23.forwardRef)(function WithTitle({
|
|
|
7221
7222
|
icon,
|
|
7222
7223
|
title,
|
|
7223
7224
|
description,
|
|
7225
|
+
isLoading,
|
|
7224
7226
|
withActions,
|
|
7225
7227
|
saveButtonLoaderName,
|
|
7226
7228
|
resetButtonLoaderName,
|
|
@@ -7232,20 +7234,43 @@ FormRowComponent.withTitle = (0, import_react23.forwardRef)(function WithTitle({
|
|
|
7232
7234
|
const theme2 = useTheme();
|
|
7233
7235
|
const mediaQuery = useMediaQuery();
|
|
7234
7236
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FormRowComponent, { ...props, ref, children: [
|
|
7235
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: theme2.styles.space, children: [
|
|
7236
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name: icon }),
|
|
7237
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
7238
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { as: "h3", children: title }),
|
|
7239
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { color: theme2.colors.textSecondary, children: description })
|
|
7240
|
-
] })
|
|
7241
|
-
] }),
|
|
7242
7237
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7243
7238
|
Div_default.row,
|
|
7244
7239
|
{
|
|
7240
|
+
width: "100%",
|
|
7241
|
+
alignItems: "center",
|
|
7242
|
+
gap: theme2.styles.space,
|
|
7243
|
+
paddingRight: isLoading ? 26 : void 0,
|
|
7244
|
+
transition: theme2.styles.transition,
|
|
7245
|
+
children: [
|
|
7246
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name: icon }),
|
|
7247
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
7248
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { as: "h3", children: title }),
|
|
7249
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { color: theme2.colors.textSecondary, children: description })
|
|
7250
|
+
] })
|
|
7251
|
+
]
|
|
7252
|
+
}
|
|
7253
|
+
),
|
|
7254
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7255
|
+
Div_default.row,
|
|
7256
|
+
{
|
|
7257
|
+
position: "relative",
|
|
7245
7258
|
width: props.noBreakingPoint && mediaQuery.size900 ? void 0 : "100%",
|
|
7246
7259
|
alignItems: "center",
|
|
7247
7260
|
gap: theme2.styles.gap,
|
|
7248
7261
|
children: [
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7263
|
+
Div_default,
|
|
7264
|
+
{
|
|
7265
|
+
position: "absolute",
|
|
7266
|
+
top: "50%",
|
|
7267
|
+
right: `calc(100% + ${theme2.styles.space}px)`,
|
|
7268
|
+
transform: "translateY(-50%)",
|
|
7269
|
+
opacity: !isLoading ? 0 : void 0,
|
|
7270
|
+
pointerEvents: !isLoading ? "none" : void 0,
|
|
7271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader_default, {})
|
|
7272
|
+
}
|
|
7273
|
+
),
|
|
7249
7274
|
children,
|
|
7250
7275
|
withActions && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
7251
7276
|
onClickReset && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Button_default.icon, { icon: "XMark", loaderName: resetButtonLoaderName, onClick: onClickReset }),
|
|
@@ -8768,6 +8793,18 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
8768
8793
|
clearTimeout(timeout);
|
|
8769
8794
|
};
|
|
8770
8795
|
}, [isOpen]);
|
|
8796
|
+
(0, import_react28.useEffect)(() => {
|
|
8797
|
+
if (!isOpen) return;
|
|
8798
|
+
if (!bodyRef.current) return;
|
|
8799
|
+
const observer = new ResizeObserver(() => {
|
|
8800
|
+
if (!bodyRef.current) return;
|
|
8801
|
+
setBodyVirtualHeight(bodyRef.current.scrollHeight * 2);
|
|
8802
|
+
});
|
|
8803
|
+
observer.observe(bodyRef.current);
|
|
8804
|
+
return () => {
|
|
8805
|
+
observer.disconnect();
|
|
8806
|
+
};
|
|
8807
|
+
}, [isOpen]);
|
|
8771
8808
|
(0, import_react28.useImperativeHandle)(
|
|
8772
8809
|
ref,
|
|
8773
8810
|
() => {
|