react-better-html 1.1.39 → 1.1.40
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.
|
@@ -2,6 +2,7 @@ import { IconName } from "../types/icon";
|
|
|
2
2
|
import { AnyOtherString } from "../types/app";
|
|
3
3
|
import { ComponentMarginProps, ComponentPropWithRef } from "../types/components";
|
|
4
4
|
type FormRowProps = {
|
|
5
|
+
oneItemOnly?: boolean;
|
|
5
6
|
gap?: React.CSSProperties["gap"];
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
} & ComponentMarginProps;
|
|
@@ -10,12 +10,12 @@ const Div_1 = __importDefault(require("./Div"));
|
|
|
10
10
|
const Icon_1 = __importDefault(require("./Icon"));
|
|
11
11
|
const Text_1 = __importDefault(require("./Text"));
|
|
12
12
|
const BetterHtmlProvider_1 = require("./BetterHtmlProvider");
|
|
13
|
-
const FormRowComponent = (0, react_1.forwardRef)(function FormRow({ gap, children, ...props }, ref) {
|
|
13
|
+
const FormRowComponent = (0, react_1.forwardRef)(function FormRow({ oneItemOnly, gap, children, ...props }, ref) {
|
|
14
14
|
const theme = (0, BetterHtmlProvider_1.useTheme)();
|
|
15
15
|
const mediaQuery = (0, hooks_1.useMediaQuery)();
|
|
16
16
|
const breakingPoint = mediaQuery.size900;
|
|
17
17
|
const readyGap = breakingPoint ? theme.styles.gap : theme.styles.space * 2;
|
|
18
|
-
return ((0, jsx_runtime_1.
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(Div_1.default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref: ref, children: [children, oneItemOnly && (0, jsx_runtime_1.jsx)(Div_1.default, { width: "100%" })] }));
|
|
19
19
|
});
|
|
20
20
|
FormRowComponent.withTitle = (0, react_1.forwardRef)(function WithTitle({ icon, title, description, children, ...props }, ref) {
|
|
21
21
|
const theme = (0, BetterHtmlProvider_1.useTheme)();
|