@react-email/button 0.0.7 → 0.0.9

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/dist/index.js CHANGED
@@ -39,7 +39,7 @@ var pxToPt = (px) => isNaN(Number(px)) ? null : parseInt(px, 10) * 3 / 4;
39
39
  // src/button.tsx
40
40
  var import_jsx_runtime = require("react/jsx-runtime");
41
41
  var Button = React.forwardRef(
42
- ({ children, style, pX, pY, target = "_blank", ...props }, forwardedRef) => {
42
+ ({ children, style, pX = 0, pY = 0, target = "_blank", ...props }, forwardedRef) => {
43
43
  const y = (pY || 0) * 2;
44
44
  const textRaise = pxToPt(y.toString());
45
45
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -75,15 +75,14 @@ var Button = React.forwardRef(
75
75
  );
76
76
  Button.displayName = "Button";
77
77
  var buttonStyle = (style) => {
78
- const paddingY = (style == null ? void 0 : style.pY) || 0;
79
- const paddingX = (style == null ? void 0 : style.pX) || 0;
78
+ const { pY, pX, ...rest } = style || {};
80
79
  return {
81
- ...style,
80
+ ...rest,
82
81
  lineHeight: "100%",
83
82
  textDecoration: "none",
84
83
  display: "inline-block",
85
84
  maxWidth: "100%",
86
- padding: `${paddingY}px ${paddingX}px`
85
+ padding: `${pY}px ${pX}px`
87
86
  };
88
87
  };
89
88
  var buttonTextStyle = (pY) => {
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ var pxToPt = (px) => isNaN(Number(px)) ? null : parseInt(px, 10) * 3 / 4;
7
7
  // src/button.tsx
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  var Button = React.forwardRef(
10
- ({ children, style, pX, pY, target = "_blank", ...props }, forwardedRef) => {
10
+ ({ children, style, pX = 0, pY = 0, target = "_blank", ...props }, forwardedRef) => {
11
11
  const y = (pY || 0) * 2;
12
12
  const textRaise = pxToPt(y.toString());
13
13
  return /* @__PURE__ */ jsxs(
@@ -43,15 +43,14 @@ var Button = React.forwardRef(
43
43
  );
44
44
  Button.displayName = "Button";
45
45
  var buttonStyle = (style) => {
46
- const paddingY = (style == null ? void 0 : style.pY) || 0;
47
- const paddingX = (style == null ? void 0 : style.pX) || 0;
46
+ const { pY, pX, ...rest } = style || {};
48
47
  return {
49
- ...style,
48
+ ...rest,
50
49
  lineHeight: "100%",
51
50
  textDecoration: "none",
52
51
  display: "inline-block",
53
52
  maxWidth: "100%",
54
- padding: `${paddingY}px ${paddingX}px`
53
+ padding: `${pY}px ${pX}px`
55
54
  };
56
55
  };
57
56
  var buttonTextStyle = (pY) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/button",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "A link that is styled to look like a button",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -37,6 +37,8 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@babel/preset-react": "7.18.6",
40
+ "@react-email/render": "0.0.6",
41
+ "@types/jest": "29.5.0",
40
42
  "@types/react": "18.0.20",
41
43
  "@types/react-dom": "18.0.6",
42
44
  "babel-jest": "28.1.3",