@react-email/button 0.0.5 → 0.0.7

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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare type RootProps = React.ComponentPropsWithoutRef<'a'>;
3
+ declare type RootProps = React.ComponentPropsWithoutRef<"a">;
4
4
  interface ButtonProps extends RootProps {
5
5
  pX?: number;
6
6
  pY?: number;
package/dist/index.js CHANGED
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __export = (target, all) => {
12
9
  for (var name in all)
13
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,269 +23,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
23
  ));
27
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
25
 
29
- // ../utils/dist/as.js
30
- var require_as = __commonJS({
31
- "../utils/dist/as.js"(exports) {
32
- "use strict";
33
- exports.__esModule = true;
34
- }
35
- });
36
-
37
- // ../utils/dist/copy-text-to-clipboard.js
38
- var require_copy_text_to_clipboard = __commonJS({
39
- "../utils/dist/copy-text-to-clipboard.js"(exports) {
40
- "use strict";
41
- var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
42
- function adopt(value) {
43
- return value instanceof P ? value : new P(function(resolve) {
44
- resolve(value);
45
- });
46
- }
47
- return new (P || (P = Promise))(function(resolve, reject) {
48
- function fulfilled(value) {
49
- try {
50
- step(generator.next(value));
51
- } catch (e) {
52
- reject(e);
53
- }
54
- }
55
- function rejected(value) {
56
- try {
57
- step(generator["throw"](value));
58
- } catch (e) {
59
- reject(e);
60
- }
61
- }
62
- function step(result) {
63
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
64
- }
65
- step((generator = generator.apply(thisArg, _arguments || [])).next());
66
- });
67
- };
68
- var __generator = exports && exports.__generator || function(thisArg, body) {
69
- var _ = { label: 0, sent: function() {
70
- if (t[0] & 1)
71
- throw t[1];
72
- return t[1];
73
- }, trys: [], ops: [] }, f, y, t, g;
74
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
75
- return this;
76
- }), g;
77
- function verb(n) {
78
- return function(v) {
79
- return step([n, v]);
80
- };
81
- }
82
- function step(op) {
83
- if (f)
84
- throw new TypeError("Generator is already executing.");
85
- while (_)
86
- try {
87
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
88
- return t;
89
- if (y = 0, t)
90
- op = [op[0] & 2, t.value];
91
- switch (op[0]) {
92
- case 0:
93
- case 1:
94
- t = op;
95
- break;
96
- case 4:
97
- _.label++;
98
- return { value: op[1], done: false };
99
- case 5:
100
- _.label++;
101
- y = op[1];
102
- op = [0];
103
- continue;
104
- case 7:
105
- op = _.ops.pop();
106
- _.trys.pop();
107
- continue;
108
- default:
109
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
110
- _ = 0;
111
- continue;
112
- }
113
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
114
- _.label = op[1];
115
- break;
116
- }
117
- if (op[0] === 6 && _.label < t[1]) {
118
- _.label = t[1];
119
- t = op;
120
- break;
121
- }
122
- if (t && _.label < t[2]) {
123
- _.label = t[2];
124
- _.ops.push(op);
125
- break;
126
- }
127
- if (t[2])
128
- _.ops.pop();
129
- _.trys.pop();
130
- continue;
131
- }
132
- op = body.call(thisArg, _);
133
- } catch (e) {
134
- op = [6, e];
135
- y = 0;
136
- } finally {
137
- f = t = 0;
138
- }
139
- if (op[0] & 5)
140
- throw op[1];
141
- return { value: op[0] ? op[1] : void 0, done: true };
142
- }
143
- };
144
- exports.__esModule = true;
145
- exports.copyTextToClipboard = void 0;
146
- var copyTextToClipboard = function(text) {
147
- return __awaiter(void 0, void 0, void 0, function() {
148
- var _a;
149
- return __generator(this, function(_b) {
150
- switch (_b.label) {
151
- case 0:
152
- _b.trys.push([0, 2, , 3]);
153
- return [4, navigator.clipboard.writeText(text)];
154
- case 1:
155
- _b.sent();
156
- return [3, 3];
157
- case 2:
158
- _a = _b.sent();
159
- throw new Error("Not able to copy");
160
- case 3:
161
- return [2];
162
- }
163
- });
164
- });
165
- };
166
- exports.copyTextToClipboard = copyTextToClipboard;
167
- }
168
- });
169
-
170
- // ../utils/dist/px-to-pt.js
171
- var require_px_to_pt = __commonJS({
172
- "../utils/dist/px-to-pt.js"(exports) {
173
- "use strict";
174
- exports.__esModule = true;
175
- exports.pxToPt = void 0;
176
- var pxToPt2 = function(px) {
177
- return isNaN(Number(px)) ? null : parseInt(px, 10) * 3 / 4;
178
- };
179
- exports.pxToPt = pxToPt2;
180
- }
181
- });
182
-
183
- // ../utils/dist/spaces.js
184
- var require_spaces = __commonJS({
185
- "../utils/dist/spaces.js"(exports) {
186
- "use strict";
187
- var __assign = exports && exports.__assign || function() {
188
- __assign = Object.assign || function(t) {
189
- for (var s, i = 1, n = arguments.length; i < n; i++) {
190
- s = arguments[i];
191
- for (var p in s)
192
- if (Object.prototype.hasOwnProperty.call(s, p))
193
- t[p] = s[p];
194
- }
195
- return t;
196
- };
197
- return __assign.apply(this, arguments);
198
- };
199
- exports.__esModule = true;
200
- exports.withMargin = void 0;
201
- var withMargin = function(props) {
202
- return [
203
- withSpace(props.m, ["margin"]),
204
- withSpace(props.mx, ["marginLeft", "marginRight"]),
205
- withSpace(props.my, ["marginTop", "marginBottom"]),
206
- withSpace(props.mt, ["marginTop"]),
207
- withSpace(props.mr, ["marginRight"]),
208
- withSpace(props.mb, ["marginBottom"]),
209
- withSpace(props.ml, ["marginLeft"])
210
- ].filter(function(s) {
211
- return Object.keys(s).length;
212
- })[0];
213
- };
214
- exports.withMargin = withMargin;
215
- var withSpace = function(value, properties) {
216
- return properties.reduce(function(styles, property) {
217
- var _a;
218
- if (value) {
219
- return __assign(__assign({}, styles), (_a = {}, _a[property] = "".concat(value, "px"), _a));
220
- }
221
- return styles;
222
- }, {});
223
- };
224
- }
225
- });
226
-
227
- // ../utils/dist/style-to-string.js
228
- var require_style_to_string = __commonJS({
229
- "../utils/dist/style-to-string.js"(exports) {
230
- "use strict";
231
- exports.__esModule = true;
232
- exports.styleToString = void 0;
233
- var styleToString = function(style) {
234
- return Object.keys(style).reduce(function(acc, key) {
235
- return acc + key.split(/(?=[A-Z])/).join("-").toLowerCase() + ":" + style[key] + ";";
236
- }, "");
237
- };
238
- exports.styleToString = styleToString;
239
- }
240
- });
241
-
242
- // ../utils/dist/unreachable.js
243
- var require_unreachable = __commonJS({
244
- "../utils/dist/unreachable.js"(exports) {
245
- "use strict";
246
- exports.__esModule = true;
247
- exports.unreachable = void 0;
248
- var unreachable = function(condition, message) {
249
- if (message === void 0) {
250
- message = "Entered unreachable code. Received '".concat(condition, "'.");
251
- }
252
- throw new TypeError(message);
253
- };
254
- exports.unreachable = unreachable;
255
- }
256
- });
257
-
258
- // ../utils/dist/index.js
259
- var require_dist = __commonJS({
260
- "../utils/dist/index.js"(exports) {
261
- "use strict";
262
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
263
- if (k2 === void 0)
264
- k2 = k;
265
- var desc = Object.getOwnPropertyDescriptor(m, k);
266
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
267
- desc = { enumerable: true, get: function() {
268
- return m[k];
269
- } };
270
- }
271
- Object.defineProperty(o, k2, desc);
272
- } : function(o, m, k, k2) {
273
- if (k2 === void 0)
274
- k2 = k;
275
- o[k2] = m[k];
276
- });
277
- var __exportStar = exports && exports.__exportStar || function(m, exports2) {
278
- for (var p in m)
279
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
280
- __createBinding(exports2, m, p);
281
- };
282
- exports.__esModule = true;
283
- __exportStar(require_as(), exports);
284
- __exportStar(require_copy_text_to_clipboard(), exports);
285
- __exportStar(require_px_to_pt(), exports);
286
- __exportStar(require_spaces(), exports);
287
- __exportStar(require_style_to_string(), exports);
288
- __exportStar(require_unreachable(), exports);
289
- }
290
- });
291
-
292
26
  // src/index.ts
