@nxavis/pdf 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,180 @@
1
+ # @nxavis/pdf
2
+
3
+ React PDF component library — 30+ composable components, theme system, and templates built on `@react-pdf/renderer`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @nxavis/pdf @react-pdf/renderer react
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```tsx
14
+ import { Document, Page, pdf } from '@react-pdf/renderer';
15
+ import {
16
+ PdfxThemeProvider,
17
+ Heading,
18
+ Text,
19
+ Stack,
20
+ Table,
21
+ TableHeader,
22
+ TableBody,
23
+ TableRow,
24
+ TableCell,
25
+ professionalTheme,
26
+ } from '@nxavis/pdf';
27
+
28
+ function MyReport() {
29
+ return (
30
+ <Document>
31
+ <Page size="A4" style={{ padding: 40 }}>
32
+ <PdfxThemeProvider theme={professionalTheme}>
33
+ <Heading level={1}>Monthly Report</Heading>
34
+ <Text>Generated on {new Date().toLocaleDateString()}</Text>
35
+ <Stack gap="md" direction="column">
36
+ <Table>
37
+ <TableHeader>
38
+ <TableRow>
39
+ <TableCell>Item</TableCell>
40
+ <TableCell>Amount</TableCell>
41
+ </TableRow>
42
+ </TableHeader>
43
+ <TableBody>
44
+ <TableRow>
45
+ <TableCell>AWS</TableCell>
46
+ <TableCell>$1,234</TableCell>
47
+ </TableRow>
48
+ </TableBody>
49
+ </Table>
50
+ </Stack>
51
+ </PdfxThemeProvider>
52
+ </Page>
53
+ </Document>
54
+ );
55
+ }
56
+
57
+ // Generate PDF blob
58
+ const blob = await pdf(<MyReport />).toBlob();
59
+ ```
60
+
61
+ ## Components (30+)
62
+
63
+ | Category | Components |
64
+ |----------|-----------|
65
+ | Text | `Heading`, `Text`, `Link` |
66
+ | Layout | `Stack`, `Section`, `PageHeader`, `PageFooter` |
67
+ | Tables | `Table`, `DataTable`, `KeyValue` |
68
+ | Visual | `Badge`, `Card`, `Divider`, `Alert`, `PdfImage`, `Watermark` |
69
+ | Data | `PdfList`, `PdfGraph` (bar/line/area/pie/donut), `PdfQRCode` |
70
+ | Forms | `PdfForm`, `PdfSignatureBlock` |
71
+ | Utility | `PageBreak`, `PdfPageNumber`, `KeepTogether` |
72
+
73
+ ## Templates
74
+
75
+ ```tsx
76
+ import { InvoiceTemplate, ResumeTemplate } from '@nxavis/pdf';
77
+
78
+ // Invoice with 3 variants: classic, modern, minimal
79
+ <InvoiceTemplate variant="modern" company={...} client={...} items={...} />
80
+
81
+ // Resume with 3 variants: professional, modern, minimal
82
+ <ResumeTemplate variant="professional" personal={...} experience={...} />
83
+ ```
84
+
85
+ ## Tailwind CSS
86
+
87
+ `tw()` 유틸로 Tailwind 클래스를 react-pdf 스타일로 변환합니다. 테마 색상이 자동 매핑됩니다.
88
+
89
+ ```tsx
90
+ import { Document, Page, View, Text } from '@react-pdf/renderer';
91
+ import { tw } from '@nxavis/pdf';
92
+
93
+ function Report() {
94
+ return (
95
+ <Document>
96
+ <Page size="A4" style={tw("p-12 font-body")}>
97
+ <View style={tw("flex-row justify-between items-center mb-8")}>
98
+ <Text style={tw("text-3xl font-bold text-primary")}>NXAVIS</Text>
99
+ <Text style={tw("text-sm text-muted-foreground")}>2026-03-17</Text>
100
+ </View>
101
+
102
+ <View style={tw("p-6 bg-muted rounded-lg mb-4")}>
103
+ <Text style={tw("text-lg font-bold mb-2")}>Monthly Summary</Text>
104
+ <Text style={tw("text-foreground")}>Total: $12,345.00</Text>
105
+ </View>
106
+
107
+ <View style={tw("flex-row gap-4")}>
108
+ <View style={tw("flex-1 p-4 border border-border rounded")}>
109
+ <Text style={tw("text-xs text-muted-foreground")}>AWS</Text>
110
+ <Text style={tw("text-xl font-bold text-info")}>$8,200</Text>
111
+ </View>
112
+ <View style={tw("flex-1 p-4 border border-border rounded")}>
113
+ <Text style={tw("text-xs text-muted-foreground")}>GCP</Text>
114
+ <Text style={tw("text-xl font-bold text-success")}>$4,145</Text>
115
+ </View>
116
+ </View>
117
+ </Page>
118
+ </Document>
119
+ );
120
+ }
121
+ ```
122
+
123
+ ### Custom Theme Tailwind
124
+
125
+ ```tsx
126
+ import { createThemeTw, modernTheme } from '@nxavis/pdf';
127
+
128
+ // modernTheme 색상이 매핑된 tw()
129
+ const tw = createThemeTw(modernTheme);
130
+
131
+ <Text style={tw("text-primary font-heading text-2xl")}>Modern Style</Text>
132
+ ```
133
+
134
+ ### 사용 가능한 테마 색상 클래스
135
+
136
+ | 클래스 | 테마 토큰 |
137
+ |--------|----------|
138
+ | `text-foreground`, `bg-foreground` | colors.foreground |
139
+ | `text-background`, `bg-background` | colors.background |
140
+ | `text-muted`, `bg-muted` | colors.muted |
141
+ | `text-muted-foreground` | colors.mutedForeground |
142
+ | `text-primary`, `bg-primary` | colors.primary |
143
+ | `text-primary-foreground` | colors.primaryForeground |
144
+ | `border-border` | colors.border |
145
+ | `text-accent`, `bg-accent` | colors.accent |
146
+ | `text-destructive` | colors.destructive |
147
+ | `text-success` | colors.success |
148
+ | `text-warning` | colors.warning |
149
+ | `text-info` | colors.info |
150
+ | `font-body` | typography.body.fontFamily |
151
+ | `font-heading` | typography.heading.fontFamily |
152
+
153
+ ### 컴포넌트 + Tailwind 혼합
154
+
155
+ ```tsx
156
+ // 컴포넌트의 style prop에 tw() 전달 가능
157
+ <Heading level={2} style={tw("mb-8 text-primary")}>Section Title</Heading>
158
+ <Badge variant="success" style={tw("mr-2")}>Active</Badge>
159
+ <Stack gap="md" style={tw("p-4 bg-muted rounded-lg")}>
160
+ <Text>Content</Text>
161
+ </Stack>
162
+ ```
163
+
164
+ ## Theme System
165
+
166
+ Three built-in presets + custom themes:
167
+
168
+ ```tsx
169
+ import { professionalTheme, modernTheme, minimalTheme } from '@nxavis/pdf/themes';
170
+
171
+ // Or create custom
172
+ const customTheme = {
173
+ ...professionalTheme,
174
+ colors: { ...professionalTheme.colors, primary: '#0066cc' },
175
+ };
176
+ ```
177
+
178
+ ## License
179
+
180
+ MIT
@@ -0,0 +1,226 @@
1
+ // src/themes/primitives.ts
2
+ var defaultPrimitives = {
3
+ typography: {
4
+ xs: 10,
5
+ sm: 12,
6
+ base: 15,
7
+ lg: 18,
8
+ xl: 22,
9
+ "2xl": 28,
10
+ "3xl": 36
11
+ },
12
+ spacing: {
13
+ 0: 0,
14
+ 0.5: 2,
15
+ 1: 4,
16
+ 2: 8,
17
+ 3: 12,
18
+ 4: 16,
19
+ 5: 20,
20
+ 6: 24,
21
+ 8: 32,
22
+ 10: 40,
23
+ 12: 48,
24
+ 16: 64
25
+ },
26
+ fontWeights: {
27
+ regular: 400,
28
+ medium: 500,
29
+ semibold: 600,
30
+ bold: 700
31
+ },
32
+ lineHeights: {
33
+ tight: 1.2,
34
+ normal: 1.4,
35
+ relaxed: 1.6
36
+ },
37
+ borderRadius: {
38
+ none: 0,
39
+ sm: 2,
40
+ md: 4,
41
+ lg: 8,
42
+ full: 9999
43
+ },
44
+ letterSpacing: {
45
+ tight: -0.025,
46
+ normal: 0,
47
+ wide: 0.025,
48
+ wider: 0.05
49
+ }
50
+ };
51
+
52
+ // src/themes/professional.ts
53
+ var professionalTheme = {
54
+ name: "professional",
55
+ primitives: defaultPrimitives,
56
+ colors: {
57
+ foreground: "#18181b",
58
+ background: "#ffffff",
59
+ muted: "#f4f4f5",
60
+ mutedForeground: "#71717a",
61
+ primary: "#18181b",
62
+ primaryForeground: "#ffffff",
63
+ border: "#e4e4e7",
64
+ accent: "#3b82f6",
65
+ destructive: "#dc2626",
66
+ success: "#16a34a",
67
+ warning: "#d97706",
68
+ info: "#0ea5e9"
69
+ },
70
+ typography: {
71
+ body: {
72
+ fontFamily: "Helvetica",
73
+ fontSize: 11,
74
+ lineHeight: 1.6
75
+ },
76
+ heading: {
77
+ fontFamily: "Times-Roman",
78
+ fontWeight: 700,
79
+ lineHeight: 1.25,
80
+ fontSize: {
81
+ h1: 32,
82
+ h2: 24,
83
+ h3: 20,
84
+ h4: 16,
85
+ h5: 14,
86
+ h6: 12
87
+ }
88
+ }
89
+ },
90
+ spacing: {
91
+ page: {
92
+ marginTop: 56,
93
+ marginRight: 48,
94
+ marginBottom: 56,
95
+ marginLeft: 48
96
+ },
97
+ sectionGap: 28,
98
+ paragraphGap: 10,
99
+ componentGap: 14
100
+ },
101
+ page: {
102
+ size: "A4",
103
+ orientation: "portrait"
104
+ }
105
+ };
106
+
107
+ // src/themes/modern.ts
108
+ var modernTheme = {
109
+ name: "modern",
110
+ primitives: defaultPrimitives,
111
+ colors: {
112
+ foreground: "#0f172a",
113
+ background: "#ffffff",
114
+ muted: "#f1f5f9",
115
+ mutedForeground: "#64748b",
116
+ primary: "#334155",
117
+ primaryForeground: "#ffffff",
118
+ border: "#e2e8f0",
119
+ accent: "#6366f1",
120
+ destructive: "#ef4444",
121
+ success: "#22c55e",
122
+ warning: "#f59e0b",
123
+ info: "#3b82f6"
124
+ },
125
+ typography: {
126
+ body: {
127
+ fontFamily: "Helvetica",
128
+ fontSize: 11,
129
+ lineHeight: 1.6
130
+ },
131
+ heading: {
132
+ fontFamily: "Helvetica",
133
+ fontWeight: 600,
134
+ lineHeight: 1.25,
135
+ fontSize: {
136
+ h1: 28,
137
+ h2: 22,
138
+ h3: 18,
139
+ h4: 16,
140
+ h5: 14,
141
+ h6: 12
142
+ }
143
+ }
144
+ },
145
+ spacing: {
146
+ page: {
147
+ marginTop: 40,
148
+ marginRight: 40,
149
+ marginBottom: 40,
150
+ marginLeft: 40
151
+ },
152
+ sectionGap: 24,
153
+ paragraphGap: 10,
154
+ componentGap: 12
155
+ },
156
+ page: {
157
+ size: "A4",
158
+ orientation: "portrait"
159
+ }
160
+ };
161
+
162
+ // src/themes/minimal.ts
163
+ var minimalTheme = {
164
+ name: "minimal",
165
+ primitives: defaultPrimitives,
166
+ colors: {
167
+ foreground: "#18181b",
168
+ background: "#ffffff",
169
+ muted: "#fafafa",
170
+ mutedForeground: "#a1a1aa",
171
+ primary: "#18181b",
172
+ primaryForeground: "#ffffff",
173
+ border: "#e4e4e7",
174
+ accent: "#71717a",
175
+ destructive: "#b91c1c",
176
+ success: "#15803d",
177
+ warning: "#a16207",
178
+ info: "#0369a1"
179
+ },
180
+ typography: {
181
+ body: {
182
+ fontFamily: "Helvetica",
183
+ fontSize: 11,
184
+ lineHeight: 1.65
185
+ },
186
+ heading: {
187
+ fontFamily: "Courier",
188
+ fontWeight: 600,
189
+ lineHeight: 1.25,
190
+ fontSize: {
191
+ h1: 24,
192
+ h2: 20,
193
+ h3: 16,
194
+ h4: 14,
195
+ h5: 12,
196
+ h6: 10
197
+ }
198
+ }
199
+ },
200
+ spacing: {
201
+ page: {
202
+ marginTop: 72,
203
+ marginRight: 56,
204
+ marginBottom: 72,
205
+ marginLeft: 56
206
+ },
207
+ sectionGap: 36,
208
+ paragraphGap: 14,
209
+ componentGap: 18
210
+ },
211
+ page: {
212
+ size: "A4",
213
+ orientation: "portrait"
214
+ }
215
+ };
216
+
217
+ // src/themes/index.ts
218
+ var themePresets = {
219
+ professional: professionalTheme,
220
+ modern: modernTheme,
221
+ minimal: minimalTheme
222
+ };
223
+
224
+ export { defaultPrimitives, minimalTheme, modernTheme, professionalTheme, themePresets };
225
+ //# sourceMappingURL=chunk-Z743L6FY.js.map
226
+ //# sourceMappingURL=chunk-Z743L6FY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/themes/primitives.ts","../src/themes/professional.ts","../src/themes/modern.ts","../src/themes/minimal.ts","../src/themes/index.ts"],"names":[],"mappings":";AAeO,IAAM,iBAAA,GAAqC;AAAA,EAChD,UAAA,EAAY;AAAA,IACV,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,IAAA,EAAM,EAAA;AAAA,IACN,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO;AAAA,GACT;AAAA,EACA,OAAA,EAAS;AAAA,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AAS;AACX","file":"chunk-Z743L6FY.js","sourcesContent":["import type { PrimitiveTokens } from '../theme';\n\n/**\n * Default primitive tokens shared by all theme presets.\n *\n * These define the raw design scales — the \"palette\" of values available.\n * Themes select from these scales when assigning semantic tokens.\n *\n * - Typography: Major Third (1.25) ratio, 12pt base\n * - Spacing: 4pt grid system\n * - Font weights: 400–700\n * - Line heights: 1.2–1.6\n * - Border radius: 0–8pt (plus full for pills)\n * - Letter spacing: -0.025 to 0.05 (em-like ratios for PDF points)\n */\nexport const defaultPrimitives: PrimitiveTokens = {\n typography: {\n xs: 10,\n sm: 12,\n base: 15,\n lg: 18,\n xl: 22,\n '2xl': 28,\n '3xl': 36,\n },\n spacing: {\n 0: 0,\n 0.5: 2,\n 1: 4,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n 16: 64,\n },\n fontWeights: {\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n lineHeights: {\n tight: 1.2,\n normal: 1.4,\n relaxed: 1.6,\n },\n borderRadius: {\n none: 0,\n sm: 2,\n md: 4,\n lg: 8,\n full: 9999,\n },\n letterSpacing: {\n tight: -0.025,\n normal: 0,\n wide: 0.025,\n wider: 0.05,\n },\n};\n","import type { PdfxTheme } from '../theme';\nimport { defaultPrimitives } from './primitives';\n\n/**\n * Professional theme preset.\n *\n * Character: Serif headings (Times-Roman), refined zinc/slate palette,\n * generous margins, formal document feel. shadcn-inspired minimal aesthetic.\n * Ideal for business documents, reports, and official correspondence.\n */\nexport const professionalTheme: PdfxTheme = {\n name: 'professional',\n primitives: defaultPrimitives,\n colors: {\n foreground: '#18181b',\n background: '#ffffff',\n muted: '#f4f4f5',\n mutedForeground: '#71717a',\n primary: '#18181b',\n primaryForeground: '#ffffff',\n border: '#e4e4e7',\n accent: '#3b82f6',\n destructive: '#dc2626',\n success: '#16a34a',\n warning: '#d97706',\n info: '#0ea5e9',\n },\n typography: {\n body: {\n fontFamily: 'Helvetica',\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: 'Times-Roman',\n fontWeight: 700,\n lineHeight: 1.25,\n fontSize: {\n h1: 32,\n h2: 24,\n h3: 20,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n },\n },\n spacing: {\n page: {\n marginTop: 56,\n marginRight: 48,\n marginBottom: 56,\n marginLeft: 48,\n },\n sectionGap: 28,\n paragraphGap: 10,\n componentGap: 14,\n },\n page: {\n size: 'A4',\n orientation: 'portrait',\n },\n};\n","import type { PdfxTheme } from '../theme';\nimport { defaultPrimitives } from './primitives';\n\n/**\n * Modern theme preset.\n *\n * Character: All-Helvetica, slate-cool neutrals with subtle violet accent,\n * clean spacing. shadcn-inspired contemporary feel.\n * Ideal for startups, tech companies, and design-forward documents.\n */\nexport const modernTheme: PdfxTheme = {\n name: 'modern',\n primitives: defaultPrimitives,\n colors: {\n foreground: '#0f172a',\n background: '#ffffff',\n muted: '#f1f5f9',\n mutedForeground: '#64748b',\n primary: '#334155',\n primaryForeground: '#ffffff',\n border: '#e2e8f0',\n accent: '#6366f1',\n destructive: '#ef4444',\n success: '#22c55e',\n warning: '#f59e0b',\n info: '#3b82f6',\n },\n typography: {\n body: {\n fontFamily: 'Helvetica',\n fontSize: 11,\n lineHeight: 1.6,\n },\n heading: {\n fontFamily: 'Helvetica',\n fontWeight: 600,\n lineHeight: 1.25,\n fontSize: {\n h1: 28,\n h2: 22,\n h3: 18,\n h4: 16,\n h5: 14,\n h6: 12,\n },\n },\n },\n spacing: {\n page: {\n marginTop: 40,\n marginRight: 40,\n marginBottom: 40,\n marginLeft: 40,\n },\n sectionGap: 24,\n paragraphGap: 10,\n componentGap: 12,\n },\n page: {\n size: 'A4',\n orientation: 'portrait',\n },\n};\n","import type { PdfxTheme } from '../theme';\nimport { defaultPrimitives } from './primitives';\n\n/**\n * Minimal theme preset.\n *\n * Character: Courier headings, zinc neutrals, maximum whitespace.\n * shadcn-inspired restrained palette. Ideal for clean documentation,\n * technical specs, and literary manuscripts.\n */\nexport const minimalTheme: PdfxTheme = {\n name: 'minimal',\n primitives: defaultPrimitives,\n colors: {\n foreground: '#18181b',\n background: '#ffffff',\n muted: '#fafafa',\n mutedForeground: '#a1a1aa',\n primary: '#18181b',\n primaryForeground: '#ffffff',\n border: '#e4e4e7',\n accent: '#71717a',\n destructive: '#b91c1c',\n success: '#15803d',\n warning: '#a16207',\n info: '#0369a1',\n },\n typography: {\n body: {\n fontFamily: 'Helvetica',\n fontSize: 11,\n lineHeight: 1.65,\n },\n heading: {\n fontFamily: 'Courier',\n fontWeight: 600,\n lineHeight: 1.25,\n fontSize: {\n h1: 24,\n h2: 20,\n h3: 16,\n h4: 14,\n h5: 12,\n h6: 10,\n },\n },\n },\n spacing: {\n page: {\n marginTop: 72,\n marginRight: 56,\n marginBottom: 72,\n marginLeft: 56,\n },\n sectionGap: 36,\n paragraphGap: 14,\n componentGap: 18,\n },\n page: {\n size: 'A4',\n orientation: 'portrait',\n },\n};\n","export { defaultPrimitives } from './primitives';\nexport { professionalTheme } from './professional';\nexport { modernTheme } from './modern';\nexport { minimalTheme } from './minimal';\n\nimport { minimalTheme } from './minimal';\nimport { modernTheme } from './modern';\nimport { professionalTheme } from './professional';\n\n/** Map of all built-in theme presets */\nexport const themePresets = {\n professional: professionalTheme,\n modern: modernTheme,\n minimal: minimalTheme,\n} as const;\n\n/** Valid theme preset names */\nexport type ThemePresetName = keyof typeof themePresets;\n"]}