react-better-html 1.1.39 → 1.1.41

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.jsx)(Div_1.default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref: ref, children: children }));
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)();
@@ -6,11 +6,12 @@ type PageHeaderProps = {
6
6
  imageSize?: number;
7
7
  title?: string;
8
8
  titleAs?: TextAs;
9
+ titleRightElement?: React.ReactNode;
9
10
  description?: string;
10
11
  textAlign?: React.CSSProperties["textAlign"];
11
12
  rightElement?: React.ReactNode;
12
13
  lightMode?: boolean;
13
14
  } & Pick<ComponentMarginProps, "marginBottom">;
14
- declare function PageHeader({ imageUrl, imageSize, title, titleAs, description, textAlign, rightElement, lightMode, marginBottom, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function PageHeader({ imageUrl, imageSize, title, titleAs, titleRightElement, description, textAlign, rightElement, lightMode, marginBottom, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
15
16
  declare const _default: React.MemoExoticComponent<typeof PageHeader>;
16
17
  export default _default;
@@ -10,9 +10,9 @@ const Div_1 = __importDefault(require("./Div"));
10
10
  const Text_1 = __importDefault(require("./Text"));
11
11
  const Image_1 = __importDefault(require("./Image"));
12
12
  const BetterHtmlProvider_1 = require("./BetterHtmlProvider");
13
- function PageHeader({ imageUrl, imageSize = 60, title, titleAs, description, textAlign, rightElement, lightMode, marginBottom, }) {
13
+ function PageHeader({ imageUrl, imageSize = 60, title, titleAs, titleRightElement, description, textAlign, rightElement, lightMode, marginBottom, }) {
14
14
  const theme = (0, BetterHtmlProvider_1.useTheme)();
15
15
  const mediaQuery = (0, hooks_1.useMediaQuery)();
16
- return ((0, jsx_runtime_1.jsxs)(Div_1.default.row, { alignItems: "center", gap: theme.styles.space, marginBottom: marginBottom ?? theme.styles.space * 2, children: [imageUrl && (0, jsx_runtime_1.jsx)(Image_1.default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }), (0, jsx_runtime_1.jsxs)(Div_1.default.column, { flex: 1, gap: theme.styles.gap / 2, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { as: titleAs ?? "h1", textAlign: textAlign, color: lightMode ? theme.colors.base : theme.colors.textPrimary, children: title }), (0, jsx_runtime_1.jsx)(Text_1.default, { textAlign: textAlign, color: lightMode ? theme.colors.base : theme.colors.textSecondary, opacity: lightMode ? 0.7 : undefined, children: description })] }), rightElement] }));
16
+ return ((0, jsx_runtime_1.jsxs)(Div_1.default.row, { alignItems: "center", gap: theme.styles.space, marginBottom: marginBottom ?? theme.styles.space * 2, children: [imageUrl && (0, jsx_runtime_1.jsx)(Image_1.default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }), (0, jsx_runtime_1.jsxs)(Div_1.default.column, { flex: 1, gap: theme.styles.gap / 2, children: [(0, jsx_runtime_1.jsxs)(Div_1.default.row, { alignItems: "center", gap: theme.styles.space, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { as: titleAs ?? "h1", textAlign: textAlign, color: lightMode ? theme.colors.base : theme.colors.textPrimary, children: title }), titleRightElement] }), (0, jsx_runtime_1.jsx)(Text_1.default, { textAlign: textAlign, color: lightMode ? theme.colors.base : theme.colors.textSecondary, opacity: lightMode ? 0.7 : undefined, children: description })] }), rightElement] }));
17
17
  }
18
18
  exports.default = (0, react_1.memo)(PageHeader);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-better-html",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "description": "A component library for react that is as close to plane html as possible",
5
5
  "main": "dist/index.js",
6
6
  "files": [