@fixefy/fixefy-ui-utils 0.2.2 → 0.2.3

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.
@@ -1,764 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return getPageContext;
9
- }
10
- });
11
- const _styles = require("@mui/material/styles");
12
- const _styles1 = require("@mui/styles");
13
- const _jss = require("jss");
14
- function _define_property(obj, key, value) {
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
26
- }
27
- function _object_spread(target) {
28
- for(var i = 1; i < arguments.length; i++){
29
- var source = arguments[i] != null ? arguments[i] : {};
30
- var ownKeys = Object.keys(source);
31
- if (typeof Object.getOwnPropertySymbols === "function") {
32
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
33
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
34
- }));
35
- }
36
- ownKeys.forEach(function(key) {
37
- _define_property(target, key, source[key]);
38
- });
39
- }
40
- return target;
41
- }
42
- function ownKeys(object, enumerableOnly) {
43
- var keys = Object.keys(object);
44
- if (Object.getOwnPropertySymbols) {
45
- var symbols = Object.getOwnPropertySymbols(object);
46
- if (enumerableOnly) {
47
- symbols = symbols.filter(function(sym) {
48
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
49
- });
50
- }
51
- keys.push.apply(keys, symbols);
52
- }
53
- return keys;
54
- }
55
- function _object_spread_props(target, source) {
56
- source = source != null ? source : {};
57
- if (Object.getOwnPropertyDescriptors) {
58
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
59
- } else {
60
- ownKeys(Object(source)).forEach(function(key) {
61
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
62
- });
63
- }
64
- return target;
65
- }
66
- const theme = (0, _styles.createTheme)({
67
- palette: {
68
- background: {
69
- paper: '#fff'
70
- },
71
- common: {
72
- black: '#323232',
73
- white: '#FFFFFF'
74
- },
75
- colors: {
76
- red: '#EB5757',
77
- lightRed: '#FEF6F6',
78
- orange: '#F2994A',
79
- lightOrange: '#FEF7F1',
80
- orangeHover: '#EC7A30',
81
- orangeFocused: '#E65C15',
82
- gold: '#C4A603',
83
- lightGold: '#FAF7E6',
84
- yellow: '#F2D74C',
85
- lightYellow: '#FEFCEE',
86
- yellowHover: '#ECC631',
87
- yellowFocused: '#E6B517',
88
- green1: '#88C00D',
89
- lightGreen1: '#F6FAEC',
90
- green2: '#27AE60',
91
- lightGreen2: '#EEF9F2',
92
- green2Hover: '#169242',
93
- green2Focused: '#067724',
94
- green3: '#6FCF97',
95
- blue: '#2D9CDB',
96
- lightBlue: '#F3F9FD',
97
- blueHover: '#2D9CDB',
98
- blueFocused: '#085FBC',
99
- blue1: '#56CCF2',
100
- lightBlue1: '#F1FBFE',
101
- blue1Hover: '#39B8EC',
102
- blue1Focused: '#1DA3E6',
103
- purple: '#BB6BD9',
104
- lightPurple: '#FBF6FD'
105
- },
106
- greyscale: {
107
- dark: '#636363',
108
- main: '#ababab',
109
- light: '#e2e2e2',
110
- contrastText: '#f7f7f7',
111
- '500': '#5C6467',
112
- '400': '#8B9092',
113
- '300': '#C5C8C9',
114
- '200': '#F0F0F0',
115
- '100': '#F7F7F7'
116
- },
117
- redscale: {
118
- main: '#EB5757',
119
- '500': '#EE6868',
120
- '400': '#F08989',
121
- '300': '#F4AAAA',
122
- '200': '#F8CCCC',
123
- '100': '#FEF6F6'
124
- },
125
- orangescale: {
126
- '700': '#E65C15',
127
- '600': '#EC7A30',
128
- main: '#F2994A',
129
- '100': '#FEF7F1'
130
- },
131
- goldscale: {
132
- main: '#C4A603',
133
- '100': '#FAF7E6'
134
- },
135
- yellowscale: {
136
- '700': '#E6B517',
137
- '600': '#ECC631',
138
- main: '#F2D74C',
139
- '100': '#FEFCEE'
140
- },
141
- purplescale: {
142
- main: '#BB6BD9',
143
- '100': '#FBF6FD'
144
- },
145
- green1scale: {
146
- main: '#88C00D',
147
- '100': '#F6FAEC'
148
- },
149
- green2scale: {
150
- '700': '#067724',
151
- '600': '#169242',
152
- main: '#27AE60',
153
- '100': '#EEF9F2'
154
- },
155
- green3scale: {
156
- main: '#6FCF97'
157
- },
158
- blue1scale: {
159
- '700': '#1DA3E6',
160
- '600': '#39B8EC',
161
- main: '#56CCF2',
162
- '100': '#F1FBFE'
163
- },
164
- blue2scale: {
165
- '700': '#085FBC',
166
- '600': '#1A7ECC',
167
- main: '#2D9CDB',
168
- '100': '#F3F9FD'
169
- },
170
- error: {
171
- main: '#f44336'
172
- },
173
- pending: {
174
- main: '#e7cc0e',
175
- dark: '#B09000'
176
- },
177
- primary: {
178
- main: '#365c65',
179
- '100': '#C6DDE2',
180
- '300': '#87ACB6',
181
- '500': '#568793',
182
- '700': '#3C636C',
183
- '800': '#2F4F57'
184
- },
185
- priority: {
186
- critical: '#EB5757',
187
- high: '#F2994A',
188
- low: '#2D9CDB',
189
- medium: '#88C00D',
190
- marginal: '#56CCF2'
191
- },
192
- typography: {
193
- title: '#172326',
194
- delete: '#EB5757'
195
- },
196
- statistics: {
197
- value: '#568793',
198
- label: '#8B9092'
199
- },
200
- success: {
201
- main: '#88c00d'
202
- },
203
- uploader: {
204
- processing: {
205
- border: '',
206
- bg: ''
207
- },
208
- pause: {
209
- border: '',
210
- bg: ''
211
- }
212
- },
213
- score: {
214
- excellent: '#27AE60',
215
- high: '#88C00D',
216
- medium: '#F2C94C',
217
- low: '#F2994A',
218
- bad: '#ED323B'
219
- },
220
- status: {
221
- active: {
222
- border: '#96B5BC',
223
- background: '#F7F9FA'
224
- },
225
- approve: {
226
- border: '#88C00D',
227
- background: '#F9FCF3'
228
- },
229
- approved: {
230
- border: '#27AE60',
231
- background: '#EEF9F2'
232
- },
233
- challenge: {
234
- border: '#F7C08F',
235
- background: '#FEFAF6'
236
- },
237
- challenged: {
238
- border: '#F7C08F',
239
- background: '#FEFAF6'
240
- },
241
- declined: {
242
- border: '#F48085',
243
- background: '#FEF5F5'
244
- },
245
- discrepancy: {
246
- border: '#CEBA61',
247
- background: '#FBFAF2'
248
- },
249
- duplicate: {
250
- border: '#CEBA61',
251
- background: '#FBFAF2'
252
- },
253
- duplicated: {
254
- border: '#CEBA61',
255
- background: '#FBFAF2'
256
- },
257
- gold: {
258
- border: '#C4A603',
259
- background: '#FEFDF3'
260
- },
261
- in_dispute: {
262
- border: '#F2994A',
263
- background: '#FEF7F1'
264
- },
265
- in_progress: {
266
- border: '#56CCF2',
267
- background: '#F1FBFE'
268
- },
269
- in_review: {
270
- border: '#BB6BD9',
271
- background: '#FAF6FE'
272
- },
273
- no_pricing: {
274
- border: '#BBBBBB',
275
- background: '#FAFAFA'
276
- },
277
- pending: {
278
- border: '#ECC631',
279
- background: '#FEFDF3'
280
- }
281
- },
282
- tag: {
283
- approved: {
284
- border: '#27AE60',
285
- background: '#27AE60'
286
- },
287
- pending: {
288
- border: '#ECC631',
289
- background: '#ECC631'
290
- },
291
- created: {
292
- border: '#87ACB6',
293
- background: '#87ACB6'
294
- },
295
- declined: {
296
- border: '#EB5757',
297
- background: '#EB5757'
298
- },
299
- in_dispute: {
300
- border: '#56CCF2',
301
- background: '#56CCF2'
302
- },
303
- in_progress: {
304
- border: '#56CCF2',
305
- background: '#56CCF2'
306
- },
307
- paid: {
308
- border: '#BB6BD9',
309
- background: '#BB6BD9'
310
- },
311
- closed: {
312
- border: '#8B9092',
313
- background: '#8B9092'
314
- },
315
- refunded: {
316
- border: '#BB6BD9',
317
- background: '#BB6BD9'
318
- },
319
- low: {
320
- border: '#56CCF2',
321
- background: '#88C00D'
322
- }
323
- },
324
- invoiceState: {
325
- approved: {
326
- border: '#27AE60',
327
- background: '#27AE60',
328
- light: '#D4EFDF'
329
- },
330
- created: {
331
- border: '#87ACB6',
332
- background: '#87ACB6'
333
- },
334
- declined: {
335
- border: '#EB5757',
336
- background: '#EB5757'
337
- },
338
- in_dispute: {
339
- border: '#F2994A',
340
- background: '#F2994A',
341
- light: '#FCEBDB'
342
- },
343
- in_progress: {
344
- border: '#56CCF2',
345
- background: '#56CCF2'
346
- },
347
- paid: {
348
- border: '#BB6BD9',
349
- background: '#BB6BD9'
350
- },
351
- closed: {
352
- border: '#8B9092',
353
- background: '#8B9092'
354
- }
355
- },
356
- reconcilationState: {
357
- created: {
358
- border: '#87ACB6',
359
- background: '#87ACB6'
360
- },
361
- in_progress: {
362
- border: '#56CCF2',
363
- background: '#56CCF2'
364
- },
365
- approved: {
366
- border: '#27AE60',
367
- background: '#27AE60'
368
- },
369
- declined: {
370
- border: '#EB5757',
371
- background: '#EB5757'
372
- },
373
- approved: {
374
- border: '#27AE60',
375
- background: '#27AE60'
376
- },
377
- declined: {
378
- border: '#EB5757',
379
- background: '#EB5757'
380
- },
381
- refunded: {
382
- border: '#BB6BD9',
383
- background: '#BB6BD9'
384
- },
385
- closed: {
386
- border: '#8B9092',
387
- background: '#8B9092'
388
- }
389
- },
390
- trends: {
391
- positive: '#88C00D',
392
- negative: '#F2994A',
393
- critical: '#ED323B',
394
- percent: '#56CCF2',
395
- sum: '#BB6BD9'
396
- },
397
- invoiceAnalysis: {
398
- underCharges: '#87ACB6',
399
- overCharges: '#C6DDE2',
400
- matching: '#568793',
401
- invalid: '#EB5757'
402
- },
403
- snackbar: {
404
- info: {
405
- icon: '#56CCF2',
406
- border: '#56CCF2'
407
- },
408
- success: {
409
- icon: '#27AE60',
410
- border: '#27AE60'
411
- },
412
- error: {
413
- icon: '#ED323B',
414
- border: '#ED323B'
415
- },
416
- warn: {
417
- icon: '#F7DD8D',
418
- border: '#F2C94C'
419
- },
420
- critical: {
421
- icon: '#ED323B',
422
- border: '#ED323B'
423
- },
424
- silent: {
425
- icon: '#56CCF2',
426
- border: '#56CCF2'
427
- },
428
- alert: {
429
- icon: '#56CCF2',
430
- border: '#56CCF2'
431
- }
432
- },
433
- notificationStatus: {
434
- unread: '#F7F9FA'
435
- }
436
- },
437
- components: {
438
- MuiButton: {
439
- defaultProps: {
440
- disableRipple: true
441
- },
442
- variants: [
443
- {
444
- props: {
445
- variant: 'contained'
446
- },
447
- style: ({ theme })=>({
448
- background: theme.palette.primary[500],
449
- color: theme.palette.common.white,
450
- boxShadow: 'none',
451
- '&:hover': {
452
- background: theme.palette.primary['700'],
453
- boxShadow: 'none'
454
- },
455
- '&:focus': {
456
- background: theme.palette.primary['800'],
457
- boxShadow: 'none'
458
- },
459
- '&:disabled': {
460
- background: theme.palette.primary[500],
461
- color: theme.palette.common.white
462
- }
463
- })
464
- },
465
- {
466
- props: {
467
- variant: 'contained:rounded'
468
- },
469
- style: ({ theme })=>({
470
- borderRadius: 100,
471
- background: theme.palette.primary[500],
472
- color: theme.palette.common.white,
473
- '&:hover': {
474
- background: theme.palette.primary['700']
475
- },
476
- '&:focus': {
477
- background: theme.palette.primary['800']
478
- },
479
- '&:disabled': {
480
- background: theme.palette.primary[500],
481
- color: theme.palette.common.white
482
- }
483
- })
484
- },
485
- {
486
- props: {
487
- variant: 'outlined'
488
- },
489
- style: ({ theme })=>({
490
- borderRadius: 100,
491
- color: theme.palette.primary[500],
492
- borderColor: theme.palette.primary[500],
493
- '&:hover': {
494
- color: theme.palette.primary['700'],
495
- borderColor: theme.palette.primary['700'],
496
- background: 'transparent'
497
- },
498
- '&:focus': {
499
- color: theme.palette.primary['800'],
500
- borderColor: theme.palette.primary['800'],
501
- background: 'transparent'
502
- },
503
- '&:disabled': {
504
- color: theme.palette.primary[500],
505
- border: `1px solid ${theme.palette.primary[500]}`
506
- }
507
- })
508
- },
509
- {
510
- props: {
511
- variant: 'text'
512
- },
513
- style: ({ theme })=>({
514
- color: theme.palette.primary[500],
515
- '&:hover': {
516
- color: theme.palette.primary['700'],
517
- background: 'transparent'
518
- },
519
- '&:focus': {
520
- color: theme.palette.primary['800'],
521
- borderColor: theme.palette.primary['800'],
522
- background: 'transparent'
523
- },
524
- '&:disabled': {
525
- color: theme.palette.primary[500]
526
- }
527
- })
528
- }
529
- ],
530
- styleOverrides: {
531
- root: {
532
- fontWeight: 600,
533
- fontSize: 12,
534
- lineHeight: '24px',
535
- letterSpacing: '0.5px',
536
- height: 40
537
- }
538
- }
539
- },
540
- MuiInputBase: {
541
- styleOverrides: {
542
- //@ts-ignore
543
- root: ({ theme })=>({
544
- background: theme.palette.common.white,
545
- padding: theme.spacing(1, 2),
546
- height: 40,
547
- boxSizing: 'border-box',
548
- borderRadius: 4,
549
- border: '1px solid transparent',
550
- transition: '.2s',
551
- '&:focus-within': {
552
- borderColor: theme.palette.primary[100],
553
- '& input': {
554
- caretColor: theme.palette.primary[500]
555
- }
556
- },
557
- '&.Mui-error': {
558
- borderColor: theme.palette.redscale.main
559
- },
560
- 'label + &': {
561
- marginTop: theme.spacing(2.2),
562
- background: theme.palette.common.white
563
- },
564
- '& input': {
565
- color: theme.palette.typography.title,
566
- '&:placeholder': {
567
- color: theme.palette.greyscale[400]
568
- }
569
- },
570
- '&.MuiInputBase-adornedStart': {
571
- '& input': {
572
- paddingLeft: theme.spacing(2)
573
- }
574
- },
575
- '&.MuiInputBase-adornedEnd': {
576
- '& input': {
577
- paddingRight: theme.spacing(2)
578
- }
579
- }
580
- })
581
- }
582
- }
583
- },
584
- typography: {
585
- fontFamily: [
586
- 'Open Sans',
587
- 'OpenSans'
588
- ].join(','),
589
- body1: {
590
- fontWeight: 'normal',
591
- fontStyle: 'normal',
592
- fontSize: 14,
593
- lineHeight: '24px',
594
- letterSpacing: '0.15px'
595
- },
596
- button: {
597
- paddingLeft: 24,
598
- paddingRight: 24,
599
- color: 'white',
600
- fontWeight: 500,
601
- fontStyle: 'normal',
602
- fontSize: 14,
603
- lineHeight: '24px',
604
- letterSpacing: '0.5px'
605
- },
606
- table: {
607
- fontWeight: 'normal',
608
- fontStyle: 'normal',
609
- fontSize: 12,
610
- lineHeight: '16px',
611
- letterSpacing: '0.1px'
612
- },
613
- table2: {
614
- fontWeight: 900,
615
- fontStyle: 'normal',
616
- fontSize: 12,
617
- lineHeight: '16px',
618
- letterSpacing: '0.1px'
619
- },
620
- overLineCaption: {
621
- fontWeight: 'normal',
622
- fontStyle: 'normal',
623
- fontSize: 11,
624
- lineHeight: '16px',
625
- letterSpacing: '0.1px'
626
- },
627
- link: {
628
- fontWeight: 'normal',
629
- fontStyle: 'italic',
630
- fontSize: 12,
631
- lineHeight: '20px',
632
- letterSpacing: '0.15px'
633
- },
634
- h1: {
635
- fontWeight: 300,
636
- fontStyle: 'normal',
637
- fontSize: 59,
638
- lineHeight: '80px',
639
- letterSpacing: '-0.5px'
640
- },
641
- h2: {
642
- fontWeight: 'normal',
643
- fontStyle: 'normal',
644
- fontSize: 44,
645
- lineHeight: '64px',
646
- letterSpacing: '0px'
647
- },
648
- h3: {
649
- fontWeight: 'normal',
650
- fontStyle: 'normal',
651
- fontSize: 33,
652
- lineHeight: '48px',
653
- letterSpacing: '0.25px'
654
- },
655
- h4: {
656
- fontWeight: 'normal',
657
- fontStyle: 'normal',
658
- fontSize: 25,
659
- lineHeight: '40px',
660
- letterSpacing: '0px'
661
- },
662
- h5: {
663
- fontWeight: 500,
664
- fontStyle: 'normal',
665
- fontSize: 19,
666
- lineHeight: '28px',
667
- letterSpacing: '0.15px'
668
- },
669
- subtitle1: {
670
- fontWeight: 'normal',
671
- fontStyle: 'normal',
672
- fontSize: 16,
673
- lineHeight: '24px',
674
- letterSpacing: '0.15px'
675
- },
676
- subtitle2: {
677
- fontWeight: 500,
678
- fontStyle: 'normal',
679
- fontSize: 14,
680
- lineHeight: '24px',
681
- letterSpacing: '0.1px'
682
- }
683
- },
684
- sizes: {
685
- sideMenu: {
686
- width: 70,
687
- itemHeight: 60,
688
- logoHeight: 60,
689
- paddingTop: 20,
690
- marginBottom: 20
691
- },
692
- hex: 80,
693
- hex_node: 60,
694
- hex_event: 60,
695
- hex_service: 60,
696
- hex_structure: 30,
697
- header: {
698
- iconTray: 200,
699
- height: 60
700
- }
701
- }
702
- });
703
- const lightTheme = (0, _styles.createTheme)(_object_spread_props(_object_spread({}, theme), {
704
- //@ts-ignore
705
- palette: _object_spread_props(_object_spread({}, theme.palette), {
706
- mode: 'light',
707
- text: {
708
- primary: 'rgba(0, 0, 0, 0.87)',
709
- secondary: 'rgba(0, 0, 0, 0.54)',
710
- disabled: 'rgba(0, 0, 0, 0.38)'
711
- },
712
- divider: '#F0F0F0',
713
- background: {
714
- paper: '#fff',
715
- default: '#fafafa'
716
- }
717
- })
718
- }));
719
- const darkTheme = (0, _styles.createTheme)(_object_spread_props(_object_spread({}, theme), {
720
- //@ts-ignore
721
- palette: _object_spread_props(_object_spread({}, theme.palette), {
722
- mode: 'dark',
723
- text: {
724
- primary: '#fff',
725
- secondary: 'rgba(255, 255, 255, 0.7)',
726
- disabled: 'rgba(255, 255, 255, 0.5)'
727
- },
728
- divider: 'rgba(255, 255, 255, 0.12)',
729
- background: {
730
- paper: '#323232',
731
- default: '#303030'
732
- }
733
- })
734
- }));
735
- // A theme with custom primary and secondary color.
736
- // It's optional.
737
- function createPageContext(darkMode = false) {
738
- // const theme = darkMode ? darkTheme : lightTheme;
739
- return {
740
- theme: darkMode ? darkTheme : lightTheme,
741
- darkMode,
742
- // This is needed in order to deduplicate the injection of CSS in the page.
743
- sheetsManager: new Map(),
744
- // This is needed in order to inject the critical CSS.
745
- jss: (0, _jss.create)(_object_spread({}, (0, _styles1.jssPreset)())),
746
- sheetsRegistry: new _jss.SheetsRegistry(),
747
- // The standard class name generator.
748
- generateClassName: (0, _styles1.createGenerateClassName)()
749
- };
750
- }
751
- let pageContext;
752
- function getPageContext(darkMode) {
753
- // Make sure to create a new context for every server-side request so that data
754
- // isn't shared between connections (which would be bad).
755
- //@ts-ignore
756
- if (!process.browser) {
757
- return createPageContext(darkMode);
758
- }
759
- // Reuse context on the client-side.
760
- if (!pageContext) {
761
- pageContext = createPageContext(darkMode);
762
- }
763
- return pageContext;
764
- }