@driveflux/pdf 1.0.14 → 1.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.
Files changed (100) hide show
  1. package/dist/__mocks__/quotation.d.ts +1 -1
  2. package/dist/__mocks__/quotation.d.ts.map +1 -1
  3. package/dist/__mocks__/subscription.d.ts +1 -1
  4. package/dist/__mocks__/subscription.d.ts.map +1 -1
  5. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
  6. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +2 -2
  7. package/dist/templates/QuotationPdf/index.d.ts +1 -1
  8. package/dist/templates/QuotationPdf/index.d.ts.map +1 -1
  9. package/dist/templates/QuotationPdf/utils.d.ts +2 -3
  10. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -1
  11. package/dist/templates/QuotationPdf/utils.js +0 -14
  12. package/dist/templates/SubscriptionAgreement/index.d.ts +1 -1
  13. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
  14. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
  15. package/dist/templates/SubscriptionAgreement/utils.d.ts +1 -1
  16. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  17. package/dist/theme/colors.d.ts.map +1 -1
  18. package/dist/theme/colors.js +36 -36
  19. package/dist/utils.d.ts +2 -8
  20. package/dist/utils.d.ts.map +1 -1
  21. package/dist/utils.js +7 -31
  22. package/package.json +23 -20
  23. package/.eslintrc +0 -3
  24. package/.swcrc +0 -14
  25. package/.turbo/turbo-build.log +0 -6
  26. package/CHANGELOG.md +0 -179
  27. package/dist/cjs/__mocks__/quotation.js +0 -69
  28. package/dist/cjs/__mocks__/subscription.js +0 -1079
  29. package/dist/cjs/components/FluxLogo.js +0 -76
  30. package/dist/cjs/components/StandardPage.js +0 -129
  31. package/dist/cjs/debug.js +0 -234
  32. package/dist/cjs/index.js +0 -20
  33. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -147
  34. package/dist/cjs/templates/QuotationPdf/GFV.js +0 -57
  35. package/dist/cjs/templates/QuotationPdf/Header.js +0 -86
  36. package/dist/cjs/templates/QuotationPdf/Pricing.js +0 -430
  37. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +0 -45
  38. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +0 -43
  39. package/dist/cjs/templates/QuotationPdf/TermsSection.js +0 -60
  40. package/dist/cjs/templates/QuotationPdf/index.js +0 -208
  41. package/dist/cjs/templates/QuotationPdf/translations.js +0 -103
  42. package/dist/cjs/templates/QuotationPdf/utils.js +0 -108
  43. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +0 -95
  44. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +0 -110
  45. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +0 -35
  46. package/dist/cjs/templates/SubscriptionAgreement/Details.js +0 -161
  47. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +0 -68
  48. package/dist/cjs/templates/SubscriptionAgreement/Header.js +0 -61
  49. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +0 -39
  50. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -48
  51. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +0 -72
  52. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -108
  53. package/dist/cjs/templates/SubscriptionAgreement/index.js +0 -276
  54. package/dist/cjs/templates/SubscriptionAgreement/translations.js +0 -666
  55. package/dist/cjs/templates/SubscriptionAgreement/utils.js +0 -14
  56. package/dist/cjs/templates/index.js +0 -19
  57. package/dist/cjs/theme/colors.js +0 -147
  58. package/dist/cjs/theme/index.js +0 -18
  59. package/dist/cjs/types.js +0 -4
  60. package/dist/cjs/utils.js +0 -184
  61. package/dist/cjs/watch.js +0 -20
  62. package/index.cjs +0 -1
  63. package/index.d.ts +0 -1
  64. package/src/__mocks__/quotation.ts +0 -62
  65. package/src/__mocks__/subscription.ts +0 -803
  66. package/src/components/FluxLogo.tsx +0 -52
  67. package/src/components/StandardPage.tsx +0 -32
  68. package/src/debug.ts +0 -45
  69. package/src/index.ts +0 -3
  70. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +0 -68
  71. package/src/templates/QuotationPdf/GFV.tsx +0 -29
  72. package/src/templates/QuotationPdf/Header.tsx +0 -31
  73. package/src/templates/QuotationPdf/Pricing.tsx +0 -214
  74. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +0 -25
  75. package/src/templates/QuotationPdf/SectionBoxNew.tsx +0 -20
  76. package/src/templates/QuotationPdf/TermsSection.tsx +0 -28
  77. package/src/templates/QuotationPdf/index.tsx +0 -46
  78. package/src/templates/QuotationPdf/translations.ts +0 -82
  79. package/src/templates/QuotationPdf/utils.ts +0 -59
  80. package/src/templates/SubscriptionAgreement/Confirmation.tsx +0 -49
  81. package/src/templates/SubscriptionAgreement/CoverPage.tsx +0 -52
  82. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +0 -25
  83. package/src/templates/SubscriptionAgreement/Details.tsx +0 -127
  84. package/src/templates/SubscriptionAgreement/Footer.tsx +0 -37
  85. package/src/templates/SubscriptionAgreement/Header.tsx +0 -37
  86. package/src/templates/SubscriptionAgreement/LabelValue.tsx +0 -19
  87. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +0 -24
  88. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +0 -30
  89. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +0 -44
  90. package/src/templates/SubscriptionAgreement/index.tsx +0 -66
  91. package/src/templates/SubscriptionAgreement/translations.ts +0 -664
  92. package/src/templates/SubscriptionAgreement/utils.ts +0 -7
  93. package/src/templates/index.ts +0 -2
  94. package/src/theme/colors.ts +0 -180
  95. package/src/theme/index.ts +0 -1
  96. package/src/types.ts +0 -1
  97. package/src/utils.ts +0 -27
  98. package/src/watch.ts +0 -16
  99. package/tsconfig.json +0 -13
  100. package/tsconfig.tsbuildinfo +0 -1
