react-better-html 1.1.90 → 1.1.91

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/README.md CHANGED
@@ -6,7 +6,7 @@ A component library for react that is as close to plane html as possible
6
6
  ![GitHub Repo stars](https://img.shields.io/github/stars/krissvv/react-better-html?style=flat)
7
7
  ![GitHub package.json version](https://img.shields.io/github/package-json/v/krissvv/react-better-html)
8
8
  ![NPM Type Definitions](https://img.shields.io/npm/types/react-better-html)<br/>
9
- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/krissvv/react-better-html/deploy.yml)
9
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/krissvv/react-better-html/document-deploy.yml)
10
10
  ![GitHub last commit](https://img.shields.io/github/last-commit/krissvv/react-better-html)
11
11
  ![NPM Downloads](https://img.shields.io/npm/dm/react-better-html)<br/>
12
12
  ![NPM License](https://img.shields.io/npm/l/react-better-html)<br/>
package/dist/index.d.mts CHANGED
@@ -167,6 +167,8 @@ type ImageComponent = {
167
167
  profileImage: (props: ComponentPropWithRef<HTMLImageElement, OmitProps<ImageProps, "width" | "height"> & {
168
168
  /** @default 40 */
169
169
  size?: number;
170
+ letters?: string;
171
+ backgroundColor?: string;
170
172
  }>) => React.ReactElement;
171
173
  };
172
174
  declare const Image: ImageComponent;
package/dist/index.d.ts CHANGED
@@ -167,6 +167,8 @@ type ImageComponent = {
167
167
  profileImage: (props: ComponentPropWithRef<HTMLImageElement, OmitProps<ImageProps, "width" | "height"> & {
168
168
  /** @default 40 */
169
169
  size?: number;
170
+ letters?: string;
171
+ backgroundColor?: string;
170
172
  }>) => React.ReactElement;
171
173
  };
172
174
  declare const Image: ImageComponent;
package/dist/index.js CHANGED
@@ -2543,8 +2543,22 @@ var Image = (0, import_react8.forwardRef)(function Image2({ name, src, ...props
2543
2543
  }
2544
2544
  );
2545
2545
  });
2546
- Image.profileImage = (0, import_react8.forwardRef)(function ProfileImage({ size = 40, ...props }, ref) {
2547
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image, { width: size, height: size, borderRadius: "50%", objectFit: "cover", ref, ...props });
2546
+ Image.profileImage = (0, import_react8.forwardRef)(function ProfileImage({ size = 40, letters, backgroundColor, ...props }, ref) {
2547
+ const theme2 = useTheme();
2548
+ return letters ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2549
+ Div_default.row,
2550
+ {
2551
+ width: size,
2552
+ height: size,
2553
+ backgroundColor: backgroundColor ?? theme2.colors.backgroundSecondary,
2554
+ borderRadius: 999,
2555
+ alignItems: "center",
2556
+ justifyContent: "center",
2557
+ ref,
2558
+ ...props,
2559
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, { fontWeight: 700, children: letters.toUpperCase().slice(0, 2) })
2560
+ }
2561
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image, { width: size, height: size, borderRadius: 999, objectFit: "cover", ref, ...props });
2548
2562
  });
2549
2563
  var MemoizedImage = (0, import_react8.memo)(Image);
2550
2564
  MemoizedImage.profileImage = Image.profileImage;