@driveflux/pdf 4.0.77 → 5.0.0-feature-e-invoicing.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.
Files changed (282) hide show
  1. package/.env +0 -0
  2. package/.env.development +4 -0
  3. package/.turbo/turbo-build.log +14 -0
  4. package/CHANGELOG.md +15 -0
  5. package/build.ts +45 -0
  6. package/bun-env.d.ts +34 -0
  7. package/bunfig.toml +8 -0
  8. package/catalog-version-stamp.json +8 -0
  9. package/dist/main.js +4 -0
  10. package/dist/main.js.map +11 -0
  11. package/dist/src/config.d.ts +20 -0
  12. package/dist/src/create-logger.d.ts +1 -0
  13. package/dist/src/errors.d.ts +43 -0
  14. package/dist/src/main.d.ts +1 -0
  15. package/dist/src/preview/api.d.ts +264 -0
  16. package/dist/src/preview/client/app.d.ts +2 -0
  17. package/dist/src/preview/client/invoice/invoice-display.d.ts +5 -0
  18. package/dist/src/preview/client/invoice/invoice-setup.d.ts +8 -0
  19. package/dist/src/preview/client/preview-targets.d.ts +12 -0
  20. package/dist/src/preview/client/preview.d.ts +6 -0
  21. package/dist/src/preview/client/sidebar.d.ts +7 -0
  22. package/dist/src/preview/client/treaty.d.ts +200 -0
  23. package/dist/src/preview/client/use-target.d.ts +1 -0
  24. package/dist/src/preview/fonts/register-fonts.d.ts +1 -0
  25. package/dist/src/preview/frontend.d.ts +1 -0
  26. package/dist/src/preview/server.d.ts +1 -0
  27. package/dist/src/repository.d.ts +171 -0
  28. package/dist/src/templates/invoice/colors.d.ts +6 -0
  29. package/dist/src/templates/invoice/company-details.d.ts +10 -0
  30. package/dist/src/templates/invoice/flux-invoice.d.ts +6 -0
  31. package/dist/src/templates/invoice/footer.d.ts +2 -0
  32. package/dist/src/templates/invoice/host-invoice.d.ts +9 -0
  33. package/dist/src/templates/invoice/invoice-details.d.ts +13 -0
  34. package/dist/src/templates/invoice/invoice-notes.d.ts +1 -0
  35. package/dist/src/templates/invoice/invoice-summary.d.ts +7 -0
  36. package/dist/src/templates/invoice/letter-head.d.ts +10 -0
  37. package/dist/src/templates/invoice/li.d.ts +10 -0
  38. package/dist/src/templates/invoice/platform-and-host-details.d.ts +11 -0
  39. package/dist/src/templates/invoice/spacer.d.ts +3 -0
  40. package/dist/src/templates/invoice/split-container-items.d.ts +10 -0
  41. package/dist/src/templates/invoice/split-container.d.ts +7 -0
  42. package/dist/src/templates/invoice/standard-page.d.ts +7 -0
  43. package/dist/src/templates/invoice/types.d.ts +3 -0
  44. package/dist/src/templates/invoice/ul.d.ts +8 -0
  45. package/dist/src/templates/invoice/utils.d.ts +2 -0
  46. package/dist/tsconfig.tsbuildinfo +1 -0
  47. package/package.json +34 -40
  48. package/src/config.ts +42 -0
  49. package/src/create-logger.ts +4 -0
  50. package/src/errors.ts +35 -0
  51. package/src/main.ts +7 -0
  52. package/src/preview/api.ts +33 -0
  53. package/src/preview/client/app.tsx +30 -0
  54. package/src/preview/client/invoice/invoice-display.tsx +27 -0
  55. package/src/preview/client/invoice/invoice-setup.tsx +95 -0
  56. package/src/preview/client/preview-targets.ts +30 -0
  57. package/src/preview/client/preview.tsx +37 -0
  58. package/src/preview/client/sidebar.tsx +39 -0
  59. package/src/preview/client/treaty.ts +8 -0
  60. package/src/preview/client/use-target.ts +11 -0
  61. package/src/preview/fonts/GOTHAM-BLACK.TTF +0 -0
  62. package/src/preview/fonts/GOTHAM-BLACKITALIC.TTF +0 -0
  63. package/src/preview/fonts/GOTHAM-BOLD.TTF +0 -0
  64. package/src/preview/fonts/GOTHAM-BOLDITALIC.TTF +0 -0
  65. package/src/preview/fonts/GOTHAM-LIGHT.TTF +0 -0
  66. package/src/preview/fonts/GOTHAM-LIGHTITALIC.TTF +0 -0
  67. package/src/preview/fonts/GOTHAM-MEDIUM.TTF +0 -0
  68. package/src/preview/fonts/GOTHAM-MEDIUMITALIC.TTF +0 -0
  69. package/src/preview/fonts/GOTHAM-THIN.TTF +0 -0
  70. package/src/preview/fonts/GOTHAM-THINITALIC.TTF +0 -0
  71. package/src/preview/fonts/GOTHAM-ULTRA.TTF +0 -0
  72. package/src/preview/fonts/GOTHAM-ULTRAITALIC.TTF +0 -0
  73. package/src/preview/fonts/GOTHAM-XLIGHT.TTF +0 -0
  74. package/src/preview/fonts/GOTHAM-XLIGHTITALIC.TTF +0 -0
  75. package/src/preview/fonts/Gotham Book Italic.otf +0 -0
  76. package/src/preview/fonts/Gotham-BoldItalic.otf +0 -0
  77. package/src/preview/fonts/Gotham-Book.otf +0 -0
  78. package/src/preview/fonts/Gotham-BookItalic.otf +0 -0
  79. package/src/preview/fonts/Gotham-ExtraLight.otf +0 -0
  80. package/src/preview/fonts/Gotham-ExtraLightItalic.otf +0 -0
  81. package/src/preview/fonts/Gotham-Light.otf +0 -0
  82. package/src/preview/fonts/Gotham-LightItalic.otf +0 -0
  83. package/src/preview/fonts/Gotham-Medium.otf +0 -0
  84. package/src/preview/fonts/Gotham-MediumItalic.otf +0 -0
  85. package/src/preview/fonts/Gotham-Thin.otf +0 -0
  86. package/src/preview/fonts/Gotham-ThinItalic.otf +0 -0
  87. package/src/preview/fonts/Gotham-Ultra.otf +0 -0
  88. package/src/preview/fonts/Gotham-UltraItalic.otf +0 -0
  89. package/src/preview/fonts/GothamNarrow-Black.otf +0 -0
  90. package/src/preview/fonts/GothamNarrow-BlackItalic.otf +0 -0
  91. package/src/preview/fonts/GothamNarrow-Book.otf +0 -0
  92. package/src/preview/fonts/GothamNarrow-BookItalic.otf +0 -0
  93. package/src/preview/fonts/GothamNarrow-Light.otf +0 -0
  94. package/src/preview/fonts/GothamNarrow-LightItalic.otf +0 -0
  95. package/src/preview/fonts/GothamNarrow-Medium.otf +0 -0
  96. package/src/preview/fonts/GothamNarrow-MediumItalic.otf +0 -0
  97. package/src/preview/fonts/GothamNarrow-Thin.otf +0 -0
  98. package/src/preview/fonts/GothamNarrow-ThinItalic.otf +0 -0
  99. package/src/preview/fonts/GothamNarrow-Ultra.otf +0 -0
  100. package/src/preview/fonts/GothamNarrow-UltraItalic.otf +0 -0
  101. package/src/preview/fonts/GothamNarrow-XLight.otf +0 -0
  102. package/src/preview/fonts/GothamNarrow-XLightItalic.otf +0 -0
  103. package/src/preview/fonts/gotham-extra-narrow-bold-italic.otf +0 -0
  104. package/src/preview/fonts/gotham-extra-narrow-bold.otf +0 -0
  105. package/src/preview/fonts/gotham-extra-narrow-book-italic.otf +0 -0
  106. package/src/preview/fonts/gotham-extra-narrow-book.otf +0 -0
  107. package/src/preview/fonts/gotham-extra-narrow-light-italic.otf +0 -0
  108. package/src/preview/fonts/gotham-extra-narrow-light.otf +0 -0
  109. package/src/preview/fonts/gotham-extra-narrow-medium-italic.otf +0 -0
  110. package/src/preview/fonts/gotham-extra-narrow-medium.otf +0 -0
  111. package/src/preview/fonts/gotham-rounded-bold-italic.otf +0 -0
  112. package/src/preview/fonts/gotham-rounded-bold.otf +0 -0
  113. package/src/preview/fonts/gotham-rounded-book-italic.otf +0 -0
  114. package/src/preview/fonts/gotham-rounded-book.otf +0 -0
  115. package/src/preview/fonts/gotham-rounded-light-italic.otf +0 -0
  116. package/src/preview/fonts/gotham-rounded-light.otf +0 -0
  117. package/src/preview/fonts/gotham-rounded-medium-italic.otf +0 -0
  118. package/src/preview/fonts/gotham-rounded-medium.otf +0 -0
  119. package/src/preview/fonts/register-fonts.ts +395 -0
  120. package/src/preview/frontend.tsx +23 -0
  121. package/src/preview/global.css +39 -0
  122. package/src/preview/preview.html +12 -0
  123. package/src/preview/server.ts +28 -0
  124. package/src/repository.ts +39 -0
  125. package/src/templates/invoice/E Invoice Format.pdf +0 -0
  126. package/src/templates/invoice/colors.ts +6 -0
  127. package/src/templates/invoice/company-details.tsx +124 -0
  128. package/src/templates/invoice/flux-invoice.tsx +134 -0
  129. package/src/templates/invoice/footer.tsx +46 -0
  130. package/src/templates/invoice/host-invoice.tsx +134 -0
  131. package/src/templates/invoice/images/logo.png +0 -0
  132. package/src/templates/invoice/images/logo.svg +41 -0
  133. package/src/templates/invoice/invoice-details.tsx +231 -0
  134. package/src/templates/invoice/invoice-notes.tsx +74 -0
  135. package/src/templates/invoice/invoice-summary.tsx +135 -0
  136. package/src/templates/invoice/letter-head.tsx +132 -0
  137. package/src/templates/invoice/li.tsx +48 -0
  138. package/src/templates/invoice/platform-and-host-details.tsx +56 -0
  139. package/src/templates/invoice/spacer.tsx +5 -0
  140. package/src/templates/invoice/split-container-items.tsx +80 -0
  141. package/src/templates/invoice/split-container.tsx +35 -0
  142. package/src/templates/invoice/standard-page.tsx +45 -0
  143. package/src/templates/invoice/types.ts +6 -0
  144. package/src/templates/invoice/ul.tsx +19 -0
  145. package/src/templates/invoice/utils.ts +5 -0
  146. package/tsconfig.json +21 -0
  147. package/dist/components/FluxLogo.d.ts +0 -3
  148. package/dist/components/FluxLogo.d.ts.map +0 -1
  149. package/dist/components/FluxLogo.js +0 -66
  150. package/dist/components/FluxLogo.js.map +0 -1
  151. package/dist/components/StandardPage.d.ts +0 -7
  152. package/dist/components/StandardPage.d.ts.map +0 -1
  153. package/dist/components/StandardPage.js +0 -132
  154. package/dist/components/StandardPage.js.map +0 -1
  155. package/dist/index.d.ts +0 -4
  156. package/dist/index.d.ts.map +0 -1
  157. package/dist/index.js +0 -3
  158. package/dist/index.js.map +0 -1
  159. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts +0 -10
  160. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +0 -1
  161. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -165
  162. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js.map +0 -1
  163. package/dist/templates/QuotationPdf/GFV.d.ts +0 -10
  164. package/dist/templates/QuotationPdf/GFV.d.ts.map +0 -1
  165. package/dist/templates/QuotationPdf/GFV.js +0 -61
  166. package/dist/templates/QuotationPdf/GFV.js.map +0 -1
  167. package/dist/templates/QuotationPdf/Header.d.ts +0 -9
  168. package/dist/templates/QuotationPdf/Header.d.ts.map +0 -1
  169. package/dist/templates/QuotationPdf/Header.js +0 -71
  170. package/dist/templates/QuotationPdf/Header.js.map +0 -1
  171. package/dist/templates/QuotationPdf/Pricing.d.ts +0 -10
  172. package/dist/templates/QuotationPdf/Pricing.d.ts.map +0 -1
  173. package/dist/templates/QuotationPdf/Pricing.js +0 -723
  174. package/dist/templates/QuotationPdf/Pricing.js.map +0 -1
  175. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts +0 -8
  176. package/dist/templates/QuotationPdf/QuotationPdfPage.d.ts.map +0 -1
  177. package/dist/templates/QuotationPdf/QuotationPdfPage.js +0 -30
  178. package/dist/templates/QuotationPdf/QuotationPdfPage.js.map +0 -1
  179. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts +0 -9
  180. package/dist/templates/QuotationPdf/SectionBoxNew.d.ts.map +0 -1
  181. package/dist/templates/QuotationPdf/SectionBoxNew.js +0 -38
  182. package/dist/templates/QuotationPdf/SectionBoxNew.js.map +0 -1
  183. package/dist/templates/QuotationPdf/TermsSection.d.ts +0 -8
  184. package/dist/templates/QuotationPdf/TermsSection.d.ts.map +0 -1
  185. package/dist/templates/QuotationPdf/TermsSection.js +0 -50
  186. package/dist/templates/QuotationPdf/TermsSection.js.map +0 -1
  187. package/dist/templates/QuotationPdf/VehiclePhotos.d.ts +0 -10
  188. package/dist/templates/QuotationPdf/VehiclePhotos.d.ts.map +0 -1
  189. package/dist/templates/QuotationPdf/VehiclePhotos.js +0 -66
  190. package/dist/templates/QuotationPdf/VehiclePhotos.js.map +0 -1
  191. package/dist/templates/QuotationPdf/index.d.ts +0 -12
  192. package/dist/templates/QuotationPdf/index.d.ts.map +0 -1
  193. package/dist/templates/QuotationPdf/index.js +0 -214
  194. package/dist/templates/QuotationPdf/index.js.map +0 -1
  195. package/dist/templates/QuotationPdf/translations.d.ts +0 -68
  196. package/dist/templates/QuotationPdf/translations.d.ts.map +0 -1
  197. package/dist/templates/QuotationPdf/translations.js +0 -101
  198. package/dist/templates/QuotationPdf/translations.js.map +0 -1
  199. package/dist/templates/QuotationPdf/utils.d.ts +0 -14
  200. package/dist/templates/QuotationPdf/utils.d.ts.map +0 -1
  201. package/dist/templates/QuotationPdf/utils.js +0 -152
  202. package/dist/templates/QuotationPdf/utils.js.map +0 -1
  203. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts +0 -12
  204. package/dist/templates/SubscriptionAgreement/Confirmation.d.ts.map +0 -1
  205. package/dist/templates/SubscriptionAgreement/Confirmation.js +0 -80
  206. package/dist/templates/SubscriptionAgreement/Confirmation.js.map +0 -1
  207. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts +0 -14
  208. package/dist/templates/SubscriptionAgreement/CoverPage.d.ts.map +0 -1
  209. package/dist/templates/SubscriptionAgreement/CoverPage.js +0 -111
  210. package/dist/templates/SubscriptionAgreement/CoverPage.js.map +0 -1
  211. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts +0 -7
  212. package/dist/templates/SubscriptionAgreement/CoverPageSection.d.ts.map +0 -1
  213. package/dist/templates/SubscriptionAgreement/CoverPageSection.js +0 -25
  214. package/dist/templates/SubscriptionAgreement/CoverPageSection.js.map +0 -1
  215. package/dist/templates/SubscriptionAgreement/Details.d.ts +0 -10
  216. package/dist/templates/SubscriptionAgreement/Details.d.ts.map +0 -1
  217. package/dist/templates/SubscriptionAgreement/Details.js +0 -223
  218. package/dist/templates/SubscriptionAgreement/Details.js.map +0 -1
  219. package/dist/templates/SubscriptionAgreement/Footer.d.ts +0 -10
  220. package/dist/templates/SubscriptionAgreement/Footer.d.ts.map +0 -1
  221. package/dist/templates/SubscriptionAgreement/Footer.js +0 -58
  222. package/dist/templates/SubscriptionAgreement/Footer.js.map +0 -1
  223. package/dist/templates/SubscriptionAgreement/Header.d.ts +0 -10
  224. package/dist/templates/SubscriptionAgreement/Header.d.ts.map +0 -1
  225. package/dist/templates/SubscriptionAgreement/Header.js +0 -46
  226. package/dist/templates/SubscriptionAgreement/Header.js.map +0 -1
  227. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts +0 -8
  228. package/dist/templates/SubscriptionAgreement/LabelValue.d.ts.map +0 -1
  229. package/dist/templates/SubscriptionAgreement/LabelValue.js +0 -29
  230. package/dist/templates/SubscriptionAgreement/LabelValue.js.map +0 -1
  231. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts +0 -10
  232. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.d.ts.map +0 -1
  233. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -33
  234. package/dist/templates/SubscriptionAgreement/SubscriptionAgreementPage.js.map +0 -1
  235. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts +0 -8
  236. package/dist/templates/SubscriptionAgreement/TermsOfUse.d.ts.map +0 -1
  237. package/dist/templates/SubscriptionAgreement/TermsOfUse.js +0 -101
  238. package/dist/templates/SubscriptionAgreement/TermsOfUse.js.map +0 -1
  239. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts +0 -12
  240. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.d.ts.map +0 -1
  241. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -103
  242. package/dist/templates/SubscriptionAgreement/TermsOfUseSubSection.js.map +0 -1
  243. package/dist/templates/SubscriptionAgreement/index.d.ts +0 -13
  244. package/dist/templates/SubscriptionAgreement/index.d.ts.map +0 -1
  245. package/dist/templates/SubscriptionAgreement/index.js +0 -271
  246. package/dist/templates/SubscriptionAgreement/index.js.map +0 -1
  247. package/dist/templates/SubscriptionAgreement/translations.d.ts +0 -78
  248. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +0 -1
  249. package/dist/templates/SubscriptionAgreement/translations.js +0 -662
  250. package/dist/templates/SubscriptionAgreement/translations.js.map +0 -1
  251. package/dist/templates/SubscriptionAgreement/types.d.ts +0 -7
  252. package/dist/templates/SubscriptionAgreement/types.d.ts.map +0 -1
  253. package/dist/templates/SubscriptionAgreement/types.js +0 -1
  254. package/dist/templates/SubscriptionAgreement/types.js.map +0 -1
  255. package/dist/templates/SubscriptionAgreement/utils.d.ts +0 -6
  256. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +0 -1
  257. package/dist/templates/SubscriptionAgreement/utils.js +0 -37
  258. package/dist/templates/SubscriptionAgreement/utils.js.map +0 -1
  259. package/dist/templates/index.d.ts +0 -3
  260. package/dist/templates/index.d.ts.map +0 -1
  261. package/dist/templates/index.js +0 -2
  262. package/dist/templates/index.js.map +0 -1
  263. package/dist/theme/colors.d.ts +0 -148
  264. package/dist/theme/colors.d.ts.map +0 -1
  265. package/dist/theme/colors.js +0 -137
  266. package/dist/theme/colors.js.map +0 -1
  267. package/dist/theme/index.d.ts +0 -2
  268. package/dist/theme/index.d.ts.map +0 -1
  269. package/dist/theme/index.js +0 -1
  270. package/dist/theme/index.js.map +0 -1
  271. package/dist/types.d.ts +0 -2
  272. package/dist/types.d.ts.map +0 -1
  273. package/dist/types.js +0 -1
  274. package/dist/types.js.map +0 -1
  275. package/dist/utils.d.ts +0 -10
  276. package/dist/utils.d.ts.map +0 -1
  277. package/dist/utils.js +0 -175
  278. package/dist/utils.js.map +0 -1
  279. package/dist/watch.d.ts +0 -2
  280. package/dist/watch.d.ts.map +0 -1
  281. package/dist/watch.js +0 -11
  282. package/dist/watch.js.map +0 -1
