@driveflux/pdf 1.0.15 → 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 (104) 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__/quotation.js +1 -2
  4. package/dist/__mocks__/subscription.d.ts +1 -1
  5. package/dist/__mocks__/subscription.d.ts.map +1 -1
  6. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.d.ts.map +1 -1
  7. package/dist/templates/QuotationPdf/CustomerSubscriptionSection.js +2 -10
  8. package/dist/templates/QuotationPdf/index.d.ts +1 -1
  9. package/dist/templates/QuotationPdf/index.d.ts.map +1 -1
  10. package/dist/templates/QuotationPdf/translations.d.ts +0 -1
  11. package/dist/templates/QuotationPdf/translations.d.ts.map +1 -1
  12. package/dist/templates/QuotationPdf/translations.js +1 -4
  13. package/dist/templates/QuotationPdf/utils.d.ts +3 -4
  14. package/dist/templates/QuotationPdf/utils.d.ts.map +1 -1
  15. package/dist/templates/QuotationPdf/utils.js +0 -14
  16. package/dist/templates/SubscriptionAgreement/index.d.ts +1 -1
  17. package/dist/templates/SubscriptionAgreement/index.d.ts.map +1 -1
  18. package/dist/templates/SubscriptionAgreement/translations.d.ts.map +1 -1
  19. package/dist/templates/SubscriptionAgreement/utils.d.ts +1 -1
  20. package/dist/templates/SubscriptionAgreement/utils.d.ts.map +1 -1
  21. package/dist/theme/colors.d.ts.map +1 -1
  22. package/dist/theme/colors.js +36 -36
  23. package/dist/utils.d.ts +2 -8
  24. package/dist/utils.d.ts.map +1 -1
  25. package/dist/utils.js +7 -31
  26. package/package.json +23 -20
  27. package/.eslintrc +0 -3
  28. package/.swcrc +0 -14
  29. package/.turbo/turbo-build.log +0 -6
  30. package/CHANGELOG.md +0 -186
  31. package/dist/cjs/__mocks__/quotation.js +0 -70
  32. package/dist/cjs/__mocks__/subscription.js +0 -1079
  33. package/dist/cjs/components/FluxLogo.js +0 -76
  34. package/dist/cjs/components/StandardPage.js +0 -129
  35. package/dist/cjs/debug.js +0 -234
  36. package/dist/cjs/index.js +0 -20
  37. package/dist/cjs/templates/QuotationPdf/CustomerSubscriptionSection.js +0 -155
  38. package/dist/cjs/templates/QuotationPdf/GFV.js +0 -57
  39. package/dist/cjs/templates/QuotationPdf/Header.js +0 -86
  40. package/dist/cjs/templates/QuotationPdf/Pricing.js +0 -430
  41. package/dist/cjs/templates/QuotationPdf/QuotationPdfPage.js +0 -45
  42. package/dist/cjs/templates/QuotationPdf/SectionBoxNew.js +0 -43
  43. package/dist/cjs/templates/QuotationPdf/TermsSection.js +0 -60
  44. package/dist/cjs/templates/QuotationPdf/index.js +0 -208
  45. package/dist/cjs/templates/QuotationPdf/translations.js +0 -106
  46. package/dist/cjs/templates/QuotationPdf/utils.js +0 -108
  47. package/dist/cjs/templates/SubscriptionAgreement/Confirmation.js +0 -95
  48. package/dist/cjs/templates/SubscriptionAgreement/CoverPage.js +0 -110
  49. package/dist/cjs/templates/SubscriptionAgreement/CoverPageSection.js +0 -35
  50. package/dist/cjs/templates/SubscriptionAgreement/Details.js +0 -161
  51. package/dist/cjs/templates/SubscriptionAgreement/Footer.js +0 -68
  52. package/dist/cjs/templates/SubscriptionAgreement/Header.js +0 -61
  53. package/dist/cjs/templates/SubscriptionAgreement/LabelValue.js +0 -39
  54. package/dist/cjs/templates/SubscriptionAgreement/SubscriptionAgreementPage.js +0 -48
  55. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUse.js +0 -72
  56. package/dist/cjs/templates/SubscriptionAgreement/TermsOfUseSubSection.js +0 -108
  57. package/dist/cjs/templates/SubscriptionAgreement/index.js +0 -276
  58. package/dist/cjs/templates/SubscriptionAgreement/translations.js +0 -666
  59. package/dist/cjs/templates/SubscriptionAgreement/utils.js +0 -14
  60. package/dist/cjs/templates/index.js +0 -19
  61. package/dist/cjs/theme/colors.js +0 -147
  62. package/dist/cjs/theme/index.js +0 -18
  63. package/dist/cjs/types.js +0 -4
  64. package/dist/cjs/utils.js +0 -184
  65. package/dist/cjs/watch.js +0 -20
  66. package/index.cjs +0 -1
  67. package/index.d.ts +0 -1
  68. package/src/__mocks__/quotation.ts +0 -63
  69. package/src/__mocks__/subscription.ts +0 -803
  70. package/src/components/FluxLogo.tsx +0 -52
  71. package/src/components/StandardPage.tsx +0 -32
  72. package/src/debug.ts +0 -45
  73. package/src/index.ts +0 -3
  74. package/src/templates/QuotationPdf/CustomerSubscriptionSection.tsx +0 -73
  75. package/src/templates/QuotationPdf/GFV.tsx +0 -29
  76. package/src/templates/QuotationPdf/Header.tsx +0 -31
  77. package/src/templates/QuotationPdf/Pricing.tsx +0 -214
  78. package/src/templates/QuotationPdf/QuotationPdfPage.tsx +0 -25
  79. package/src/templates/QuotationPdf/SectionBoxNew.tsx +0 -20
  80. package/src/templates/QuotationPdf/TermsSection.tsx +0 -28
  81. package/src/templates/QuotationPdf/index.tsx +0 -46
  82. package/src/templates/QuotationPdf/translations.ts +0 -84
  83. package/src/templates/QuotationPdf/utils.ts +0 -59
  84. package/src/templates/SubscriptionAgreement/Confirmation.tsx +0 -49
  85. package/src/templates/SubscriptionAgreement/CoverPage.tsx +0 -52
  86. package/src/templates/SubscriptionAgreement/CoverPageSection.tsx +0 -25
  87. package/src/templates/SubscriptionAgreement/Details.tsx +0 -127
  88. package/src/templates/SubscriptionAgreement/Footer.tsx +0 -37
  89. package/src/templates/SubscriptionAgreement/Header.tsx +0 -37
  90. package/src/templates/SubscriptionAgreement/LabelValue.tsx +0 -19
  91. package/src/templates/SubscriptionAgreement/SubscriptionAgreementPage.tsx +0 -24
  92. package/src/templates/SubscriptionAgreement/TermsOfUse.tsx +0 -30
  93. package/src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx +0 -44
  94. package/src/templates/SubscriptionAgreement/index.tsx +0 -66
  95. package/src/templates/SubscriptionAgreement/translations.ts +0 -664
  96. package/src/templates/SubscriptionAgreement/utils.ts +0 -7
  97. package/src/templates/index.ts +0 -2
  98. package/src/theme/colors.ts +0 -180
  99. package/src/theme/index.ts +0 -1
  100. package/src/types.ts +0 -1
  101. package/src/utils.ts +0 -27
  102. package/src/watch.ts +0 -16
  103. package/tsconfig.json +0 -13
  104. 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
- }