@nathapp/na-cli 1.0.7 → 1.0.9

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 (173) hide show
  1. package/dist/templates/db-schema/.gitlab-ci.yml +139 -0
  2. package/dist/templates/db-schema/Makefile +885 -0
  3. package/dist/templates/k8s-deployment/.gitlab-ci.yml +158 -0
  4. package/dist/templates/k8s-deployment/Makefile +233 -0
  5. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
  6. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
  7. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +56 -0
  8. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
  9. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
  10. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
  11. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
  12. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
  13. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
  14. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
  15. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
  16. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
  17. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
  18. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
  19. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
  20. package/dist/templates/nestjs-api/.dockerignore +9 -0
  21. package/dist/templates/nestjs-api/.env +31 -0
  22. package/dist/templates/nestjs-api/.gitignore-rename +1 -0
  23. package/dist/templates/nestjs-api/.gitlab-ci.yml +180 -0
  24. package/dist/templates/nestjs-api/.nvmrc +1 -0
  25. package/dist/templates/nestjs-api/.oxlintrc.json +18 -0
  26. package/dist/templates/nestjs-api/.prettierrc +4 -0
  27. package/dist/templates/nestjs-api/Dockerfile +15 -21
  28. package/dist/templates/nestjs-api/Makefile +95 -0
  29. package/dist/templates/nestjs-api/README.md +22 -30
  30. package/dist/templates/nestjs-api/nest-cli.json +10 -0
  31. package/dist/templates/nestjs-api/ormconfig.ts +18 -0
  32. package/dist/templates/nestjs-api/package.json +58 -72
  33. package/dist/templates/nestjs-api/src/app.controller.spec.ts +24 -0
  34. package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
  35. package/dist/templates/nestjs-api/src/app.module.ts +31 -0
  36. package/dist/templates/nestjs-api/src/app.service.ts +27 -0
  37. package/dist/templates/nestjs-api/src/main.ts +31 -0
  38. package/dist/templates/nestjs-api/test/app.e2e-spec.ts +47 -0
  39. package/dist/templates/nestjs-api/tsconfig.build.json +5 -0
  40. package/dist/templates/nestjs-api/tsconfig.json +28 -0
  41. package/dist/templates/nestjs-api/tsconfig.spec.json +9 -0
  42. package/dist/templates/nestjs-api/vitest.config.mts +33 -0
  43. package/dist/templates/nestjs-library/.gitignore-rename +1 -0
  44. package/dist/templates/nestjs-library/.gitlab-ci.yml +134 -0
  45. package/dist/templates/nestjs-library/.npmignore-rename +5 -2
  46. package/dist/templates/nestjs-library/.nvmrc +1 -0
  47. package/dist/templates/nestjs-library/.oxlintrc.json +18 -0
  48. package/dist/templates/nestjs-library/.prettierrc +6 -0
  49. package/dist/templates/nestjs-library/Makefile +60 -0
  50. package/dist/templates/nestjs-library/README.md +24 -0
  51. package/dist/templates/nestjs-library/lib/index.ts +2 -0
  52. package/dist/templates/nestjs-library/package.json +43 -33
  53. package/dist/templates/nestjs-library/test/app/controller/hello.controller.spec.ts +20 -0
  54. package/dist/templates/nestjs-library/test/app/controller/hello.controller.ts +7 -0
  55. package/dist/templates/nestjs-library/tsconfig.build.json +8 -0
  56. package/dist/templates/nestjs-library/tsconfig.json +21 -0
  57. package/dist/templates/nestjs-library/tsconfig.spec.json +9 -0
  58. package/dist/templates/nestjs-library/vitest.config.mts +29 -0
  59. package/dist/templates/ts-library/.dockerignore +2 -0
  60. package/dist/templates/ts-library/.eslintrc.js +24 -0
  61. package/dist/templates/ts-library/.gitlab-ci.yml +136 -0
  62. package/dist/templates/ts-library/.prettierrc +6 -0
  63. package/dist/templates/ts-library/Makefile +58 -0
  64. package/dist/templates/ts-library/index.ts +1 -0
  65. package/dist/templates/ts-library/lib/index.ts +1 -0
  66. package/dist/templates/ts-library/lib/samples/index.ts +5 -0
  67. package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
  68. package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
  69. package/dist/templates/ts-library/tsconfig.build.json +4 -0
  70. package/dist/templates/ts-library/tsconfig.json +18 -0
  71. package/dist/templates/turbo-nestjs-vuexy/.dockerignore +2 -0
  72. package/dist/templates/turbo-nestjs-vuexy/.gitignore-rename +40 -0
  73. package/dist/templates/turbo-nestjs-vuexy/.npmrc-rename +0 -0
  74. package/dist/templates/turbo-nestjs-vuexy/Makefile +48 -0
  75. package/dist/templates/vuexy-portal/.dockerignore +2 -0
  76. package/dist/templates/vuexy-portal/.env +1 -0
  77. package/dist/templates/vuexy-portal/.gitlab-ci.yml +233 -0
  78. package/dist/templates/vuexy-portal/.npmrc-rename +2 -0
  79. package/dist/templates/vuexy-portal/.nvmrc +1 -0
  80. package/dist/templates/vuexy-portal/Makefile +55 -0
  81. package/dist/templates/vuexy-portal/src/@core/composable/createUrl.ts +20 -0
  82. package/dist/templates/vuexy-portal/src/@core/composable/useCookie.ts +43 -0
  83. package/dist/templates/vuexy-portal/src/@core/composable/useGenerateImageVariant.ts +25 -0
  84. package/dist/templates/vuexy-portal/src/@core/composable/useResponsiveSidebar.ts +29 -0
  85. package/dist/templates/vuexy-portal/src/@core/composable/useSkins.ts +42 -0
  86. package/dist/templates/vuexy-portal/src/@core/enums.ts +21 -0
  87. package/dist/templates/vuexy-portal/src/@core/index.ts +43 -0
  88. package/dist/templates/vuexy-portal/src/@core/initCore.ts +93 -0
  89. package/dist/templates/vuexy-portal/src/@core/libs/apex-chart/apexCharConfig.ts +701 -0
  90. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/chartjsConfig.ts +372 -0
  91. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BarChart.ts +58 -0
  92. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BubbleChart.ts +58 -0
  93. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/DoughnutChart.ts +58 -0
  94. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/LineChart.ts +58 -0
  95. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/PolarAreaChart.ts +58 -0
  96. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/RadarChart.ts +58 -0
  97. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/ScatterChart.ts +58 -0
  98. package/dist/templates/vuexy-portal/src/@core/stores/config.ts +80 -0
  99. package/dist/templates/vuexy-portal/src/@core/types.ts +49 -0
  100. package/dist/templates/vuexy-portal/src/@core/utils/formatters.ts +48 -0
  101. package/dist/templates/vuexy-portal/src/@core/utils/helpers.ts +32 -0
  102. package/dist/templates/vuexy-portal/src/@core/utils/plugins.ts +53 -0
  103. package/dist/templates/vuexy-portal/src/@core/utils/validators.ts +105 -0
  104. package/dist/templates/vuexy-portal/src/@core/utils/vuetify.ts +13 -0
  105. package/dist/templates/vuexy-portal/src/@custom/composables/toasts.ts +45 -0
  106. package/dist/templates/vuexy-portal/src/@custom/composables/validator.ts +160 -0
  107. package/dist/templates/vuexy-portal/src/@custom/enums/index.ts +0 -0
  108. package/dist/templates/vuexy-portal/src/@custom/types/common.ts +17 -0
  109. package/dist/templates/vuexy-portal/src/@custom/types/index.ts +0 -0
  110. package/dist/templates/vuexy-portal/src/@custom/types/pagination.ts +19 -0
  111. package/dist/templates/vuexy-portal/src/@custom/types/user.ts +5 -0
  112. package/dist/templates/vuexy-portal/src/@custom/utils/formatters.ts +83 -0
  113. package/dist/templates/vuexy-portal/src/@custom/utils/index.ts +0 -0
  114. package/dist/templates/vuexy-portal/src/@custom/utils/validators.ts +51 -0
  115. package/dist/templates/vuexy-portal/src/@layouts/components.ts +11 -0
  116. package/dist/templates/vuexy-portal/src/@layouts/config.ts +43 -0
  117. package/dist/templates/vuexy-portal/src/@layouts/enums.ts +27 -0
  118. package/dist/templates/vuexy-portal/src/@layouts/index.ts +49 -0
  119. package/dist/templates/vuexy-portal/src/@layouts/plugins/casl.ts +48 -0
  120. package/dist/templates/vuexy-portal/src/@layouts/stores/config.ts +115 -0
  121. package/dist/templates/vuexy-portal/src/@layouts/symbols.ts +1 -0
  122. package/dist/templates/vuexy-portal/src/@layouts/types.ts +126 -0
  123. package/dist/templates/vuexy-portal/src/@layouts/utils.ts +180 -0
  124. package/dist/templates/vuexy-portal/src/api/api.ts +1 -0
  125. package/dist/templates/vuexy-portal/src/api/commonApi.ts +25 -0
  126. package/dist/templates/vuexy-portal/src/api/index.ts +58 -0
  127. package/dist/templates/vuexy-portal/src/api/requestInterceptor.ts +21 -0
  128. package/dist/templates/vuexy-portal/src/api/responseInterceptor.ts +52 -0
  129. package/dist/templates/vuexy-portal/src/api/types.ts +14 -0
  130. package/dist/templates/vuexy-portal/src/api/useApi.ts +68 -0
  131. package/dist/templates/vuexy-portal/src/api/useFetchApi.ts +41 -0
  132. package/dist/templates/vuexy-portal/src/api/userApi.ts +11 -0
  133. package/dist/templates/vuexy-portal/src/composables/useApiFetch.ts +48 -0
  134. package/dist/templates/vuexy-portal/src/composables/useJwt.ts +108 -0
  135. package/dist/templates/vuexy-portal/src/main.ts +17 -0
  136. package/dist/templates/vuexy-portal/src/navigation/horizontal/index.ts +5 -0
  137. package/dist/templates/vuexy-portal/src/navigation/index.ts +7 -0
  138. package/dist/templates/vuexy-portal/src/navigation/vertical/index.ts +5 -0
  139. package/dist/templates/vuexy-portal/src/plugins/1.router/additional-routes.ts +23 -0
  140. package/dist/templates/vuexy-portal/src/plugins/1.router/guards.ts +50 -0
  141. package/dist/templates/vuexy-portal/src/plugins/1.router/index.ts +45 -0
  142. package/dist/templates/vuexy-portal/src/plugins/2.pinia.ts +8 -0
  143. package/dist/templates/vuexy-portal/src/plugins/casl/ability.ts +10 -0
  144. package/dist/templates/vuexy-portal/src/plugins/casl/composables/useAbility.ts +4 -0
  145. package/dist/templates/vuexy-portal/src/plugins/casl/index.ts +14 -0
  146. package/dist/templates/vuexy-portal/src/plugins/i18n/index.ts +29 -0
  147. package/dist/templates/vuexy-portal/src/plugins/iconify/build-icons.ts +299 -0
  148. package/dist/templates/vuexy-portal/src/plugins/iconify/index.ts +5 -0
  149. package/dist/templates/vuexy-portal/src/plugins/layouts.ts +13 -0
  150. package/dist/templates/vuexy-portal/src/plugins/toast/index.ts +9 -0
  151. package/dist/templates/vuexy-portal/src/plugins/vuetify/defaults.ts +192 -0
  152. package/dist/templates/vuexy-portal/src/plugins/vuetify/icons.ts +84 -0
  153. package/dist/templates/vuexy-portal/src/plugins/vuetify/index.ts +47 -0
  154. package/dist/templates/vuexy-portal/src/plugins/vuetify/theme.ts +155 -0
  155. package/dist/templates/vuexy-portal/src/plugins/webfontloader.ts +19 -0
  156. package/dist/templates/vuexy-portal/src/stores/auth.ts +22 -0
  157. package/dist/templates/vuexy-portal/src/stores/common.ts +41 -0
  158. package/dist/templates/vuexy-portal/src/stores/index.ts +0 -0
  159. package/dist/templates/vuexy-portal/src/utils/constants.ts +3 -0
  160. package/dist/templates/vuexy-portal/src/utils/paginationMeta.ts +10 -0
  161. package/dist/templates/vuexy-portal/themeConfig.ts +66 -0
  162. package/dist/templates/vuexy-portal/tsconfig.json +86 -0
  163. package/dist/templates/vuexy-portal/vite.config.ts +111 -0
  164. package/dist/utils/template.js +2 -0
  165. package/dist/utils/template.js.map +1 -1
  166. package/package.json +4 -1
  167. package/alias-script.sh +0 -30
  168. package/bunfig.toml +0 -3
  169. package/dist/templates/nestjs-api/test/jest-e2e.json +0 -12
  170. package/dist/templates/nestjs-api/test/jest-test.json +0 -26
  171. package/dist/templates/nestjs-library/test/jest-test.json +0 -23
  172. package/nax/config.json +0 -23
  173. package/nax/features/enhancements/prd.json +0 -61