@@ -0,0 +1,395 @@
1
+ import { Font } from '@react-pdf/renderer'
2
+ import gothamBlack from './GOTHAM-BLACK.TTF'
3
+ import gothamBlackItalic from './GOTHAM-BLACKITALIC.TTF'
4
+ import gothamBold from './GOTHAM-BOLD.TTF'
5
+ import gothamXLight from './GOTHAM-XLIGHT.TTF'
6
+ import gothamXLightItalic from './GOTHAM-XLIGHTITALIC.TTF'
7
+ import gothamBoldItalic from './Gotham-BoldItalic.otf'
8
+ import gothamBook from './Gotham-Book.otf'
9
+ import gothamBookItalic from './Gotham-BookItalic.otf'
10
+ import gothamExtraLight from './Gotham-ExtraLight.otf'
11
+ import gothamExtraLightItalic from './Gotham-ExtraLightItalic.otf'
12
+ import gothamLight from './Gotham-Light.otf'
13
+ import gothamLightItalic from './Gotham-LightItalic.otf'
14
+ import gothamMedium from './Gotham-Medium.otf'
15
+ import gothamMediumItalic from './Gotham-MediumItalic.otf'
16
+ // Standard Gotham fonts
17
+ import gothamThin from './Gotham-Thin.otf'
18
+ import gothamThinItalic from './Gotham-ThinItalic.otf'
19
+ import gothamUltra from './Gotham-Ultra.otf'
20
+ import gothamUltraItalic from './Gotham-UltraItalic.otf'
21
+ import gothamNarrowBlack from './GothamNarrow-Black.otf'
22
+ import gothamNarrowBlackItalic from './GothamNarrow-BlackItalic.otf'
23
+ import gothamNarrowBook from './GothamNarrow-Book.otf'
24
+ import gothamNarrowBookItalic from './GothamNarrow-BookItalic.otf'
25
+ import gothamNarrowLight from './GothamNarrow-Light.otf'
26
+ import gothamNarrowLightItalic from './GothamNarrow-LightItalic.otf'
27
+ import gothamNarrowMedium from './GothamNarrow-Medium.otf'
28
+ import gothamNarrowMediumItalic from './GothamNarrow-MediumItalic.otf'
29
+ // Gotham Narrow fonts
30
+ import gothamNarrowThin from './GothamNarrow-Thin.otf'
31
+ import gothamNarrowThinItalic from './GothamNarrow-ThinItalic.otf'
32
+ import gothamNarrowUltra from './GothamNarrow-Ultra.otf'
33
+ import gothamNarrowUltraItalic from './GothamNarrow-UltraItalic.otf'
34
+ import gothamNarrowXLight from './GothamNarrow-XLight.otf'
35
+ import gothamNarrowXLightItalic from './GothamNarrow-XLightItalic.otf'
36
+ import gothamExtraNarrowBold from './gotham-extra-narrow-bold.otf'
37
+ import gothamExtraNarrowBoldItalic from './gotham-extra-narrow-bold-italic.otf'
38
+ // Gotham Extra Narrow fonts
39
+ import gothamExtraNarrowBook from './gotham-extra-narrow-book.otf'
40
+ import gothamExtraNarrowBookItalic from './gotham-extra-narrow-book-italic.otf'
41
+ import gothamExtraNarrowLight from './gotham-extra-narrow-light.otf'
42
+ import gothamExtraNarrowLightItalic from './gotham-extra-narrow-light-italic.otf'
43
+ import gothamExtraNarrowMedium from './gotham-extra-narrow-medium.otf'
44
+ import gothamExtraNarrowMediumItalic from './gotham-extra-narrow-medium-italic.otf'
45
+ import gothamRoundedBold from './gotham-rounded-bold.otf'
46
+ import gothamRoundedBoldItalic from './gotham-rounded-bold-italic.otf'
47
+ // Gotham Rounded fonts
48
+ import gothamRoundedBook from './gotham-rounded-book.otf'
49
+ import gothamRoundedBookItalic from './gotham-rounded-book-italic.otf'
50
+ import gothamRoundedLight from './gotham-rounded-light.otf'
51
+ import gothamRoundedLightItalic from './gotham-rounded-light-italic.otf'
52
+ import gothamRoundedMedium from './gotham-rounded-medium.otf'
53
+ import gothamRoundedMediumItalic from './gotham-rounded-medium-italic.otf'
54
+
55
+ export const registerFonts = () => {
56
+ // Standard Gotham fonts
57
+ // Gotham-Thin
58
+ Font.register({
59
+ family: 'Gotham-Thin',
60
+ src: gothamThin,
61
+ fontStyle: 'normal',
62
+ fontWeight: 100,
63
+ })
64
+ Font.register({
65
+ family: 'Gotham-Thin',
66
+ src: gothamThinItalic,
67
+ fontStyle: 'italic',
68
+ fontWeight: 100,
69
+ })
70
+
71
+ // Gotham-XLight
72
+ Font.register({
73
+ family: 'Gotham-XLight',
74
+ src: gothamXLight,
75
+ fontStyle: 'normal',
76
+ fontWeight: 200,
77
+ })
78
+ Font.register({
79
+ family: 'Gotham-XLight',
80
+ src: gothamXLightItalic,
81
+ fontStyle: 'italic',
82
+ fontWeight: 200,
83
+ })
84
+
85
+ // Gotham-ExtraLight
86
+ Font.register({
87
+ family: 'Gotham-ExtraLight',
88
+ src: gothamExtraLight,
89
+ fontStyle: 'normal',
90
+ fontWeight: 200,
91
+ })
92
+ Font.register({
93
+ family: 'Gotham-ExtraLight',
94
+ src: gothamExtraLightItalic,
95
+ fontStyle: 'italic',
96
+ fontWeight: 200,
97
+ })
98
+
99
+ // Gotham-Light
100
+ Font.register({
101
+ family: 'Gotham-Light',
102
+ src: gothamLight,
103
+ fontStyle: 'normal',
104
+ fontWeight: 300,
105
+ })
106
+ Font.register({
107
+ family: 'Gotham-Light',
108
+ src: gothamLightItalic,
109
+ fontStyle: 'italic',
110
+ fontWeight: 300,
111
+ })
112
+
113
+ // Gotham-Book
114
+ Font.register({
115
+ family: 'Gotham-Book',
116
+ src: gothamBook,
117
+ fontStyle: 'normal',
118
+ fontWeight: 400,
119
+ })
120
+ Font.register({
121
+ family: 'Gotham-Book',
122
+ src: gothamBookItalic,
123
+ fontStyle: 'italic',
124
+ fontWeight: 400,
125
+ })
126
+
127
+ // Gotham-Medium
128
+ Font.register({
129
+ family: 'Gotham-Medium',
130
+ src: gothamMedium,
131
+ fontStyle: 'normal',
132
+ fontWeight: 500,
133
+ })
134
+ Font.register({
135
+ family: 'Gotham-Medium',
136
+ src: gothamMediumItalic,
137
+ fontStyle: 'italic',
138
+ fontWeight: 500,
139
+ })
140
+
141
+ // Gotham-Bold
142
+ Font.register({
143
+ family: 'Gotham-Bold',
144
+ src: gothamBold,
145
+ fontStyle: 'normal',
146
+ fontWeight: 700,
147
+ })
148
+ Font.register({
149
+ family: 'Gotham-Bold',
150
+ src: gothamBoldItalic,
151
+ fontStyle: 'italic',
152
+ fontWeight: 700,
153
+ })
154
+
155
+ // Gotham-Black
156
+ Font.register({
157
+ family: 'Gotham-Black',
158
+ src: gothamBlack,
159
+ fontStyle: 'normal',
160
+ fontWeight: 800,
161
+ })
162
+ Font.register({
163
+ family: 'Gotham-Black',
164
+ src: gothamBlackItalic,
165
+ fontStyle: 'italic',
166
+ fontWeight: 800,
167
+ })
168
+
169
+ // Gotham-Ultra
170
+ Font.register({
171
+ family: 'Gotham-Ultra',
172
+ src: gothamUltra,
173
+ fontStyle: 'normal',
174
+ fontWeight: 900,
175
+ })
176
+ Font.register({
177
+ family: 'Gotham-Ultra',
178
+ src: gothamUltraItalic,
179
+ fontStyle: 'italic',
180
+ fontWeight: 900,
181
+ })
182
+
183
+ // Gotham Narrow fonts
184
+ // GothamNarrow-Thin
185
+ Font.register({
186
+ family: 'GothamNarrow-Thin',
187
+ src: gothamNarrowThin,
188
+ fontStyle: 'normal',
189
+ fontWeight: 100,
190
+ })
191
+ Font.register({
192
+ family: 'GothamNarrow-Thin',
193
+ src: gothamNarrowThinItalic,
194
+ fontStyle: 'italic',
195
+ fontWeight: 100,
196
+ })
197
+
198
+ // GothamNarrow-XLight
199
+ Font.register({
200
+ family: 'GothamNarrow-XLight',
201
+ src: gothamNarrowXLight,
202
+ fontStyle: 'normal',
203
+ fontWeight: 200,
204
+ })
205
+ Font.register({
206
+ family: 'GothamNarrow-XLight',
207
+ src: gothamNarrowXLightItalic,
208
+ fontStyle: 'italic',
209
+ fontWeight: 200,
210
+ })
211
+
212
+ // GothamNarrow-Light
213
+ Font.register({
214
+ family: 'GothamNarrow-Light',
215
+ src: gothamNarrowLight,
216
+ fontStyle: 'normal',
217
+ fontWeight: 300,
218
+ })
219
+ Font.register({
220
+ family: 'GothamNarrow-Light',
221
+ src: gothamNarrowLightItalic,
222
+ fontStyle: 'italic',
223
+ fontWeight: 300,
224
+ })
225
+
226
+ // GothamNarrow-Book
227
+ Font.register({
228
+ family: 'GothamNarrow-Book',
229
+ src: gothamNarrowBook,
230
+ fontStyle: 'normal',
231
+ fontWeight: 400,
232
+ })
233
+ Font.register({
234
+ family: 'GothamNarrow-Book',
235
+ src: gothamNarrowBookItalic,
236
+ fontStyle: 'italic',
237
+ fontWeight: 400,
238
+ })
239
+
240
+ // GothamNarrow-Medium
241
+ Font.register({
242
+ family: 'GothamNarrow-Medium',
243
+ src: gothamNarrowMedium,
244
+ fontStyle: 'normal',
245
+ fontWeight: 500,
246
+ })
247
+ Font.register({
248
+ family: 'GothamNarrow-Medium',
249
+ src: gothamNarrowMediumItalic,
250
+ fontStyle: 'italic',
251
+ fontWeight: 500,
252
+ })
253
+
254
+ // GothamNarrow-Black
255
+ Font.register({
256
+ family: 'GothamNarrow-Black',
257
+ src: gothamNarrowBlack,
258
+ fontStyle: 'normal',
259
+ fontWeight: 800,
260
+ })
261
+ Font.register({
262
+ family: 'GothamNarrow-Black',
263
+ src: gothamNarrowBlackItalic,
264
+ fontStyle: 'italic',
265
+ fontWeight: 800,
266
+ })
267
+
268
+ // GothamNarrow-Ultra
269
+ Font.register({
270
+ family: 'GothamNarrow-Ultra',
271
+ src: gothamNarrowUltra,
272
+ fontStyle: 'normal',
273
+ fontWeight: 900,
274
+ })
275
+ Font.register({
276
+ family: 'GothamNarrow-Ultra',
277
+ src: gothamNarrowUltraItalic,
278
+ fontStyle: 'italic',
279
+ fontWeight: 900,
280
+ })
281
+
282
+ // Gotham Rounded fonts
283
+ // GothamRounded-Book
284
+ Font.register({
285
+ family: 'GothamRounded-Book',
286
+ src: gothamRoundedBook,
287
+ fontStyle: 'normal',
288
+ fontWeight: 400,
289
+ })
290
+ Font.register({
291
+ family: 'GothamRounded-Book',
292
+ src: gothamRoundedBookItalic,
293
+ fontStyle: 'italic',
294
+ fontWeight: 400,
295
+ })
296
+
297
+ // GothamRounded-Light
298
+ Font.register({
299
+ family: 'GothamRounded-Light',
300
+ src: gothamRoundedLight,
301
+ fontStyle: 'normal',
302
+ fontWeight: 300,
303
+ })
304
+ Font.register({
305
+ family: 'GothamRounded-Light',
306
+ src: gothamRoundedLightItalic,
307
+ fontStyle: 'italic',
308
+ fontWeight: 300,
309
+ })
310
+
311
+ // GothamRounded-Medium
312
+ Font.register({
313
+ family: 'GothamRounded-Medium',
314
+ src: gothamRoundedMedium,
315
+ fontStyle: 'normal',
316
+ fontWeight: 500,
317
+ })
318
+ Font.register({
319
+ family: 'GothamRounded-Medium',
320
+ src: gothamRoundedMediumItalic,
321
+ fontStyle: 'italic',
322
+ fontWeight: 500,
323
+ })
324
+
325
+ // GothamRounded-Bold
326
+ Font.register({
327
+ family: 'GothamRounded-Bold',
328
+ src: gothamRoundedBold,
329
+ fontStyle: 'normal',
330
+ fontWeight: 700,
331
+ })
332
+ Font.register({
333
+ family: 'GothamRounded-Bold',
334
+ src: gothamRoundedBoldItalic,
335
+ fontStyle: 'italic',
336
+ fontWeight: 700,
337
+ })
338
+
339
+ // Gotham Extra Narrow fonts
340
+ // GothamExtraNarrow-Book
341
+ Font.register({
342
+ family: 'GothamExtraNarrow-Book',
343
+ src: gothamExtraNarrowBook,
344
+ fontStyle: 'normal',
345
+ fontWeight: 400,
346
+ })
347
+ Font.register({
348
+ family: 'GothamExtraNarrow-Book',
349
+ src: gothamExtraNarrowBookItalic,
350
+ fontStyle: 'italic',
351
+ fontWeight: 400,
352
+ })
353
+
354
+ // GothamExtraNarrow-Light
355
+ Font.register({
356
+ family: 'GothamExtraNarrow-Light',
357
+ src: gothamExtraNarrowLight,
358
+ fontStyle: 'normal',
359
+ fontWeight: 300,
360
+ })
361
+ Font.register({
362
+ family: 'GothamExtraNarrow-Light',
363
+ src: gothamExtraNarrowLightItalic,
364
+ fontStyle: 'italic',
365
+ fontWeight: 300,
366
+ })
367
+
368
+ // GothamExtraNarrow-Medium
369
+ Font.register({
370
+ family: 'GothamExtraNarrow-Medium',
371
+ src: gothamExtraNarrowMedium,
372
+ fontStyle: 'normal',
373
+ fontWeight: 500,
374
+ })
375
+ Font.register({
376
+ family: 'GothamExtraNarrow-Medium',
377
+ src: gothamExtraNarrowMediumItalic,
378
+ fontStyle: 'italic',
379
+ fontWeight: 500,
380
+ })
381
+
382
+ // GothamExtraNarrow-Bold
383
+ Font.register({
384
+ family: 'GothamExtraNarrow-Bold',
385
+ src: gothamExtraNarrowBold,
386
+ fontStyle: 'normal',
387
+ fontWeight: 700,
388
+ })
389
+ Font.register({
390
+ family: 'GothamExtraNarrow-Bold',
391
+ src: gothamExtraNarrowBoldItalic,
392
+ fontStyle: 'italic',
393
+ fontWeight: 700,
394
+ })
395
+ }
@@ -0,0 +1,23 @@
1
+ import { NuqsAdapter } from 'nuqs/adapters/react'
2
+ import { StrictMode } from 'react'
3
+ import { createRoot } from 'react-dom/client'
4
+ import { App } from './client/app'
5
+
6
+ const elem = document.getElementById('root')!
7
+ const app = (
8
+ <StrictMode>
9
+ <NuqsAdapter>
10
+ <App />
11
+ </NuqsAdapter>
12
+ </StrictMode>
13
+ )
14
+
15
+ if (import.meta.hot) {
16
+ // With hot module reloading, `import.meta.hot.data` is persisted.
17
+ // biome-ignore lint/suspicious/noAssignInExpressions: generated by bun
18
+ const root = (import.meta.hot.data.root ??= createRoot(elem))
19
+ root.render(app)
20
+ } else {
21
+ // The hot module reloading API is not available in production.
22
+ createRoot(elem).render(app)
23
+ }
@@ -0,0 +1,39 @@
1
+ @import "tailwindcss";
2
+ @import "../../node_modules/@driveflux/beam/dist/base-styles.css";
3
+ @source "../../node_modules/@driveflux/beam/dist";
4
+
5
+ @layer base {
6
+
7
+ h1,
8
+ h2,
9
+ h3,
10
+ h4 {
11
+ font-family: "Gotham-Bold", sans-serif;
12
+ text-transform: uppercase;
13
+ }
14
+
15
+ body {
16
+ letter-spacing: 1px;
17
+ font-size: 14px;
18
+ }
19
+
20
+ li {
21
+ margin-left: 16px;
22
+ }
23
+ }
24
+
25
+ @layer utilities {
26
+
27
+ /* Hide scrollbar for Chrome, Safari and Opera */
28
+ .no-scrollbar::-webkit-scrollbar {
29
+ display: none;
30
+ }
31
+
32
+ /* Hide scrollbar for IE, Edge and Firefox */
33
+ .no-scrollbar {
34
+ -ms-overflow-style: none;
35
+ /* IE and Edge */
36
+ scrollbar-width: none;
37
+ /* Firefox */
38
+ }
39
+ }
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Preview PDF</title>
7
+ </head>
8
+ <body class="text-base">
9
+ <div id="root"></div>
10
+ <script type="module" src="./frontend.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,28 @@
1
+ import { serve } from 'bun'
2
+ import { api } from './api'
3
+ import preview from './preview.html'
4
+
5
+ const extractPort = (url: string | undefined) => {
6
+ if (!url) return 3000
7
+ const urlObj = new URL(url)
8
+ return urlObj.port
9
+ }
10
+
11
+ const server = serve({
12
+ routes: {
13
+ // Serve preview.html for all unmatched routes.
14
+ '/': preview,
15
+ '/api/*': api.handle,
16
+ },
17
+
18
+ development: process.env.NODE_ENV !== 'production' && {
19
+ // Enable browser hot reloading in development
20
+ hmr: true,
21
+
22
+ // Echo console logs from the browser to the server
23
+ console: true,
24
+ },
25
+ port: extractPort(process.env.FLUX_PUBLIC_APP_URL),
26
+ })
27
+
28
+ console.log(`🚀 Server running at ${server.url}`)
@@ -0,0 +1,39 @@
1
+ import { prisma } from '@driveflux/db'
2
+ import { PDFErrors } from './errors'
3
+
4
+ class PDFRepository {
5
+ async getInvoiceForPDF(invoiceId: string) {
6
+ const invoice = await prisma.invoice.findUnique({
7
+ where: {
8
+ id: invoiceId,
9
+ },
10
+ select: {
11
+ id: true,
12
+ eInvoice: true,
13
+ total: true,
14
+ lines: true,
15
+ subscriptionDetails: true,
16
+ payerName: true,
17
+ billingAddress: true,
18
+ payerPhoneNumber: true,
19
+ payerEmail: true,
20
+ paidAt: true,
21
+ createdAt: true,
22
+ date: true,
23
+ paid: true,
24
+ },
25
+ })
26
+
27
+ if (!invoice) {
28
+ throw new PDFErrors.InvoiceNotFound(`Invoice ${invoiceId} not found`)
29
+ }
30
+ if (!invoice.eInvoice) {
31
+ throw new PDFErrors.InvoiceNotEInvoice(invoiceId)
32
+ }
33
+ return invoice as Omit<typeof invoice, 'eInvoice'> & {
34
+ eInvoice: NonNullable<typeof invoice.eInvoice>
35
+ }
36
+ }
37
+ }
38
+
39
+ export const repository = new PDFRepository()
@@ -0,0 +1,6 @@
1
+ export const colors = {
2
+ primaryBlack: '#030303',
3
+ blueBranding: '#50C8E8',
4
+ darkGrey: '#585858',
5
+ lightGrey: '#EFEFF0',
6
+ }
@@ -0,0 +1,124 @@
1
+ import { StyleSheet, Text, View } from '@react-pdf/renderer'
2
+ import { colors } from './colors'
3
+
4
+ type CompanyDetailsProps = {
5
+ title: string
6
+ companyName: string
7
+ address: string
8
+ sstNumber: string
9
+ tinNumber: string
10
+ invoiceNumber: string
11
+ }
12
+
13
+ const styles = StyleSheet.create({
14
+ title: {
15
+ fontFamily: 'Gotham-Medium',
16
+ fontSize: 8,
17
+ fontWeight: 500,
18
+ color: colors.primaryBlack,
19
+ marginBottom: 2,
20
+ },
21
+ companyName: {
22
+ fontFamily: 'Gotham-Medium',
23
+ fontSize: 6,
24
+ fontWeight: 500,
25
+ color: colors.darkGrey,
26
+ },
27
+ address: {
28
+ fontFamily: 'Gotham-Book',
29
+ fontSize: 6,
30
+ fontWeight: 400,
31
+ color: colors.darkGrey,
32
+ },
33
+ detailsContainer: {
34
+ display: 'flex',
35
+ flexDirection: 'column',
36
+ alignSelf: 'stretch',
37
+ },
38
+ item: {
39
+ display: 'flex',
40
+ flexDirection: 'row',
41
+ alignSelf: 'stretch',
42
+ minHeight: 0,
43
+ },
44
+ titleContainer: {
45
+ width: 60,
46
+ flexShrink: 0,
47
+ flexGrow: 0,
48
+ display: 'flex',
49
+ flexDirection: 'row',
50
+ justifyContent: 'flex-start',
51
+ },
52
+ detailsTitle: {
53
+ fontFamily: 'Gotham-Book',
54
+ fontSize: 6,
55
+ fontWeight: 400,
56
+ color: colors.darkGrey,
57
+ textAlign: 'right',
58
+ },
59
+ colon: {
60
+ fontFamily: 'Gotham-Book',
61
+ fontSize: 6,
62
+ fontWeight: 400,
63
+ color: colors.darkGrey,
64
+ width: 6,
65
+ marginLeft: 2,
66
+ flexShrink: 0,
67
+ flexGrow: 0,
68
+ },
69
+ details: {
70
+ fontFamily: 'Gotham-Medium',
71
+ fontSize: 6,
72
+ fontWeight: 500,
73
+ color: colors.primaryBlack,
74
+ flex: 1,
75
+ marginLeft: 0,
76
+ },
77
+ container: {
78
+ display: 'flex',
79
+ flexDirection: 'column',
80
+ gap: 2,
81
+ alignSelf: 'stretch',
82
+ },
83
+ })
84
+
85
+ export const CompanyDetails = ({
86
+ title,
87
+ companyName,
88
+ address,
89
+ sstNumber,
90
+ tinNumber,
91
+ invoiceNumber,
92
+ }: CompanyDetailsProps) => {
93
+ return (
94
+ <View style={styles.container}>
95
+ <Text style={styles.title}>{title}</Text>
96
+ <Text style={styles.companyName}>{companyName}</Text>
97
+ <Text style={styles.address}>{address}</Text>
98
+
99
+ <View style={styles.detailsContainer}>
100
+ <View style={styles.item}>
101
+ <View style={styles.titleContainer}>
102
+ <Text style={styles.detailsTitle}>SST No</Text>
103
+ </View>
104
+ <Text style={styles.colon}>:</Text>
105
+ <Text style={styles.details}>{sstNumber}</Text>
106
+ </View>
107
+ <View style={styles.item}>
108
+ <View style={styles.titleContainer}>
109
+ <Text style={styles.detailsTitle}>TIN No</Text>
110
+ </View>
111
+ <Text style={styles.colon}>:</Text>
112
+ <Text style={styles.details}>{tinNumber}</Text>
113
+ </View>
114
+ <View style={styles.item}>
115
+ <View style={styles.titleContainer}>
116
+ <Text style={styles.detailsTitle}>Invoice No</Text>
117
+ </View>
118
+ <Text style={styles.colon}>:</Text>
119
+ <Text style={styles.details}>{invoiceNumber}</Text>
120
+ </View>
121
+ </View>
122
+ </View>
123
+ )
124
+ }