@flopay/ui 1.14.5 → 1.14.6
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/annotations/index.d.cts +0 -4
- package/dist/annotations/index.d.ts +0 -4
- package/dist/email/index.cjs +6 -0
- package/dist/email/index.cjs.map +1 -1
- package/dist/email/index.d.cts +1 -3
- package/dist/email/index.d.ts +1 -3
- package/dist/email/index.mjs +6 -0
- package/dist/email/index.mjs.map +1 -1
- package/dist/index.d.cts +0 -36
- package/dist/index.d.ts +0 -36
- package/dist/marketing/index.d.cts +0 -8
- package/dist/marketing/index.d.ts +0 -8
- package/package.json +9 -9
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
//#region dist/.types/annotations/arrow-paths.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Arrow outlines for {@link AnnotationLayer} — GENERATED, do not hand-edit.
|
|
5
4
|
*
|
|
@@ -132,8 +131,6 @@ export declare const ARROWS: Record<ArrowVariant, {
|
|
|
132
131
|
shaft: string;
|
|
133
132
|
head: string;
|
|
134
133
|
}>;
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region dist/.types/annotations/annotation-layer.d.ts
|
|
137
134
|
/** CSS edge offsets. Any length or percentage the property accepts. */
|
|
138
135
|
interface AnnotationOffsets {
|
|
139
136
|
top?: string;
|
|
@@ -224,5 +221,4 @@ interface AnnotationStageProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
224
221
|
* annotations.css, and re-declare it if your layout is constrained.
|
|
225
222
|
*/
|
|
226
223
|
export declare function AnnotationStage({ annotations, children, className, ...props }: AnnotationStageProps): import("react").JSX.Element;
|
|
227
|
-
//#endregion
|
|
228
224
|
export type { Annotation, AnnotationLayerProps, AnnotationListProps, AnnotationOffsets, AnnotationStageProps, ArrowVariant };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
//#region dist/.types/annotations/arrow-paths.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Arrow outlines for {@link AnnotationLayer} — GENERATED, do not hand-edit.
|
|
5
4
|
*
|
|
@@ -132,8 +131,6 @@ export declare const ARROWS: Record<ArrowVariant, {
|
|
|
132
131
|
shaft: string;
|
|
133
132
|
head: string;
|
|
134
133
|
}>;
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region dist/.types/annotations/annotation-layer.d.ts
|
|
137
134
|
/** CSS edge offsets. Any length or percentage the property accepts. */
|
|
138
135
|
interface AnnotationOffsets {
|
|
139
136
|
top?: string;
|
|
@@ -224,5 +221,4 @@ interface AnnotationStageProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
224
221
|
* annotations.css, and re-declare it if your layout is constrained.
|
|
225
222
|
*/
|
|
226
223
|
export declare function AnnotationStage({ annotations, children, className, ...props }: AnnotationStageProps): import("react").JSX.Element;
|
|
227
|
-
//#endregion
|
|
228
224
|
export type { Annotation, AnnotationLayerProps, AnnotationListProps, AnnotationOffsets, AnnotationStageProps, ArrowVariant };
|
package/dist/email/index.cjs
CHANGED
|
@@ -114,6 +114,7 @@ function Detail({ detail }) {
|
|
|
114
114
|
"th",
|
|
115
115
|
{
|
|
116
116
|
className: "email-muted",
|
|
117
|
+
"data-key-value-cell": "true",
|
|
117
118
|
scope: "row",
|
|
118
119
|
style: {
|
|
119
120
|
borderBottom: index < detail.rows.length - 1 ? `1px solid ${emailTheme.colors.border}` : void 0,
|
|
@@ -134,6 +135,7 @@ function Detail({ detail }) {
|
|
|
134
135
|
"td",
|
|
135
136
|
{
|
|
136
137
|
className: "email-text",
|
|
138
|
+
"data-key-value-cell": "true",
|
|
137
139
|
style: {
|
|
138
140
|
borderBottom: index < detail.rows.length - 1 ? `1px solid ${emailTheme.colors.border}` : void 0,
|
|
139
141
|
color: emailTheme.colors.text,
|
|
@@ -429,6 +431,10 @@ function renderTransactionalEmail(props) {
|
|
|
429
431
|
text: (0, import_render.toPlainText)(html, {
|
|
430
432
|
selectors: [
|
|
431
433
|
{ selector: "h1", options: { uppercase: false } },
|
|
434
|
+
// @react-email/render 2.3 formats every td/th as its own block; keep a key-value row's
|
|
435
|
+
// label and value together on one labelled line.
|
|
436
|
+
{ selector: 'th[data-key-value-cell="true"]', format: "inline" },
|
|
437
|
+
{ selector: 'td[data-key-value-cell="true"]', format: "inline" },
|
|
432
438
|
{
|
|
433
439
|
selector: 'tr[data-key-value-row="true"]',
|
|
434
440
|
format: "block",
|
package/dist/email/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/index.tsx","../../design-tokens.json","../../src/email/theme.ts"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n} from '@react-email/components';\nimport { toPlainText } from '@react-email/render';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport { emailTheme } from './theme';\n\nexport const FLOPAY_EMAIL_LOGO_URL = 'https://flopay.com/logo.png';\n\nexport interface TransactionalEmailAction {\n label: string;\n href: string;\n}\n\nexport interface TransactionalCodeDetail {\n kind: 'code';\n value: string;\n caption?: string;\n}\n\nexport interface TransactionalKeyValueDetail {\n kind: 'keyValue';\n rows: { label: string; value: string }[];\n}\n\nexport type TransactionalEmailDetail = TransactionalCodeDetail | TransactionalKeyValueDetail;\n\nexport interface TransactionalFooter {\n companyName: string;\n supportLabel: string;\n supportUrl: string;\n privacyUrl: string;\n termsUrl: string;\n notice: string;\n address: string;\n}\n\nexport interface TransactionalEmailProps {\n preheader: string;\n heading: string;\n body: string[];\n action?: TransactionalEmailAction;\n detail?: TransactionalEmailDetail;\n logoUrl?: string;\n footer?: Partial<TransactionalFooter>;\n}\n\nexport interface RenderedTransactionalEmail {\n html: string;\n text: string;\n}\n\nconst DEFAULT_TRANSACTIONAL_FOOTER: TransactionalFooter = {\n companyName: 'FloPay LLC',\n supportLabel: 'hello@flopay.com',\n supportUrl: 'mailto:hello@flopay.com',\n privacyUrl: 'https://flopay.com/legal/privacy',\n termsUrl: 'https://flopay.com/legal/terms',\n notice: 'This is a service message about your FloPay account.',\n address: '',\n};\n\nconst FOOTER_TEXT_STYLE = {\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n lineHeight: '20px',\n margin: '0 0 12px',\n} as const;\n\nfunction Detail({ detail }: { detail: TransactionalEmailDetail }) {\n if (detail.kind === 'keyValue') {\n return (\n <table\n cellPadding=\"0\"\n cellSpacing=\"0\"\n className=\"email-detail\"\n data-key-value=\"true\"\n style={{\n backgroundColor: emailTheme.colors.background,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n width: '100%',\n }}\n >\n <tbody>\n {detail.rows.map((row, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; rows can repeat a label, so the index is the only unique part of the key\n <tr data-key-value-row=\"true\" key={`${index}-${row.label}`}>\n <th\n className=\"email-muted\"\n scope=\"row\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.textSecondary,\n fontSize: '14px',\n fontWeight: 600,\n padding: '12px 16px',\n verticalAlign: 'top',\n width: '36%',\n }}\n >\n {row.label}:\n </th>\n <td\n className=\"email-text\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.text,\n fontSize: '14px',\n padding: '12px 16px',\n verticalAlign: 'top',\n wordBreak: 'break-word',\n }}\n >\n {' '}\n {row.value}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n\n return (\n <Section\n className=\"email-detail\"\n style={{\n backgroundColor: emailTheme.colors.muted,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n padding: '20px',\n }}\n >\n {detail.caption ? (\n <Text\n className=\"email-muted\"\n style={{\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n fontWeight: 600,\n lineHeight: '20px',\n margin: '0 0 8px',\n }}\n >\n {detail.caption}\n </Text>\n ) : null}\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontFamily: emailTheme.fontMono,\n fontSize: '24px',\n fontWeight: 700,\n letterSpacing: '0.12em',\n lineHeight: '32px',\n margin: 0,\n overflowWrap: 'anywhere',\n }}\n >\n {detail.value}\n </Text>\n </Section>\n );\n}\n\nfunction EmailFooter({ overrides }: { overrides?: Partial<TransactionalFooter> }) {\n const footer = { ...DEFAULT_TRANSACTIONAL_FOOTER, ...overrides };\n\n return (\n <Section style={{ marginTop: '32px' }}>\n <Hr\n className=\"email-divider\"\n style={{ borderColor: emailTheme.colors.border, margin: '0 0 24px' }}\n />\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.notice}\n </Text>\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n Need help?{' '}\n <Link\n className=\"email-link\"\n href={footer.supportUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n {footer.supportLabel}\n </Link>\n </Text>\n {footer.address ? (\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.address}\n </Text>\n ) : null}\n <Text className=\"email-muted\" style={{ ...FOOTER_TEXT_STYLE, margin: 0 }}>\n © {new Date().getFullYear()} {footer.companyName}.{' '}\n <Link\n className=\"email-link\"\n href={footer.privacyUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Privacy\n </Link>{' '}\n ·{' '}\n <Link\n className=\"email-link\"\n href={footer.termsUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Terms\n </Link>\n </Text>\n </Section>\n );\n}\n\nfunction Brand({ logoUrl }: { logoUrl: string }) {\n return (\n <table cellPadding=\"0\" cellSpacing=\"0\" role=\"presentation\" style={{ marginBottom: '32px' }}>\n <tbody>\n <tr>\n <td style={{ verticalAlign: 'middle', width: '40px' }}>\n <Img\n alt=\"\"\n height=\"40\"\n src={logoUrl}\n style={{ borderRadius: emailTheme.radius }}\n width=\"40\"\n />\n </td>\n <td style={{ paddingLeft: '12px', verticalAlign: 'middle' }}>\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '18px',\n fontWeight: 700,\n lineHeight: '24px',\n margin: 0,\n }}\n >\n FloPay\n </Text>\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n\nexport function TransactionalEmail({\n preheader,\n heading,\n body,\n action,\n detail,\n logoUrl = FLOPAY_EMAIL_LOGO_URL,\n footer,\n}: TransactionalEmailProps) {\n return (\n <Html lang=\"en\">\n <Head>\n <meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\" />\n <style>{`\n :root {\n color-scheme: light dark;\n supported-color-schemes: light dark;\n }\n\n @media only screen and (max-width: 620px) {\n .email-shell { padding: 0 !important; }\n .email-card { border-left: 0 !important; border-radius: 0 !important; border-right: 0 !important; margin: 0 !important; width: 100% !important; }\n .email-content { padding: 24px !important; }\n }\n\n @media (prefers-color-scheme: dark) {\n .email-body { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-shell { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-card { background-color: ${emailTheme.colors.darkSurface} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-text { color: ${emailTheme.colors.darkText} !important; }\n .email-muted { color: ${emailTheme.colors.darkTextSecondary} !important; }\n .email-detail { background-color: ${emailTheme.colors.darkMuted} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-link { color: ${emailTheme.colors.brandLight} !important; }\n .email-action { background-color: ${emailTheme.colors.darkText} !important; color: ${emailTheme.colors.darkBackground} !important; }\n .email-divider { border-color: ${emailTheme.colors.darkBorder} !important; }\n }\n `}</style>\n </Head>\n <Preview>{preheader}</Preview>\n <Body\n className=\"email-body\"\n style={{\n backgroundColor: emailTheme.colors.background,\n margin: 0,\n padding: 0,\n }}\n >\n <Section\n className=\"email-shell\"\n style={{\n backgroundColor: emailTheme.colors.background,\n color: emailTheme.colors.text,\n fontFamily: emailTheme.font,\n padding: '32px 12px',\n width: '100%',\n }}\n >\n <Container\n className=\"email-card\"\n style={{\n backgroundColor: emailTheme.colors.surface,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n borderTop: `4px solid ${emailTheme.colors.brand}`,\n margin: '0 auto',\n maxWidth: emailTheme.width,\n overflow: 'hidden',\n width: '100%',\n }}\n >\n <Section className=\"email-content\" style={{ padding: '40px' }}>\n <Brand logoUrl={logoUrl} />\n <Heading\n as=\"h1\"\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '28px',\n fontWeight: 700,\n letterSpacing: '-0.02em',\n lineHeight: '36px',\n margin: '0 0 16px',\n }}\n >\n {heading}\n </Heading>\n {body.map((paragraph, index) => (\n <Text\n className=\"email-text\"\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; two paragraphs can be identical, so the index is the only unique part of the key\n key={`${index}-${paragraph}`}\n style={{\n color: emailTheme.colors.text,\n fontSize: '16px',\n lineHeight: '25px',\n margin: '0 0 16px',\n }}\n >\n {paragraph}\n </Text>\n ))}\n {detail ? <Detail detail={detail} /> : null}\n {action ? (\n <Button\n className=\"email-action\"\n href={action.href}\n style={{\n backgroundColor: emailTheme.colors.text,\n borderRadius: emailTheme.radius,\n color: emailTheme.colors.surface,\n fontSize: '16px',\n fontWeight: 700,\n lineHeight: '20px',\n marginTop: '8px',\n padding: '14px 24px',\n textDecoration: 'none',\n }}\n >\n {action.label}\n </Button>\n ) : null}\n <EmailFooter overrides={footer} />\n </Section>\n </Container>\n </Section>\n </Body>\n </Html>\n );\n}\n\nexport function renderTransactionalEmail(\n props: TransactionalEmailProps,\n): RenderedTransactionalEmail {\n const markup = renderToStaticMarkup(<TransactionalEmail {...props} />);\n const html = `<!doctype html>${markup.replace(\n /<link\\b(?=[^>]*\\brel=\"preload\")(?=[^>]*\\bas=\"image\")[^>]*\\/?>/gi,\n '',\n )}`;\n\n return {\n html,\n text: toPlainText(html, {\n selectors: [\n { selector: 'h1', options: { uppercase: false } },\n {\n selector: 'tr[data-key-value-row=\"true\"]',\n format: 'block',\n options: { leadingLineBreaks: 1, trailingLineBreaks: 1 },\n },\n ],\n }),\n };\n}\n","{\n \"colors\": {\n \"light\": {\n \"background\": \"#f7f7f8\",\n \"surface\": \"#ffffff\",\n \"muted\": \"#f0f0f2\",\n \"border\": \"#e5e5e8\",\n \"text\": \"#0a0a0b\",\n \"textSecondary\": \"#52525b\",\n \"brand\": \"#1785e0\",\n \"brandLight\": \"#4ba6ec\"\n },\n \"dark\": {\n \"background\": \"#0a0a0b\",\n \"surface\": \"#141416\",\n \"muted\": \"#1c1c1f\",\n \"border\": \"#27272a\",\n \"text\": \"#fafafa\",\n \"textSecondary\": \"#a1a1aa\"\n }\n },\n \"radius\": \"8px\"\n}\n","import designTokens from '../../design-tokens.json';\n\nconst { dark, light } = designTokens.colors;\n\n/** Email clients need inline values; email-only choices remain local here. */\nexport const emailTheme = {\n colors: {\n ...light,\n accessibleLink: '#0969b3',\n darkBackground: dark.background,\n darkSurface: dark.surface,\n darkMuted: dark.muted,\n darkBorder: dark.border,\n darkText: dark.text,\n darkTextSecondary: dark.textSecondary,\n },\n radius: designTokens.radius,\n font: 'Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif',\n fontMono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n width: '600px',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAaO;AACP,oBAA4B;AAC5B,oBAAqC;;;ACfrC;AAAA,EACE,QAAU;AAAA,IACR,OAAS;AAAA,MACP,YAAc;AAAA,MACd,SAAW;AAAA,MACX,OAAS;AAAA,MACT,QA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AAO,kBAAkB,OAAO;AAAA,IACpC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA,UAAM,2BAAY,MAAM;AAAA,MACtB,WAAW;AAAA,QACT,EAAE,UAAU,MAAM,SAAS,EAAE,WAAW,MAAM,EAAE;AAAA,QAChD;AAAA,UACE,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,SAAS,EAAE,mBAAmB,GAAG,oBAAoB,EAAE;AAAA,QACzD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/email/index.tsx","../../design-tokens.json","../../src/email/theme.ts"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n} from '@react-email/components';\nimport { toPlainText } from '@react-email/render';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport { emailTheme } from './theme';\n\nexport const FLOPAY_EMAIL_LOGO_URL = 'https://flopay.com/logo.png';\n\nexport interface TransactionalEmailAction {\n label: string;\n href: string;\n}\n\nexport interface TransactionalCodeDetail {\n kind: 'code';\n value: string;\n caption?: string;\n}\n\nexport interface TransactionalKeyValueDetail {\n kind: 'keyValue';\n rows: { label: string; value: string }[];\n}\n\nexport type TransactionalEmailDetail = TransactionalCodeDetail | TransactionalKeyValueDetail;\n\nexport interface TransactionalFooter {\n companyName: string;\n supportLabel: string;\n supportUrl: string;\n privacyUrl: string;\n termsUrl: string;\n notice: string;\n address: string;\n}\n\nexport interface TransactionalEmailProps {\n preheader: string;\n heading: string;\n body: string[];\n action?: TransactionalEmailAction;\n detail?: TransactionalEmailDetail;\n logoUrl?: string;\n footer?: Partial<TransactionalFooter>;\n}\n\nexport interface RenderedTransactionalEmail {\n html: string;\n text: string;\n}\n\nconst DEFAULT_TRANSACTIONAL_FOOTER: TransactionalFooter = {\n companyName: 'FloPay LLC',\n supportLabel: 'hello@flopay.com',\n supportUrl: 'mailto:hello@flopay.com',\n privacyUrl: 'https://flopay.com/legal/privacy',\n termsUrl: 'https://flopay.com/legal/terms',\n notice: 'This is a service message about your FloPay account.',\n address: '',\n};\n\nconst FOOTER_TEXT_STYLE = {\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n lineHeight: '20px',\n margin: '0 0 12px',\n} as const;\n\nfunction Detail({ detail }: { detail: TransactionalEmailDetail }) {\n if (detail.kind === 'keyValue') {\n return (\n <table\n cellPadding=\"0\"\n cellSpacing=\"0\"\n className=\"email-detail\"\n data-key-value=\"true\"\n style={{\n backgroundColor: emailTheme.colors.background,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n width: '100%',\n }}\n >\n <tbody>\n {detail.rows.map((row, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; rows can repeat a label, so the index is the only unique part of the key\n <tr data-key-value-row=\"true\" key={`${index}-${row.label}`}>\n <th\n className=\"email-muted\"\n data-key-value-cell=\"true\"\n scope=\"row\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.textSecondary,\n fontSize: '14px',\n fontWeight: 600,\n padding: '12px 16px',\n verticalAlign: 'top',\n width: '36%',\n }}\n >\n {row.label}:\n </th>\n <td\n className=\"email-text\"\n data-key-value-cell=\"true\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.text,\n fontSize: '14px',\n padding: '12px 16px',\n verticalAlign: 'top',\n wordBreak: 'break-word',\n }}\n >\n {' '}\n {row.value}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n\n return (\n <Section\n className=\"email-detail\"\n style={{\n backgroundColor: emailTheme.colors.muted,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n padding: '20px',\n }}\n >\n {detail.caption ? (\n <Text\n className=\"email-muted\"\n style={{\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n fontWeight: 600,\n lineHeight: '20px',\n margin: '0 0 8px',\n }}\n >\n {detail.caption}\n </Text>\n ) : null}\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontFamily: emailTheme.fontMono,\n fontSize: '24px',\n fontWeight: 700,\n letterSpacing: '0.12em',\n lineHeight: '32px',\n margin: 0,\n overflowWrap: 'anywhere',\n }}\n >\n {detail.value}\n </Text>\n </Section>\n );\n}\n\nfunction EmailFooter({ overrides }: { overrides?: Partial<TransactionalFooter> }) {\n const footer = { ...DEFAULT_TRANSACTIONAL_FOOTER, ...overrides };\n\n return (\n <Section style={{ marginTop: '32px' }}>\n <Hr\n className=\"email-divider\"\n style={{ borderColor: emailTheme.colors.border, margin: '0 0 24px' }}\n />\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.notice}\n </Text>\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n Need help?{' '}\n <Link\n className=\"email-link\"\n href={footer.supportUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n {footer.supportLabel}\n </Link>\n </Text>\n {footer.address ? (\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.address}\n </Text>\n ) : null}\n <Text className=\"email-muted\" style={{ ...FOOTER_TEXT_STYLE, margin: 0 }}>\n © {new Date().getFullYear()} {footer.companyName}.{' '}\n <Link\n className=\"email-link\"\n href={footer.privacyUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Privacy\n </Link>{' '}\n ·{' '}\n <Link\n className=\"email-link\"\n href={footer.termsUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Terms\n </Link>\n </Text>\n </Section>\n );\n}\n\nfunction Brand({ logoUrl }: { logoUrl: string }) {\n return (\n <table cellPadding=\"0\" cellSpacing=\"0\" role=\"presentation\" style={{ marginBottom: '32px' }}>\n <tbody>\n <tr>\n <td style={{ verticalAlign: 'middle', width: '40px' }}>\n <Img\n alt=\"\"\n height=\"40\"\n src={logoUrl}\n style={{ borderRadius: emailTheme.radius }}\n width=\"40\"\n />\n </td>\n <td style={{ paddingLeft: '12px', verticalAlign: 'middle' }}>\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '18px',\n fontWeight: 700,\n lineHeight: '24px',\n margin: 0,\n }}\n >\n FloPay\n </Text>\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n\nexport function TransactionalEmail({\n preheader,\n heading,\n body,\n action,\n detail,\n logoUrl = FLOPAY_EMAIL_LOGO_URL,\n footer,\n}: TransactionalEmailProps) {\n return (\n <Html lang=\"en\">\n <Head>\n <meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\" />\n <style>{`\n :root {\n color-scheme: light dark;\n supported-color-schemes: light dark;\n }\n\n @media only screen and (max-width: 620px) {\n .email-shell { padding: 0 !important; }\n .email-card { border-left: 0 !important; border-radius: 0 !important; border-right: 0 !important; margin: 0 !important; width: 100% !important; }\n .email-content { padding: 24px !important; }\n }\n\n @media (prefers-color-scheme: dark) {\n .email-body { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-shell { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-card { background-color: ${emailTheme.colors.darkSurface} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-text { color: ${emailTheme.colors.darkText} !important; }\n .email-muted { color: ${emailTheme.colors.darkTextSecondary} !important; }\n .email-detail { background-color: ${emailTheme.colors.darkMuted} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-link { color: ${emailTheme.colors.brandLight} !important; }\n .email-action { background-color: ${emailTheme.colors.darkText} !important; color: ${emailTheme.colors.darkBackground} !important; }\n .email-divider { border-color: ${emailTheme.colors.darkBorder} !important; }\n }\n `}</style>\n </Head>\n <Preview>{preheader}</Preview>\n <Body\n className=\"email-body\"\n style={{\n backgroundColor: emailTheme.colors.background,\n margin: 0,\n padding: 0,\n }}\n >\n <Section\n className=\"email-shell\"\n style={{\n backgroundColor: emailTheme.colors.background,\n color: emailTheme.colors.text,\n fontFamily: emailTheme.font,\n padding: '32px 12px',\n width: '100%',\n }}\n >\n <Container\n className=\"email-card\"\n style={{\n backgroundColor: emailTheme.colors.surface,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n borderTop: `4px solid ${emailTheme.colors.brand}`,\n margin: '0 auto',\n maxWidth: emailTheme.width,\n overflow: 'hidden',\n width: '100%',\n }}\n >\n <Section className=\"email-content\" style={{ padding: '40px' }}>\n <Brand logoUrl={logoUrl} />\n <Heading\n as=\"h1\"\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '28px',\n fontWeight: 700,\n letterSpacing: '-0.02em',\n lineHeight: '36px',\n margin: '0 0 16px',\n }}\n >\n {heading}\n </Heading>\n {body.map((paragraph, index) => (\n <Text\n className=\"email-text\"\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; two paragraphs can be identical, so the index is the only unique part of the key\n key={`${index}-${paragraph}`}\n style={{\n color: emailTheme.colors.text,\n fontSize: '16px',\n lineHeight: '25px',\n margin: '0 0 16px',\n }}\n >\n {paragraph}\n </Text>\n ))}\n {detail ? <Detail detail={detail} /> : null}\n {action ? (\n <Button\n className=\"email-action\"\n href={action.href}\n style={{\n backgroundColor: emailTheme.colors.text,\n borderRadius: emailTheme.radius,\n color: emailTheme.colors.surface,\n fontSize: '16px',\n fontWeight: 700,\n lineHeight: '20px',\n marginTop: '8px',\n padding: '14px 24px',\n textDecoration: 'none',\n }}\n >\n {action.label}\n </Button>\n ) : null}\n <EmailFooter overrides={footer} />\n </Section>\n </Container>\n </Section>\n </Body>\n </Html>\n );\n}\n\nexport function renderTransactionalEmail(\n props: TransactionalEmailProps,\n): RenderedTransactionalEmail {\n const markup = renderToStaticMarkup(<TransactionalEmail {...props} />);\n const html = `<!doctype html>${markup.replace(\n /<link\\b(?=[^>]*\\brel=\"preload\")(?=[^>]*\\bas=\"image\")[^>]*\\/?>/gi,\n '',\n )}`;\n\n return {\n html,\n text: toPlainText(html, {\n selectors: [\n { selector: 'h1', options: { uppercase: false } },\n // @react-email/render 2.3 formats every td/th as its own block; keep a key-value row's\n // label and value together on one labelled line.\n { selector: 'th[data-key-value-cell=\"true\"]', format: 'inline' },\n { selector: 'td[data-key-value-cell=\"true\"]', format: 'inline' },\n {\n selector: 'tr[data-key-value-row=\"true\"]',\n format: 'block',\n options: { leadingLineBreaks: 1, trailingLineBreaks: 1 },\n },\n ],\n }),\n };\n}\n","{\n \"colors\": {\n \"light\": {\n \"background\": \"#f7f7f8\",\n \"surface\": \"#ffffff\",\n \"muted\": \"#f0f0f2\",\n \"border\": \"#e5e5e8\",\n \"text\": \"#0a0a0b\",\n \"textSecondary\": \"#52525b\",\n \"brand\": \"#1785e0\",\n \"brandLight\": \"#4ba6ec\"\n },\n \"dark\": {\n \"background\": \"#0a0a0b\",\n \"surface\": \"#141416\",\n \"muted\": \"#1c1c1f\",\n \"border\": \"#27272a\",\n \"text\": \"#fafafa\",\n \"textSecondary\": \"#a1a1aa\"\n }\n },\n \"radius\": \"8px\"\n}\n","import designTokens from '../../design-tokens.json';\n\nconst { dark, light } = designTokens.colors;\n\n/** Email clients need inline values; email-only choices remain local here. */\nexport const emailTheme = {\n colors: {\n ...light,\n accessibleLink: '#0969b3',\n darkBackground: dark.background,\n darkSurface: dark.surface,\n darkMuted: dark.muted,\n darkBorder: dark.border,\n darkText: dark.text,\n darkTextSecondary: dark.textSecondary,\n },\n radius: designTokens.radius,\n font: 'Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif',\n fontMono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n width: '600px',\n} as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;A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4CAAC,eAAY,WAAW,QAAQ;AAAA,mBAClC;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEO,SAAS,yBACd,OAC4B;AAC5B,QAAM,aAAS,oCAAqB,4CAAC,sBAAoB,GAAG,OAAO,CAAE;AACrE,QAAM,OAAO,kBAAkB,OAAO;AAAA,IACpC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA,UAAM,2BAAY,MAAM;AAAA,MACtB,WAAW;AAAA,QACT,EAAE,UAAU,MAAM,SAAS,EAAE,WAAW,MAAM,EAAE;AAAA;AAAA;AAAA,QAGhD,EAAE,UAAU,kCAAkC,QAAQ,SAAS;AAAA,QAC/D,EAAE,UAAU,kCAAkC,QAAQ,SAAS;AAAA,QAC/D;AAAA,UACE,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,SAAS,EAAE,mBAAmB,GAAG,oBAAoB,EAAE;AAAA,QACzD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/email/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region dist/.types/email/index.d.ts
|
|
2
1
|
export declare const FLOPAY_EMAIL_LOGO_URL = "https://flopay.com/logo.png";
|
|
3
2
|
export interface TransactionalEmailAction {
|
|
4
3
|
label: string;
|
|
@@ -40,5 +39,4 @@ export interface RenderedTransactionalEmail {
|
|
|
40
39
|
text: string;
|
|
41
40
|
}
|
|
42
41
|
export declare function TransactionalEmail({ preheader, heading, body, action, detail, logoUrl, footer }: TransactionalEmailProps): import("react").JSX.Element;
|
|
43
|
-
export declare function renderTransactionalEmail(props: TransactionalEmailProps): RenderedTransactionalEmail;
|
|
44
|
-
//#endregion
|
|
42
|
+
export declare function renderTransactionalEmail(props: TransactionalEmailProps): RenderedTransactionalEmail;
|
package/dist/email/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region dist/.types/email/index.d.ts
|
|
2
1
|
export declare const FLOPAY_EMAIL_LOGO_URL = "https://flopay.com/logo.png";
|
|
3
2
|
export interface TransactionalEmailAction {
|
|
4
3
|
label: string;
|
|
@@ -40,5 +39,4 @@ export interface RenderedTransactionalEmail {
|
|
|
40
39
|
text: string;
|
|
41
40
|
}
|
|
42
41
|
export declare function TransactionalEmail({ preheader, heading, body, action, detail, logoUrl, footer }: TransactionalEmailProps): import("react").JSX.Element;
|
|
43
|
-
export declare function renderTransactionalEmail(props: TransactionalEmailProps): RenderedTransactionalEmail;
|
|
44
|
-
//#endregion
|
|
42
|
+
export declare function renderTransactionalEmail(props: TransactionalEmailProps): RenderedTransactionalEmail;
|
package/dist/email/index.mjs
CHANGED
|
@@ -101,6 +101,7 @@ function Detail({ detail }) {
|
|
|
101
101
|
"th",
|
|
102
102
|
{
|
|
103
103
|
className: "email-muted",
|
|
104
|
+
"data-key-value-cell": "true",
|
|
104
105
|
scope: "row",
|
|
105
106
|
style: {
|
|
106
107
|
borderBottom: index < detail.rows.length - 1 ? `1px solid ${emailTheme.colors.border}` : void 0,
|
|
@@ -121,6 +122,7 @@ function Detail({ detail }) {
|
|
|
121
122
|
"td",
|
|
122
123
|
{
|
|
123
124
|
className: "email-text",
|
|
125
|
+
"data-key-value-cell": "true",
|
|
124
126
|
style: {
|
|
125
127
|
borderBottom: index < detail.rows.length - 1 ? `1px solid ${emailTheme.colors.border}` : void 0,
|
|
126
128
|
color: emailTheme.colors.text,
|
|
@@ -416,6 +418,10 @@ function renderTransactionalEmail(props) {
|
|
|
416
418
|
text: toPlainText(html, {
|
|
417
419
|
selectors: [
|
|
418
420
|
{ selector: "h1", options: { uppercase: false } },
|
|
421
|
+
// @react-email/render 2.3 formats every td/th as its own block; keep a key-value row's
|
|
422
|
+
// label and value together on one labelled line.
|
|
423
|
+
{ selector: 'th[data-key-value-cell="true"]', format: "inline" },
|
|
424
|
+
{ selector: 'td[data-key-value-cell="true"]', format: "inline" },
|
|
419
425
|
{
|
|
420
426
|
selector: 'tr[data-key-value-row="true"]',
|
|
421
427
|
format: "block",
|
package/dist/email/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/email/index.tsx","../../design-tokens.json","../../src/email/theme.ts"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n} from '@react-email/components';\nimport { toPlainText } from '@react-email/render';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport { emailTheme } from './theme';\n\nexport const FLOPAY_EMAIL_LOGO_URL = 'https://flopay.com/logo.png';\n\nexport interface TransactionalEmailAction {\n label: string;\n href: string;\n}\n\nexport interface TransactionalCodeDetail {\n kind: 'code';\n value: string;\n caption?: string;\n}\n\nexport interface TransactionalKeyValueDetail {\n kind: 'keyValue';\n rows: { label: string; value: string }[];\n}\n\nexport type TransactionalEmailDetail = TransactionalCodeDetail | TransactionalKeyValueDetail;\n\nexport interface TransactionalFooter {\n companyName: string;\n supportLabel: string;\n supportUrl: string;\n privacyUrl: string;\n termsUrl: string;\n notice: string;\n address: string;\n}\n\nexport interface TransactionalEmailProps {\n preheader: string;\n heading: string;\n body: string[];\n action?: TransactionalEmailAction;\n detail?: TransactionalEmailDetail;\n logoUrl?: string;\n footer?: Partial<TransactionalFooter>;\n}\n\nexport interface RenderedTransactionalEmail {\n html: string;\n text: string;\n}\n\nconst DEFAULT_TRANSACTIONAL_FOOTER: TransactionalFooter = {\n companyName: 'FloPay LLC',\n supportLabel: 'hello@flopay.com',\n supportUrl: 'mailto:hello@flopay.com',\n privacyUrl: 'https://flopay.com/legal/privacy',\n termsUrl: 'https://flopay.com/legal/terms',\n notice: 'This is a service message about your FloPay account.',\n address: '',\n};\n\nconst FOOTER_TEXT_STYLE = {\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n lineHeight: '20px',\n margin: '0 0 12px',\n} as const;\n\nfunction Detail({ detail }: { detail: TransactionalEmailDetail }) {\n if (detail.kind === 'keyValue') {\n return (\n <table\n cellPadding=\"0\"\n cellSpacing=\"0\"\n className=\"email-detail\"\n data-key-value=\"true\"\n style={{\n backgroundColor: emailTheme.colors.background,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n width: '100%',\n }}\n >\n <tbody>\n {detail.rows.map((row, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; rows can repeat a label, so the index is the only unique part of the key\n <tr data-key-value-row=\"true\" key={`${index}-${row.label}`}>\n <th\n className=\"email-muted\"\n scope=\"row\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.textSecondary,\n fontSize: '14px',\n fontWeight: 600,\n padding: '12px 16px',\n verticalAlign: 'top',\n width: '36%',\n }}\n >\n {row.label}:\n </th>\n <td\n className=\"email-text\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.text,\n fontSize: '14px',\n padding: '12px 16px',\n verticalAlign: 'top',\n wordBreak: 'break-word',\n }}\n >\n {' '}\n {row.value}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n\n return (\n <Section\n className=\"email-detail\"\n style={{\n backgroundColor: emailTheme.colors.muted,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n padding: '20px',\n }}\n >\n {detail.caption ? (\n <Text\n className=\"email-muted\"\n style={{\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n fontWeight: 600,\n lineHeight: '20px',\n margin: '0 0 8px',\n }}\n >\n {detail.caption}\n </Text>\n ) : null}\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontFamily: emailTheme.fontMono,\n fontSize: '24px',\n fontWeight: 700,\n letterSpacing: '0.12em',\n lineHeight: '32px',\n margin: 0,\n overflowWrap: 'anywhere',\n }}\n >\n {detail.value}\n </Text>\n </Section>\n );\n}\n\nfunction EmailFooter({ overrides }: { overrides?: Partial<TransactionalFooter> }) {\n const footer = { ...DEFAULT_TRANSACTIONAL_FOOTER, ...overrides };\n\n return (\n <Section style={{ marginTop: '32px' }}>\n <Hr\n className=\"email-divider\"\n style={{ borderColor: emailTheme.colors.border, margin: '0 0 24px' }}\n />\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.notice}\n </Text>\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n Need help?{' '}\n <Link\n className=\"email-link\"\n href={footer.supportUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n {footer.supportLabel}\n </Link>\n </Text>\n {footer.address ? (\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.address}\n </Text>\n ) : null}\n <Text className=\"email-muted\" style={{ ...FOOTER_TEXT_STYLE, margin: 0 }}>\n © {new Date().getFullYear()} {footer.companyName}.{' '}\n <Link\n className=\"email-link\"\n href={footer.privacyUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Privacy\n </Link>{' '}\n ·{' '}\n <Link\n className=\"email-link\"\n href={footer.termsUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Terms\n </Link>\n </Text>\n </Section>\n );\n}\n\nfunction Brand({ logoUrl }: { logoUrl: string }) {\n return (\n <table cellPadding=\"0\" cellSpacing=\"0\" role=\"presentation\" style={{ marginBottom: '32px' }}>\n <tbody>\n <tr>\n <td style={{ verticalAlign: 'middle', width: '40px' }}>\n <Img\n alt=\"\"\n height=\"40\"\n src={logoUrl}\n style={{ borderRadius: emailTheme.radius }}\n width=\"40\"\n />\n </td>\n <td style={{ paddingLeft: '12px', verticalAlign: 'middle' }}>\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '18px',\n fontWeight: 700,\n lineHeight: '24px',\n margin: 0,\n }}\n >\n FloPay\n </Text>\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n\nexport function TransactionalEmail({\n preheader,\n heading,\n body,\n action,\n detail,\n logoUrl = FLOPAY_EMAIL_LOGO_URL,\n footer,\n}: TransactionalEmailProps) {\n return (\n <Html lang=\"en\">\n <Head>\n <meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\" />\n <style>{`\n :root {\n color-scheme: light dark;\n supported-color-schemes: light dark;\n }\n\n @media only screen and (max-width: 620px) {\n .email-shell { padding: 0 !important; }\n .email-card { border-left: 0 !important; border-radius: 0 !important; border-right: 0 !important; margin: 0 !important; width: 100% !important; }\n .email-content { padding: 24px !important; }\n }\n\n @media (prefers-color-scheme: dark) {\n .email-body { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-shell { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-card { background-color: ${emailTheme.colors.darkSurface} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-text { color: ${emailTheme.colors.darkText} !important; }\n .email-muted { color: ${emailTheme.colors.darkTextSecondary} !important; }\n .email-detail { background-color: ${emailTheme.colors.darkMuted} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-link { color: ${emailTheme.colors.brandLight} !important; }\n .email-action { background-color: ${emailTheme.colors.darkText} !important; color: ${emailTheme.colors.darkBackground} !important; }\n .email-divider { border-color: ${emailTheme.colors.darkBorder} !important; }\n }\n `}</style>\n </Head>\n <Preview>{preheader}</Preview>\n <Body\n className=\"email-body\"\n style={{\n backgroundColor: emailTheme.colors.background,\n margin: 0,\n padding: 0,\n }}\n >\n <Section\n className=\"email-shell\"\n style={{\n backgroundColor: emailTheme.colors.background,\n color: emailTheme.colors.text,\n fontFamily: emailTheme.font,\n padding: '32px 12px',\n width: '100%',\n }}\n >\n <Container\n className=\"email-card\"\n style={{\n backgroundColor: emailTheme.colors.surface,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n borderTop: `4px solid ${emailTheme.colors.brand}`,\n margin: '0 auto',\n maxWidth: emailTheme.width,\n overflow: 'hidden',\n width: '100%',\n }}\n >\n <Section className=\"email-content\" style={{ padding: '40px' }}>\n <Brand logoUrl={logoUrl} />\n <Heading\n as=\"h1\"\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '28px',\n fontWeight: 700,\n letterSpacing: '-0.02em',\n lineHeight: '36px',\n margin: '0 0 16px',\n }}\n >\n {heading}\n </Heading>\n {body.map((paragraph, index) => (\n <Text\n className=\"email-text\"\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; two paragraphs can be identical, so the index is the only unique part of the key\n key={`${index}-${paragraph}`}\n style={{\n color: emailTheme.colors.text,\n fontSize: '16px',\n lineHeight: '25px',\n margin: '0 0 16px',\n }}\n >\n {paragraph}\n </Text>\n ))}\n {detail ? <Detail detail={detail} /> : null}\n {action ? (\n <Button\n className=\"email-action\"\n href={action.href}\n style={{\n backgroundColor: emailTheme.colors.text,\n borderRadius: emailTheme.radius,\n color: emailTheme.colors.surface,\n fontSize: '16px',\n fontWeight: 700,\n lineHeight: '20px',\n marginTop: '8px',\n padding: '14px 24px',\n textDecoration: 'none',\n }}\n >\n {action.label}\n </Button>\n ) : null}\n <EmailFooter overrides={footer} />\n </Section>\n </Container>\n </Section>\n </Body>\n </Html>\n );\n}\n\nexport function renderTransactionalEmail(\n props: TransactionalEmailProps,\n): RenderedTransactionalEmail {\n const markup = renderToStaticMarkup(<TransactionalEmail {...props} />);\n const html = `<!doctype html>${markup.replace(\n /<link\\b(?=[^>]*\\brel=\"preload\")(?=[^>]*\\bas=\"image\")[^>]*\\/?>/gi,\n '',\n )}`;\n\n return {\n html,\n text: toPlainText(html, {\n selectors: [\n { selector: 'h1', options: { uppercase: false } },\n {\n selector: 'tr[data-key-value-row=\"true\"]',\n format: 'block',\n options: { leadingLineBreaks: 1, trailingLineBreaks: 1 },\n },\n ],\n }),\n };\n}\n","{\n \"colors\": {\n \"light\": {\n \"background\": \"#f7f7f8\",\n \"surface\": \"#ffffff\",\n \"muted\": \"#f0f0f2\",\n \"border\": \"#e5e5e8\",\n \"text\": \"#0a0a0b\",\n \"textSecondary\": \"#52525b\",\n \"brand\": \"#1785e0\",\n \"brandLight\": \"#4ba6ec\"\n },\n \"dark\": {\n \"background\": \"#0a0a0b\",\n \"surface\": \"#141416\",\n \"muted\": \"#1c1c1f\",\n \"border\": \"#27272a\",\n \"text\": \"#fafafa\",\n \"textSecondary\": \"#a1a1aa\"\n }\n },\n \"radius\": \"8px\"\n}\n","import designTokens from '../../design-tokens.json';\n\nconst { dark, light } = designTokens.colors;\n\n/** Email clients need inline values; email-only choices remain local here. */\nexport const emailTheme = {\n colors: {\n ...light,\n accessibleLink: '#0969b3',\n darkBackground: dark.background,\n darkSurface: dark.surface,\n darkMuted: dark.muted,\n darkBorder: dark.border,\n darkText: dark.text,\n darkTextSecondary: dark.textSecondary,\n },\n radius: designTokens.radius,\n font: 'Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif',\n fontMono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n width: '600px',\n} as const;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;;;ACfrC;AAAA,EACE,QAAU;AAAA,IACR,OAAS;AAAA,MACP,YAAc;AAAA,MACd,SAAW;AAAA,MACX,OAAS;AAAA,MACT,QAAU;AAAA,MACV,MAAQ;AAAA,MACR,eAAiB;AAAA,MACjB,OAAS;AAAA,MACT,YAAc;AAAA,IAChB;AAAA,IACA,MAAQ;AAAA,MACN,YAAc;AAAA,MACd,SAAW;AAAA,MACX,OAAS;AAAA,MACT,Q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E,WAAW,MAAM,EAAE;AAAA,QAChD;AAAA,UACE,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,SAAS,EAAE,mBAAmB,GAAG,oBAAoB,EAAE;AAAA,QACzD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/email/index.tsx","../../design-tokens.json","../../src/email/theme.ts"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n} from '@react-email/components';\nimport { toPlainText } from '@react-email/render';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport { emailTheme } from './theme';\n\nexport const FLOPAY_EMAIL_LOGO_URL = 'https://flopay.com/logo.png';\n\nexport interface TransactionalEmailAction {\n label: string;\n href: string;\n}\n\nexport interface TransactionalCodeDetail {\n kind: 'code';\n value: string;\n caption?: string;\n}\n\nexport interface TransactionalKeyValueDetail {\n kind: 'keyValue';\n rows: { label: string; value: string }[];\n}\n\nexport type TransactionalEmailDetail = TransactionalCodeDetail | TransactionalKeyValueDetail;\n\nexport interface TransactionalFooter {\n companyName: string;\n supportLabel: string;\n supportUrl: string;\n privacyUrl: string;\n termsUrl: string;\n notice: string;\n address: string;\n}\n\nexport interface TransactionalEmailProps {\n preheader: string;\n heading: string;\n body: string[];\n action?: TransactionalEmailAction;\n detail?: TransactionalEmailDetail;\n logoUrl?: string;\n footer?: Partial<TransactionalFooter>;\n}\n\nexport interface RenderedTransactionalEmail {\n html: string;\n text: string;\n}\n\nconst DEFAULT_TRANSACTIONAL_FOOTER: TransactionalFooter = {\n companyName: 'FloPay LLC',\n supportLabel: 'hello@flopay.com',\n supportUrl: 'mailto:hello@flopay.com',\n privacyUrl: 'https://flopay.com/legal/privacy',\n termsUrl: 'https://flopay.com/legal/terms',\n notice: 'This is a service message about your FloPay account.',\n address: '',\n};\n\nconst FOOTER_TEXT_STYLE = {\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n lineHeight: '20px',\n margin: '0 0 12px',\n} as const;\n\nfunction Detail({ detail }: { detail: TransactionalEmailDetail }) {\n if (detail.kind === 'keyValue') {\n return (\n <table\n cellPadding=\"0\"\n cellSpacing=\"0\"\n className=\"email-detail\"\n data-key-value=\"true\"\n style={{\n backgroundColor: emailTheme.colors.background,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n width: '100%',\n }}\n >\n <tbody>\n {detail.rows.map((row, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; rows can repeat a label, so the index is the only unique part of the key\n <tr data-key-value-row=\"true\" key={`${index}-${row.label}`}>\n <th\n className=\"email-muted\"\n data-key-value-cell=\"true\"\n scope=\"row\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.textSecondary,\n fontSize: '14px',\n fontWeight: 600,\n padding: '12px 16px',\n verticalAlign: 'top',\n width: '36%',\n }}\n >\n {row.label}:\n </th>\n <td\n className=\"email-text\"\n data-key-value-cell=\"true\"\n style={{\n borderBottom:\n index < detail.rows.length - 1\n ? `1px solid ${emailTheme.colors.border}`\n : undefined,\n color: emailTheme.colors.text,\n fontSize: '14px',\n padding: '12px 16px',\n verticalAlign: 'top',\n wordBreak: 'break-word',\n }}\n >\n {' '}\n {row.value}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n\n return (\n <Section\n className=\"email-detail\"\n style={{\n backgroundColor: emailTheme.colors.muted,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n margin: '24px 0',\n padding: '20px',\n }}\n >\n {detail.caption ? (\n <Text\n className=\"email-muted\"\n style={{\n color: emailTheme.colors.textSecondary,\n fontSize: '13px',\n fontWeight: 600,\n lineHeight: '20px',\n margin: '0 0 8px',\n }}\n >\n {detail.caption}\n </Text>\n ) : null}\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontFamily: emailTheme.fontMono,\n fontSize: '24px',\n fontWeight: 700,\n letterSpacing: '0.12em',\n lineHeight: '32px',\n margin: 0,\n overflowWrap: 'anywhere',\n }}\n >\n {detail.value}\n </Text>\n </Section>\n );\n}\n\nfunction EmailFooter({ overrides }: { overrides?: Partial<TransactionalFooter> }) {\n const footer = { ...DEFAULT_TRANSACTIONAL_FOOTER, ...overrides };\n\n return (\n <Section style={{ marginTop: '32px' }}>\n <Hr\n className=\"email-divider\"\n style={{ borderColor: emailTheme.colors.border, margin: '0 0 24px' }}\n />\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.notice}\n </Text>\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n Need help?{' '}\n <Link\n className=\"email-link\"\n href={footer.supportUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n {footer.supportLabel}\n </Link>\n </Text>\n {footer.address ? (\n <Text className=\"email-muted\" style={FOOTER_TEXT_STYLE}>\n {footer.address}\n </Text>\n ) : null}\n <Text className=\"email-muted\" style={{ ...FOOTER_TEXT_STYLE, margin: 0 }}>\n © {new Date().getFullYear()} {footer.companyName}.{' '}\n <Link\n className=\"email-link\"\n href={footer.privacyUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Privacy\n </Link>{' '}\n ·{' '}\n <Link\n className=\"email-link\"\n href={footer.termsUrl}\n style={{ color: emailTheme.colors.accessibleLink, textDecoration: 'underline' }}\n >\n Terms\n </Link>\n </Text>\n </Section>\n );\n}\n\nfunction Brand({ logoUrl }: { logoUrl: string }) {\n return (\n <table cellPadding=\"0\" cellSpacing=\"0\" role=\"presentation\" style={{ marginBottom: '32px' }}>\n <tbody>\n <tr>\n <td style={{ verticalAlign: 'middle', width: '40px' }}>\n <Img\n alt=\"\"\n height=\"40\"\n src={logoUrl}\n style={{ borderRadius: emailTheme.radius }}\n width=\"40\"\n />\n </td>\n <td style={{ paddingLeft: '12px', verticalAlign: 'middle' }}>\n <Text\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '18px',\n fontWeight: 700,\n lineHeight: '24px',\n margin: 0,\n }}\n >\n FloPay\n </Text>\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n\nexport function TransactionalEmail({\n preheader,\n heading,\n body,\n action,\n detail,\n logoUrl = FLOPAY_EMAIL_LOGO_URL,\n footer,\n}: TransactionalEmailProps) {\n return (\n <Html lang=\"en\">\n <Head>\n <meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\" />\n <style>{`\n :root {\n color-scheme: light dark;\n supported-color-schemes: light dark;\n }\n\n @media only screen and (max-width: 620px) {\n .email-shell { padding: 0 !important; }\n .email-card { border-left: 0 !important; border-radius: 0 !important; border-right: 0 !important; margin: 0 !important; width: 100% !important; }\n .email-content { padding: 24px !important; }\n }\n\n @media (prefers-color-scheme: dark) {\n .email-body { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-shell { background-color: ${emailTheme.colors.darkBackground} !important; }\n .email-card { background-color: ${emailTheme.colors.darkSurface} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-text { color: ${emailTheme.colors.darkText} !important; }\n .email-muted { color: ${emailTheme.colors.darkTextSecondary} !important; }\n .email-detail { background-color: ${emailTheme.colors.darkMuted} !important; border-color: ${emailTheme.colors.darkBorder} !important; }\n .email-link { color: ${emailTheme.colors.brandLight} !important; }\n .email-action { background-color: ${emailTheme.colors.darkText} !important; color: ${emailTheme.colors.darkBackground} !important; }\n .email-divider { border-color: ${emailTheme.colors.darkBorder} !important; }\n }\n `}</style>\n </Head>\n <Preview>{preheader}</Preview>\n <Body\n className=\"email-body\"\n style={{\n backgroundColor: emailTheme.colors.background,\n margin: 0,\n padding: 0,\n }}\n >\n <Section\n className=\"email-shell\"\n style={{\n backgroundColor: emailTheme.colors.background,\n color: emailTheme.colors.text,\n fontFamily: emailTheme.font,\n padding: '32px 12px',\n width: '100%',\n }}\n >\n <Container\n className=\"email-card\"\n style={{\n backgroundColor: emailTheme.colors.surface,\n border: `1px solid ${emailTheme.colors.border}`,\n borderRadius: emailTheme.radius,\n borderTop: `4px solid ${emailTheme.colors.brand}`,\n margin: '0 auto',\n maxWidth: emailTheme.width,\n overflow: 'hidden',\n width: '100%',\n }}\n >\n <Section className=\"email-content\" style={{ padding: '40px' }}>\n <Brand logoUrl={logoUrl} />\n <Heading\n as=\"h1\"\n className=\"email-text\"\n style={{\n color: emailTheme.colors.text,\n fontSize: '28px',\n fontWeight: 700,\n letterSpacing: '-0.02em',\n lineHeight: '36px',\n margin: '0 0 16px',\n }}\n >\n {heading}\n </Heading>\n {body.map((paragraph, index) => (\n <Text\n className=\"email-text\"\n // biome-ignore lint/suspicious/noArrayIndexKey: static email render, serialised to HTML once and never reconciled; two paragraphs can be identical, so the index is the only unique part of the key\n key={`${index}-${paragraph}`}\n style={{\n color: emailTheme.colors.text,\n fontSize: '16px',\n lineHeight: '25px',\n margin: '0 0 16px',\n }}\n >\n {paragraph}\n </Text>\n ))}\n {detail ? <Detail detail={detail} /> : null}\n {action ? (\n <Button\n className=\"email-action\"\n href={action.href}\n style={{\n backgroundColor: emailTheme.colors.text,\n borderRadius: emailTheme.radius,\n color: emailTheme.colors.surface,\n fontSize: '16px',\n fontWeight: 700,\n lineHeight: '20px',\n marginTop: '8px',\n padding: '14px 24px',\n textDecoration: 'none',\n }}\n >\n {action.label}\n </Button>\n ) : null}\n <EmailFooter overrides={footer} />\n </Section>\n </Container>\n </Section>\n </Body>\n </Html>\n );\n}\n\nexport function renderTransactionalEmail(\n props: TransactionalEmailProps,\n): RenderedTransactionalEmail {\n const markup = renderToStaticMarkup(<TransactionalEmail {...props} />);\n const html = `<!doctype html>${markup.replace(\n /<link\\b(?=[^>]*\\brel=\"preload\")(?=[^>]*\\bas=\"image\")[^>]*\\/?>/gi,\n '',\n )}`;\n\n return {\n html,\n text: toPlainText(html, {\n selectors: [\n { selector: 'h1', options: { uppercase: false } },\n // @react-email/render 2.3 formats every td/th as its own block; keep a key-value row's\n // label and value together on one labelled line.\n { selector: 'th[data-key-value-cell=\"true\"]', format: 'inline' },\n { selector: 'td[data-key-value-cell=\"true\"]', format: 'inline' },\n {\n selector: 'tr[data-key-value-row=\"true\"]',\n format: 'block',\n options: { leadingLineBreaks: 1, trailingLineBreaks: 1 },\n },\n ],\n }),\n };\n}\n","{\n \"colors\": {\n \"light\": {\n \"background\": \"#f7f7f8\",\n \"surface\": \"#ffffff\",\n \"muted\": \"#f0f0f2\",\n \"border\": \"#e5e5e8\",\n \"text\": \"#0a0a0b\",\n \"textSecondary\": \"#52525b\",\n \"brand\": \"#1785e0\",\n \"brandLight\": \"#4ba6ec\"\n },\n \"dark\": {\n \"background\": \"#0a0a0b\",\n \"surface\": \"#141416\",\n \"muted\": \"#1c1c1f\",\n \"border\": \"#27272a\",\n \"text\": \"#fafafa\",\n \"textSecondary\": \"#a1a1aa\"\n }\n },\n \"radius\": \"8px\"\n}\n","import designTokens from '../../design-tokens.json';\n\nconst { dark, light } = designTokens.colors;\n\n/** Email clients need inline values; email-only choices remain local here. */\nexport const emailTheme = {\n colors: {\n ...light,\n accessibleLink: '#0969b3',\n darkBackground: dark.background,\n darkSurface: dark.surface,\n darkMuted: dark.muted,\n darkBorder: dark.border,\n darkText: dark.text,\n darkTextSecondary: dark.textSecondary,\n },\n radius: designTokens.radius,\n font: 'Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif',\n fontMono: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n width: '600px',\n} as const;\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,4BAA4B;;;ACfrC;AAAA,EACE,QAAU;A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IACF;AAAA,KACF;AAEJ;AAEO,SAAS,yBACd,OAC4B;AAC5B,QAAM,SAAS,qBAAqB,oBAAC,sBAAoB,GAAG,OAAO,CAAE;AACrE,QAAM,OAAO,kBAAkB,OAAO;AAAA,IACpC;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA,MAAM,YAAY,MAAM;AAAA,MACtB,WAAW;AAAA,QACT,EAAE,UAAU,MAAM,SAAS,EAAE,WAAW,MAAM,EAAE;AAAA;AAAA;AAAA,QAGhD,EAAE,UAAU,kCAAkC,QAAQ,SAAS;AAAA,QAC/D,EAAE,UAAU,kCAAkC,QAAQ,SAAS;AAAA,QAC/D;AAAA,UACE,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,SAAS,EAAE,mBAAmB,GAAG,oBAAoB,EAAE;AAAA,QACzD;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ClassValue } from "clsx";
|
|
2
2
|
import { ButtonHTMLAttributes, ChangeEventHandler, ComponentType, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactNode, Ref, RefObject } from "react";
|
|
3
|
-
//#region dist/.types/cn.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Merge class names, resolving conflicting Tailwind utilities (last wins).
|
|
6
5
|
* Mirrors the helper used across the FloPay frontends so consumers can extend
|
|
7
6
|
* any primitive's classes safely.
|
|
8
7
|
*/
|
|
9
8
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region dist/.types/components/badge.d.ts
|
|
12
9
|
type BadgeVariant = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
13
10
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
14
11
|
/** Render a leading status dot. */
|
|
@@ -18,8 +15,6 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
18
15
|
}
|
|
19
16
|
/** Pill badge — neutral by default, or a semantic variant, optionally with a dot. */
|
|
20
17
|
export declare function Badge({ dot, variant, className, children, ...props }: BadgeProps): import("react").JSX.Element;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region dist/.types/components/block-list.d.ts
|
|
23
18
|
interface BlockListItem {
|
|
24
19
|
id: string;
|
|
25
20
|
/** A locked item never moves, has no handle or controls, and nothing moves past it. */
|
|
@@ -52,8 +47,6 @@ interface BlockListProps<T extends BlockListItem = BlockListItem> {
|
|
|
52
47
|
* when focus was lost to `<body>` or left on a disabled button, never when it went elsewhere.
|
|
53
48
|
*/
|
|
54
49
|
export declare function BlockList<T extends BlockListItem>({ items, renderItem, onChange, className }: BlockListProps<T>): import("react").JSX.Element;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region dist/.types/components/button.d.ts
|
|
57
50
|
type ButtonVariant = 'primary' | 'secondary' | 'outline';
|
|
58
51
|
type ButtonSize = 'md' | 'sm';
|
|
59
52
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -61,8 +54,6 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
61
54
|
size?: ButtonSize;
|
|
62
55
|
}
|
|
63
56
|
export declare function Button({ variant, size, className, type, ...props }: ButtonProps): import("react").JSX.Element;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region dist/.types/components/card.d.ts
|
|
66
57
|
type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
67
58
|
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
68
59
|
/** Inner padding. Defaults to `md` (28px); use `none` to supply your own. */
|
|
@@ -72,8 +63,6 @@ interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
72
63
|
}
|
|
73
64
|
/** Bordered surface card. Static by default; opt into hover with `interactive`. */
|
|
74
65
|
export declare function Card({ padding, interactive, className, ...props }: CardProps): import("react").JSX.Element;
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region dist/.types/components/checklist.d.ts
|
|
77
66
|
interface ChecklistProps {
|
|
78
67
|
/** The `ChecklistRow`s (or any list items) of the list. */
|
|
79
68
|
children?: ReactNode;
|
|
@@ -125,8 +114,6 @@ export declare function ChecklistRow({ label, done, status, optional, href, link
|
|
|
125
114
|
* hidden from assistive tech.
|
|
126
115
|
*/
|
|
127
116
|
export declare function ChecklistSkeleton({ rows, className }: ChecklistSkeletonProps): import("react").JSX.Element;
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region dist/.types/components/code-area.d.ts
|
|
130
117
|
interface CodeAreaProps {
|
|
131
118
|
label: ReactNode;
|
|
132
119
|
hint?: ReactNode;
|
|
@@ -146,8 +133,6 @@ interface CodeAreaProps {
|
|
|
146
133
|
* job of moving focus, so the field never traps keyboard users.
|
|
147
134
|
*/
|
|
148
135
|
export declare function CodeArea({ label, hint, error, value, defaultValue, onChange, ref, id, name, className }: CodeAreaProps): import("react").JSX.Element;
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region dist/.types/components/confirm-dialog.d.ts
|
|
151
136
|
interface ConfirmDialogProps {
|
|
152
137
|
open: boolean;
|
|
153
138
|
title: ReactNode;
|
|
@@ -173,13 +158,9 @@ interface ConfirmDialogProps {
|
|
|
173
158
|
* `confirmLabel` and `cancelLabel` have no defaults.
|
|
174
159
|
*/
|
|
175
160
|
export declare function ConfirmDialog({ open, ...props }: ConfirmDialogProps): import("react").JSX.Element | null;
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region dist/.types/components/container.d.ts
|
|
178
161
|
type ContainerProps = HTMLAttributes<HTMLDivElement>;
|
|
179
162
|
/** Centered, max-width content wrapper (var(--max-w)) with horizontal padding. */
|
|
180
163
|
export declare function Container({ className, ...props }: ContainerProps): import("react").JSX.Element;
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region dist/.types/components/feedback.d.ts
|
|
183
164
|
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
184
165
|
/** Wrap in a centered, padded block (for loading states in a panel). */
|
|
185
166
|
center?: boolean;
|
|
@@ -195,8 +176,6 @@ interface EmptyStateProps {
|
|
|
195
176
|
}
|
|
196
177
|
/** Centered "nothing here yet" placeholder for empty lists/tables. */
|
|
197
178
|
export declare function EmptyState({ title, description, icon, className }: EmptyStateProps): import("react").JSX.Element;
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region dist/.types/components/field.d.ts
|
|
200
179
|
type InputProps = InputHTMLAttributes<HTMLInputElement>;
|
|
201
180
|
/** Token-aligned text input (the `.field` look: border, surface, brand focus ring). */
|
|
202
181
|
export declare function Input({ className, ...props }: InputProps): import("react").JSX.Element;
|
|
@@ -215,8 +194,6 @@ interface FieldProps {
|
|
|
215
194
|
}
|
|
216
195
|
/** Labelled field wrapper: optional label above and hint/error below the control. */
|
|
217
196
|
export declare function Field({ label, hint, error, htmlFor, className, children }: FieldProps): import("react").JSX.Element;
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region dist/.types/components/preview-frame.d.ts
|
|
220
197
|
interface PreviewFrameProps {
|
|
221
198
|
/** HTML shown inside the isolated frame. */
|
|
222
199
|
html: string;
|
|
@@ -231,8 +208,6 @@ interface PreviewFrameProps {
|
|
|
231
208
|
* `className` on the container; the frame fills it.
|
|
232
209
|
*/
|
|
233
210
|
export declare function PreviewFrame({ html, title, className }: PreviewFrameProps): import("react").JSX.Element;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region dist/.types/components/section.d.ts
|
|
236
211
|
type SectionProps = HTMLAttributes<HTMLElement>;
|
|
237
212
|
/** Vertical page section with max-width and standard padding. */
|
|
238
213
|
export declare function Section({ className, ...props }: SectionProps): import("react").JSX.Element;
|
|
@@ -245,8 +220,6 @@ interface SectionHeaderProps {
|
|
|
245
220
|
}
|
|
246
221
|
/** Centered section heading: optional label, title, optional description. */
|
|
247
222
|
export declare function SectionHeader({ label, title, description, className }: SectionHeaderProps): import("react").JSX.Element;
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region dist/.types/components/select.d.ts
|
|
250
223
|
interface SelectOption {
|
|
251
224
|
value: string;
|
|
252
225
|
label: string;
|
|
@@ -268,8 +241,6 @@ interface SelectProps {
|
|
|
268
241
|
* a native control, so keyboard operation and the platform chevron come from the browser.
|
|
269
242
|
*/
|
|
270
243
|
export declare function Select({ id, label, value, options, onChange, disabled, name }: SelectProps): import("react").JSX.Element;
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region dist/.types/components/slot-text-field.d.ts
|
|
273
244
|
interface SlotTextFieldProps {
|
|
274
245
|
label: ReactNode;
|
|
275
246
|
/** Helper text (hidden when `error` is set), as in `Field`. */
|
|
@@ -293,8 +264,6 @@ interface SlotTextFieldProps {
|
|
|
293
264
|
* `onChange` unchanged, and toolbar edits fire `onChange` too, so controlled parents stay in sync.
|
|
294
265
|
*/
|
|
295
266
|
export declare function SlotTextField({ label, hint, error, multiline, value, defaultValue, onChange, ref, id, name, className }: SlotTextFieldProps): import("react").JSX.Element;
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region dist/.types/components/step-indicator.d.ts
|
|
298
267
|
type StepStatus = 'done' | 'current' | 'upcoming';
|
|
299
268
|
interface StepIndicatorStep {
|
|
300
269
|
label: ReactNode;
|
|
@@ -314,8 +283,6 @@ interface StepIndicatorProps {
|
|
|
314
283
|
* "Current", "Upcoming", or `statusLabels`), so the state is never conveyed by colour alone.
|
|
315
284
|
*/
|
|
316
285
|
export declare function StepIndicator({ steps, statusLabels, className }: StepIndicatorProps): import("react").JSX.Element;
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region dist/.types/components/switch.d.ts
|
|
319
286
|
interface SwitchProps {
|
|
320
287
|
/** Accessible name of the switch. Always rendered; `labelHidden` only hides it visually. */
|
|
321
288
|
label: ReactNode;
|
|
@@ -339,8 +306,6 @@ interface SwitchProps {
|
|
|
339
306
|
* checkbox, a disabled switch submits nothing.
|
|
340
307
|
*/
|
|
341
308
|
export declare function Switch({ label, labelHidden, checked, defaultChecked, onCheckedChange, disabled, loading, id, name, className }: SwitchProps): import("react").JSX.Element;
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region dist/.types/components/variable-picker.d.ts
|
|
344
309
|
interface VariablePickerProps {
|
|
345
310
|
variables: ReadonlyArray<{
|
|
346
311
|
name: string;
|
|
@@ -357,5 +322,4 @@ interface VariablePickerProps {
|
|
|
357
322
|
* the cursor after the token. The variable list is a prop; the picker fetches nothing.
|
|
358
323
|
*/
|
|
359
324
|
export declare function VariablePicker({ variables, targetRef, className }: VariablePickerProps): import("react").JSX.Element;
|
|
360
|
-
//#endregion
|
|
361
325
|
export type { BadgeProps, BadgeVariant, BlockListItem, BlockListProps, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, ChecklistProps, ChecklistRowProps, ChecklistSkeletonProps, CodeAreaProps, ConfirmDialogProps, ContainerProps, EmptyStateProps, FieldProps, InputProps, LabelProps, PreviewFrameProps, SectionHeaderProps, SectionProps, SelectOption, SelectProps, SlotTextFieldProps, SpinnerProps, StepIndicatorProps, StepIndicatorStep, StepStatus, SwitchProps, VariablePickerProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ClassValue } from "clsx";
|
|
2
2
|
import { ButtonHTMLAttributes, ChangeEventHandler, ComponentType, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactNode, Ref, RefObject } from "react";
|
|
3
|
-
//#region dist/.types/cn.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Merge class names, resolving conflicting Tailwind utilities (last wins).
|
|
6
5
|
* Mirrors the helper used across the FloPay frontends so consumers can extend
|
|
7
6
|
* any primitive's classes safely.
|
|
8
7
|
*/
|
|
9
8
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region dist/.types/components/badge.d.ts
|
|
12
9
|
type BadgeVariant = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
13
10
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
14
11
|
/** Render a leading status dot. */
|
|
@@ -18,8 +15,6 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
18
15
|
}
|
|
19
16
|
/** Pill badge — neutral by default, or a semantic variant, optionally with a dot. */
|
|
20
17
|
export declare function Badge({ dot, variant, className, children, ...props }: BadgeProps): import("react").JSX.Element;
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region dist/.types/components/block-list.d.ts
|
|
23
18
|
interface BlockListItem {
|
|
24
19
|
id: string;
|
|
25
20
|
/** A locked item never moves, has no handle or controls, and nothing moves past it. */
|
|
@@ -52,8 +47,6 @@ interface BlockListProps<T extends BlockListItem = BlockListItem> {
|
|
|
52
47
|
* when focus was lost to `<body>` or left on a disabled button, never when it went elsewhere.
|
|
53
48
|
*/
|
|
54
49
|
export declare function BlockList<T extends BlockListItem>({ items, renderItem, onChange, className }: BlockListProps<T>): import("react").JSX.Element;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region dist/.types/components/button.d.ts
|
|
57
50
|
type ButtonVariant = 'primary' | 'secondary' | 'outline';
|
|
58
51
|
type ButtonSize = 'md' | 'sm';
|
|
59
52
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -61,8 +54,6 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
61
54
|
size?: ButtonSize;
|
|
62
55
|
}
|
|
63
56
|
export declare function Button({ variant, size, className, type, ...props }: ButtonProps): import("react").JSX.Element;
|
|
64
|
-
//#endregion
|
|
65
|
-
//#region dist/.types/components/card.d.ts
|
|
66
57
|
type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
67
58
|
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
68
59
|
/** Inner padding. Defaults to `md` (28px); use `none` to supply your own. */
|
|
@@ -72,8 +63,6 @@ interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
72
63
|
}
|
|
73
64
|
/** Bordered surface card. Static by default; opt into hover with `interactive`. */
|
|
74
65
|
export declare function Card({ padding, interactive, className, ...props }: CardProps): import("react").JSX.Element;
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region dist/.types/components/checklist.d.ts
|
|
77
66
|
interface ChecklistProps {
|
|
78
67
|
/** The `ChecklistRow`s (or any list items) of the list. */
|
|
79
68
|
children?: ReactNode;
|
|
@@ -125,8 +114,6 @@ export declare function ChecklistRow({ label, done, status, optional, href, link
|
|
|
125
114
|
* hidden from assistive tech.
|
|
126
115
|
*/
|
|
127
116
|
export declare function ChecklistSkeleton({ rows, className }: ChecklistSkeletonProps): import("react").JSX.Element;
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region dist/.types/components/code-area.d.ts
|
|
130
117
|
interface CodeAreaProps {
|
|
131
118
|
label: ReactNode;
|
|
132
119
|
hint?: ReactNode;
|
|
@@ -146,8 +133,6 @@ interface CodeAreaProps {
|
|
|
146
133
|
* job of moving focus, so the field never traps keyboard users.
|
|
147
134
|
*/
|
|
148
135
|
export declare function CodeArea({ label, hint, error, value, defaultValue, onChange, ref, id, name, className }: CodeAreaProps): import("react").JSX.Element;
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region dist/.types/components/confirm-dialog.d.ts
|
|
151
136
|
interface ConfirmDialogProps {
|
|
152
137
|
open: boolean;
|
|
153
138
|
title: ReactNode;
|
|
@@ -173,13 +158,9 @@ interface ConfirmDialogProps {
|
|
|
173
158
|
* `confirmLabel` and `cancelLabel` have no defaults.
|
|
174
159
|
*/
|
|
175
160
|
export declare function ConfirmDialog({ open, ...props }: ConfirmDialogProps): import("react").JSX.Element | null;
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region dist/.types/components/container.d.ts
|
|
178
161
|
type ContainerProps = HTMLAttributes<HTMLDivElement>;
|
|
179
162
|
/** Centered, max-width content wrapper (var(--max-w)) with horizontal padding. */
|
|
180
163
|
export declare function Container({ className, ...props }: ContainerProps): import("react").JSX.Element;
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region dist/.types/components/feedback.d.ts
|
|
183
164
|
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
184
165
|
/** Wrap in a centered, padded block (for loading states in a panel). */
|
|
185
166
|
center?: boolean;
|
|
@@ -195,8 +176,6 @@ interface EmptyStateProps {
|
|
|
195
176
|
}
|
|
196
177
|
/** Centered "nothing here yet" placeholder for empty lists/tables. */
|
|
197
178
|
export declare function EmptyState({ title, description, icon, className }: EmptyStateProps): import("react").JSX.Element;
|
|
198
|
-
//#endregion
|
|
199
|
-
//#region dist/.types/components/field.d.ts
|
|
200
179
|
type InputProps = InputHTMLAttributes<HTMLInputElement>;
|
|
201
180
|
/** Token-aligned text input (the `.field` look: border, surface, brand focus ring). */
|
|
202
181
|
export declare function Input({ className, ...props }: InputProps): import("react").JSX.Element;
|
|
@@ -215,8 +194,6 @@ interface FieldProps {
|
|
|
215
194
|
}
|
|
216
195
|
/** Labelled field wrapper: optional label above and hint/error below the control. */
|
|
217
196
|
export declare function Field({ label, hint, error, htmlFor, className, children }: FieldProps): import("react").JSX.Element;
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region dist/.types/components/preview-frame.d.ts
|
|
220
197
|
interface PreviewFrameProps {
|
|
221
198
|
/** HTML shown inside the isolated frame. */
|
|
222
199
|
html: string;
|
|
@@ -231,8 +208,6 @@ interface PreviewFrameProps {
|
|
|
231
208
|
* `className` on the container; the frame fills it.
|
|
232
209
|
*/
|
|
233
210
|
export declare function PreviewFrame({ html, title, className }: PreviewFrameProps): import("react").JSX.Element;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region dist/.types/components/section.d.ts
|
|
236
211
|
type SectionProps = HTMLAttributes<HTMLElement>;
|
|
237
212
|
/** Vertical page section with max-width and standard padding. */
|
|
238
213
|
export declare function Section({ className, ...props }: SectionProps): import("react").JSX.Element;
|
|
@@ -245,8 +220,6 @@ interface SectionHeaderProps {
|
|
|
245
220
|
}
|
|
246
221
|
/** Centered section heading: optional label, title, optional description. */
|
|
247
222
|
export declare function SectionHeader({ label, title, description, className }: SectionHeaderProps): import("react").JSX.Element;
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region dist/.types/components/select.d.ts
|
|
250
223
|
interface SelectOption {
|
|
251
224
|
value: string;
|
|
252
225
|
label: string;
|
|
@@ -268,8 +241,6 @@ interface SelectProps {
|
|
|
268
241
|
* a native control, so keyboard operation and the platform chevron come from the browser.
|
|
269
242
|
*/
|
|
270
243
|
export declare function Select({ id, label, value, options, onChange, disabled, name }: SelectProps): import("react").JSX.Element;
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region dist/.types/components/slot-text-field.d.ts
|
|
273
244
|
interface SlotTextFieldProps {
|
|
274
245
|
label: ReactNode;
|
|
275
246
|
/** Helper text (hidden when `error` is set), as in `Field`. */
|
|
@@ -293,8 +264,6 @@ interface SlotTextFieldProps {
|
|
|
293
264
|
* `onChange` unchanged, and toolbar edits fire `onChange` too, so controlled parents stay in sync.
|
|
294
265
|
*/
|
|
295
266
|
export declare function SlotTextField({ label, hint, error, multiline, value, defaultValue, onChange, ref, id, name, className }: SlotTextFieldProps): import("react").JSX.Element;
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region dist/.types/components/step-indicator.d.ts
|
|
298
267
|
type StepStatus = 'done' | 'current' | 'upcoming';
|
|
299
268
|
interface StepIndicatorStep {
|
|
300
269
|
label: ReactNode;
|
|
@@ -314,8 +283,6 @@ interface StepIndicatorProps {
|
|
|
314
283
|
* "Current", "Upcoming", or `statusLabels`), so the state is never conveyed by colour alone.
|
|
315
284
|
*/
|
|
316
285
|
export declare function StepIndicator({ steps, statusLabels, className }: StepIndicatorProps): import("react").JSX.Element;
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region dist/.types/components/switch.d.ts
|
|
319
286
|
interface SwitchProps {
|
|
320
287
|
/** Accessible name of the switch. Always rendered; `labelHidden` only hides it visually. */
|
|
321
288
|
label: ReactNode;
|
|
@@ -339,8 +306,6 @@ interface SwitchProps {
|
|
|
339
306
|
* checkbox, a disabled switch submits nothing.
|
|
340
307
|
*/
|
|
341
308
|
export declare function Switch({ label, labelHidden, checked, defaultChecked, onCheckedChange, disabled, loading, id, name, className }: SwitchProps): import("react").JSX.Element;
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region dist/.types/components/variable-picker.d.ts
|
|
344
309
|
interface VariablePickerProps {
|
|
345
310
|
variables: ReadonlyArray<{
|
|
346
311
|
name: string;
|
|
@@ -357,5 +322,4 @@ interface VariablePickerProps {
|
|
|
357
322
|
* the cursor after the token. The variable list is a prop; the picker fetches nothing.
|
|
358
323
|
*/
|
|
359
324
|
export declare function VariablePicker({ variables, targetRef, className }: VariablePickerProps): import("react").JSX.Element;
|
|
360
|
-
//#endregion
|
|
361
325
|
export type { BadgeProps, BadgeVariant, BlockListItem, BlockListProps, ButtonProps, ButtonSize, ButtonVariant, CardPadding, CardProps, ChecklistProps, ChecklistRowProps, ChecklistSkeletonProps, CodeAreaProps, ConfirmDialogProps, ContainerProps, EmptyStateProps, FieldProps, InputProps, LabelProps, PreviewFrameProps, SectionHeaderProps, SectionProps, SelectOption, SelectProps, SlotTextFieldProps, SpinnerProps, StepIndicatorProps, StepIndicatorStep, StepStatus, SwitchProps, VariablePickerProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { ImageProps } from "next/image";
|
|
3
|
-
//#region dist/.types/marketing/footer.d.ts
|
|
4
3
|
interface FooterLink {
|
|
5
4
|
href: string;
|
|
6
5
|
label: ReactNode;
|
|
@@ -29,8 +28,6 @@ interface FooterProps {
|
|
|
29
28
|
}
|
|
30
29
|
/** Shared site footer for marketing surfaces (landing, demo). */
|
|
31
30
|
export declare function Footer({ brand, columns, legal, copyright, className }: FooterProps): import("react").JSX.Element;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region dist/.types/marketing/flopay-footer.d.ts
|
|
34
31
|
interface FlopayFooterOptions {
|
|
35
32
|
/**
|
|
36
33
|
* Origin for marketing-site routes, e.g. `https://flopay.com`. Leave unset on
|
|
@@ -74,8 +71,6 @@ interface FlopayFooterProps extends FlopayFooterOptions {
|
|
|
74
71
|
* ```
|
|
75
72
|
*/
|
|
76
73
|
export declare function FlopayFooter({ logo, brand, className, ...options }: FlopayFooterProps): import("react").JSX.Element;
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region dist/.types/marketing/link.d.ts
|
|
79
74
|
interface MarketingLinkProps {
|
|
80
75
|
href: string;
|
|
81
76
|
/** Force new-tab rendering. Defaults to true for absolute http(s) URLs. */
|
|
@@ -90,8 +85,6 @@ interface MarketingLinkProps {
|
|
|
90
85
|
* - absolute URL (or `external`) → new-tab anchor
|
|
91
86
|
*/
|
|
92
87
|
export declare function MarketingLink({ href, external, className, children }: MarketingLinkProps): import("react").JSX.Element;
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region dist/.types/marketing/nav.d.ts
|
|
95
88
|
interface NavLink {
|
|
96
89
|
href: string;
|
|
97
90
|
label: ReactNode;
|
|
@@ -119,5 +112,4 @@ interface NavProps {
|
|
|
119
112
|
}
|
|
120
113
|
/** Shared fixed top navigation for marketing surfaces (landing, demo). */
|
|
121
114
|
export declare function Nav({ logo, links, children, className }: NavProps): import("react").JSX.Element;
|
|
122
|
-
//#endregion
|
|
123
115
|
export type { FlopayFooterContent, FlopayFooterOptions, FlopayFooterProps, FooterBrand, FooterColumn, FooterLink, FooterProps, MarketingLinkProps, NavLink, NavLogo, NavProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { ImageProps } from "next/image";
|
|
3
|
-
//#region dist/.types/marketing/footer.d.ts
|
|
4
3
|
interface FooterLink {
|
|
5
4
|
href: string;
|
|
6
5
|
label: ReactNode;
|
|
@@ -29,8 +28,6 @@ interface FooterProps {
|
|
|
29
28
|
}
|
|
30
29
|
/** Shared site footer for marketing surfaces (landing, demo). */
|
|
31
30
|
export declare function Footer({ brand, columns, legal, copyright, className }: FooterProps): import("react").JSX.Element;
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region dist/.types/marketing/flopay-footer.d.ts
|
|
34
31
|
interface FlopayFooterOptions {
|
|
35
32
|
/**
|
|
36
33
|
* Origin for marketing-site routes, e.g. `https://flopay.com`. Leave unset on
|
|
@@ -74,8 +71,6 @@ interface FlopayFooterProps extends FlopayFooterOptions {
|
|
|
74
71
|
* ```
|
|
75
72
|
*/
|
|
76
73
|
export declare function FlopayFooter({ logo, brand, className, ...options }: FlopayFooterProps): import("react").JSX.Element;
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region dist/.types/marketing/link.d.ts
|
|
79
74
|
interface MarketingLinkProps {
|
|
80
75
|
href: string;
|
|
81
76
|
/** Force new-tab rendering. Defaults to true for absolute http(s) URLs. */
|
|
@@ -90,8 +85,6 @@ interface MarketingLinkProps {
|
|
|
90
85
|
* - absolute URL (or `external`) → new-tab anchor
|
|
91
86
|
*/
|
|
92
87
|
export declare function MarketingLink({ href, external, className, children }: MarketingLinkProps): import("react").JSX.Element;
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region dist/.types/marketing/nav.d.ts
|
|
95
88
|
interface NavLink {
|
|
96
89
|
href: string;
|
|
97
90
|
label: ReactNode;
|
|
@@ -119,5 +112,4 @@ interface NavProps {
|
|
|
119
112
|
}
|
|
120
113
|
/** Shared fixed top navigation for marketing surfaces (landing, demo). */
|
|
121
114
|
export declare function Nav({ logo, links, children, className }: NavProps): import("react").JSX.Element;
|
|
122
|
-
//#endregion
|
|
123
115
|
export type { FlopayFooterContent, FlopayFooterOptions, FlopayFooterProps, FooterBrand, FooterColumn, FooterLink, FooterProps, MarketingLinkProps, NavLink, NavLogo, NavProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flopay/ui",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "FloPay shared design system — design tokens, a Tailwind v4 preset, and React primitives shared across landing, demo, docs, and dashboard.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -66,30 +66,30 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@react-email/components": "^1.0.12",
|
|
69
|
-
"@react-email/render": "2.
|
|
69
|
+
"@react-email/render": "2.3.1",
|
|
70
70
|
"clsx": "^2.1.1",
|
|
71
71
|
"tailwind-merge": "^3.7.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@biomejs/biome": "2.6.
|
|
74
|
+
"@biomejs/biome": "2.6.7",
|
|
75
75
|
"@juicyllama/repo": "2.0.2",
|
|
76
76
|
"@testing-library/dom": "^10.4.2",
|
|
77
77
|
"@testing-library/react": "^16.3.3",
|
|
78
|
-
"@testing-library/user-event": "^14.6.
|
|
78
|
+
"@testing-library/user-event": "^14.6.10",
|
|
79
79
|
"@types/node": "26.6.6",
|
|
80
80
|
"@types/react": "19.3.0",
|
|
81
81
|
"@types/react-dom": "19.3.0",
|
|
82
82
|
"husky": "^9.1.7",
|
|
83
83
|
"jsdom": "^30.1.3",
|
|
84
|
-
"knip": "6.
|
|
85
|
-
"next": "16.4.
|
|
84
|
+
"knip": "6.45.1",
|
|
85
|
+
"next": "16.4.6",
|
|
86
86
|
"react": "19.3.1",
|
|
87
87
|
"react-dom": "19.3.1",
|
|
88
|
-
"rolldown": "1.2
|
|
89
|
-
"rolldown-plugin-dts": "0.30.
|
|
88
|
+
"rolldown": "1.3.2",
|
|
89
|
+
"rolldown-plugin-dts": "0.30.2",
|
|
90
90
|
"tsup": "^9.0.0",
|
|
91
91
|
"typescript": "^7.0.2",
|
|
92
|
-
"vitest": "5.0
|
|
92
|
+
"vitest": "5.1.0"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"build": "tsup && tsc -p tsconfig.build.json && node scripts/build-dts.mjs",
|