@react-email/button 0.0.3 → 0.0.4

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
@@ -2,6 +2,8 @@ import * as React from 'react';
2
2
 
3
3
  declare type RootProps = React.ComponentPropsWithoutRef<'a'>;
4
4
  interface ButtonProps extends RootProps {
5
+ pX?: number;
6
+ pY?: number;
5
7
  }
6
8
  declare const Button: React.ForwardRefExoticComponent<Readonly<ButtonProps> & React.RefAttributes<HTMLAnchorElement>>;
7
9
 
package/dist/index.js CHANGED
@@ -5,6 +5,9 @@ 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
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -23,6 +26,224 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
26
  ));
24
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
28
 
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/style-to-string.js
184
+ var require_style_to_string = __commonJS({
185
+ "../utils/dist/style-to-string.js"(exports) {
186
+ "use strict";
187
+ exports.__esModule = true;
188
+ exports.styleToString = void 0;
189
+ var styleToString = function(style) {
190
+ return Object.keys(style).reduce(function(acc, key) {
191
+ return acc + key.split(/(?=[A-Z])/).join("-").toLowerCase() + ":" + style[key] + ";";
192
+ }, "");
193
+ };
194
+ exports.styleToString = styleToString;
195
+ }
196
+ });
197
+
198
+ // ../utils/dist/unreachable.js
199
+ var require_unreachable = __commonJS({
200
+ "../utils/dist/unreachable.js"(exports) {
201
+ "use strict";
202
+ exports.__esModule = true;
203
+ exports.unreachable = void 0;
204
+ var unreachable = function(condition, message) {
205
+ if (message === void 0) {
206
+ message = "Entered unreachable code. Received '".concat(condition, "'.");
207
+ }
208
+ throw new TypeError(message);
209
+ };
210
+ exports.unreachable = unreachable;
211
+ }
212
+ });
213
+
214
+ // ../utils/dist/index.js
215
+ var require_dist = __commonJS({
216
+ "../utils/dist/index.js"(exports) {
217
+ "use strict";
218
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
219
+ if (k2 === void 0)
220
+ k2 = k;
221
+ var desc = Object.getOwnPropertyDescriptor(m, k);
222
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
223
+ desc = { enumerable: true, get: function() {
224
+ return m[k];
225
+ } };
226
+ }
227
+ Object.defineProperty(o, k2, desc);
228
+ } : function(o, m, k, k2) {
229
+ if (k2 === void 0)
230
+ k2 = k;
231
+ o[k2] = m[k];
232
+ });
233
+ var __exportStar = exports && exports.__exportStar || function(m, exports2) {
234
+ for (var p in m)
235
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
236
+ __createBinding(exports2, m, p);
237
+ };
238
+ exports.__esModule = true;
239
+ __exportStar(require_as(), exports);
240
+ __exportStar(require_copy_text_to_clipboard(), exports);
241
+ __exportStar(require_px_to_pt(), exports);
242
+ __exportStar(require_style_to_string(), exports);
243
+ __exportStar(require_unreachable(), exports);
244
+ }
245
+ });
246
+
26
247
  // src/index.ts
27
248
  var src_exports = {};
28
249
  __export(src_exports, {
@@ -32,19 +253,62 @@ module.exports = __toCommonJS(src_exports);
32
253
 
33
254
  // src/button.tsx
34
255
  var React = __toESM(require("react"));
256
+ var import_utils = __toESM(require_dist());
35
257
  var import_jsx_runtime = require("react/jsx-runtime");
36
258
  var Button = React.forwardRef(
37
- ({ children, style, target = "_blank", ...props }, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
38
- ref: forwardedRef,
39
- target,
40
- dangerouslySetInnerHTML: {
41
- __html: `<!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%;mso-text-raise:30pt" hidden>&nbsp;</i><![endif]--><span>${children}</span><!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`
42
- },
43
- style,
44
- ...props
45
- })
259
+ ({ children, style, pX, pY, target = "_blank", ...props }, forwardedRef) => {
260
+ const y = (pY || 0) * 2;
261
+ const textRaise = (0, import_utils.pxToPt)(y.toString());
262
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", {
263
+ ...props,
264
+ ref: forwardedRef,
265
+ target,
266
+ style: buttonStyle({ ...style, pX, pY }),
267
+ children: [
268
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
269
+ dangerouslySetInnerHTML: {
270
+ __html: `<!--[if mso]><i style="letter-spacing: ${pX}px;mso-font-width:-100%;mso-text-raise:${textRaise}" hidden>&nbsp;</i><![endif]-->`
271
+ }
272
+ }),
273
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
274
+ style: buttonTextStyle({ ...style, pX, pY }),
275
+ children
276
+ }),
277
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
278
+ dangerouslySetInnerHTML: {
279
+ __html: `<!--[if mso]><i style="letter-spacing: ${pX}px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`
280
+ }
281
+ })
282
+ ]
283
+ });
284
+ }
46
285
  );
