@ukpc-lib/react 0.3.4 → 0.3.5

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,636 +0,0 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { createTheme as b, ThemeProvider as v } from "@mui/material";
3
- import l, { createContext as P, useContext as C } from "react";
4
- import { useQuery as O } from "react-query";
5
- const M = {
6
- primary100: "#F0F6E1",
7
- primary200: "#E5F5ED",
8
- primary300: "#93D500",
9
- primary400: "#009D4F",
10
- primary500: "#2E7D32",
11
- secondary: "#CC0066",
12
- secondaryDark: "#AE1857",
13
- textPrimary: "#292929",
14
- white: "#FFFFFF",
15
- grey100: "#FAFAFA",
16
- grey200: "#EEEEEE",
17
- grey300: "#DDDDDD",
18
- grey400: "#C5C5C5",
19
- grey500: "#BFBFBF",
20
- grey600: "#85858A",
21
- success: "#009D4F",
22
- successLight: "#009D4F10",
23
- warning: "#FFB600",
24
- warningLight: "#FFB60010",
25
- danger: "#E01B00",
26
- dangerLight: "#E01B0010",
27
- dangerDark: "#BE1700",
28
- linkPrimary: "#007BFF",
29
- linkLight: "#007BFF10"
30
- };
31
- var h = {
32
- color: void 0,
33
- size: void 0,
34
- className: void 0,
35
- style: void 0,
36
- attr: void 0
37
- }, p = l.createContext && /* @__PURE__ */ l.createContext(h), w = ["attr", "size", "title"];
38
- function S(r, e) {
39
- if (r == null)
40
- return {};
41
- var t = F(r, e), o, i;
42
- if (Object.getOwnPropertySymbols) {
43
- var n = Object.getOwnPropertySymbols(r);
44
- for (i = 0; i < n.length; i++)
45
- o = n[i], !(e.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(r, o) && (t[o] = r[o]);
46
- }
47
- return t;
48
- }
49
- function F(r, e) {
50
- if (r == null)
51
- return {};
52
- var t = {}, o = Object.keys(r), i, n;
53
- for (n = 0; n < o.length; n++)
54
- i = o[n], !(e.indexOf(i) >= 0) && (t[i] = r[i]);
55
- return t;
56
- }
57
- function u() {
58
- return u = Object.assign ? Object.assign.bind() : function(r) {
59
- for (var e = 1; e < arguments.length; e++) {
60
- var t = arguments[e];
61
- for (var o in t)
62
- Object.prototype.hasOwnProperty.call(t, o) && (r[o] = t[o]);
63
- }
64
- return r;
65
- }, u.apply(this, arguments);
66
- }
67
- function m(r, e) {
68
- var t = Object.keys(r);
69
- if (Object.getOwnPropertySymbols) {
70
- var o = Object.getOwnPropertySymbols(r);
71
- e && (o = o.filter(function(i) {
72
- return Object.getOwnPropertyDescriptor(r, i).enumerable;
73
- })), t.push.apply(t, o);
74
- }
75
- return t;
76
- }
77
- function d(r) {
78
- for (var e = 1; e < arguments.length; e++) {
79
- var t = arguments[e] != null ? arguments[e] : {};
80
- e % 2 ? m(Object(t), !0).forEach(function(o) {
81
- T(r, o, t[o]);
82
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : m(Object(t)).forEach(function(o) {
83
- Object.defineProperty(r, o, Object.getOwnPropertyDescriptor(t, o));
84
- });
85
- }
86
- return r;
87
- }
88
- function T(r, e, t) {
89
- return e = k(e), e in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
90
- }
91
- function k(r) {
92
- var e = z(r, "string");
93
- return typeof e == "symbol" ? e : String(e);
94
- }
95
- function z(r, e) {
96
- if (typeof r != "object" || r === null)
97
- return r;
98
- var t = r[Symbol.toPrimitive];
99
- if (t !== void 0) {
100
- var o = t.call(r, e || "default");
101
- if (typeof o != "object")
102
- return o;
103
- throw new TypeError("@@toPrimitive must return a primitive value.");
104
- }
105
- return (e === "string" ? String : Number)(r);
106
- }
107
- function f(r) {
108
- return r && r.map((e, t) => /* @__PURE__ */ l.createElement(e.tag, d({
109
- key: t
110
- }, e.attr), f(e.child)));
111
- }
112
- function y(r) {
113
- return (e) => /* @__PURE__ */ l.createElement(E, u({
114
- attr: d({}, r.attr)
115
- }, e), f(r.child));
116
- }
117
- function E(r) {
118
- var e = (t) => {
119
- var {
120
- attr: o,
121
- size: i,
122
- title: n
123
- } = r, s = S(r, w), c = i || t.size || "1em", a;
124
- return t.className && (a = t.className), r.className && (a = (a ? a + " " : "") + r.className), /* @__PURE__ */ l.createElement("svg", u({
125
- stroke: "currentColor",
126
- fill: "currentColor",
127
- strokeWidth: "0"
128
- }, t.attr, o, s, {
129
- className: a,
130
- style: d(d({
131
- color: r.color || t.color
132
- }, t.style), r.style),
133
- height: c,
134
- width: c,
135
- xmlns: "http://www.w3.org/2000/svg"
136
- }), n && /* @__PURE__ */ l.createElement("title", null, n), r.children);
137
- };
138
- return p !== void 0 ? /* @__PURE__ */ l.createElement(p.Consumer, null, (t) => e(t)) : e(h);
139
- }
140
- function B(r) {
141
- return y({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z" }, child: [] }] })(r);
142
- }
143
- function D(r) {
144
- return y({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z" }, child: [] }] })(r);
145
- }
146
- const j = (r) => {
147
- const e = { ...r.colors };
148
- return b({
149
- palette: {
150
- primary: {
151
- main: e.primary300,
152
- contrastText: e.textPrimary
153
- },
154
- secondary: {
155
- main: e.secondary,
156
- contrastText: e.textPrimary
157
- },
158
- warning: {
159
- main: e.warning,
160
- contrastText: e.textPrimary
161
- },
162
- error: {
163
- main: e.danger,
164
- contrastText: e.textPrimary
165
- }
166
- },
167
- typography: {
168
- fontFamily: "TT Firs Neue Trl",
169
- button: {
170
- textTransform: "none",
171
- // padding: '0.75rem 1rem',
172
- fontSize: "0.875rem",
173
- // lineHeight: '1rem',
174
- // height: 'fit-content',
175
- // // fontFamily: '',
176
- // borderRadius: 5,
177
- fontWeight: 400,
178
- boxShadow: "none"
179
- },
180
- body1: {
181
- fontSize: "0.875rem",
182
- fontWeight: 400
183
- },
184
- body2: {
185
- fontSize: "0.75rem"
186
- },
187
- h6: {
188
- fontSize: "0.875rem",
189
- fontWeight: 500
190
- },
191
- h5: {
192
- fontSize: "1rem",
193
- fontWeight: 500
194
- },
195
- h4: {
196
- fontSize: "1.25rem",
197
- fontWeight: 500
198
- },
199
- h3: {
200
- fontSize: "1.5rem",
201
- fontWeight: 500
202
- },
203
- h2: {
204
- fontSize: "2rem",
205
- fontWeight: 500
206
- },
207
- h1: {
208
- fontSize: "2.5rem",
209
- fontWeight: 500
210
- },
211
- subtitle1: {
212
- fontSize: "0.75rem"
213
- },
214
- subtitle2: {
215
- fontSize: "0.625rem"
216
- }
217
- },
218
- components: {
219
- MuiIconButton: {
220
- styleOverrides: {
221
- root: {},
222
- sizeSmall: {}
223
- }
224
- },
225
- MuiButton: {
226
- styleOverrides: {
227
- root: {
228
- boxShadow: "none !important",
229
- padding: "8px 32px",
230
- borderWidth: 1,
231
- borderRadius: 3,
232
- fontWeight: 400
233
- }
234
- },
235
- variants: [
236
- {
237
- props: { variant: "primary" },
238
- style: {
239
- backgroundColor: e.primary300,
240
- color: e.buttonText,
241
- "&:hover": {
242
- backgroundColor: e.buttonHover || e.primary300
243
- },
244
- "&.Mui-disabled": {
245
- backgroundColor: e.grey200
246
- }
247
- }
248
- },
249
- {
250
- props: { variant: "confirm" },
251
- style: {
252
- backgroundColor: e.danger,
253
- color: e.white,
254
- "&:hover": {
255
- backgroundColor: e.dangerDark
256
- },
257
- "&.Mui-disabled": {
258
- backgroundColor: e.grey200
259
- }
260
- }
261
- },
262
- {
263
- props: { variant: "cancel" },
264
- style: {
265
- backgroundColor: e.grey300,
266
- color: e.textPrimary,
267
- "&:hover": {
268
- backgroundColor: e.grey400
269
- }
270
- }
271
- },
272
- {
273
- props: { variant: "outlinedPrimary" },
274
- style: {
275
- color: e.primary500,
276
- border: "1px solid",
277
- borderColor: e.primary500,
278
- "&:hover": {
279
- backgroundColor: "inherit"
280
- }
281
- }
282
- },
283
- {
284
- props: { variant: "outLinedDanger" },
285
- style: {
286
- color: e.danger,
287
- border: "1px solid",
288
- borderColor: e.danger,
289
- "&:hover": {
290
- backgroundColor: "inherit"
291
- }
292
- }
293
- },
294
- {
295
- props: { size: "small" },
296
- style: {
297
- fontSize: "12px",
298
- lineHeight: "normal",
299
- borderRadius: "3px",
300
- padding: "4px 16px"
301
- }
302
- }
303
- ]
304
- },
305
- MuiAppBar: {
306
- styleOverrides: {
307
- root: {
308
- backgroundColor: e.appBarBgColor,
309
- color: e.appBarColor
310
- }
311
- }
312
- },
313
- MuiSelect: {
314
- defaultProps: {
315
- MenuProps: {
316
- PaperProps: {
317
- sx: {
318
- boxShadow: "none",
319
- border: 1,
320
- borderStyle: "solid",
321
- borderColor: e.grey300,
322
- mt: "5px"
323
- }
324
- },
325
- MenuListProps: {
326
- sx: {
327
- padding: "5px",
328
- "& .MuiMenuItem-root": {
329
- fontWeight: 400,
330
- minHeight: 0,
331
- borderRadius: "5px",
332
- "&:hover": {
333
- backgroundColor: e.grey100
334
- },
335
- "&.Mui-selected": {
336
- // fontWeight: 500,
337
- // color: color.darkPrimary,
338
- backgroundColor: e.primary200
339
- }
340
- // [breakpoints.down('sm')]: {
341
- // padding:0
342
- // },
343
- }
344
- }
345
- }
346
- }
347
- },
348
- styleOverrides: {
349
- select: {
350
- padding: "9.94px 5px 9.94px 15px"
351
- }
352
- }
353
- },
354
- MuiPaginationItem: {
355
- defaultProps: {
356
- components: {
357
- previous: B,
358
- next: D
359
- }
360
- },
361
- styleOverrides: {
362
- root: {
363
- "& svg": {
364
- width: "10px"
365
- },
366
- border: "none",
367
- fontSize: "14px",
368
- lineHeight: "1.5rem",
369
- borderRadius: "7px",
370
- "&.Mui-selected": {
371
- backgroundColor: e.primary200
372
- },
373
- "&.MuiPaginationItem-previousNext": {
374
- backgroundColor: e.grey200
375
- }
376
- }
377
- }
378
- },
379
- MuiChip: {
380
- styleOverrides: {
381
- root: {
382
- borderRadius: "5px",
383
- fontSize: "10px",
384
- lineHeight: "12px",
385
- fontWeight: 400,
386
- "& .MuiChip-label": {
387
- lineHeight: "normal"
388
- }
389
- },
390
- avatar: {
391
- width: "10px"
392
- },
393
- colorSuccess: {
394
- color: e.success,
395
- backgroundColor: e.successLight
396
- },
397
- colorWarning: {
398
- color: e.warning,
399
- backgroundColor: e.warningLight
400
- },
401
- colorError: {
402
- color: e.danger,
403
- backgroundColor: e.dangerLight
404
- },
405
- colorSecondary: {
406
- color: e.linkPrimary,
407
- backgroundColor: e.linkLight
408
- }
409
- }
410
- },
411
- MuiTab: {
412
- styleOverrides: {
413
- root: {
414
- background: e.grey200,
415
- borderTopLeftRadius: "8px",
416
- borderTopRightRadius: "8px",
417
- marginRight: "5px",
418
- minWidth: "200px",
419
- flexDirection: "row",
420
- alignContent: "center",
421
- gap: "8px",
422
- textTransform: "capitalize",
423
- "& svg": {
424
- mb: "0 !important"
425
- },
426
- padding: 0,
427
- height: "32px",
428
- minHeight: "auto",
429
- fontSize: "12px",
430
- "& .chart-icon": {
431
- fill: e.grey600
432
- },
433
- "& .detail-icon": {
434
- stroke: e.grey600
435
- }
436
- }
437
- }
438
- },
439
- MuiDrawer: {
440
- defaultProps: {},
441
- styleOverrides: {
442
- root: {
443
- "&.MuiDrawer-paper": {
444
- overflowY: "unset"
445
- },
446
- "& .MuiDrawer-paper": {
447
- zIndex: 9
448
- },
449
- "&.MuiPaper-root": {
450
- border: "none",
451
- background: e.grey100,
452
- pt: 12,
453
- zIndex: 9
454
- }
455
- }
456
- }
457
- },
458
- MuiTextField: {
459
- defaultProps: {
460
- InputProps: {
461
- sx: {
462
- "& .Mui-disabled": {
463
- background: e.grey200
464
- }
465
- }
466
- },
467
- InputLabelProps: {
468
- shrink: !0
469
- }
470
- },
471
- styleOverrides: {
472
- root: {
473
- backgroundColor: e.white,
474
- "& .MuiOutlinedInput-input": {
475
- padding: "0px 16px 0px 12px",
476
- fontWeight: 400,
477
- height: 40,
478
- fontSize: "14px",
479
- border: 1,
480
- borderRadius: 4,
481
- "&::placeholder": {
482
- color: e.grey600
483
- }
484
- },
485
- "& .MuiFormLabel-root": {
486
- color: e.textPrimary
487
- },
488
- "& .MuiFormLabel-asterisk": {
489
- color: e.danger
490
- }
491
- }
492
- }
493
- },
494
- MuiFormGroup: {
495
- styleOverrides: {
496
- root: {
497
- // position: 'relative',
498
- }
499
- }
500
- },
501
- MuiFormHelperText: {
502
- defaultProps: {
503
- sx: {
504
- fontSize: 12
505
- }
506
- },
507
- styleOverrides: {}
508
- },
509
- MuiAutocomplete: {
510
- defaultProps: {
511
- sx: {
512
- "& .MuiPaper-root": {
513
- padding: "5px"
514
- }
515
- }
516
- },
517
- styleOverrides: {
518
- root: {
519
- "& .MuiSvgIcon-root": {
520
- width: "20px",
521
- height: "20px"
522
- },
523
- "& .MuiAutocomplete-tag": {
524
- margin: 0
525
- },
526
- "& .MuiButtonBase-root": {
527
- marginRight: "2px !important",
528
- height: "max-content",
529
- padding: "2px"
530
- },
531
- "& .MuiOutlinedInput-root": {
532
- padding: "7.45px 55px 7.45px 10px !important"
533
- },
534
- "& svg": {},
535
- "& #checkboxes-tags-demo": {
536
- padding: "6px 4px"
537
- },
538
- "& .MuiAutocomplete-endAdornment": {
539
- top: "calc(50% - 12px)"
540
- }
541
- }
542
- }
543
- },
544
- MuiTableHead: {
545
- styleOverrides: {
546
- root: {
547
- "& th": {
548
- fontSize: "14px",
549
- padding: "8px 16px"
550
- }
551
- }
552
- }
553
- },
554
- MuiTableBody: {
555
- styleOverrides: {
556
- root: {
557
- "& th,td": {
558
- fontSize: "14px",
559
- padding: "8px 16px",
560
- height: "45px"
561
- },
562
- "& .MuiTableCell-root": {
563
- borderBottom: `1px solid ${e.grey300}`
564
- }
565
- }
566
- }
567
- },
568
- MuiRadio: {
569
- defaultProps: {
570
- sx: {
571
- "&.MuiButtonBase-root": {
572
- padding: "5px"
573
- }
574
- }
575
- },
576
- styleOverrides: {
577
- root: {
578
- "& .MuiSvgIcon-root": {
579
- fontSize: 16
580
- },
581
- color: e.grey600,
582
- "&.Mui-checked": {
583
- color: e.success
584
- },
585
- "&.Mui-disabled": {
586
- color: e.grey600
587
- }
588
- }
589
- }
590
- },
591
- MuiTooltip: {
592
- defaultProps: {
593
- placement: "top"
594
- // arrow: true,
595
- }
596
- }
597
- }
598
- });
599
- };
600
- function L(r, e) {
601
- const t = { ...r };
602
- return e == null || e.forEach((o) => {
603
- o.children && o.children.forEach((i) => {
604
- t[i.key] = i.color.trim();
605
- });
606
- }), t;
607
- }
608
- function W(r) {
609
- var s, c;
610
- const { data: e, isFetching: t } = O(
611
- ["customTheme"],
612
- () => r != null && r.url ? fetch(r.url).then((a) => a.json()) : void 0,
613
- {
614
- enabled: !!(r != null && r.url) && (r == null ? void 0 : r.enabled),
615
- refetchOnWindowFocus: !1,
616
- cacheTime: 0
617
- }
618
- ), o = L(M, (s = e == null ? void 0 : e.theme) == null ? void 0 : s.keyColor);
619
- console.log("🚀 ~ useThemeContext ~ isFetching:", t);
620
- const i = j({ colors: o }), n = (c = e == null ? void 0 : e.theme) == null ? void 0 : c.image;
621
- return {
622
- colors: o,
623
- theme: i,
624
- logo: n,
625
- isFetching: t
626
- };
627
- }
628
- const x = P({}), _ = () => C(x), H = (r) => {
629
- const { children: e, brandTheme: t, customTheme: o } = r, i = W(o ? void 0 : t), n = r.customTheme || i.theme;
630
- return /* @__PURE__ */ g(x.Provider, { value: i, children: /* @__PURE__ */ g(v, { theme: n, children: e }) });
631
- };
632
- export {
633
- H as S,
634
- M as c,
635
- _ as u
636
- };
@@ -1 +0,0 @@
1
- "use strict";const g=require("react/jsx-runtime"),h=require("@mui/material"),a=require("react"),P=require("react-query"),y={primary100:"#F0F6E1",primary200:"#E5F5ED",primary300:"#93D500",primary400:"#009D4F",primary500:"#2E7D32",secondary:"#CC0066",secondaryDark:"#AE1857",textPrimary:"#292929",white:"#FFFFFF",grey100:"#FAFAFA",grey200:"#EEEEEE",grey300:"#DDDDDD",grey400:"#C5C5C5",grey500:"#BFBFBF",grey600:"#85858A",success:"#009D4F",successLight:"#009D4F10",warning:"#FFB600",warningLight:"#FFB60010",danger:"#E01B00",dangerLight:"#E01B0010",dangerDark:"#BE1700",linkPrimary:"#007BFF",linkLight:"#007BFF10"};var f={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},p=a.createContext&&a.createContext(f),C=["attr","size","title"];function O(r,e){if(r==null)return{};var t=M(r,e),o,i;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(i=0;i<n.length;i++)o=n[i],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(r,o)&&(t[o]=r[o])}return t}function M(r,e){if(r==null)return{};var t={},o=Object.keys(r),i,n;for(n=0;n<o.length;n++)i=o[n],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function u(){return u=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}return r},u.apply(this,arguments)}function m(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,o)}return t}function d(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m(Object(t),!0).forEach(function(o){w(r,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach(function(o){Object.defineProperty(r,o,Object.getOwnPropertyDescriptor(t,o))})}return r}function w(r,e,t){return e=S(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function S(r){var e=F(r,"string");return typeof e=="symbol"?e:String(e)}function F(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var o=t.call(r,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function x(r){return r&&r.map((e,t)=>a.createElement(e.tag,d({key:t},e.attr),x(e.child)))}function b(r){return e=>a.createElement(T,u({attr:d({},r.attr)},e),x(r.child))}function T(r){var e=t=>{var{attr:o,size:i,title:n}=r,s=O(r,C),c=i||t.size||"1em",l;return t.className&&(l=t.className),r.className&&(l=(l?l+" ":"")+r.className),a.createElement("svg",u({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,s,{className:l,style:d(d({color:r.color||t.color},t.style),r.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),n&&a.createElement("title",null,n),r.children)};return p!==void 0?a.createElement(p.Consumer,null,t=>e(t)):e(f)}function k(r){return b({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M689 165.1L308.2 493.5c-10.9 9.4-10.9 27.5 0 37L689 858.9c14.2 12.2 35 1.2 35-18.5V183.6c0-19.7-20.8-30.7-35-18.5z"},child:[]}]})(r)}function z(r){return b({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"},child:[]}]})(r)}const E=r=>{const e={...r.colors};return h.createTheme({palette:{primary:{main:e.primary300,contrastText:e.textPrimary},secondary:{main:e.secondary,contrastText:e.textPrimary},warning:{main:e.warning,contrastText:e.textPrimary},error:{main:e.danger,contrastText:e.textPrimary}},typography:{fontFamily:"TT Firs Neue Trl",button:{textTransform:"none",fontSize:"0.875rem",fontWeight:400,boxShadow:"none"},body1:{fontSize:"0.875rem",fontWeight:400},body2:{fontSize:"0.75rem"},h6:{fontSize:"0.875rem",fontWeight:500},h5:{fontSize:"1rem",fontWeight:500},h4:{fontSize:"1.25rem",fontWeight:500},h3:{fontSize:"1.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h1:{fontSize:"2.5rem",fontWeight:500},subtitle1:{fontSize:"0.75rem"},subtitle2:{fontSize:"0.625rem"}},components:{MuiIconButton:{styleOverrides:{root:{},sizeSmall:{}}},MuiButton:{styleOverrides:{root:{boxShadow:"none !important",padding:"8px 32px",borderWidth:1,borderRadius:3,fontWeight:400}},variants:[{props:{variant:"primary"},style:{backgroundColor:e.primary300,color:e.buttonText,"&:hover":{backgroundColor:e.buttonHover||e.primary300},"&.Mui-disabled":{backgroundColor:e.grey200}}},{props:{variant:"confirm"},style:{backgroundColor:e.danger,color:e.white,"&:hover":{backgroundColor:e.dangerDark},"&.Mui-disabled":{backgroundColor:e.grey200}}},{props:{variant:"cancel"},style:{backgroundColor:e.grey300,color:e.textPrimary,"&:hover":{backgroundColor:e.grey400}}},{props:{variant:"outlinedPrimary"},style:{color:e.primary500,border:"1px solid",borderColor:e.primary500,"&:hover":{backgroundColor:"inherit"}}},{props:{variant:"outLinedDanger"},style:{color:e.danger,border:"1px solid",borderColor:e.danger,"&:hover":{backgroundColor:"inherit"}}},{props:{size:"small"},style:{fontSize:"12px",lineHeight:"normal",borderRadius:"3px",padding:"4px 16px"}}]},MuiAppBar:{styleOverrides:{root:{backgroundColor:e.appBarBgColor,color:e.appBarColor}}},MuiSelect:{defaultProps:{MenuProps:{PaperProps:{sx:{boxShadow:"none",border:1,borderStyle:"solid",borderColor:e.grey300,mt:"5px"}},MenuListProps:{sx:{padding:"5px","& .MuiMenuItem-root":{fontWeight:400,minHeight:0,borderRadius:"5px","&:hover":{backgroundColor:e.grey100},"&.Mui-selected":{backgroundColor:e.primary200}}}}}},styleOverrides:{select:{padding:"9.94px 5px 9.94px 15px"}}},MuiPaginationItem:{defaultProps:{components:{previous:k,next:z}},styleOverrides:{root:{"& svg":{width:"10px"},border:"none",fontSize:"14px",lineHeight:"1.5rem",borderRadius:"7px","&.Mui-selected":{backgroundColor:e.primary200},"&.MuiPaginationItem-previousNext":{backgroundColor:e.grey200}}}},MuiChip:{styleOverrides:{root:{borderRadius:"5px",fontSize:"10px",lineHeight:"12px",fontWeight:400,"& .MuiChip-label":{lineHeight:"normal"}},avatar:{width:"10px"},colorSuccess:{color:e.success,backgroundColor:e.successLight},colorWarning:{color:e.warning,backgroundColor:e.warningLight},colorError:{color:e.danger,backgroundColor:e.dangerLight},colorSecondary:{color:e.linkPrimary,backgroundColor:e.linkLight}}},MuiTab:{styleOverrides:{root:{background:e.grey200,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",marginRight:"5px",minWidth:"200px",flexDirection:"row",alignContent:"center",gap:"8px",textTransform:"capitalize","& svg":{mb:"0 !important"},padding:0,height:"32px",minHeight:"auto",fontSize:"12px","& .chart-icon":{fill:e.grey600},"& .detail-icon":{stroke:e.grey600}}}},MuiDrawer:{defaultProps:{},styleOverrides:{root:{"&.MuiDrawer-paper":{overflowY:"unset"},"& .MuiDrawer-paper":{zIndex:9},"&.MuiPaper-root":{border:"none",background:e.grey100,pt:12,zIndex:9}}}},MuiTextField:{defaultProps:{InputProps:{sx:{"& .Mui-disabled":{background:e.grey200}}},InputLabelProps:{shrink:!0}},styleOverrides:{root:{backgroundColor:e.white,"& .MuiOutlinedInput-input":{padding:"0px 16px 0px 12px",fontWeight:400,height:40,fontSize:"14px",border:1,borderRadius:4,"&::placeholder":{color:e.grey600}},"& .MuiFormLabel-root":{color:e.textPrimary},"& .MuiFormLabel-asterisk":{color:e.danger}}}},MuiFormGroup:{styleOverrides:{root:{}}},MuiFormHelperText:{defaultProps:{sx:{fontSize:12}},styleOverrides:{}},MuiAutocomplete:{defaultProps:{sx:{"& .MuiPaper-root":{padding:"5px"}}},styleOverrides:{root:{"& .MuiSvgIcon-root":{width:"20px",height:"20px"},"& .MuiAutocomplete-tag":{margin:0},"& .MuiButtonBase-root":{marginRight:"2px !important",height:"max-content",padding:"2px"},"& .MuiOutlinedInput-root":{padding:"7.45px 55px 7.45px 10px !important"},"& svg":{},"& #checkboxes-tags-demo":{padding:"6px 4px"},"& .MuiAutocomplete-endAdornment":{top:"calc(50% - 12px)"}}}},MuiTableHead:{styleOverrides:{root:{"& th":{fontSize:"14px",padding:"8px 16px"}}}},MuiTableBody:{styleOverrides:{root:{"& th,td":{fontSize:"14px",padding:"8px 16px",height:"45px"},"& .MuiTableCell-root":{borderBottom:`1px solid ${e.grey300}`}}}},MuiRadio:{defaultProps:{sx:{"&.MuiButtonBase-root":{padding:"5px"}}},styleOverrides:{root:{"& .MuiSvgIcon-root":{fontSize:16},color:e.grey600,"&.Mui-checked":{color:e.success},"&.Mui-disabled":{color:e.grey600}}}},MuiTooltip:{defaultProps:{placement:"top"}}}})};function j(r,e){const t={...r};return e==null||e.forEach(o=>{o.children&&o.children.forEach(i=>{t[i.key]=i.color.trim()})}),t}function B(r){var s,c;const{data:e,isFetching:t}=P.useQuery(["customTheme"],()=>r!=null&&r.url?fetch(r.url).then(l=>l.json()):void 0,{enabled:!!(r!=null&&r.url)&&(r==null?void 0:r.enabled),refetchOnWindowFocus:!1,cacheTime:0}),o=j(y,(s=e==null?void 0:e.theme)==null?void 0:s.keyColor);console.log("🚀 ~ useThemeContext ~ isFetching:",t);const i=E({colors:o}),n=(c=e==null?void 0:e.theme)==null?void 0:c.image;return{colors:o,theme:i,logo:n,isFetching:t}}const v=a.createContext({}),D=()=>a.useContext(v),L=r=>{const{children:e,brandTheme:t,customTheme:o}=r,i=B(o?void 0:t),n=r.customTheme||i.theme;return g.jsx(v.Provider,{value:i,children:g.jsx(h.ThemeProvider,{theme:n,children:e})})};exports.SaasThemeProvider=L;exports.color=y;exports.useTheme=D;