293
27
  var src_exports = {};
294
28
  __export(src_exports, {
@@ -298,17 +32,22 @@ module.exports = __toCommonJS(src_exports);
298
32
 
299
33
  // src/button.tsx
300
34
  var React = __toESM(require("react"));
301
- var import_utils = __toESM(require_dist());
35
+
36
+ // src/utils/px-to-pt.ts
37
+ var pxToPt = (px) => isNaN(Number(px)) ? null : parseInt(px, 10) * 3 / 4;
38
+
39
+ // src/button.tsx
302
40
  var import_jsx_runtime = require("react/jsx-runtime");
303
41
  var Button = React.forwardRef(
304
42
  ({ children, style, pX, pY, target = "_blank", ...props }, forwardedRef) => {
305
43
  const y = (pY || 0) * 2;
306
- const textRaise = (0, import_utils.pxToPt)(y.toString());
44
+ const textRaise = pxToPt(y.toString());
307
45
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
308
46
  "a",
309
47
  {
310
48
  ...props,
311
49
  ref: forwardedRef,
50
+ "data-id": "react-email-button",
312
51
  target,
313
52
  style: buttonStyle({ ...style, pX, pY }),
314
53
  children: [
@@ -320,7 +59,7 @@ var Button = React.forwardRef(
320
59
  }
321
60
  }
322
61
  ),
323
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: buttonTextStyle({ ...style, pX, pY }), children }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: buttonTextStyle(pY), children }),
324
63
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
325
64
  "span",
326
65
  {
@@ -347,17 +86,14 @@ var buttonStyle = (style) => {
347
86
  padding: `${paddingY}px ${paddingX}px`
348
87
  };
349
88
  };
350
- var buttonTextStyle = (style) => {
351
- const paddingY = (style == null ? void 0 : style.pY) || 0;
89
+ var buttonTextStyle = (pY) => {
90
+ const paddingY = pY || 0;
352
91
  return {
353
- ...style,
354
92
  maxWidth: "100%",
355
93
  display: "inline-block",
356
94
  lineHeight: "120%",
357
- textDecoration: "none",
358
- textTransform: "none",
359
95
  msoPaddingAlt: "0px",
360
- msoTextRaise: (0, import_utils.pxToPt)(paddingY.toString())
96
+ msoTextRaise: pxToPt(paddingY.toString())
361
97
  };
362
98
  };
363
99
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -1,301 +1,21 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
20
- mod
21
- ));
22
-
23
- // ../utils/dist/as.js
24
- var require_as = __commonJS({
25
- "../utils/dist/as.js"(exports) {
26
- "use strict";
27
- exports.__esModule = true;
28
- }
29
- });
30
-
31
- // ../utils/dist/copy-text-to-clipboard.js
32
- var require_copy_text_to_clipboard = __commonJS({
33
- "../utils/dist/copy-text-to-clipboard.js"(exports) {
34
- "use strict";
35
- var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
36
- function adopt(value) {
37
- return value instanceof P ? value : new P(function(resolve) {
38
- resolve(value);
39
- });
40
- }
41
- return new (P || (P = Promise))(function(resolve, reject) {
42
- function fulfilled(value) {
43
- try {
44
- step(generator.next(value));
45
- } catch (e) {
46
- reject(e);
47
- }
48
- }
49
- function rejected(value) {
50
- try {
51
- step(generator["throw"](value));
52
- } catch (e) {
53
- reject(e);
54
- }
55
- }
56
- function step(result) {
57
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
58
- }
59
- step((generator = generator.apply(thisArg, _arguments || [])).next());
60
- });
61
- };
62
- var __generator = exports && exports.__generator || function(thisArg, body) {
63
- var _ = { label: 0, sent: function() {
64
- if (t[0] & 1)
65
- throw t[1];
66
- return t[1];
67
- }, trys: [], ops: [] }, f, y, t, g;
68
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
69
- return this;
70
- }), g;
71
- function verb(n) {
72
- return function(v) {
73
- return step([n, v]);
74
- };
75
- }
76
- function step(op) {
77
- if (f)
78
- throw new TypeError("Generator is already executing.");
79
- while (_)
80
- try {
81
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
82
- return t;
83
- if (y = 0, t)
84
- op = [op[0] & 2, t.value];
85
- switch (op[0]) {
86
- case 0:
87
- case 1:
88
- t = op;
89
- break;
90
- case 4:
91
- _.label++;
92
- return { value: op[1], done: false };
93
- case 5:
94
- _.label++;
95
- y = op[1];
96
- op = [0];
97
- continue;
98
- case 7:
99
- op = _.ops.pop();
100
- _.trys.pop();
101
- continue;
102
- default:
103
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
104
- _ = 0;
105
- continue;
106
- }
107
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
108
- _.label = op[1];
109
- break;
110
- }
111
- if (op[0] === 6 && _.label < t[1]) {
112
- _.label = t[1];
113
- t = op;
114
- break;
115
- }
116
- if (t && _.label < t[2]) {
117
- _.label = t[2];
118
- _.ops.push(op);
119
- break;
120
- }
121
- if (t[2])
122
- _.ops.pop();
123
- _.trys.pop();
124
- continue;
125
- }
126
- op = body.call(thisArg, _);
127
- } catch (e) {
128
- op = [6, e];
129
- y = 0;
130
- } finally {
131
- f = t = 0;
132
- }
133
- if (op[0] & 5)
134
- throw op[1];
135
- return { value: op[0] ? op[1] : void 0, done: true };
136
- }
137
- };
138
- exports.__esModule = true;
139
- exports.copyTextToClipboard = void 0;
140
- var copyTextToClipboard = function(text) {
141
- return __awaiter(void 0, void 0, void 0, function() {
142
- var _a;
143
- return __generator(this, function(_b) {
144
- switch (_b.label) {
145
- case 0:
146
- _b.trys.push([0, 2, , 3]);
147
- return [4, navigator.clipboard.writeText(text)];
148
- case 1:
149
- _b.sent();
150
- return [3, 3];
151
- case 2:
152
- _a = _b.sent();
153
- throw new Error("Not able to copy");
154
- case 3:
155
- return [2];
156
- }
157
- });
158
- });
159
- };
160
- exports.copyTextToClipboard = copyTextToClipboard;
161
- }
162
- });
163
-
164
- // ../utils/dist/px-to-pt.js
165
- var require_px_to_pt = __commonJS({
166
- "../utils/dist/px-to-pt.js"(exports) {
167
- "use strict";
168
- exports.__esModule = true;
169
- exports.pxToPt = void 0;
170
- var pxToPt2 = function(px) {
171
- return isNaN(Number(px)) ? null : parseInt(px, 10) * 3 / 4;
172
- };
173
- exports.pxToPt = pxToPt2;
174
- }
175
- });
176
-
177
- // ../utils/dist/spaces.js
178
- var require_spaces = __commonJS({
179
- "../utils/dist/spaces.js"(exports) {
180
- "use strict";
181
- var __assign = exports && exports.__assign || function() {
182
- __assign = Object.assign || function(t) {
183
- for (var s, i = 1, n = arguments.length; i < n; i++) {
184
- s = arguments[i];
185
- for (var p in s)
186
- if (Object.prototype.hasOwnProperty.call(s, p))
187
- t[p] = s[p];
188
- }
189
- return t;
190
- };
191
- return __assign.apply(this, arguments);
192
- };
193
- exports.__esModule = true;
194
- exports.withMargin = void 0;
195
- var withMargin = function(props) {
196
- return [
197
- withSpace(props.m, ["margin"]),
198
- withSpace(props.mx, ["marginLeft", "marginRight"]),
199
- withSpace(props.my, ["marginTop", "marginBottom"]),
200
- withSpace(props.mt, ["marginTop"]),
201
- withSpace(props.mr, ["marginRight"]),
202
- withSpace(props.mb, ["marginBottom"]),
203
- withSpace(props.ml, ["marginLeft"])
204
- ].filter(function(s) {
205
- return Object.keys(s).length;
206
- })[0];
207
- };
208
- exports.withMargin = withMargin;
209
- var withSpace = function(value, properties) {
210
- return properties.reduce(function(styles, property) {
211
- var _a;
212
- if (value) {
213
- return __assign(__assign({}, styles), (_a = {}, _a[property] = "".concat(value, "px"), _a));
214
- }
215
- return styles;
216
- }, {});
217
- };
218
- }
219
- });
220
-
221
- // ../utils/dist/style-to-string.js
222
- var require_style_to_string = __commonJS({
223
- "../utils/dist/style-to-string.js"(exports) {
224
- "use strict";
225
- exports.__esModule = true;
226
- exports.styleToString = void 0;
227
- var styleToString = function(style) {
228
- return Object.keys(style).reduce(function(acc, key) {
229
- return acc + key.split(/(?=[A-Z])/).join("-").toLowerCase() + ":" + style[key] + ";";
230
- }, "");
231
- };
232
- exports.styleToString = styleToString;
233
- }
234
- });
235
-
236
- // ../utils/dist/unreachable.js
237
- var require_unreachable = __commonJS({
238
- "../utils/dist/unreachable.js"(exports) {
239
- "use strict";
240
- exports.__esModule = true;
241
- exports.unreachable = void 0;
242
- var unreachable = function(condition, message) {
243
- if (message === void 0) {
244
- message = "Entered unreachable code. Received '".concat(condition, "'.");
245
- }
246
- throw new TypeError(message);
247
- };
248
- exports.unreachable = unreachable;
249
- }
250
- });
1
+ // src/button.tsx
2
+ import * as React from "react";
251
3
 