@@ -1,7 +0,0 @@
1
- import { UserIdentification } from '@driveflux/db'
2
-
3
- export const formatIdentification = (identification?: UserIdentification | null) => {
4
- return identification?.type === 'id'
5
- ? `${identification?.number?.slice(0, 6)}-${identification?.number?.slice(6, 8)}-${identification?.number?.slice(8)}`
6
- : identification?.number || '-'
7
- }
@@ -1,2 +0,0 @@
1
- export * from './QuotationPdf/index.js'
2
- export * from './SubscriptionAgreement/index.js'
@@ -1,180 +0,0 @@
1
- // TODO sync this with the one in dump
2
- // remove dump file version
3
- // update all instances using colors
4
-
5
- export const colors = {
6
- /**
7
- * #EFEFF0 Light Gray
8
- */
9
- primary1: '#EFEFF0',
10
-
11
- /**
12
- * #CACACA Gray
13
- */
14
- primary2: '#CACACA',
15
-
16
- /**
17
- * #585858 Dark Gray
18
- */
19
- primary3: '#585858',
20
-
21
- /**
22
- * #191919 Soft Black
23
- */
24
- primary4: '#191919',
25
-
26
- /**
27
- * #E55867 Red
28
- */
29
- accent4: '#E55867',
30
-
31
- /**
32
- * #ADE0EE Light Blue
33
- */
34
- links2: '#ADE0EE',
35
-
36
- /**
37
- * #50C8E8 Blue
38
- */
39
- links: '#50C8E8',
40
-
41
- /**
42
- * #E24657 Red
43
- */
44
- alert4: '#E24657',
45
-
46
- /**
47
- * #E24657 Red
48
- */
49
- danger: '#E24657',
50
-
51
- /**
52
- * #F4B25C Yellow
53
- */
54
- warning4: '#F4B25C',
55
-
56
- /**
57
- * #4FD9C2 Green
58
- */
59
- success4: '#4FD9C2',
60
-
61
- /**
62
- * #4FD9C2 Green
63
- */
64
- green: '#4FD9C2',
65
-
66
- /**
67
- * #3BD5BC Green
68
- */
69
- // green: '#3BD5BC',
70
-
71
- /**
72
- * #000000 Black
73
- */
74
- black: '#000000',
75
-
76
- /**
77
- * #ffffff White
78
- */
79
- white: '#ffffff',
80
-
81
- /**
82
- * #E6E6E6 Light Gray
83
- */
84
- whiteHover: '#E6E6E6',
85
-
86
- /**
87
- * #F4F4F4 Light Gray
88
- */
89
- placeholder: '#F4F4F4',
90
-
91
- /**
92
- * #F9F7D7 Light Yellow
93
- */
94
- highlight: '#F9F7D7',
95
-
96
- primary: {
97
- 25: '#fafafa',
98
- 50: '#d6f5f0',
99
- 100: '#98e6d6',
100
- 200: '#191919',
101
- 300: '#191919',
102
- 400: '#3bd5bb',
103
- 500: '#000000',
104
- 600: '#000000',
105
- 700: '#000000',
106
- 800: '#000000',
107
- 900: '#000000'
108
- },
109
-
110
- // TODO add 25
111
- success: {
112
- 50: '#d8f7f2',
113
- 100: '#98e6d6',
114
- 200: '#3bd5bc',
115
- 300: '#4FD9C2',
116
- 400: '#3bd5bb',
117
- 500: '#3bd5bb',
118
- 600: '#2EA692',
119
- 700: '#00825c',
120
- 800: '#00724d',
121
- 900: '#005530'
122
- },
123
-
124
- // TODO add 25
125
- accent: {
126
- 50: '#fceaee',
127
- 100: '#f8cad3',
128
- 200: '#E55867',
129
- 300: '#E55867',
130
- 400: '#E24657',
131
- 500: '#E24657',
132
- 600: '#d8253f',
133
- 700: '#c61a38',
134
- 800: '#b91231',
135
- 900: '#aa0026'
136
- },
137
-
138
- // TODO add 25
139
- warning: {
140
- 50: '#FDF0DE',
141
- 100: '#F4B25C',
142
- 200: '#F4B25C',
143
- 300: '#F4B25C',
144
- 400: '#F4B25C',
145
- 500: '#F4B25C',
146
- 600: '#BF7F2C',
147
- 700: '#F4B25C',
148
- 800: '#F4B25C',
149
- 900: '#F4B25C'
150
- },
151
-
152
- info: {
153
- 25: '#50C8E81A',
154
- 50: '#CDF1FA',
155
- 100: '#50C8E8',
156
- 200: '#50C8E8',
157
- 300: '#50C8E8',
158
- 400: '#50C8E8',
159
- 500: '#50C8E8',
160
- 600: '#3EA5C0',
161
- 700: '#50C8E8',
162
- 800: '#50C8E8',
163
- 900: '#50C8E8'
164
- },
165
-
166
- // TODO add 25
167
- alert: {
168
- 50: '#E24657',
169
- 100: '#E24657',
170
- 200: '#E24657',
171
- 300: '#E24657',
172
- 400: '#E24657',
173
- 500: '#E24657',
174
- 600: '#E24657',
175
- 700: '#E24657',
176
- 800: '#E24657',
177
- 900: '#E24657',
178
- }
179
- }
180
-
@@ -1 +0,0 @@
1
- export * from './colors.js'
package/src/types.ts DELETED
@@ -1 +0,0 @@
1
- export type PdfTemplatesSupportedLocales = 'en'
package/src/utils.ts DELETED
@@ -1,27 +0,0 @@
1
- import type { DocumentProps } from '@react-pdf/renderer'
2
- import ReactPDF from '@react-pdf/renderer'
3
- import { ReactElement } from 'react'
4
-
5
- /**
6
- *
7
- * @param document React PDF Document element
8
- * @param fileName DO NOT USE THIS IN NEXT.JS APP, as Vercel does not allow us to amend files. This will generate a PDF file in the given fileName
9
- * @returns PDF Buffer
10
- */
11
- export const toPdf = async (document: ReactElement<DocumentProps>, fileName?: string): Promise<Buffer> => {
12
- if (!!fileName) {
13
- await ReactPDF.renderToFile(document, fileName)
14
- }
15
-
16
- const stream = await ReactPDF.renderToStream(document)
17
- return new Promise((resolve, reject) => {
18
- let buffers: Uint8Array[] = []
19
- stream.on('data', (data) => {
20
- buffers.push(data)
21
- })
22
- stream.on('end', () => {
23
- resolve(Buffer.concat(buffers))
24
- })
25
- stream.on('error', reject)
26
- })
27
- }
package/src/watch.ts DELETED
@@ -1,16 +0,0 @@
1
- import { execSync } from 'child_process'
2
- import fs from 'node:fs'
3
-
4
- fs.watch(
5
- 'src',
6
- {
7
- persistent: true,
8
- recursive: true
9
- },
10
- () => {
11
- console.log('Reloading...')
12
- execSync('pnpm debug', {
13
- stdio: 'inherit'
14
- })
15
- }
16
- )
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@driveflux/tsconfig/frontend.json",
4
- "compilerOptions": {
5
- "rootDir": "src",
6
- "outDir": "./dist"
7
- },
8
- "include": [
9
- "src/**/*.ts",
10
- "src/**/*.tsx"
11
- ],
12
- "exclude": ["node_modules"]
13
- }