@duro-app/ui-email 4.5.0 → 5.0.0
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/components.d.ts.map +1 -1
- package/dist/index.js +95 -95
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +6 -6
- package/dist/theme.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAmB9B;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAC,EAAE;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,2CAkC5F;AAED,wBAAgB,OAAO,CAAC,EAAC,EAAS,EAAE,QAAQ,EAAC,EAAE;IAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,2CAgB3F;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAErD,wBAAgB,IAAI,CAAC,EACnB,OAAgB,EAChB,QAAQ,EACR,KAAK,GACN,EAAE;IACD,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,2CAgBA;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,KAAgB,GACjB,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;CACpC,2CAqBA;AAED,wBAAgB,EAAE,4CAEjB;AAED,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IAGZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,2CAUA;AAED,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,2CAEA"}
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { Section as
|
|
3
|
-
import { Img as
|
|
4
|
-
import { darkColors as
|
|
5
|
-
const
|
|
6
|
-
xs:
|
|
7
|
-
sm:
|
|
8
|
-
ms:
|
|
9
|
-
md:
|
|
10
|
-
lg:
|
|
11
|
-
xl:
|
|
12
|
-
xxl:
|
|
13
|
-
xxxl:
|
|
14
|
-
},
|
|
15
|
-
sm:
|
|
16
|
-
md:
|
|
17
|
-
lg:
|
|
18
|
-
},
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { Section as b, Button as k, Html as S, Head as y, Preview as z, Body as M, Container as H, Heading as C, Hr as B, Link as L, Text as N } from "@react-email/components";
|
|
3
|
+
import { Img as v, Preview as J, Link as K } from "@react-email/components";
|
|
4
|
+
import { SPACING_PX as s, RADII_PX as g, FONT_SIZE_REM as c, darkColors as X, lightColors as w, EMAIL_PX as P, BORDERS_PX as R } from "@duro-app/tokens/raw";
|
|
5
|
+
const i = (t) => `${t}px`, _ = 16, m = (t) => i(t * _), d = {
|
|
6
|
+
xs: i(s.xs),
|
|
7
|
+
sm: i(s.sm),
|
|
8
|
+
ms: i(s.ms),
|
|
9
|
+
md: i(s.md),
|
|
10
|
+
lg: i(s.lg),
|
|
11
|
+
xl: i(s.xl),
|
|
12
|
+
xxl: i(s.xxl),
|
|
13
|
+
xxxl: i(s.xxxl)
|
|
14
|
+
}, p = {
|
|
15
|
+
sm: i(g.sm),
|
|
16
|
+
md: i(g.md),
|
|
17
|
+
lg: i(g.lg)
|
|
18
|
+
}, a = {
|
|
19
19
|
family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',
|
|
20
|
-
//
|
|
21
|
-
sizeXs:
|
|
22
|
-
sizeSm:
|
|
23
|
-
sizeMd:
|
|
24
|
-
sizeLg:
|
|
25
|
-
sizeXl:
|
|
26
|
-
sizeHeading:
|
|
20
|
+
// FONT_SIZE_REM resolved against the fixed REM_PX root.
|
|
21
|
+
sizeXs: m(c.fontSizeXs),
|
|
22
|
+
sizeSm: m(c.fontSizeSm),
|
|
23
|
+
sizeMd: m(c.fontSizeMd),
|
|
24
|
+
sizeLg: m(c.fontSizeLg),
|
|
25
|
+
sizeXl: m(c.fontSizeXl),
|
|
26
|
+
sizeHeading: m(c.fontSizeHeading),
|
|
27
27
|
weightNormal: 400,
|
|
28
28
|
weightMedium: 500,
|
|
29
29
|
weightSemibold: 600,
|
|
30
30
|
weightBold: 700,
|
|
31
31
|
lineHeight: 1.5
|
|
32
|
-
},
|
|
32
|
+
}, $ = (t) => ({
|
|
33
33
|
bg: t.bg,
|
|
34
34
|
card: t.bgCard,
|
|
35
35
|
cardBorder: t.border,
|
|
@@ -39,9 +39,9 @@ const a = {
|
|
|
39
39
|
accent: t.accent,
|
|
40
40
|
accentText: t.accentContrast,
|
|
41
41
|
border: t.border
|
|
42
|
-
}),
|
|
43
|
-
light:
|
|
44
|
-
dark:
|
|
42
|
+
}), f = {
|
|
43
|
+
light: $(w),
|
|
44
|
+
dark: $(X)
|
|
45
45
|
}, n = {
|
|
46
46
|
body: "d-body",
|
|
47
47
|
card: "d-card",
|
|
@@ -51,8 +51,8 @@ const a = {
|
|
|
51
51
|
button: "d-btn",
|
|
52
52
|
hr: "d-hr",
|
|
53
53
|
link: "d-link"
|
|
54
|
-
},
|
|
55
|
-
const e =
|
|
54
|
+
}, h = (t) => {
|
|
55
|
+
const e = f.dark, o = t ? `${t} ` : "";
|
|
56
56
|
return [
|
|
57
57
|
`${o}.${n.body} { background-color: ${e.bg} !important; }`,
|
|
58
58
|
`${o}.${n.card} { background-color: ${e.card} !important; border-color: ${e.cardBorder} !important; }`,
|
|
@@ -63,43 +63,43 @@ const a = {
|
|
|
63
63
|
`${o}.${n.hr} { border-color: ${e.border} !important; }`,
|
|
64
64
|
`${o}.${n.link} { color: ${e.accent} !important; }`
|
|
65
65
|
];
|
|
66
|
-
},
|
|
66
|
+
}, I = [
|
|
67
67
|
"@media (prefers-color-scheme: dark) {",
|
|
68
|
-
...
|
|
68
|
+
...h("").map((t) => " " + t),
|
|
69
69
|
"}",
|
|
70
70
|
"/* Outlook.com / Outlook mobile dark mode */",
|
|
71
|
-
...
|
|
71
|
+
...h("[data-ogsc]")
|
|
72
72
|
].join(`
|
|
73
|
-
`),
|
|
74
|
-
function
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
73
|
+
`), l = f.light;
|
|
74
|
+
function A({ preview: t, children: e }) {
|
|
75
|
+
return /* @__PURE__ */ u(S, { lang: "en", children: [
|
|
76
|
+
/* @__PURE__ */ u(y, { children: [
|
|
77
77
|
/* @__PURE__ */ r("meta", { name: "color-scheme", content: "light dark" }),
|
|
78
78
|
/* @__PURE__ */ r("meta", { name: "supported-color-schemes", content: "light dark" }),
|
|
79
|
-
/* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html:
|
|
79
|
+
/* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html: I } })
|
|
80
80
|
] }),
|
|
81
|
-
t ? /* @__PURE__ */ r(
|
|
81
|
+
t ? /* @__PURE__ */ r(z, { children: t }) : null,
|
|
82
82
|
/* @__PURE__ */ r(
|
|
83
|
-
|
|
83
|
+
M,
|
|
84
84
|
{
|
|
85
85
|
className: n.body,
|
|
86
86
|
style: {
|
|
87
|
-
backgroundColor:
|
|
88
|
-
fontFamily:
|
|
87
|
+
backgroundColor: l.bg,
|
|
88
|
+
fontFamily: a.family,
|
|
89
89
|
margin: 0,
|
|
90
|
-
padding: `${
|
|
90
|
+
padding: `${d.xl} 0`
|
|
91
91
|
},
|
|
92
92
|
children: /* @__PURE__ */ r(
|
|
93
|
-
|
|
93
|
+
H,
|
|
94
94
|
{
|
|
95
95
|
className: n.card,
|
|
96
96
|
style: {
|
|
97
|
-
backgroundColor:
|
|
98
|
-
border:
|
|
99
|
-
borderRadius:
|
|
97
|
+
backgroundColor: l.card,
|
|
98
|
+
border: `${R.hairline}px solid ${l.cardBorder}`,
|
|
99
|
+
borderRadius: p.md,
|
|
100
100
|
margin: "0 auto",
|
|
101
|
-
maxWidth:
|
|
102
|
-
padding:
|
|
101
|
+
maxWidth: `${P.emailCardW}px`,
|
|
102
|
+
padding: d.xl
|
|
103
103
|
},
|
|
104
104
|
children: e
|
|
105
105
|
}
|
|
@@ -108,108 +108,108 @@ function T({ preview: t, children: e }) {
|
|
|
108
108
|
)
|
|
109
109
|
] });
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function D({ as: t = "h1", children: e }) {
|
|
112
112
|
const o = t === "h1";
|
|
113
113
|
return /* @__PURE__ */ r(
|
|
114
|
-
|
|
114
|
+
C,
|
|
115
115
|
{
|
|
116
116
|
as: t,
|
|
117
117
|
className: n.heading,
|
|
118
118
|
style: {
|
|
119
|
-
color:
|
|
120
|
-
fontSize: o ?
|
|
121
|
-
fontWeight: o ?
|
|
122
|
-
margin: o ? `0 0 ${
|
|
119
|
+
color: l.heading,
|
|
120
|
+
fontSize: o ? a.sizeHeading : a.sizeMd,
|
|
121
|
+
fontWeight: o ? a.weightBold : a.weightSemibold,
|
|
122
|
+
margin: o ? `0 0 ${d.md}` : `0 0 ${d.sm}`
|
|
123
123
|
},
|
|
124
124
|
children: e
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function W({
|
|
129
129
|
variant: t = "body",
|
|
130
130
|
children: e,
|
|
131
131
|
style: o
|
|
132
132
|
}) {
|
|
133
|
-
const
|
|
133
|
+
const x = t !== "body";
|
|
134
134
|
return /* @__PURE__ */ r(
|
|
135
|
-
|
|
135
|
+
N,
|
|
136
136
|
{
|
|
137
|
-
className:
|
|
137
|
+
className: x ? n.textMuted : n.text,
|
|
138
138
|
style: {
|
|
139
|
-
color:
|
|
140
|
-
fontSize: t === "footer" ?
|
|
141
|
-
lineHeight:
|
|
142
|
-
margin: `0 0 ${
|
|
139
|
+
color: x ? l.textMuted : l.text,
|
|
140
|
+
fontSize: t === "footer" ? a.sizeXs : a.sizeSm,
|
|
141
|
+
lineHeight: a.lineHeight,
|
|
142
|
+
margin: `0 0 ${d.ms}`,
|
|
143
143
|
...o
|
|
144
144
|
},
|
|
145
145
|
children: e
|
|
146
146
|
}
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function j({
|
|
150
150
|
href: t,
|
|
151
151
|
children: e,
|
|
152
152
|
align: o = "center"
|
|
153
153
|
}) {
|
|
154
|
-
return /* @__PURE__ */ r(
|
|
155
|
-
|
|
154
|
+
return /* @__PURE__ */ r(b, { style: { textAlign: o, margin: `${d.xl} 0` }, children: /* @__PURE__ */ r(
|
|
155
|
+
k,
|
|
156
156
|
{
|
|
157
157
|
href: t,
|
|
158
158
|
className: n.button,
|
|
159
159
|
style: {
|
|
160
|
-
backgroundColor:
|
|
161
|
-
color:
|
|
162
|
-
borderRadius:
|
|
160
|
+
backgroundColor: l.accent,
|
|
161
|
+
color: l.accentText,
|
|
162
|
+
borderRadius: p.sm,
|
|
163
163
|
display: "inline-block",
|
|
164
|
-
fontSize:
|
|
165
|
-
fontWeight:
|
|
166
|
-
padding: `${
|
|
164
|
+
fontSize: a.sizeSm,
|
|
165
|
+
fontWeight: a.weightSemibold,
|
|
166
|
+
padding: `${d.ms} ${d.xl}`,
|
|
167
167
|
textDecoration: "none"
|
|
168
168
|
},
|
|
169
169
|
children: e
|
|
170
170
|
}
|
|
171
171
|
) });
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
return /* @__PURE__ */ r(
|
|
173
|
+
function F() {
|
|
174
|
+
return /* @__PURE__ */ r(B, { className: n.hr, style: { borderColor: l.border, margin: `${d.lg} 0` } });
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function U({
|
|
177
177
|
href: t,
|
|
178
178
|
children: e,
|
|
179
179
|
style: o
|
|
180
180
|
}) {
|
|
181
181
|
return /* @__PURE__ */ r(
|
|
182
|
-
|
|
182
|
+
L,
|
|
183
183
|
{
|
|
184
184
|
href: t,
|
|
185
185
|
className: n.link,
|
|
186
|
-
style: { color:
|
|
186
|
+
style: { color: l.accent, textDecoration: "underline", ...o },
|
|
187
187
|
children: e
|
|
188
188
|
}
|
|
189
189
|
);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function G({
|
|
192
192
|
children: t,
|
|
193
193
|
style: e
|
|
194
194
|
}) {
|
|
195
|
-
return /* @__PURE__ */ r(
|
|
195
|
+
return /* @__PURE__ */ r(b, { style: { margin: `${d.lg} 0`, ...e }, children: t });
|
|
196
196
|
}
|
|
197
197
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
198
|
+
j as Button,
|
|
199
|
+
A as EmailShell,
|
|
200
|
+
D as Heading,
|
|
201
|
+
F as Hr,
|
|
202
|
+
v as Img,
|
|
203
|
+
U as Link,
|
|
204
|
+
J as Preview,
|
|
205
|
+
K as RawLink,
|
|
206
|
+
G as Section,
|
|
207
|
+
W as Text,
|
|
208
208
|
n as cls,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
I as darkModeCss,
|
|
210
|
+
a as font,
|
|
211
|
+
f as palette,
|
|
212
|
+
p as radius,
|
|
213
|
+
d as space
|
|
214
214
|
};
|
|
215
215
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/theme.ts","../src/components.tsx"],"sourcesContent":["import {darkColors, lightColors, type RawColors} from '@duro-app/tokens/raw'\n\n// ---------------------------------------------------------------------------\n// Spacing / radius / type\n//\n// Email needs literal px values (clients reset the root font-size, so rem is\n// unsafe) and table-friendly units. These mirror @duro-app/tokens (spacing /\n// type scale) converted to px. Colours, by contrast, are imported live from\n// the tokens package below so the brand palette can never drift.\n// ---------------------------------------------------------------------------\n\nexport const space = {\n xs: '4px',\n sm: '8px',\n ms: '12px',\n md: '16px',\n lg: '24px',\n xl: '32px',\n xxl: '48px',\n xxxl: '64px',\n} as const\n\nexport const radius = {\n sm: '8px',\n md: '12px',\n lg: '16px',\n} as const\n\nexport const font = {\n family:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',\n // rem → px (1rem = 16px): xs .75 / sm .875 / md 1 / lg 1.125 / xl 1.25 / heading 1.5\n sizeXs: '12px',\n sizeSm: '14px',\n sizeMd: '16px',\n sizeLg: '18px',\n sizeXl: '20px',\n sizeHeading: '24px',\n weightNormal: 400,\n weightMedium: 500,\n weightSemibold: 600,\n weightBold: 700,\n lineHeight: 1.5,\n} as const\n\n// ---------------------------------------------------------------------------\n// Semantic colour roles, derived from the shared token palettes\n// ---------------------------------------------------------------------------\n\nexport interface EmailRoles {\n bg: string\n card: string\n cardBorder: string\n text: string\n textMuted: string\n heading: string\n accent: string\n accentText: string\n border: string\n}\n\nconst roles = (c: RawColors): EmailRoles => ({\n bg: c.bg,\n card: c.bgCard,\n cardBorder: c.border,\n text: c.text,\n textMuted: c.textMuted,\n heading: c.text,\n accent: c.accent,\n accentText: c.accentContrast,\n border: c.border,\n})\n\nexport const palette = {\n light: roles(lightColors),\n dark: roles(darkColors),\n} as const\n\n// ---------------------------------------------------------------------------\n// Dark-mode mechanism\n//\n// Stable classNames that the dark <style> block targets. Inline (light) styles\n// are the base; the @media (prefers-color-scheme: dark) rules override them.\n// NB: inline styles beat <style> rules, so every override MUST use !important.\n// Honoured by Apple Mail (iOS/macOS); Gmail/Outlook apply their own dark\n// transform regardless; every other client falls back to the light base.\n// ---------------------------------------------------------------------------\n\nexport const cls = {\n body: 'd-body',\n card: 'd-card',\n text: 'd-text',\n textMuted: 'd-text-muted',\n heading: 'd-heading',\n button: 'd-btn',\n hr: 'd-hr',\n link: 'd-link',\n} as const\n\nconst ruleLines = (prefix: string): string[] => {\n const d = palette.dark\n const p = prefix ? `${prefix} ` : ''\n return [\n `${p}.${cls.body} { background-color: ${d.bg} !important; }`,\n `${p}.${cls.card} { background-color: ${d.card} !important; border-color: ${d.cardBorder} !important; }`,\n `${p}.${cls.text} { color: ${d.text} !important; }`,\n `${p}.${cls.textMuted} { color: ${d.textMuted} !important; }`,\n `${p}.${cls.heading} { color: ${d.heading} !important; }`,\n `${p}.${cls.button} { background-color: ${d.accent} !important; color: ${d.accentText} !important; }`,\n `${p}.${cls.hr} { border-color: ${d.border} !important; }`,\n `${p}.${cls.link} { color: ${d.accent} !important; }`,\n ]\n}\n\nexport const darkModeCss = [\n '@media (prefers-color-scheme: dark) {',\n ...ruleLines('').map((l) => ' ' + l),\n '}',\n '/* Outlook.com / Outlook mobile dark mode */',\n ...ruleLines('[data-ogsc]'),\n].join('\\n')\n","import * as React from 'react'\nimport {\n Html,\n Head,\n Body,\n Container,\n Section as RESection,\n Heading as REHeading,\n Text as REText,\n Button as REButton,\n Hr as REHr,\n Link as RELink,\n Preview,\n} from '@react-email/components'\nimport {palette, space, radius, font, cls, darkModeCss} from './theme'\n\nconst L = palette.light\n\n/**\n * Root wrapper: <Html><Head> (color-scheme meta + the prefers-color-scheme\n * dark <style>) + a themed card <Body>/<Container>. Compose the rest of the\n * email inside it with the other primitives.\n */\nexport function EmailShell({preview, children}: {preview?: string; children: React.ReactNode}) {\n return (\n <Html lang=\"en\">\n <Head>\n <meta name=\"color-scheme\" content=\"light dark\" />\n <meta name=\"supported-color-schemes\" content=\"light dark\" />\n <style dangerouslySetInnerHTML={{__html: darkModeCss}} />\n </Head>\n {preview ? <Preview>{preview}</Preview> : null}\n <Body\n className={cls.body}\n style={{\n backgroundColor: L.bg,\n fontFamily: font.family,\n margin: 0,\n padding: `${space.xl} 0`,\n }}\n >\n <Container\n className={cls.card}\n style={{\n backgroundColor: L.card,\n border: `1px solid ${L.cardBorder}`,\n borderRadius: radius.md,\n margin: '0 auto',\n maxWidth: '520px',\n padding: space.xl,\n }}\n >\n {children}\n </Container>\n </Body>\n </Html>\n )\n}\n\nexport function Heading({as = 'h1', children}: {as?: 'h1' | 'h2'; children: React.ReactNode}) {\n const isH1 = as === 'h1'\n return (\n <REHeading\n as={as}\n className={cls.heading}\n style={{\n color: L.heading,\n fontSize: isH1 ? font.sizeHeading : font.sizeMd,\n fontWeight: isH1 ? font.weightBold : font.weightSemibold,\n margin: isH1 ? `0 0 ${space.md}` : `0 0 ${space.sm}`,\n }}\n >\n {children}\n </REHeading>\n )\n}\n\nexport type TextVariant = 'body' | 'small' | 'footer'\n\nexport function Text({\n variant = 'body',\n children,\n style,\n}: {\n variant?: TextVariant\n children: React.ReactNode\n style?: React.CSSProperties\n}) {\n const muted = variant !== 'body'\n return (\n <REText\n className={muted ? cls.textMuted : cls.text}\n style={{\n color: muted ? L.textMuted : L.text,\n fontSize: variant === 'footer' ? font.sizeXs : font.sizeSm,\n lineHeight: font.lineHeight,\n margin: `0 0 ${space.ms}`,\n ...style,\n }}\n >\n {children}\n </REText>\n )\n}\n\nexport function Button({\n href,\n children,\n align = 'center',\n}: {\n href: string\n children: React.ReactNode\n align?: 'left' | 'center' | 'right'\n}) {\n return (\n <RESection style={{textAlign: align, margin: `${space.xl} 0`}}>\n <REButton\n href={href}\n className={cls.button}\n style={{\n backgroundColor: L.accent,\n color: L.accentText,\n borderRadius: radius.sm,\n display: 'inline-block',\n fontSize: font.sizeSm,\n fontWeight: font.weightSemibold,\n padding: `${space.ms} ${space.xl}`,\n textDecoration: 'none',\n }}\n >\n {children}\n </REButton>\n </RESection>\n )\n}\n\nexport function Hr() {\n return <REHr className={cls.hr} style={{borderColor: L.border, margin: `${space.lg} 0`}} />\n}\n\nexport function Link({\n href,\n children,\n style,\n}: {\n href: string\n // Optional: react-i18next <Trans> injects the link text via cloneElement,\n // so the element is declared without children (components={{ a: <Link href /> }}).\n children?: React.ReactNode\n style?: React.CSSProperties\n}) {\n return (\n <RELink\n href={href}\n className={cls.link}\n style={{color: L.accent, textDecoration: 'underline', ...style}}\n >\n {children}\n </RELink>\n )\n}\n\nexport function Section({\n children,\n style,\n}: {\n children: React.ReactNode\n style?: React.CSSProperties\n}) {\n return <RESection style={{margin: `${space.lg} 0`, ...style}}>{children}</RESection>\n}\n"],"names":["space","radius","font","roles","c","palette","lightColors","darkColors","cls","ruleLines","prefix","d","p","darkModeCss","l","L","EmailShell","preview","children","jsxs","Html","Head","jsx","Preview","Body","Container","Heading","as","isH1","REHeading","Text","variant","style","muted","REText","Button","href","align","RESection","REButton","Hr","REHr","Link","RELink","Section"],"mappings":";;;;AAWO,MAAMA,IAAQ;AAAA,EACnB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,MAAM;AACR,GAEaC,IAAS;AAAA,EACpB,IAAI;AAAA,EACJ,IA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U,OAAO,EAAC,WAAWD,GAAO,QAAQ,GAAGrC,EAAM,EAAE,KAAA,GACtD,UAAA,gBAAAsB;AAAA,IAACiB;AAAAA,IAAA;AAAA,MACC,MAAAH;AAAA,MACA,WAAW5B,EAAI;AAAA,MACf,OAAO;AAAA,QACL,iBAAiBO,EAAE;AAAA,QACnB,OAAOA,EAAE;AAAA,QACT,cAAcd,EAAO;AAAA,QACrB,SAAS;AAAA,QACT,UAAUC,EAAK;AAAA,QACf,YAAYA,EAAK;AAAA,QACjB,SAAS,GAAGF,EAAM,EAAE,IAAIA,EAAM,EAAE;AAAA,QAChC,gBAAgB;AAAA,MAAA;AAAA,MAGjB,UAAAkB;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;AAEO,SAASsB,IAAK;AACnB,SAAO,gBAAAlB,EAACmB,GAAA,EAAK,WAAWjC,EAAI,IAAI,OAAO,EAAC,aAAaO,EAAE,QAAQ,QAAQ,GAAGf,EAAM,EAAE,QAAO;AAC3F;AAEO,SAAS0C,EAAK;AAAA,EACnB,MAAAN;AAAA,EACA,UAAAlB;AAAA,EACA,OAAAc;AACF,GAMG;AACD,SACE,gBAAAV;AAAA,IAACqB;AAAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,WAAW5B,EAAI;AAAA,MACf,OAAO,EAAC,OAAOO,EAAE,QAAQ,gBAAgB,aAAa,GAAGiB,EAAA;AAAA,MAExD,UAAAd;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAAS0B,EAAQ;AAAA,EACtB,UAAA1B;AAAA,EACA,OAAAc;AACF,GAGG;AACD,SAAO,gBAAAV,EAACgB,GAAA,EAAU,OAAO,EAAC,QAAQ,GAAGtC,EAAM,EAAE,MAAM,GAAGgC,EAAA,GAAS,UAAAd,EAAA,CAAS;AAC1E;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/theme.ts","../src/components.tsx"],"sourcesContent":["import {\n darkColors,\n FONT_SIZE_REM,\n lightColors,\n RADII_PX,\n SPACING_PX,\n type RawColors,\n} from '@duro-app/tokens/raw'\n\n// ---------------------------------------------------------------------------\n// Spacing / radius / type\n//\n// Email needs literal px values (clients reset the root font-size, so rem is\n// unsafe, and they cannot read CSS variables) and table-friendly units. Every\n// value below is computed from the @duro-app/tokens raw maps, so a measure\n// still comes from its token (ADR-0027); only the unit is resolved here.\n// ---------------------------------------------------------------------------\n\nconst px = <N extends number>(n: N) => `${n}px` as `${N}px`\n\n// Type sizes are rem tokens; email resolves them against a fixed root size.\nconst REM_PX = 16\nconst remPx = (rem: number) => px(rem * REM_PX)\n\nexport const space = {\n xs: px(SPACING_PX.xs),\n sm: px(SPACING_PX.sm),\n ms: px(SPACING_PX.ms),\n md: px(SPACING_PX.md),\n lg: px(SPACING_PX.lg),\n xl: px(SPACING_PX.xl),\n xxl: px(SPACING_PX.xxl),\n xxxl: px(SPACING_PX.xxxl),\n} as const\n\nexport const radius = {\n sm: px(RADII_PX.sm),\n md: px(RADII_PX.md),\n lg: px(RADII_PX.lg),\n} as const\n\nexport const font = {\n family:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',\n // FONT_SIZE_REM resolved against the fixed REM_PX root.\n sizeXs: remPx(FONT_SIZE_REM.fontSizeXs),\n sizeSm: remPx(FONT_SIZE_REM.fontSizeSm),\n sizeMd: remPx(FONT_SIZE_REM.fontSizeMd),\n sizeLg: remPx(FONT_SIZE_REM.fontSizeLg),\n sizeXl: remPx(FONT_SIZE_REM.fontSizeXl),\n sizeHeading: remPx(FONT_SIZE_REM.fontSizeHeading),\n weightNormal: 400,\n weightMedium: 500,\n weightSemibold: 600,\n weightBold: 700,\n lineHeight: 1.5,\n} as const\n\n// ---------------------------------------------------------------------------\n// Semantic colour roles, derived from the shared token palettes\n// ---------------------------------------------------------------------------\n\nexport interface EmailRoles {\n bg: string\n card: string\n cardBorder: string\n text: string\n textMuted: string\n heading: string\n accent: string\n accentText: string\n border: string\n}\n\nconst roles = (c: RawColors): EmailRoles => ({\n bg: c.bg,\n card: c.bgCard,\n cardBorder: c.border,\n text: c.text,\n textMuted: c.textMuted,\n heading: c.text,\n accent: c.accent,\n accentText: c.accentContrast,\n border: c.border,\n})\n\nexport const palette = {\n light: roles(lightColors),\n dark: roles(darkColors),\n} as const\n\n// ---------------------------------------------------------------------------\n// Dark-mode mechanism\n//\n// Stable classNames that the dark <style> block targets. Inline (light) styles\n// are the base; the @media (prefers-color-scheme: dark) rules override them.\n// NB: inline styles beat <style> rules, so every override MUST use !important.\n// Honoured by Apple Mail (iOS/macOS); Gmail/Outlook apply their own dark\n// transform regardless; every other client falls back to the light base.\n// ---------------------------------------------------------------------------\n\nexport const cls = {\n body: 'd-body',\n card: 'd-card',\n text: 'd-text',\n textMuted: 'd-text-muted',\n heading: 'd-heading',\n button: 'd-btn',\n hr: 'd-hr',\n link: 'd-link',\n} as const\n\nconst ruleLines = (prefix: string): string[] => {\n const d = palette.dark\n const p = prefix ? `${prefix} ` : ''\n return [\n `${p}.${cls.body} { background-color: ${d.bg} !important; }`,\n `${p}.${cls.card} { background-color: ${d.card} !important; border-color: ${d.cardBorder} !important; }`,\n `${p}.${cls.text} { color: ${d.text} !important; }`,\n `${p}.${cls.textMuted} { color: ${d.textMuted} !important; }`,\n `${p}.${cls.heading} { color: ${d.heading} !important; }`,\n `${p}.${cls.button} { background-color: ${d.accent} !important; color: ${d.accentText} !important; }`,\n `${p}.${cls.hr} { border-color: ${d.border} !important; }`,\n `${p}.${cls.link} { color: ${d.accent} !important; }`,\n ]\n}\n\nexport const darkModeCss = [\n '@media (prefers-color-scheme: dark) {',\n ...ruleLines('').map((l) => ' ' + l),\n '}',\n '/* Outlook.com / Outlook mobile dark mode */',\n ...ruleLines('[data-ogsc]'),\n].join('\\n')\n","import * as React from 'react'\nimport {\n Html,\n Head,\n Body,\n Container,\n Section as RESection,\n Heading as REHeading,\n Text as REText,\n Button as REButton,\n Hr as REHr,\n Link as RELink,\n Preview,\n} from '@react-email/components'\nimport {BORDERS_PX, EMAIL_PX} from '@duro-app/tokens/raw'\nimport {palette, space, radius, font, cls, darkModeCss} from './theme'\n\nconst L = palette.light\n\n/**\n * Root wrapper: <Html><Head> (color-scheme meta + the prefers-color-scheme\n * dark <style>) + a themed card <Body>/<Container>. Compose the rest of the\n * email inside it with the other primitives.\n */\nexport function EmailShell({preview, children}: {preview?: string; children: React.ReactNode}) {\n return (\n <Html lang=\"en\">\n <Head>\n <meta name=\"color-scheme\" content=\"light dark\" />\n <meta name=\"supported-color-schemes\" content=\"light dark\" />\n <style dangerouslySetInnerHTML={{__html: darkModeCss}} />\n </Head>\n {preview ? <Preview>{preview}</Preview> : null}\n <Body\n className={cls.body}\n style={{\n backgroundColor: L.bg,\n fontFamily: font.family,\n margin: 0,\n padding: `${space.xl} 0`,\n }}\n >\n <Container\n className={cls.card}\n style={{\n backgroundColor: L.card,\n border: `${BORDERS_PX.hairline}px solid ${L.cardBorder}`,\n borderRadius: radius.md,\n margin: '0 auto',\n maxWidth: `${EMAIL_PX.emailCardW}px`,\n padding: space.xl,\n }}\n >\n {children}\n </Container>\n </Body>\n </Html>\n )\n}\n\nexport function Heading({as = 'h1', children}: {as?: 'h1' | 'h2'; children: React.ReactNode}) {\n const isH1 = as === 'h1'\n return (\n <REHeading\n as={as}\n className={cls.heading}\n style={{\n color: L.heading,\n fontSize: isH1 ? font.sizeHeading : font.sizeMd,\n fontWeight: isH1 ? font.weightBold : font.weightSemibold,\n margin: isH1 ? `0 0 ${space.md}` : `0 0 ${space.sm}`,\n }}\n >\n {children}\n </REHeading>\n )\n}\n\nexport type TextVariant = 'body' | 'small' | 'footer'\n\nexport function Text({\n variant = 'body',\n children,\n style,\n}: {\n variant?: TextVariant\n children: React.ReactNode\n style?: React.CSSProperties\n}) {\n const muted = variant !== 'body'\n return (\n <REText\n className={muted ? cls.textMuted : cls.text}\n style={{\n color: muted ? L.textMuted : L.text,\n fontSize: variant === 'footer' ? font.sizeXs : font.sizeSm,\n lineHeight: font.lineHeight,\n margin: `0 0 ${space.ms}`,\n ...style,\n }}\n >\n {children}\n </REText>\n )\n}\n\nexport function Button({\n href,\n children,\n align = 'center',\n}: {\n href: string\n children: React.ReactNode\n align?: 'left' | 'center' | 'right'\n}) {\n return (\n <RESection style={{textAlign: align, margin: `${space.xl} 0`}}>\n <REButton\n href={href}\n className={cls.button}\n style={{\n backgroundColor: L.accent,\n color: L.accentText,\n borderRadius: radius.sm,\n display: 'inline-block',\n fontSize: font.sizeSm,\n fontWeight: font.weightSemibold,\n padding: `${space.ms} ${space.xl}`,\n textDecoration: 'none',\n }}\n >\n {children}\n </REButton>\n </RESection>\n )\n}\n\nexport function Hr() {\n return <REHr className={cls.hr} style={{borderColor: L.border, margin: `${space.lg} 0`}} />\n}\n\nexport function Link({\n href,\n children,\n style,\n}: {\n href: string\n // Optional: react-i18next <Trans> injects the link text via cloneElement,\n // so the element is declared without children (components={{ a: <Link href /> }}).\n children?: React.ReactNode\n style?: React.CSSProperties\n}) {\n return (\n <RELink\n href={href}\n className={cls.link}\n style={{color: L.accent, textDecoration: 'underline', ...style}}\n >\n {children}\n </RELink>\n )\n}\n\nexport function Section({\n children,\n style,\n}: {\n children: React.ReactNode\n style?: React.CSSProperties\n}) {\n return <RESection style={{margin: `${space.lg} 0`, ...style}}>{children}</RESection>\n}\n"],"names":["px","n","REM_PX","remPx","rem","space","SPACING_PX","radius","RADII_PX","font","FONT_SIZE_REM","roles","c","palette","lightColors","darkColors","cls","ruleLines","prefix","d","p","darkModeCss","l","L","EmailShell","preview","children","jsxs","Html","Head","jsx","Preview","Body","Container","BORDERS_PX","EMAIL_PX","Heading","as","isH1","REHeading","Text","variant","style","muted","REText","Button","href","align","RESection","REButton","Hr","REHr","Link","RELink","Section"],"mappings":";;;;AAkBA,MAAMA,IAAK,CAAmBC,MAAS,GAAGA,CAAC,MAGrCC,IAAS,IACTC,IAAQ,CAACC,MAAgBJ,EAAGI,IAAMF,CAAM,GAEjCG,IAAQ;A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;AAAA,EACnB,MAAAN;AAAA,EACA,UAAApB;AAAA,EACA,OAAAgB;AACF,GAMG;AACD,SACE,gBAAAZ;AAAA,IAACuB;AAAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,WAAW9B,EAAI;AAAA,MACf,OAAO,EAAC,OAAOO,EAAE,QAAQ,gBAAgB,aAAa,GAAGmB,EAAA;AAAA,MAExD,UAAAhB;AAAA,IAAA;AAAA,EAAA;AAGP;AAEO,SAAS4B,EAAQ;AAAA,EACtB,UAAA5B;AAAA,EACA,OAAAgB;AACF,GAGG;AACD,SAAO,gBAAAZ,EAACkB,GAAA,EAAU,OAAO,EAAC,QAAQ,GAAG3C,EAAM,EAAE,MAAM,GAAGqC,EAAA,GAAS,UAAAhB,EAAA,CAAS;AAC1E;"}
|
package/dist/theme.d.ts
CHANGED
|
@@ -15,12 +15,12 @@ export declare const radius: {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const font: {
|
|
17
17
|
readonly family: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif";
|
|
18
|
-
readonly sizeXs:
|
|
19
|
-
readonly sizeSm:
|
|
20
|
-
readonly sizeMd:
|
|
21
|
-
readonly sizeLg:
|
|
22
|
-
readonly sizeXl:
|
|
23
|
-
readonly sizeHeading:
|
|
18
|
+
readonly sizeXs: `${number}px`;
|
|
19
|
+
readonly sizeSm: `${number}px`;
|
|
20
|
+
readonly sizeMd: `${number}px`;
|
|
21
|
+
readonly sizeLg: `${number}px`;
|
|
22
|
+
readonly sizeXl: `${number}px`;
|
|
23
|
+
readonly sizeHeading: `${number}px`;
|
|
24
24
|
readonly weightNormal: 400;
|
|
25
25
|
readonly weightMedium: 500;
|
|
26
26
|
readonly weightSemibold: 600;
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,KAAK;;;;;;;;;CASR,CAAA;AAEV,eAAO,MAAM,MAAM;;;;CAIT,CAAA;AAEV,eAAO,MAAM,IAAI;;;;;;;;;;;;;CAeP,CAAA;AAMV,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAcD,eAAO,MAAM,OAAO;;;CAGV,CAAA;AAYV,eAAO,MAAM,GAAG;;;;;;;;;CASN,CAAA;AAiBV,eAAO,MAAM,WAAW,QAMZ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duro-app/ui-email",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Token-driven, dark/light-aware email components for Duro (React Email).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@react-email/components": "^1.0.9",
|
|
23
|
-
"@duro-app/tokens": "^
|
|
23
|
+
"@duro-app/tokens": "^5.0.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^19.0.0"
|