@react-email/heading
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -37,9 +37,30 @@ "use strict"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Heading = React.forwardRef(({ as: Tag = "h1", children, style, ...props }, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slot, { | ||
ref: forwardedRef, | ||
...props, | ||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { | ||
children | ||
}) | ||
})); | ||
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" }; | ||
} | ||
}; | ||
Heading.displayName = "Heading"; | ||
@@ -46,0 +67,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "@react-email/heading", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A block of heading text", | ||
@@ -25,3 +25,4 @@ "sideEffects": false, | ||
"@radix-ui/react-slot": "1.0.0", | ||
"react": "18.2.0" | ||
"react": "18.2.0", | ||
"utils": "*" | ||
}, | ||
@@ -28,0 +29,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
11086
132
3
1
+ Addedutils@*
+ Addedalign-text@0.1.4(transitive)
+ Addedany@1.0.0(transitive)
+ Addedarr-diff@1.1.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-map@2.0.2(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-each@0.1.1(transitive)
+ Addedarray-slice@0.2.3(transitive)
+ Addedarray-unique@0.2.1(transitive)
+ Addedcenter-align@0.1.3(transitive)
+ Addedexport-dirs@0.2.4(transitive)
+ Addedexport-files@2.1.1(transitive)
+ Addedfor-in@0.1.81.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedhas-values@0.1.4(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedis-number@2.1.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedisobject@1.0.23.0.1(transitive)
+ Addedkind-of@2.0.13.2.26.0.3(transitive)
+ Addedlazy-cache@1.0.4(transitive)
+ Addedlongest@1.0.1(transitive)
+ Addedmake-iterator@0.1.10.2.11.0.1(transitive)
+ Addedobject.defaults@0.3.0(transitive)
+ Addedobject.filter@0.3.0(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedobject.reduce@0.1.7(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedright-align@0.1.3(transitive)
+ Addedstriptags@2.2.1(transitive)
+ Addedutils@0.3.1(transitive)
+ Addedword-wrap@1.2.5(transitive)