47
286
  Button.displayName = "Button";
287
+ var buttonStyle = (style) => {
288
+ const paddingY = (style == null ? void 0 : style.pY) || 0;
289
+ const paddingX = (style == null ? void 0 : style.pX) || 0;
290
+ return {
291
+ ...style,
292
+ lineHeight: "100%",
293
+ textDecoration: "none",
294
+ display: "inline-block",
295
+ maxWidth: "100%",
296
+ padding: `${paddingY}px ${paddingX}px`
297
+ };
298
+ };
299
+ var buttonTextStyle = (style) => {
300
+ const paddingY = (style == null ? void 0 : style.pY) || 0;
301
+ return {
302
+ ...style,
303
+ maxWidth: "100%",
304
+ display: "inline-block",
305
+ lineHeight: "120%",
306
+ textDecoration: "none",
307
+ textTransform: "none",
308
+ msoPaddingAlt: "0px",
309
+ msoTextRaise: (0, import_utils.pxToPt)(paddingY.toString())
310
+ };
311
+ };
48
312
  // Annotate the CommonJS export names for ESM import in node:
49
313
  0 && (module.exports = {
50
314
  Button
package/dist/index.mjs CHANGED
@@ -1,18 +1,301 @@
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/style-to-string.js
178
+ var require_style_to_string = __commonJS({
179
+ "../utils/dist/style-to-string.js"(exports) {
180
+ "use strict";
181
+ exports.__esModule = true;
182
+ exports.styleToString = void 0;
183
+ var styleToString = function(style) {
184
+ return Object.keys(style).reduce(function(acc, key) {
185
+ return acc + key.split(/(?=[A-Z])/).join("-").toLowerCase() + ":" + style[key] + ";";
186
+ }, "");
187
+ };
188
+ exports.styleToString = styleToString;
189
+ }
190
+ });
191
+
192
+ // ../utils/dist/unreachable.js
193
+ var require_unreachable = __commonJS({
194
+ "../utils/dist/unreachable.js"(exports) {
195
+ "use strict";
196
+ exports.__esModule = true;
197
+ exports.unreachable = void 0;
198
+ var unreachable = function(condition, message) {
199
+ if (message === void 0) {
200
+ message = "Entered unreachable code. Received '".concat(condition, "'.");
201
+ }
202
+ throw new TypeError(message);
203
+ };
204
+ exports.unreachable = unreachable;
205
+ }
206
+ });
207
+
208
+ // ../utils/dist/index.js
209
+ var require_dist = __commonJS({
210
+ "../utils/dist/index.js"(exports) {
211
+ "use strict";
212
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
213
+ if (k2 === void 0)
214
+ k2 = k;
215
+ var desc = Object.getOwnPropertyDescriptor(m, k);
216
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
217
+ desc = { enumerable: true, get: function() {
218
+ return m[k];
219
+ } };
220
+ }
221
+ Object.defineProperty(o, k2, desc);
222
+ } : function(o, m, k, k2) {
223
+ if (k2 === void 0)
224
+ k2 = k;
225
+ o[k2] = m[k];
226
+ });
227
+ var __exportStar = exports && exports.__exportStar || function(m, exports2) {
228
+ for (var p in m)
229
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
230
+ __createBinding(exports2, m, p);
231
+ };
232
+ exports.__esModule = true;
233
+ __exportStar(require_as(), exports);
234
+ __exportStar(require_copy_text_to_clipboard(), exports);
235
+ __exportStar(require_px_to_pt(), exports);
236
+ __exportStar(require_style_to_string(), exports);
237
+ __exportStar(require_unreachable(), exports);
238
+ }
239
+ });
240
+
1
241
  // src/button.tsx