252
- // ../utils/dist/index.js
253
- var require_dist = __commonJS({
254
- "../utils/dist/index.js"(exports) {
255
- "use strict";
256
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
257
- if (k2 === void 0)
258
- k2 = k;
259
- var desc = Object.getOwnPropertyDescriptor(m, k);
260
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
261
- desc = { enumerable: true, get: function() {
262
- return m[k];
263
- } };
264
- }
265
- Object.defineProperty(o, k2, desc);
266
- } : function(o, m, k, k2) {
267
- if (k2 === void 0)
268
- k2 = k;
269
- o[k2] = m[k];
270
- });
271
- var __exportStar = exports && exports.__exportStar || function(m, exports2) {
272
- for (var p in m)
273
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
274
- __createBinding(exports2, m, p);
275
- };
276
- exports.__esModule = true;
277
- __exportStar(require_as(), exports);
278
- __exportStar(require_copy_text_to_clipboard(), exports);
279
- __exportStar(require_px_to_pt(), exports);
280
- __exportStar(require_spaces(), exports);
281
- __exportStar(require_style_to_string(), exports);
282
- __exportStar(require_unreachable(), exports);
283
- }
284
- });
4
+ // src/utils/px-to-pt.ts
5
+ var pxToPt = (px) => isNaN(Number(px)) ? null : parseInt(px, 10) * 3 / 4;
285
6
 
