@liiift-studio/sales-portal 1.2.1
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 +461 -0
- package/SETUP.md +230 -0
- package/api/getAnalytics.d.ts +38 -0
- package/api/getAnalytics.js +346 -0
- package/api/getBalanceTransactions.d.ts +29 -0
- package/api/getBalanceTransactions.js +125 -0
- package/api/getDesignerInfo.d.ts +37 -0
- package/api/getDesignerInfo.js +98 -0
- package/api/getDesigners.d.ts +28 -0
- package/api/getDesigners.js +63 -0
- package/api/getPreviousSales.d.ts +23 -0
- package/api/getPreviousSales.js +82 -0
- package/api/getSales.d.ts +29 -0
- package/api/getSales.js +50 -0
- package/api/getSalesRange.d.ts +23 -0
- package/api/getSalesRange.js +58 -0
- package/api/utils/authMiddleware.js +84 -0
- package/api/utils/dateUtils.js +69 -0
- package/api/utils/feeCalculator.js +148 -0
- package/api/utils/processors/invoiceProcessor.js +337 -0
- package/api/utils/processors/paymentProcessor.js +462 -0
- package/api/utils/salesDataProcessing.js +596 -0
- package/api/utils/salesDataProcessor.js +224 -0
- package/api/utils/stripeFetcher.js +248 -0
- package/components/DateRangeSalesTable.js +1072 -0
- package/components/DebugValues.js +48 -0
- package/components/LicenseTypeList.js +193 -0
- package/components/LoginForm.js +219 -0
- package/components/PeriodComparison.js +501 -0
- package/components/Sales.js +773 -0
- package/components/SalesChart.js +307 -0
- package/components/SalesPortalPage.js +147 -0
- package/components/SalesTable.js +677 -0
- package/components/SummaryCards.js +345 -0
- package/components/TopPerformers.js +331 -0
- package/components/TypefaceList.js +154 -0
- package/components/table-columns.js +70 -0
- package/components/table-row-cells.js +295 -0
- package/data/countryCode.json +318 -0
- package/hooks/useSalesDateQuery.d.ts +20 -0
- package/hooks/useSalesDateQuery.js +71 -0
- package/index.d.ts +172 -0
- package/index.js +33 -0
- package/package.json +87 -0
- package/styles/sales-portal.module.scss +383 -0
- package/styles/sales-portal.theme.d.ts +5 -0
- package/styles/sales-portal.theme.js +799 -0
- package/utils/currencyUtils.d.ts +20 -0
- package/utils/currencyUtils.js +79 -0
- package/utils/salesDataProcessing.d.ts +44 -0
- package/utils/salesDataProcessing.js +596 -0
- package/utils/useSalesDateQuery.js +71 -0
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liiift-studio/sales-portal",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Centralized sales portal package for Liiift Studio projects",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"api/**/*.js",
|
|
11
|
+
"api/**/*.d.ts",
|
|
12
|
+
"components/**/*.js",
|
|
13
|
+
"components/**/*.d.ts",
|
|
14
|
+
"hooks/**/*.js",
|
|
15
|
+
"hooks/**/*.d.ts",
|
|
16
|
+
"utils/**/*.js",
|
|
17
|
+
"utils/**/*.d.ts",
|
|
18
|
+
"styles/**/*.js",
|
|
19
|
+
"styles/**/*.d.ts",
|
|
20
|
+
"styles/**/*.scss",
|
|
21
|
+
"data/**/*.json",
|
|
22
|
+
"README.md",
|
|
23
|
+
"SETUP.md"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
|
+
"default": "./index.js"
|
|
29
|
+
},
|
|
30
|
+
"./components/*": {
|
|
31
|
+
"types": "./components/*.d.ts",
|
|
32
|
+
"default": "./components/*.js"
|
|
33
|
+
},
|
|
34
|
+
"./hooks/*": {
|
|
35
|
+
"types": "./hooks/*.d.ts",
|
|
36
|
+
"default": "./hooks/*.js"
|
|
37
|
+
},
|
|
38
|
+
"./utils/*": {
|
|
39
|
+
"types": "./utils/*.d.ts",
|
|
40
|
+
"default": "./utils/*.js"
|
|
41
|
+
},
|
|
42
|
+
"./api/*": {
|
|
43
|
+
"types": "./api/*.d.ts",
|
|
44
|
+
"default": "./api/*.js"
|
|
45
|
+
},
|
|
46
|
+
"./styles/*": {
|
|
47
|
+
"types": "./styles/*.d.ts",
|
|
48
|
+
"default": "./styles/*"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"test": "echo \"No tests yet\" && exit 0"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"sales",
|
|
56
|
+
"portal",
|
|
57
|
+
"dashboard",
|
|
58
|
+
"stripe"
|
|
59
|
+
],
|
|
60
|
+
"author": "Liiift Studio",
|
|
61
|
+
"license": "UNLICENSED",
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"@mui/material": "^5.10.0",
|
|
64
|
+
"@mui/x-charts": "^7.0.0",
|
|
65
|
+
"@mui/x-data-grid": "^8.0.0",
|
|
66
|
+
"@mui/x-date-pickers": "^7.0.0",
|
|
67
|
+
"dayjs": "^1.11.0",
|
|
68
|
+
"next": "^14.0.0",
|
|
69
|
+
"react": "^18.0.0",
|
|
70
|
+
"react-dom": "^18.0.0",
|
|
71
|
+
"slugify": "^1.6.0"
|
|
72
|
+
},
|
|
73
|
+
"repository": {
|
|
74
|
+
"type": "git",
|
|
75
|
+
"url": "git+https://github.com/Liiift-Studio/sales-portal.git"
|
|
76
|
+
},
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"registry": "https://registry.npmjs.org",
|
|
79
|
+
"access": "public"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@emotion/react": "^11.14.0",
|
|
83
|
+
"@emotion/styled": "^11.14.1",
|
|
84
|
+
"@mui/icons-material": "^5.18.0",
|
|
85
|
+
"slugify": "^1.6.6"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
.contentContainer{
|
|
2
|
+
padding-top: var(--marginY, 80px);
|
|
3
|
+
@media screen and (max-width: 900px) {
|
|
4
|
+
padding-top: var(--marginYMobile, 40px);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
.dash {
|
|
8
|
+
position: relative;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
background-color: var(--brand, purple);
|
|
13
|
+
margin-left: 1.5em;
|
|
14
|
+
|
|
15
|
+
&:after {
|
|
16
|
+
content: '';
|
|
17
|
+
height: 2px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.anchor{
|
|
22
|
+
display: block;
|
|
23
|
+
position: relative;
|
|
24
|
+
top:-80px;
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
.pageTitleContainer{
|
|
29
|
+
padding-left: var(--marginX, 30px);
|
|
30
|
+
padding-top: var(--marginY, 80px);
|
|
31
|
+
padding-bottom: calc(var(--marginY, 80px) / 2);
|
|
32
|
+
@media screen and (max-width: 900px) {
|
|
33
|
+
padding-left: 0;
|
|
34
|
+
padding-top: var(--marginYMobile, 40px);
|
|
35
|
+
padding-bottom: calc(var(--marginYMobile, 40px) / 2);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pageTitle{
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
text-transform: none;
|
|
41
|
+
letter-spacing: 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.titleContainer{
|
|
46
|
+
display:flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
:global(.MuiTypography-root){
|
|
50
|
+
font-family: 'Tomato Grotesk', sans-serif;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.svgContainer{
|
|
55
|
+
position: sticky;
|
|
56
|
+
top:50%;
|
|
57
|
+
height: fit-content;
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.line{
|
|
62
|
+
width: 100%;
|
|
63
|
+
margin-top: 5px;
|
|
64
|
+
border-bottom: 2px solid var(--brand, purple);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.iconContainer{
|
|
68
|
+
display:flex;
|
|
69
|
+
width:100%;
|
|
70
|
+
.icon{
|
|
71
|
+
width: 45px;
|
|
72
|
+
aspect-ratio: 1/1;
|
|
73
|
+
object-fit: contain;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.earningContainer {
|
|
79
|
+
border-bottom: 1px solid rgba(0, 0, 0, .25);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.displayLossContainer{
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 0;
|
|
85
|
+
right: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.tableRow{
|
|
89
|
+
&:last-child td, &:last-child th{
|
|
90
|
+
border: 0;
|
|
91
|
+
}
|
|
92
|
+
td{
|
|
93
|
+
max-width: 400px;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
text-overflow: ellipsis;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
.salesPortal{
|
|
100
|
+
&[data-loading="false"], [data-loading="false"]{
|
|
101
|
+
pointer-events: initial;
|
|
102
|
+
opacity: initial;
|
|
103
|
+
filter: saturate(1);
|
|
104
|
+
transition: 0.25s;
|
|
105
|
+
}
|
|
106
|
+
&[data-loading="true"], [data-loading="true"]{
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
opacity: .25;
|
|
109
|
+
filter: saturate(0);
|
|
110
|
+
transition: 0.25s;
|
|
111
|
+
mix-blend-mode: multiply;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.salesSection{
|
|
116
|
+
padding-left: var(--marginXMobile, 15px);
|
|
117
|
+
padding-right: var(--marginXMobile, 15px);
|
|
118
|
+
margin-bottom: 28px;
|
|
119
|
+
transition: all 0.3s ease;
|
|
120
|
+
@media screen and (min-width: 900px) {
|
|
121
|
+
padding-left: var(--marginX, 30px);
|
|
122
|
+
padding-right: var(--marginX, 30px);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.exportSection{
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
&::before{
|
|
128
|
+
content: '';
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 0;
|
|
132
|
+
left: -50%;
|
|
133
|
+
width: 200%;
|
|
134
|
+
height: 100%;
|
|
135
|
+
box-shadow: inset 0 10px 10px 0px rgba(0, 0, 0, 1);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
.globeWrap {
|
|
139
|
+
position: fixed;
|
|
140
|
+
left: -25%;
|
|
141
|
+
top: -10px;
|
|
142
|
+
width: 90vw;
|
|
143
|
+
height: 90vw;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
border-radius: 50%;
|
|
146
|
+
mix-blend-mode: multiply;
|
|
147
|
+
z-index: 0;
|
|
148
|
+
opacity: .7;
|
|
149
|
+
background: radial-gradient(circle at 50% 50%,rgba(var(--greenRGB), 0.1) 40%, rgba(var(--greenRGB), .25) 50%);
|
|
150
|
+
rotate: -7deg;
|
|
151
|
+
perspective: 100px;
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
&:hover{
|
|
155
|
+
animation: bubble-anim .5s ease-out;
|
|
156
|
+
}
|
|
157
|
+
&:before {
|
|
158
|
+
content: "";
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 1%;
|
|
161
|
+
left: 5%;
|
|
162
|
+
width: 90%;
|
|
163
|
+
height: 90%;
|
|
164
|
+
border-radius: 100%;
|
|
165
|
+
background: radial-gradient(circle at top, white, rgba(255, 255, 255, 0) 58%);
|
|
166
|
+
filter: blur(5px);
|
|
167
|
+
z-index: 2;
|
|
168
|
+
}
|
|
169
|
+
&:after {
|
|
170
|
+
content: "";
|
|
171
|
+
position: absolute;
|
|
172
|
+
bottom: 0%;
|
|
173
|
+
right: 0%;
|
|
174
|
+
width: 100%;
|
|
175
|
+
height: 100%;
|
|
176
|
+
border-radius: 100%;
|
|
177
|
+
background: radial-gradient(circle at top, rgba(var(--greenRGB), 0) 60%, rgba(var(--greenRGB), 1) 100%);
|
|
178
|
+
z-index: 1;
|
|
179
|
+
}
|
|
180
|
+
.globe{
|
|
181
|
+
rotate: -3deg;
|
|
182
|
+
pointer-events: none;
|
|
183
|
+
width: 200vw;
|
|
184
|
+
filter: drop-shadow(0px -1px 0px rgba(67, 171, 95, .5));
|
|
185
|
+
object-fit: contain;
|
|
186
|
+
animation: move 40s linear infinite;
|
|
187
|
+
}
|
|
188
|
+
.globe2{
|
|
189
|
+
position: absolute;
|
|
190
|
+
left: 200vw;
|
|
191
|
+
top: 0;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
@keyframes move {
|
|
195
|
+
0% {
|
|
196
|
+
transform: translateX(0vw);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
100% {
|
|
200
|
+
transform: translateX(-100vw);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
@keyframes bubble-anim {
|
|
204
|
+
0% {
|
|
205
|
+
transform: scale(1) rotateZ(0deg)
|
|
206
|
+
}
|
|
207
|
+
20% {
|
|
208
|
+
transform: scaleY(0.97) scaleX(1.03);
|
|
209
|
+
}
|
|
210
|
+
48% {
|
|
211
|
+
transform: scaleY(1.1) scaleX(0.9) rotateZ(4deg);
|
|
212
|
+
}
|
|
213
|
+
68% {
|
|
214
|
+
transform: scaleY(0.98) scaleX(1.02);
|
|
215
|
+
}
|
|
216
|
+
80% {
|
|
217
|
+
transform: scaleY(1.02) scaleX(0.98);
|
|
218
|
+
}
|
|
219
|
+
97%, 100% {
|
|
220
|
+
transform: scale(1) rotateZ(0deg);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* New Dashboard Styles */
|
|
225
|
+
|
|
226
|
+
/* Summary Cards Styling */
|
|
227
|
+
.summaryCardsContainer {
|
|
228
|
+
display: grid;
|
|
229
|
+
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
|
|
230
|
+
gap: 16px;
|
|
231
|
+
margin-bottom: 24px;
|
|
232
|
+
|
|
233
|
+
.summaryCard {
|
|
234
|
+
background-color: rgba(var(--blackRGB, 0, 0, 0), 0.04);
|
|
235
|
+
padding: 16px;
|
|
236
|
+
border-radius: 4px;
|
|
237
|
+
border: 1px solid rgba(var(--blackRGB, 0, 0, 0), 0.1);
|
|
238
|
+
transition: all 0.3s ease;
|
|
239
|
+
|
|
240
|
+
&:hover {
|
|
241
|
+
transform: translateY(-2px);
|
|
242
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.cardTitle {
|
|
246
|
+
font-size: 14px;
|
|
247
|
+
color: rgba(var(--blackRGB, 0, 0, 0), 0.6);
|
|
248
|
+
margin-bottom: 8px;
|
|
249
|
+
text-transform: uppercase;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.cardValue {
|
|
253
|
+
font-size: 24px;
|
|
254
|
+
font-weight: 700;
|
|
255
|
+
margin-bottom: 4px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.trendPositive {
|
|
259
|
+
color: var(--green);
|
|
260
|
+
display: flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
font-size: 14px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.trendNegative {
|
|
266
|
+
color: var(--red);
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
font-size: 14px;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.trendNeutral {
|
|
273
|
+
color: rgba(var(--blackRGB, 0, 0, 0), 0.6);
|
|
274
|
+
display: flex;
|
|
275
|
+
align-items: center;
|
|
276
|
+
font-size: 14px;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* Period Comparison Styling */
|
|
282
|
+
.comparisonContainer {
|
|
283
|
+
background-color: rgba(var(--blackRGB, 0, 0, 0), 0.02);
|
|
284
|
+
border-radius: 4px;
|
|
285
|
+
margin-top: 24px;
|
|
286
|
+
padding: 20px;
|
|
287
|
+
border: 1px solid rgba(var(--blackRGB, 0, 0, 0), 0.08);
|
|
288
|
+
|
|
289
|
+
.comparisonHeader {
|
|
290
|
+
display: flex;
|
|
291
|
+
justify-content: space-between;
|
|
292
|
+
align-items: center;
|
|
293
|
+
margin-bottom: 16px;
|
|
294
|
+
|
|
295
|
+
@media screen and (max-width: 900px) {
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
align-items: flex-start;
|
|
298
|
+
gap: 12px;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.comparisonControls {
|
|
303
|
+
display: flex;
|
|
304
|
+
gap: 12px;
|
|
305
|
+
align-items: center;
|
|
306
|
+
|
|
307
|
+
@media screen and (max-width: 900px) {
|
|
308
|
+
flex-wrap: wrap;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.comparisonChart {
|
|
313
|
+
min-height: 300px;
|
|
314
|
+
border-top: 1px solid rgba(var(--blackRGB, 0, 0, 0), 0.05);
|
|
315
|
+
padding-top: 20px;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* Enhanced Tables */
|
|
320
|
+
.enhancedTable {
|
|
321
|
+
border-radius: 4px;
|
|
322
|
+
overflow: hidden;
|
|
323
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
|
324
|
+
|
|
325
|
+
.tableHeader {
|
|
326
|
+
background-color: rgba(var(--blackRGB, 0, 0, 0), 0.06);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.tableFilter {
|
|
330
|
+
display: flex;
|
|
331
|
+
justify-content: space-between;
|
|
332
|
+
align-items: center;
|
|
333
|
+
margin-bottom: 12px;
|
|
334
|
+
flex-wrap: wrap;
|
|
335
|
+
gap: 8px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.sortableHeader {
|
|
339
|
+
cursor: pointer;
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
user-select: none;
|
|
343
|
+
|
|
344
|
+
&:hover {
|
|
345
|
+
background-color: rgba(var(--blackRGB, 0, 0, 0), 0.1);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.positiveValue {
|
|
350
|
+
color: var(--green);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.negativeValue {
|
|
354
|
+
color: var(--red);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* View Mode Toggle */
|
|
359
|
+
.viewModeToggle {
|
|
360
|
+
margin-bottom: 16px;
|
|
361
|
+
display: flex;
|
|
362
|
+
justify-content: flex-end;
|
|
363
|
+
|
|
364
|
+
.toggleButton {
|
|
365
|
+
border-radius: 4px;
|
|
366
|
+
padding: 6px 12px;
|
|
367
|
+
|
|
368
|
+
&.active {
|
|
369
|
+
background-color: rgba(var(--blackRGB, 0, 0, 0), 0.1);
|
|
370
|
+
font-weight: 500;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* Animation for data updates */
|
|
376
|
+
@keyframes fadeIn {
|
|
377
|
+
from { opacity: 0; transform: translateY(10px); }
|
|
378
|
+
to { opacity: 1; transform: translateY(0); }
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.fadeInAnimation {
|
|
382
|
+
animation: fadeIn 0.3s ease-out forwards;
|
|
383
|
+
}
|