242
+ var import_utils = __toESM(require_dist());
2
243
  import * as React from "react";
3
- import { jsx } from "react/jsx-runtime";
244
+ import { jsx, jsxs } from "react/jsx-runtime";
4
245
  var Button = React.forwardRef(
5
- ({ children, style, target = "_blank", ...props }, forwardedRef) => /* @__PURE__ */ jsx("a", {
6
- ref: forwardedRef,
7
- target,
8
- dangerouslySetInnerHTML: {
9
- __html: `<!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%;mso-text-raise:30pt" hidden>&nbsp;</i><![endif]--><span>${children}</span><!--[if mso]><i style="letter-spacing: 25px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`
10
- },
11
- style,
12
- ...props
13
- })
246
+ ({ children, style, pX, pY, target = "_blank", ...props }, forwardedRef) => {
247
+ const y = (pY || 0) * 2;
248
+ const textRaise = (0, import_utils.pxToPt)(y.toString());
249
+ return /* @__PURE__ */ jsxs("a", {
250
+ ...props,
251
+ ref: forwardedRef,
252
+ target,
253
+ style: buttonStyle({ ...style, pX, pY }),
254
+ children: [
255
+ /* @__PURE__ */ jsx("span", {
256
+ dangerouslySetInnerHTML: {
257
+ __html: `<!--[if mso]><i style="letter-spacing: ${pX}px;mso-font-width:-100%;mso-text-raise:${textRaise}" hidden>&nbsp;</i><![endif]-->`
258
+ }
259
+ }),
260
+ /* @__PURE__ */ jsx("span", {
261
+ style: buttonTextStyle({ ...style, pX, pY }),
262
+ children
263
+ }),
264
+ /* @__PURE__ */ jsx("span", {
265
+ dangerouslySetInnerHTML: {
266
+ __html: `<!--[if mso]><i style="letter-spacing: ${pX}px;mso-font-width:-100%" hidden>&nbsp;</i><![endif]-->`
267
+ }
268
+ })
269
+ ]
270
+ });
271
+ }
14
272
  );
15
273
  Button.displayName = "Button";
274
+ var buttonStyle = (style) => {
275
+ const paddingY = (style == null ? void 0 : style.pY) || 0;
276
+ const paddingX = (style == null ? void 0 : style.pX) || 0;
277
+ return {
278
+ ...style,
279
+ lineHeight: "100%",
280
+ textDecoration: "none",
281
+ display: "inline-block",
282
+ maxWidth: "100%",
283
+ padding: `${paddingY}px ${paddingX}px`
284
+ };
285
+ };
286
+ var buttonTextStyle = (style) => {
287
+ const paddingY = (style == null ? void 0 : style.pY) || 0;
288
+ return {
289
+ ...style,
290
+ maxWidth: "100%",
291
+ display: "inline-block",
292
+ lineHeight: "120%",
293
+ textDecoration: "none",
294
+ textTransform: "none",
295
+ msoPaddingAlt: "0px",
296
+ msoTextRaise: (0, import_utils.pxToPt)(paddingY.toString())
297
+ };
298
+ };
16
299
  export {
17
300
  Button
18
301
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/button",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "A React button component to help build emails",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
package/readme.md CHANGED
@@ -55,8 +55,8 @@ const Email = () => {
55
55
  This component was tested using the most popular email clients.
56
56
 
57
57
  | <img src="https://react.email/static/images/readme/icons/gmail.svg" width="48px" height="48px" alt="Gmail logo"> | <img src="https://react.email/static/images/readme/icons/apple-mail.svg" width="48px" height="48px" alt="Apple Mail"> | <img src="https://react.email/static/images/readme/icons/outlook.svg" width="48px" height="48px" alt="Outlook logo"> | <img src="https://react.email/static/images/readme/icons/yahoo-mail.svg" width="48px" height="48px" alt="Yahoo! Mail logo"> | <img src="https://react.email/static/images/readme/icons/hey.svg" width="48px" height="48px" alt="HEY logo"> | <img src="https://react.email/static/images/readme/icons/superhuman.svg" width="48px" height="48px" alt="Superhuman logo"> |
58
- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
59
- | Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
58
+ | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
59
+ | Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
60
60
 
61
61
  ## License
62
62