286
7
  // src/button.tsx
287
- var import_utils = __toESM(require_dist());
288
- import * as React from "react";
289
8
  import { jsx, jsxs } from "react/jsx-runtime";
290
9
  var Button = React.forwardRef(
291
10
  ({ children, style, pX, pY, target = "_blank", ...props }, forwardedRef) => {
292
11
  const y = (pY || 0) * 2;
293
- const textRaise = (0, import_utils.pxToPt)(y.toString());
12
+ const textRaise = pxToPt(y.toString());
294
13
  return /* @__PURE__ */ jsxs(
295
14
  "a",
296
15
  {
297
16
  ...props,
298
17
  ref: forwardedRef,
18
+ "data-id": "react-email-button",
299
19
  target,
300
20
  style: buttonStyle({ ...style, pX, pY }),
301
21
  children: [
@@ -307,7 +27,7 @@ var Button = React.forwardRef(
307
27
  }
308
28
  }
309
29
  ),
310
- /* @__PURE__ */ jsx("span", { style: buttonTextStyle({ ...style, pX, pY }), children }),
30
+ /* @__PURE__ */ jsx("span", { style: buttonTextStyle(pY), children }),
311
31
  /* @__PURE__ */ jsx(
312
32
  "span",
313
33
  {
@@ -334,17 +54,14 @@ var buttonStyle = (style) => {
334
54
  padding: `${paddingY}px ${paddingX}px`
335
55
  };
336
56
  };
337
- var buttonTextStyle = (style) => {
338
- const paddingY = (style == null ? void 0 : style.pY) || 0;
57
+ var buttonTextStyle = (pY) => {
58
+ const paddingY = pY || 0;
339
59
  return {
340
- ...style,
341
60
  maxWidth: "100%",
342
61
  display: "inline-block",
343
62
  lineHeight: "120%",
344
- textDecoration: "none",
345
- textTransform: "none",
346
63
  msoPaddingAlt: "0px",
347
- msoTextRaise: (0, import_utils.pxToPt)(paddingY.toString())
64
+ msoTextRaise: pxToPt(paddingY.toString())
348
65
  };
349
66
  };
350
67
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/button",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "A link that is styled to look like a button",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -17,12 +17,12 @@
17
17
  "clean": "rm -rf dist",
18
18
  "test": "jest",
19
19
  "test:watch": "jest --watch",
20
- "format:check": "prettier --ignore-path ./../../.prettierignore --check \"**/*.{ts,tsx,md}\"",
21
- "format": "prettier --ignore-path ./../../.prettierignore --write \"**/*.{ts,tsx,md}\""
20
+ "format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
21
+ "format": "prettier --write \"**/*.{ts,tsx,md}\""
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/zenorocha/react-email.git",
25
+ "url": "https://github.com/resendlabs/react-email.git",
26
26
  "directory": "packages/button"
27
27
  },
28
28
  "keywords": [
@@ -30,26 +30,24 @@
30
30
  "email"
31
31
  ],
32
32
  "engines": {
33
- "node": ">=18.0.0"
33
+ "node": ">=16.0.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "react": "18.2.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@babel/preset-react": "7.18.6",
40
- "@react-email/render": "*",
41
40
  "@types/react": "18.0.20",
42
41
  "@types/react-dom": "18.0.6",
43
42
  "babel-jest": "28.1.3",
44
43
  "eslint": "8.23.1",
45
- "eslint-config-custom": "*",
46
44
  "jest": "28.1.3",
45
+ "prettier": "2.8.4",
47
46
  "ts-jest": "28.0.8",
48
- "tsconfig": "*",
49
47
  "tsup": "6.2.3",
50
48
  "typescript": "4.8.3"
51
49
  },
52
50
  "publishConfig": {
53
51
  "access": "public"
54
52
  }
55
- }
53
+ }
package/readme.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <div align="center">
7
7
  <a href="https://react.email">Website</a>
8
8
  <span> · </span>
9
- <a href="https://github.com/zenorocha/react-email">GitHub</a>
9
+ <a href="https://github.com/resendlabs/react-email">GitHub</a>
10
10
  <span> · </span>
11
11
  <a href="https://react.email/discord">Discord</a>
12
12
  </div>
@@ -32,11 +32,11 @@ npm install @react-email/button -E
32
32
  Add the component to your email template. Include styles where needed.
33
33
 
34
34
  ```jsx
35
- import { Button } from '@react-email/button';
35
+ import { Button } from "@react-email/button";
36
36
 
37
37
  const Email = () => {
38
38
  return (
39
- <Button href="https://example.com" style={{ color: '#61dafb' }}>
39
+ <Button href="https://example.com" style={{ color: "#61dafb" }}>
40
40
  Click me
41
41
  </Button>
42
42
  );