@@ -0,0 +1,701 @@
1
+ import type { ThemeInstance } from 'vuetify'
2
+ import { hexToRgb } from '@layouts/utils'
3
+
4
+ // 👉 Colors variables
5
+ const colorVariables = (themeColors: ThemeInstance['themes']['value']['colors']) => {
6
+ const themeSecondaryTextColor = `rgba(${hexToRgb(themeColors.colors['on-surface'])},${themeColors.variables['medium-emphasis-opacity']})`
7
+ const themeDisabledTextColor = `rgba(${hexToRgb(themeColors.colors['on-surface'])},${themeColors.variables['disabled-opacity']})`
8
+ const themeBorderColor = `rgba(${hexToRgb(String(themeColors.variables['border-color']))},${themeColors.variables['border-opacity']})`
9
+ const themePrimaryTextColor = `rgba(${hexToRgb(themeColors.colors['on-surface'])},${themeColors.variables['high-emphasis-opacity']})`
10
+
11
+ return { themeSecondaryTextColor, themeDisabledTextColor, themeBorderColor, themePrimaryTextColor }
12
+ }
13
+
14
+ export const getScatterChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
15
+ const scatterColors = {
16
+ series1: '#ff9f43',
17
+ series2: '#7367f0',
18
+ series3: '#28c76f',
19
+ }
20
+
21
+ const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
22
+
23
+ return {
24
+ chart: {
25
+ parentHeightOffset: 0,
26
+ toolbar: { show: false },
27
+ zoom: {
28
+ type: 'xy',
29
+ enabled: true,
30
+ },
31
+ },
32
+ legend: {
33
+ position: 'top',
34
+ horizontalAlign: 'left',
35
+ markers: { offsetX: -3 },
36
+ fontSize: '13px',
37
+ labels: { colors: themeSecondaryTextColor },
38
+ itemMargin: {
39
+ vertical: 3,
40
+ horizontal: 10,
41
+ },
42
+ },
43
+ colors: [scatterColors.series1, scatterColors.series2, scatterColors.series3],
44
+ grid: {
45
+ borderColor: themeBorderColor,
46
+ xaxis: {
47
+ lines: { show: true },
48
+ },
49
+ },
50
+ yaxis: {
51
+ labels: {
52
+ style: { fontSize: '0.8125rem', colors: themeDisabledTextColor },
53
+ },
54
+ },
55
+ xaxis: {
56
+ tickAmount: 10,
57
+ axisBorder: { show: false },
58
+ axisTicks: { color: themeBorderColor },
59
+ crosshairs: {
60
+ stroke: { color: themeBorderColor },
61
+ },
62
+ labels: {
63
+ style: { colors: themeDisabledTextColor },
64
+ formatter: (val: string) => Number.parseFloat(val).toFixed(1),
65
+ },
66
+ },
67
+ }
68
+ }
69
+ export const getLineChartSimpleConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
70
+ const { themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
71
+
72
+ return {
73
+ chart: {
74
+ parentHeightOffset: 0,
75
+ zoom: { enabled: false },
76
+ toolbar: { show: false },
77
+ },
78
+ colors: ['#ff9f43'],
79
+ stroke: { curve: 'straight' },
80
+ dataLabels: { enabled: false },
81
+ markers: {
82
+ strokeWidth: 7,
83
+ strokeOpacity: 1,
84
+ colors: ['#ff9f43'],
85
+ strokeColors: ['#fff'],
86
+ },
87
+ grid: {
88
+ padding: { top: -10 },
89
+ borderColor: themeBorderColor,
90
+ xaxis: {
91
+ lines: { show: true },
92
+ },
93
+ },
94
+ tooltip: {
95
+ custom(data: any) {
96
+ return `<div class='bar-chart pa-2'>
97
+ <span>${data.series[data.seriesIndex][data.dataPointIndex]}%</span>
98
+ </div>`
99
+ },
100
+ },
101
+ yaxis: {
102
+ labels: {
103
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
104
+ },
105
+ },
106
+ xaxis: {
107
+ axisBorder: { show: false },
108
+ axisTicks: { color: themeBorderColor },
109
+ crosshairs: {
110
+ stroke: { color: themeBorderColor },
111
+ },
112
+ labels: {
113
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
114
+ },
115
+ categories: [
116
+ '7/12',
117
+ '8/12',
118
+ '9/12',
119
+ '10/12',
120
+ '11/12',
121
+ '12/12',
122
+ '13/12',
123
+ '14/12',
124
+ '15/12',
125
+ '16/12',
126
+ '17/12',
127
+ '18/12',
128
+ '19/12',
129
+ '20/12',
130
+ '21/12',
131
+ ],
132
+ },
133
+ }
134
+ }
135
+
136
+ export const getBarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
137
+ const { themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
138
+
139
+ return {
140
+ chart: {
141
+ parentHeightOffset: 0,
142
+ toolbar: { show: false },
143
+ },
144
+ colors: ['#00cfe8'],
145
+ dataLabels: { enabled: false },
146
+ plotOptions: {
147
+ bar: {
148
+ borderRadius: 8,
149
+ barHeight: '30%',
150
+ horizontal: true,
151
+ },
152
+ },
153
+ grid: {
154
+ borderColor: themeBorderColor,
155
+ xaxis: {
156
+ lines: { show: false },
157
+ },
158
+ padding: {
159
+ top: -10,
160
+ },
161
+ },
162
+ yaxis: {
163
+ labels: {
164
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
165
+ },
166
+ },
167
+ xaxis: {
168
+ axisBorder: { show: false },
169
+ axisTicks: { color: themeBorderColor },
170
+ categories: ['MON, 11', 'THU, 14', 'FRI, 15', 'MON, 18', 'WED, 20', 'FRI, 21', 'MON, 23'],
171
+ labels: {
172
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
173
+ },
174
+ },
175
+ }
176
+ }
177
+
178
+ export const getCandlestickChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
179
+ const candlestickColors = {
180
+ series1: '#28c76f',
181
+ series2: '#ea5455',
182
+ }
183
+
184
+ const { themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
185
+
186
+ return {
187
+ chart: {
188
+ parentHeightOffset: 0,
189
+ toolbar: { show: false },
190
+ },
191
+ plotOptions: {
192
+ bar: { columnWidth: '40%' },
193
+ candlestick: {
194
+ colors: {
195
+ upward: candlestickColors.series1,
196
+ downward: candlestickColors.series2,
197
+ },
198
+ },
199
+ },
200
+ grid: {
201
+ padding: { top: -10 },
202
+ borderColor: themeBorderColor,
203
+ xaxis: {
204
+ lines: { show: true },
205
+ },
206
+ },
207
+ yaxis: {
208
+ tooltip: { enabled: true },
209
+ crosshairs: {
210
+ stroke: { color: themeBorderColor },
211
+ },
212
+ labels: {
213
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
214
+ },
215
+ },
216
+ xaxis: {
217
+ type: 'datetime',
218
+ axisBorder: { show: false },
219
+ axisTicks: { color: themeBorderColor },
220
+ crosshairs: {
221
+ stroke: { color: themeBorderColor },
222
+ },
223
+ labels: {
224
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
225
+ },
226
+ },
227
+ }
228
+ }
229
+ export const getRadialBarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
230
+ const radialBarColors = {
231
+ series1: '#fdd835',
232
+ series2: '#32baff',
233
+ series3: '#00d4bd',
234
+ series4: '#7367f0',
235
+ series5: '#FFA1A1',
236
+ }
237
+
238
+ const { themeSecondaryTextColor, themePrimaryTextColor } = colorVariables(themeColors)
239
+
240
+ return {
241
+ stroke: { lineCap: 'round' },
242
+ labels: ['Comments', 'Replies', 'Shares'],
243
+ legend: {
244
+ show: true,
245
+ fontSize: '13px',
246
+ position: 'bottom',
247
+ labels: {
248
+ colors: themeSecondaryTextColor,
249
+ },
250
+ markers: {
251
+ offsetX: -3,
252
+ },
253
+ itemMargin: {
254
+ vertical: 3,
255
+ horizontal: 10,
256
+ },
257
+ },
258
+ colors: [radialBarColors.series1, radialBarColors.series2, radialBarColors.series4],
259
+ plotOptions: {
260
+ radialBar: {
261
+ hollow: { size: '30%' },
262
+ track: {
263
+ margin: 15,
264
+ background: themeColors.variables['track-bg'],
265
+ },
266
+ dataLabels: {
267
+ name: {
268
+ fontSize: '2rem',
269
+ },
270
+ value: {
271
+ fontSize: '0.9375rem',
272
+ color: themeSecondaryTextColor,
273
+ },
274
+ total: {
275
+ show: true,
276
+ fontWeight: 400,
277
+ label: 'Comments',
278
+ fontSize: '1.125rem',
279
+
280
+ color: themePrimaryTextColor,
281
+
282
+ formatter(w: { globals: { seriesTotals: any[]; series: string | any[] } }) {
283
+ const totalValue
284
+ = w.globals.seriesTotals.reduce((a: number, b: number) => {
285
+ return a + b
286
+ }, 0) / w.globals.series.length
287
+
288
+ if (totalValue % 1 === 0)
289
+ return `${totalValue}%`
290
+ else
291
+ return `${totalValue.toFixed(2)}%`
292
+ },
293
+ },
294
+ },
295
+ },
296
+ },
297
+ grid: {
298
+ padding: {
299
+ top: -30,
300
+ bottom: -25,
301
+ },
302
+ },
303
+ }
304
+ }
305
+
306
+ export const getDonutChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
307
+ const donutColors = {
308
+ series1: '#fdd835',
309
+ series2: '#00d4bd',
310
+ series3: '#826bf8',
311
+ series4: '#32baff',
312
+ series5: '#ffa1a1',
313
+ }
314
+
315
+ const { themeSecondaryTextColor, themePrimaryTextColor } = colorVariables(themeColors)
316
+
317
+ return {
318
+ stroke: { width: 0 },
319
+ labels: ['Operational', 'Networking', 'Hiring', 'R&D'],
320
+ colors: [donutColors.series1, donutColors.series5, donutColors.series3, donutColors.series2],
321
+ dataLabels: {
322
+ enabled: true,
323
+ formatter: (val: string) => `${Number.parseInt(val, 10)}%`,
324
+ },
325
+ legend: {
326
+ position: 'bottom',
327
+ markers: { offsetX: -3 },
328
+ fontSize: '13px',
329
+ labels: { colors: themeSecondaryTextColor },
330
+ itemMargin: {
331
+ vertical: 3,
332
+ horizontal: 10,
333
+ },
334
+ },
335
+ plotOptions: {
336
+ pie: {
337
+ donut: {
338
+ labels: {
339
+ show: true,
340
+ name: {
341
+ fontSize: '1.125rem',
342
+ },
343
+ value: {
344
+ fontSize: '1.125rem',
345
+ color: themeSecondaryTextColor,
346
+ formatter: (val: string) => `${Number.parseInt(val, 10)}`,
347
+ },
348
+ total: {
349
+ show: true,
350
+ fontSize: '1.125rem',
351
+ label: 'Operational',
352
+ formatter: () => '31%',
353
+ color: themePrimaryTextColor,
354
+ },
355
+ },
356
+ },
357
+ },
358
+ },
359
+ responsive: [
360
+ {
361
+ breakpoint: 992,
362
+ options: {
363
+ chart: {
364
+ height: 380,
365
+ },
366
+ legend: {
367
+ position: 'bottom',
368
+ },
369
+ },
370
+ },
371
+ {
372
+ breakpoint: 576,
373
+ options: {
374
+ chart: {
375
+ height: 320,
376
+ },
377
+ plotOptions: {
378
+ pie: {
379
+ donut: {
380
+ labels: {
381
+ show: true,
382
+ name: {
383
+ fontSize: '0.9375rem',
384
+ },
385
+ value: {
386
+ fontSize: '0.9375rem',
387
+ },
388
+ total: {
389
+ fontSize: '0.9375rem',
390
+ },
391
+ },
392
+ },
393
+ },
394
+ },
395
+ },
396
+ },
397
+ ],
398
+ }
399
+ }
400
+
401
+ export const getAreaChartSplineConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
402
+ const areaColors = {
403
+ series3: '#e0cffe',
404
+ series2: '#b992fe',
405
+ series1: '#ab7efd',
406
+ }
407
+
408
+ const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
409
+
410
+ return {
411
+ chart: {
412
+ parentHeightOffset: 0,
413
+ toolbar: { show: false },
414
+ },
415
+ tooltip: { shared: false },
416
+ dataLabels: { enabled: false },
417
+ stroke: {
418
+ show: false,
419
+ curve: 'straight',
420
+ },
421
+ legend: {
422
+ position: 'top',
423
+ horizontalAlign: 'left',
424
+ fontSize: '13px',
425
+ labels: { colors: themeSecondaryTextColor },
426
+ markers: {
427
+ offsetY: 1,
428
+ offsetX: -3,
429
+ },
430
+ itemMargin: {
431
+ vertical: 3,
432
+ horizontal: 10,
433
+ },
434
+ },
435
+
436
+ colors: [areaColors.series3, areaColors.series2, areaColors.series1],
437
+ fill: {
438
+ opacity: 1,
439
+ type: 'solid',
440
+ },
441
+ grid: {
442
+ show: true,
443
+ borderColor: themeBorderColor,
444
+ xaxis: {
445
+ lines: { show: true },
446
+ },
447
+ },
448
+ yaxis: {
449
+ labels: {
450
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
451
+ },
452
+ },
453
+ xaxis: {
454
+ axisBorder: { show: false },
455
+ axisTicks: { color: themeBorderColor },
456
+ crosshairs: {
457
+ stroke: { color: themeBorderColor },
458
+ },
459
+ labels: {
460
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
461
+ },
462
+ categories: [
463
+ '7/12',
464
+ '8/12',
465
+ '9/12',
466
+ '10/12',
467
+ '11/12',
468
+ '12/12',
469
+ '13/12',
470
+ '14/12',
471
+ '15/12',
472
+ '16/12',
473
+ '17/12',
474
+ '18/12',
475
+ '19/12',
476
+ ],
477
+ },
478
+ }
479
+ }
480
+
481
+ export const getColumnChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
482
+ const columnColors = {
483
+ series1: '#826af9',
484
+ series2: '#d2b0ff',
485
+ bg: '#f8d3ff',
486
+ }
487
+
488
+ const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
489
+
490
+ return {
491
+ chart: {
492
+ offsetX: -10,
493
+ stacked: true,
494
+ parentHeightOffset: 0,
495
+ toolbar: { show: false },
496
+ },
497
+ fill: { opacity: 1 },
498
+ dataLabels: { enabled: false },
499
+
500
+ colors: [columnColors.series1, columnColors.series2],
501
+ legend: {
502
+ position: 'top',
503
+ horizontalAlign: 'left',
504
+ fontSize: '13px',
505
+ labels: { colors: themeSecondaryTextColor },
506
+ markers: {
507
+ offsetY: 1,
508
+ offsetX: -3,
509
+ },
510
+ itemMargin: {
511
+ vertical: 3,
512
+ horizontal: 10,
513
+ },
514
+ },
515
+ stroke: {
516
+ show: true,
517
+ colors: ['transparent'],
518
+ },
519
+ plotOptions: {
520
+ bar: {
521
+ columnWidth: '15%',
522
+ colors: {
523
+ backgroundBarRadius: 10,
524
+ backgroundBarColors: [columnColors.bg, columnColors.bg, columnColors.bg, columnColors.bg, columnColors.bg],
525
+ },
526
+ },
527
+ },
528
+ grid: {
529
+ borderColor: themeBorderColor,
530
+ xaxis: {
531
+ lines: { show: true },
532
+ },
533
+ },
534
+ yaxis: {
535
+ labels: {
536
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
537
+ },
538
+ },
539
+ xaxis: {
540
+ axisBorder: { show: false },
541
+ axisTicks: { color: themeBorderColor },
542
+ categories: ['7/12', '8/12', '9/12', '10/12', '11/12', '12/12', '13/12', '14/12', '15/12'],
543
+ crosshairs: {
544
+ stroke: { color: themeBorderColor },
545
+ },
546
+ labels: {
547
+ style: { colors: themeDisabledTextColor, fontSize: '0.8125rem' },
548
+ },
549
+ },
550
+ responsive: [
551
+ {
552
+ breakpoint: 600,
553
+ options: {
554
+ plotOptions: {
555
+ bar: {
556
+ columnWidth: '35%',
557
+ },
558
+ },
559
+ },
560
+ },
561
+ ],
562
+ }
563
+ }
564
+
565
+ export const getHeatMapChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
566
+ const { themeSecondaryTextColor, themeDisabledTextColor } = colorVariables(themeColors)
567
+
568
+ return {
569
+ chart: {
570
+ parentHeightOffset: 0,
571
+ toolbar: { show: false },
572
+ },
573
+ dataLabels: { enabled: false },
574
+ stroke: {
575
+ colors: [themeColors.colors.surface],
576
+ },
577
+ legend: {
578
+ position: 'bottom',
579
+ fontSize: '13px',
580
+ labels: {
581
+ colors: themeSecondaryTextColor,
582
+ },
583
+ markers: {
584
+ offsetY: 0,
585
+ offsetX: -3,
586
+ },
587
+ itemMargin: {
588
+ vertical: 3,
589
+ horizontal: 10,
590
+ },
591
+ },
592
+ plotOptions: {
593
+ heatmap: {
594
+ enableShades: false,
595
+ colorScale: {
596
+ ranges: [
597
+ { to: 10, from: 0, name: '0-10', color: '#b9b3f8' },
598
+ { to: 20, from: 11, name: '10-20', color: '#aba4f6' },
599
+ { to: 30, from: 21, name: '20-30', color: '#9d95f5' },
600
+ { to: 40, from: 31, name: '30-40', color: '#8f85f3' },
601
+ { to: 50, from: 41, name: '40-50', color: '#8176f2' },
602
+ { to: 60, from: 51, name: '50-60', color: '#7367f0' },
603
+ ],
604
+ },
605
+ },
606
+ },
607
+ grid: {
608
+ padding: { top: -20 },
609
+ },
610
+ yaxis: {
611
+ labels: {
612
+ style: {
613
+ colors: themeDisabledTextColor,
614
+ fontSize: '0.8125rem',
615
+ },
616
+ },
617
+ },
618
+ xaxis: {
619
+ labels: { show: false },
620
+ axisTicks: { show: false },
621
+ axisBorder: { show: false },
622
+ },
623
+ }
624
+ }
625
+
626
+ export const getRadarChartConfig = (themeColors: ThemeInstance['themes']['value']['colors']) => {
627
+ const radarColors = {
628
+ series1: '#9b88fa',
629
+ series2: '#ffa1a1',
630
+ }
631
+
632
+ const { themeSecondaryTextColor, themeBorderColor, themeDisabledTextColor } = colorVariables(themeColors)
633
+
634
+ return {
635
+ chart: {
636
+ parentHeightOffset: 0,
637
+ toolbar: { show: false },
638
+ dropShadow: {
639
+ top: 1,
640
+ blur: 8,
641
+ left: 1,
642
+ opacity: 0.2,
643
+ enabled: false,
644
+ },
645
+ },
646
+ markers: { size: 0 },
647
+ fill: { opacity: [1, 0.8] },
648
+ colors: [radarColors.series1, radarColors.series2],
649
+ stroke: {
650
+ width: 0,
651
+ show: false,
652
+ },
653
+ legend: {
654
+ fontSize: '13px',
655
+ labels: {
656
+ colors: themeSecondaryTextColor,
657
+ },
658
+ markers: {
659
+ offsetX: -3,
660
+ },
661
+ itemMargin: {
662
+ vertical: 3,
663
+ horizontal: 10,
664
+ },
665
+ },
666
+ plotOptions: {
667
+ radar: {
668
+ polygons: {
669
+ strokeColors: themeBorderColor,
670
+ connectorColors: themeBorderColor,
671
+ },
672
+ },
673
+ },
674
+ grid: {
675
+ show: false,
676
+ padding: {
677
+ top: -20,
678
+ bottom: -20,
679
+ },
680
+ },
681
+ yaxis: { show: false },
682
+ xaxis: {
683
+ categories: ['Battery', 'Brand', 'Camera', 'Memory', 'Storage', 'Display', 'OS', 'Price'],
684
+ labels: {
685
+ style: {
686
+ fontSize: '0.8125rem',
687
+ colors: [
688
+ themeDisabledTextColor,
689
+ themeDisabledTextColor,
690
+ themeDisabledTextColor,
691
+ themeDisabledTextColor,
692
+ themeDisabledTextColor,
693
+ themeDisabledTextColor,
694
+ themeDisabledTextColor,
695
+ themeDisabledTextColor,
696
+ ],
697
+ },
698
+ },
699
+ },
700
+ }
701
+ }