New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-email/heading

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-email/heading - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

178

dist/index.d.ts
import * as React from 'react';
import { Margin } from 'utils';
interface HeadingOwnProps {
}
declare const Heading: React.ForwardRefExoticComponent<(Pick<Readonly<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
ref?: ((instance: HTMLHeadingElement | null) => void) | React.RefObject<HTMLHeadingElement> | null | undefined;
} & {
as?: "h1" | undefined;
} & HeadingOwnProps>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement> | "as"> | Pick<Readonly<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
ref?: ((instance: HTMLHeadingElement | null) => void) | React.RefObject<HTMLHeadingElement> | null | undefined;
} & {
as: "h2";
} & HeadingOwnProps>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement> | "as"> | Pick<Readonly<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
ref?: ((instance: HTMLHeadingElement | null) => void) | React.RefObject<HTMLHeadingElement> | null | undefined;
} & {
as: "h3";
} & HeadingOwnProps>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement> | "as"> | Pick<Readonly<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
ref?: ((instance: HTMLHeadingElement | null) => void) | React.RefObject<HTMLHeadingElement> | null | undefined;
} & {
as: "h4";
} & HeadingOwnProps>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement> | "as"> | Pick<Readonly<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
ref?: ((instance: HTMLHeadingElement | null) => void) | React.RefObject<HTMLHeadingElement> | null | undefined;
} & {
as: "h5";
} & HeadingOwnProps>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement> | "as"> | Pick<Readonly<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement>> & {
ref?: ((instance: HTMLHeadingElement | null) => void) | React.RefObject<HTMLHeadingElement> | null | undefined;
} & {
as: "h6";
} & HeadingOwnProps>, "key" | keyof React.HTMLAttributes<HTMLHeadingElement> | "as">) & React.RefAttributes<HTMLHeadingElement>>;
interface HeadingOwnProps {}
declare const Heading: React.ForwardRefExoticComponent<
(
| Pick<
Readonly<
Pick<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
'key' | keyof React.HTMLAttributes<HTMLHeadingElement>
> & {
ref?:
| ((instance: HTMLHeadingElement | null) => void)
| React.RefObject<HTMLHeadingElement>
| null
| undefined;
} & {
as?: 'h1' | undefined;
} & HeadingOwnProps &
Margin
>,
| 'key'
| keyof React.HTMLAttributes<HTMLHeadingElement>
| 'as'
| keyof Margin
>
| Pick<
Readonly<
Pick<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
'key' | keyof React.HTMLAttributes<HTMLHeadingElement>
> & {
ref?:
| ((instance: HTMLHeadingElement | null) => void)
| React.RefObject<HTMLHeadingElement>
| null
| undefined;
} & {
as: 'h2';
} & HeadingOwnProps &
Margin
>,
| 'key'
| keyof React.HTMLAttributes<HTMLHeadingElement>
| 'as'
| keyof Margin
>
| Pick<
Readonly<
Pick<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
'key' | keyof React.HTMLAttributes<HTMLHeadingElement>
> & {
ref?:
| ((instance: HTMLHeadingElement | null) => void)
| React.RefObject<HTMLHeadingElement>
| null
| undefined;
} & {
as: 'h3';
} & HeadingOwnProps &
Margin
>,
| 'key'
| keyof React.HTMLAttributes<HTMLHeadingElement>
| 'as'
| keyof Margin
>
| Pick<
Readonly<
Pick<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
'key' | keyof React.HTMLAttributes<HTMLHeadingElement>
> & {
ref?:
| ((instance: HTMLHeadingElement | null) => void)
| React.RefObject<HTMLHeadingElement>
| null
| undefined;
} & {
as: 'h4';
} & HeadingOwnProps &
Margin
>,
| 'key'
| keyof React.HTMLAttributes<HTMLHeadingElement>
| 'as'
| keyof Margin
>
| Pick<
Readonly<
Pick<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
'key' | keyof React.HTMLAttributes<HTMLHeadingElement>
> & {
ref?:
| ((instance: HTMLHeadingElement | null) => void)
| React.RefObject<HTMLHeadingElement>
| null
| undefined;
} & {
as: 'h5';
} & HeadingOwnProps &
Margin
>,
| 'key'
| keyof React.HTMLAttributes<HTMLHeadingElement>
| 'as'
| keyof Margin
>
| Pick<
Readonly<
Pick<
React.DetailedHTMLProps<
React.HTMLAttributes<HTMLHeadingElement>,
HTMLHeadingElement
>,
'key' | keyof React.HTMLAttributes<HTMLHeadingElement>
> & {
ref?:
| ((instance: HTMLHeadingElement | null) => void)
| React.RefObject<HTMLHeadingElement>
| null
| undefined;
} & {
as: 'h6';
} & HeadingOwnProps &
Margin
>,
| 'key'
| keyof React.HTMLAttributes<HTMLHeadingElement>
| 'as'
| keyof Margin
>
) &
React.RefAttributes<HTMLHeadingElement>
>;
export { Heading };

42

dist/index.js

@@ -36,31 +36,19 @@ "use strict";

var React = __toESM(require("react"));
var import_utils = require("utils");
var import_jsx_runtime = require("react/jsx-runtime");
var Heading = React.forwardRef(({ as: Tag = "h1", children, style, ...props }, forwardedRef) => {
const styles = { ...style, ...getDefaultStyles(Tag) };
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slot, {
ref: forwardedRef,
style: styles,
...props,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, {
children
})
});
});
var getDefaultStyles = (as) => {
switch (as) {
default:
case "h1":
return { margin: ".67em 0", fontSize: "2em" };
case "h2":
return { margin: ".83em 0", fontSize: "1.5em" };
case "h3":
return { margin: "1em 0", fontSize: "1.17em" };
case "h4":
return { margin: "1.33em 0", fontSize: "1em" };
case "h5":
return { margin: "1.67em 0", fontSize: ".83em" };
case "h6":
return { margin: "2.33em 0", fontSize: ".67em" };
var Heading = React.forwardRef(
({ as: Tag = "h1", children, style, m, mx, my, mt, mr, mb, ml, ...props }, forwardedRef) => {
const marginStyles = (0, import_utils.withMargin)({ m, mx, my, mt, mr, mb, ml });
const styles = { marginStyles, ...style };
console.log({ styles });
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slot, {
ref: forwardedRef,
style: styles,
...props,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, {
children
})
});
}
};
);
Heading.displayName = "Heading";

@@ -67,0 +55,0 @@ // Annotate the CommonJS export names for ESM import in node:

{
"name": "@react-email/heading",
"version": "0.0.4",
"version": "0.0.5",
"description": "A block of heading text",

@@ -5,0 +5,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc