@duro-app/ui-email 0.37.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Frederic Rousseau
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Root wrapper: <Html><Head> (color-scheme meta + the prefers-color-scheme
4
+ * dark <style>) + a themed card <Body>/<Container>. Compose the rest of the
5
+ * email inside it with the other primitives.
6
+ */
7
+ export declare function EmailShell({ preview, children }: {
8
+ preview?: string;
9
+ children: React.ReactNode;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Heading({ as, children }: {
12
+ as?: 'h1' | 'h2';
13
+ children: React.ReactNode;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ export type TextVariant = 'body' | 'small' | 'footer';
16
+ export declare function Text({ variant, children, style, }: {
17
+ variant?: TextVariant;
18
+ children: React.ReactNode;
19
+ style?: React.CSSProperties;
20
+ }): import("react/jsx-runtime").JSX.Element;
21
+ export declare function Button({ href, children, align, }: {
22
+ href: string;
23
+ children: React.ReactNode;
24
+ align?: 'left' | 'center' | 'right';
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ export declare function Hr(): import("react/jsx-runtime").JSX.Element;
27
+ export declare function Link({ href, children, style, }: {
28
+ href: string;
29
+ children: React.ReactNode;
30
+ style?: React.CSSProperties;
31
+ }): import("react/jsx-runtime").JSX.Element;
32
+ export declare function Section({ children, style, }: {
33
+ children: React.ReactNode;
34
+ style?: React.CSSProperties;
35
+ }): import("react/jsx-runtime").JSX.Element;
36
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B;;;;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;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,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"}
@@ -0,0 +1,4 @@
1
+ export { EmailShell, Heading, Text, Button, Hr, Link, Section, type TextVariant } from './components';
2
+ export { palette, space, radius, font, cls, darkModeCss, type EmailRoles } from './theme';
3
+ export { Img, Preview, Link as RawLink } from '@react-email/components';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,WAAW,EAAC,MAAM,cAAc,CAAA;AACnG,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,UAAU,EAAC,MAAM,SAAS,CAAA;AAIvF,OAAO,EAAC,GAAG,EAAE,OAAO,EAAE,IAAI,IAAI,OAAO,EAAC,MAAM,yBAAyB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,215 @@
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
+ import { Section as g, Button as p, Html as $, Head as h, Preview as b, Body as k, Container as y, Heading as f, Hr as S, Link as H, Text as z } from "@react-email/components";
3
+ import { Img as P, Preview as U, Link as _ } from "@react-email/components";
4
+ import { darkColors as M, lightColors as C } from "@duro-app/tokens/raw";
5
+ const a = {
6
+ xs: "4px",
7
+ sm: "8px",
8
+ ms: "12px",
9
+ md: "16px",
10
+ lg: "24px",
11
+ xl: "32px",
12
+ xxl: "48px",
13
+ xxxl: "64px"
14
+ }, x = {
15
+ sm: "8px",
16
+ md: "12px",
17
+ lg: "16px"
18
+ }, i = {
19
+ family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif',
20
+ // rem → px (1rem = 16px): xs .75 / sm .875 / md 1 / lg 1.125 / xl 1.25 / heading 1.5
21
+ sizeXs: "12px",
22
+ sizeSm: "14px",
23
+ sizeMd: "16px",
24
+ sizeLg: "18px",
25
+ sizeXl: "20px",
26
+ sizeHeading: "24px",
27
+ weightNormal: 400,
28
+ weightMedium: 500,
29
+ weightSemibold: 600,
30
+ weightBold: 700,
31
+ lineHeight: 1.5
32
+ }, c = (t) => ({
33
+ bg: t.bg,
34
+ card: t.bgCard,
35
+ cardBorder: t.border,
36
+ text: t.text,
37
+ textMuted: t.textMuted,
38
+ heading: t.text,
39
+ accent: t.accent,
40
+ accentText: t.accentContrast,
41
+ border: t.border
42
+ }), u = {
43
+ light: c(C),
44
+ dark: c(M)
45
+ }, n = {
46
+ body: "d-body",
47
+ card: "d-card",
48
+ text: "d-text",
49
+ textMuted: "d-text-muted",
50
+ heading: "d-heading",
51
+ button: "d-btn",
52
+ hr: "d-hr",
53
+ link: "d-link"
54
+ }, m = (t) => {
55
+ const e = u.dark, o = t ? `${t} ` : "";
56
+ return [
57
+ `${o}.${n.body} { background-color: ${e.bg} !important; }`,
58
+ `${o}.${n.card} { background-color: ${e.card} !important; border-color: ${e.cardBorder} !important; }`,
59
+ `${o}.${n.text} { color: ${e.text} !important; }`,
60
+ `${o}.${n.textMuted} { color: ${e.textMuted} !important; }`,
61
+ `${o}.${n.heading} { color: ${e.heading} !important; }`,
62
+ `${o}.${n.button} { background-color: ${e.accent} !important; color: ${e.accentText} !important; }`,
63
+ `${o}.${n.hr} { border-color: ${e.border} !important; }`,
64
+ `${o}.${n.link} { color: ${e.accent} !important; }`
65
+ ];
66
+ }, B = [
67
+ "@media (prefers-color-scheme: dark) {",
68
+ ...m("").map((t) => " " + t),
69
+ "}",
70
+ "/* Outlook.com / Outlook mobile dark mode */",
71
+ ...m("[data-ogsc]")
72
+ ].join(`
73
+ `), d = u.light;
74
+ function T({ preview: t, children: e }) {
75
+ return /* @__PURE__ */ s($, { lang: "en", children: [
76
+ /* @__PURE__ */ s(h, { children: [
77
+ /* @__PURE__ */ r("meta", { name: "color-scheme", content: "light dark" }),
78
+ /* @__PURE__ */ r("meta", { name: "supported-color-schemes", content: "light dark" }),
79
+ /* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html: B } })
80
+ ] }),
81
+ t ? /* @__PURE__ */ r(b, { children: t }) : null,
82
+ /* @__PURE__ */ r(
83
+ k,
84
+ {
85
+ className: n.body,
86
+ style: {
87
+ backgroundColor: d.bg,
88
+ fontFamily: i.family,
89
+ margin: 0,
90
+ padding: `${a.xl} 0`
91
+ },
92
+ children: /* @__PURE__ */ r(
93
+ y,
94
+ {
95
+ className: n.card,
96
+ style: {
97
+ backgroundColor: d.card,
98
+ border: `1px solid ${d.cardBorder}`,
99
+ borderRadius: x.md,
100
+ margin: "0 auto",
101
+ maxWidth: "520px",
102
+ padding: a.xl
103
+ },
104
+ children: e
105
+ }
106
+ )
107
+ }
108
+ )
109
+ ] });
110
+ }
111
+ function R({ as: t = "h1", children: e }) {
112
+ const o = t === "h1";
113
+ return /* @__PURE__ */ r(
114
+ f,
115
+ {
116
+ as: t,
117
+ className: n.heading,
118
+ style: {
119
+ color: d.heading,
120
+ fontSize: o ? i.sizeHeading : i.sizeMd,
121
+ fontWeight: o ? i.weightBold : i.weightSemibold,
122
+ margin: o ? `0 0 ${a.md}` : `0 0 ${a.sm}`
123
+ },
124
+ children: e
125
+ }
126
+ );
127
+ }
128
+ function j({
129
+ variant: t = "body",
130
+ children: e,
131
+ style: o
132
+ }) {
133
+ const l = t !== "body";
134
+ return /* @__PURE__ */ r(
135
+ z,
136
+ {
137
+ className: l ? n.textMuted : n.text,
138
+ style: {
139
+ color: l ? d.textMuted : d.text,
140
+ fontSize: t === "footer" ? i.sizeXs : i.sizeSm,
141
+ lineHeight: i.lineHeight,
142
+ margin: `0 0 ${a.ms}`,
143
+ ...o
144
+ },
145
+ children: e
146
+ }
147
+ );
148
+ }
149
+ function I({
150
+ href: t,
151
+ children: e,
152
+ align: o = "center"
153
+ }) {
154
+ return /* @__PURE__ */ r(g, { style: { textAlign: o, margin: `${a.xl} 0` }, children: /* @__PURE__ */ r(
155
+ p,
156
+ {
157
+ href: t,
158
+ className: n.button,
159
+ style: {
160
+ backgroundColor: d.accent,
161
+ color: d.accentText,
162
+ borderRadius: x.sm,
163
+ display: "inline-block",
164
+ fontSize: i.sizeSm,
165
+ fontWeight: i.weightSemibold,
166
+ padding: `${a.ms} ${a.xl}`,
167
+ textDecoration: "none"
168
+ },
169
+ children: e
170
+ }
171
+ ) });
172
+ }
173
+ function O() {
174
+ return /* @__PURE__ */ r(S, { className: n.hr, style: { borderColor: d.border, margin: `${a.lg} 0` } });
175
+ }
176
+ function W({
177
+ href: t,
178
+ children: e,
179
+ style: o
180
+ }) {
181
+ return /* @__PURE__ */ r(
182
+ H,
183
+ {
184
+ href: t,
185
+ className: n.link,
186
+ style: { color: d.accent, textDecoration: "underline", ...o },
187
+ children: e
188
+ }
189
+ );
190
+ }
191
+ function X({
192
+ children: t,
193
+ style: e
194
+ }) {
195
+ return /* @__PURE__ */ r(g, { style: { margin: `${a.lg} 0`, ...e }, children: t });
196
+ }
197
+ export {
198
+ I as Button,
199
+ T as EmailShell,
200
+ R as Heading,
201
+ O as Hr,
202
+ P as Img,
203
+ W as Link,
204
+ U as Preview,
205
+ _ as RawLink,
206
+ X as Section,
207
+ j as Text,
208
+ n as cls,
209
+ B as darkModeCss,
210
+ i as font,
211
+ u as palette,
212
+ x as radius,
213
+ a as space
214
+ };
215
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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 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,IAAI;AAAA,EACJ,IAAI;AACN,GAEaC,IAAO;AAAA,EAClB,QACE;AAAA;AAAA,EAEF,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;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C,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,GAIG;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;"}
@@ -0,0 +1,56 @@
1
+ export declare const space: {
2
+ readonly xs: "4px";
3
+ readonly sm: "8px";
4
+ readonly ms: "12px";
5
+ readonly md: "16px";
6
+ readonly lg: "24px";
7
+ readonly xl: "32px";
8
+ readonly xxl: "48px";
9
+ readonly xxxl: "64px";
10
+ };
11
+ export declare const radius: {
12
+ readonly sm: "8px";
13
+ readonly md: "12px";
14
+ readonly lg: "16px";
15
+ };
16
+ export declare const font: {
17
+ readonly family: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif";
18
+ readonly sizeXs: "12px";
19
+ readonly sizeSm: "14px";
20
+ readonly sizeMd: "16px";
21
+ readonly sizeLg: "18px";
22
+ readonly sizeXl: "20px";
23
+ readonly sizeHeading: "24px";
24
+ readonly weightNormal: 400;
25
+ readonly weightMedium: 500;
26
+ readonly weightSemibold: 600;
27
+ readonly weightBold: 700;
28
+ readonly lineHeight: 1.5;
29
+ };
30
+ export interface EmailRoles {
31
+ bg: string;
32
+ card: string;
33
+ cardBorder: string;
34
+ text: string;
35
+ textMuted: string;
36
+ heading: string;
37
+ accent: string;
38
+ accentText: string;
39
+ border: string;
40
+ }
41
+ export declare const palette: {
42
+ readonly light: EmailRoles;
43
+ readonly dark: EmailRoles;
44
+ };
45
+ export declare const cls: {
46
+ readonly body: "d-body";
47
+ readonly card: "d-card";
48
+ readonly text: "d-text";
49
+ readonly textMuted: "d-text-muted";
50
+ readonly heading: "d-heading";
51
+ readonly button: "d-btn";
52
+ readonly hr: "d-hr";
53
+ readonly link: "d-link";
54
+ };
55
+ export declare const darkModeCss: string;
56
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAWA,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 ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@duro-app/ui-email",
3
+ "version": "0.37.1",
4
+ "description": "Token-driven, dark/light-aware email components for Duro (React Email).",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "source": "./src/index.ts",
17
+ "import": "./dist/index.js",
18
+ "types": "./dist/index.d.ts"
19
+ }
20
+ },
21
+ "dependencies": {
22
+ "@react-email/components": "^1.0.9",
23
+ "@duro-app/tokens": "^0.37.1"
24
+ },
25
+ "peerDependencies": {
26
+ "react": "^19.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react": "^19.0.0",
30
+ "@vitejs/plugin-react": "^4.3.0",
31
+ "react": "^19.0.0",
32
+ "typescript": "^5.6.0",
33
+ "vite": "^6.0.0",
34
+ "vite-plugin-dts": "^4.0.0"
35
+ },
36
+ "scripts": {
37
+ "dev": "vite build --watch",
38
+ "build": "vite build",
39
+ "typecheck": "tsc --noEmit"
40
+ }
41
+ }