@sikka/hawa 0.0.36 → 0.0.40

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 (79) hide show
  1. package/.github/workflows/hawa-publish-push.yml +3 -1
  2. package/README.md +2 -1
  3. package/es/index.es.js +1 -1
  4. package/lib/index.js +1 -1
  5. package/package.json +5 -3
  6. package/src/Hooks.js +61 -0
  7. package/src/blocks/AuthForms/CodeConfirmation.js +94 -0
  8. package/src/blocks/AuthForms/index.js +1 -0
  9. package/src/blocks/Misc/NotFound.js +47 -0
  10. package/src/blocks/Misc/index.js +1 -0
  11. package/src/blocks/Pricing/PricingPlans.js +3 -3
  12. package/src/elements/HawaChip.js +6 -0
  13. package/src/elements/{HawaRadio.js → HawaPanelTabs.js} +3 -2
  14. package/src/elements/HawaSettingsRow.js +2 -2
  15. package/src/elements/HawaSnackbar.js +11 -8
  16. package/src/elements/PinInput.js +141 -0
  17. package/src/elements/index.js +2 -2
  18. package/src/index.js +2 -0
  19. package/src/layout/HawaAppBar.js +0 -1
  20. package/src/styles.css +4 -0
  21. package/src/styles.scss +3 -1
  22. package/src/theme/HawaTheme.js +927 -0
  23. package/src/theme/index.js +2 -0
  24. package/src/util.js +11 -1
  25. package/storybook-static/0.a2c13f8ca8477800b11f.manager.bundle.js +2 -0
  26. package/storybook-static/{0.0d994c92.iframe.bundle.js.LICENSE.txt → 0.a2c13f8ca8477800b11f.manager.bundle.js.LICENSE.txt} +0 -0
  27. package/storybook-static/0.d94b248f.iframe.bundle.js +3 -0
  28. package/storybook-static/{4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt → 0.d94b248f.iframe.bundle.js.LICENSE.txt} +0 -0
  29. package/storybook-static/0.d94b248f.iframe.bundle.js.map +1 -0
  30. package/storybook-static/1.37f89487.iframe.bundle.js +1 -0
  31. package/storybook-static/1.d522251f2377f7751924.manager.bundle.js +1 -0
  32. package/storybook-static/{2.430bf1e3.iframe.bundle.js → 2.89943a03.iframe.bundle.js} +1 -1
  33. package/storybook-static/5.a331b0a36ded1c541923.manager.bundle.js +2 -0
  34. package/storybook-static/5.a331b0a36ded1c541923.manager.bundle.js.LICENSE.txt +31 -0
  35. package/storybook-static/6.3a1fb0c3.iframe.bundle.js +3 -0
  36. package/storybook-static/6.3a1fb0c3.iframe.bundle.js.LICENSE.txt +31 -0
  37. package/storybook-static/6.3a1fb0c3.iframe.bundle.js.map +1 -0
  38. package/storybook-static/6.aee6c4935c69d480fc0d.manager.bundle.js +1 -0
  39. package/storybook-static/7.5b8a4de4b5fa42d8de02.manager.bundle.js +1 -0
  40. package/storybook-static/7.f33530b1.iframe.bundle.js +1 -0
  41. package/storybook-static/8.a3dec9c37e8951a17939.manager.bundle.js +2 -0
  42. package/storybook-static/{6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt → 8.a3dec9c37e8951a17939.manager.bundle.js.LICENSE.txt} +0 -0
  43. package/storybook-static/8.b569e86b.iframe.bundle.js +1 -0
  44. package/storybook-static/{8.76c3cbf398692028e834.manager.bundle.js → 9.d04fdaada645cd23cb4b.manager.bundle.js} +1 -1
  45. package/storybook-static/9.f9db5c90.iframe.bundle.js +3 -0
  46. package/storybook-static/{7.9ce807e3.iframe.bundle.js.LICENSE.txt → 9.f9db5c90.iframe.bundle.js.LICENSE.txt} +0 -0
  47. package/storybook-static/9.f9db5c90.iframe.bundle.js.map +1 -0
  48. package/storybook-static/iframe.html +19 -3
  49. package/storybook-static/index.html +2 -2
  50. package/storybook-static/main.066fa5c5.iframe.bundle.js +1 -0
  51. package/storybook-static/main.750dea0e0e515fd26844.manager.bundle.js +1 -0
  52. package/storybook-static/project.json +1 -0
  53. package/storybook-static/runtime~main.1bd817501fb34a0cb56b.manager.bundle.js +1 -0
  54. package/storybook-static/runtime~main.9be73be4.iframe.bundle.js +1 -0
  55. package/storybook-static/vendors~main.40879e99.iframe.bundle.js +76 -0
  56. package/storybook-static/{vendors~main.3cf4a535.iframe.bundle.js.LICENSE.txt → vendors~main.40879e99.iframe.bundle.js.LICENSE.txt} +15 -0
  57. package/storybook-static/vendors~main.40879e99.iframe.bundle.js.map +1 -0
  58. package/storybook-static/vendors~main.ed8bc18573e141ab3b26.manager.bundle.js +2 -0
  59. package/storybook-static/{vendors~main.11281b487bf96f5ff19e.manager.bundle.js.LICENSE.txt → vendors~main.ed8bc18573e141ab3b26.manager.bundle.js.LICENSE.txt} +18 -18
  60. package/src/elements/HawaTextArea.js +0 -26
  61. package/storybook-static/0.0d994c92.iframe.bundle.js +0 -3
  62. package/storybook-static/0.0d994c92.iframe.bundle.js.map +0 -1
  63. package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +0 -1
  64. package/storybook-static/1.aabc3f3a.iframe.bundle.js +0 -1
  65. package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +0 -2
  66. package/storybook-static/5.63ab4f94d50a3acf080d.manager.bundle.js +0 -1
  67. package/storybook-static/6.13a534cb.iframe.bundle.js +0 -1
  68. package/storybook-static/6.a6d45262f7e98f3f18d3.manager.bundle.js +0 -2
  69. package/storybook-static/7.097710753af9a1c41b80.manager.bundle.js +0 -1
  70. package/storybook-static/7.9ce807e3.iframe.bundle.js +0 -3
  71. package/storybook-static/7.9ce807e3.iframe.bundle.js.map +0 -1
  72. package/storybook-static/8.1bf48ea7.iframe.bundle.js +0 -1
  73. package/storybook-static/main.3f5171ae.iframe.bundle.js +0 -1
  74. package/storybook-static/main.9d5968bcf15d21f5487c.manager.bundle.js +0 -1
  75. package/storybook-static/runtime~main.708d7ac1.iframe.bundle.js +0 -1
  76. package/storybook-static/runtime~main.c8dac23bc753439736f0.manager.bundle.js +0 -1
  77. package/storybook-static/vendors~main.11281b487bf96f5ff19e.manager.bundle.js +0 -2
  78. package/storybook-static/vendors~main.3cf4a535.iframe.bundle.js +0 -76
  79. package/storybook-static/vendors~main.3cf4a535.iframe.bundle.js.map +0 -1
@@ -0,0 +1,927 @@
1
+ import { createTheme } from "@mui/material";
2
+ import { darken, lighten } from "@mui/material";
3
+
4
+ export const CreateHawaTheme = (
5
+ allBorderRadius,
6
+ primaryActionColor,
7
+ primaryLayoutColor,
8
+ primaryActionTextColor,
9
+ mainFont,
10
+ breakpointsValues
11
+ ) => {
12
+ console.log("achra achraf", breakpointsValues);
13
+ return createTheme({
14
+ typography: { fontFamily: ["IBMPlex", "Roboto"].join(",") },
15
+ palette: {
16
+ primary: {
17
+ main: primaryActionColor
18
+ }
19
+ },
20
+ breakpoints: {
21
+ values: breakpointsValues
22
+ ? breakpointsValues
23
+ : { xs: 0, sm: 600, md: 900, lg: 1200, xl: 1536 }
24
+ },
25
+ components: {
26
+ MuiStack: {
27
+ variants: [
28
+ {
29
+ props: { variant: "card" },
30
+ style: {
31
+ backgroundColor: primaryLayoutColor,
32
+ padding: 15,
33
+ // paddingLeft: 5,
34
+ // paddingRight: 5,
35
+ borderRadius: allBorderRadius
36
+ }
37
+ }
38
+ ]
39
+ },
40
+ MuiChip: {
41
+ styleOverrides: {
42
+ root: {
43
+ borderRadius: allBorderRadius
44
+ }
45
+ }
46
+ },
47
+ MuiSlider: {
48
+ styleOverrides: {
49
+ root: {
50
+ marginRight: 15,
51
+ marginLeft: 15,
52
+ minWidth: 50
53
+ }
54
+ }
55
+ },
56
+ MuiAccordion: {
57
+ styleOverrides: {
58
+ root: {
59
+ borderRadius: `${allBorderRadius}px !important`,
60
+ marginBottom: 10,
61
+ position: "unset",
62
+ "&.Mui-expanded": {
63
+ marginBottom: 10,
64
+ marginTop: 10
65
+ }
66
+ }
67
+ }
68
+ },
69
+ MuiDivider: {
70
+ styleOverrides: { root: { margin: 20 } }
71
+ },
72
+ MuiTableContainer: {
73
+ styleOverrides: {
74
+ root: {
75
+ backgroundColor: "white",
76
+ width: "100%",
77
+ borderRadius: allBorderRadius,
78
+ margin: 0
79
+ }
80
+ }
81
+ },
82
+ MuiTableCell: {
83
+ variants: [
84
+ {
85
+ props: { variant: "borderedLeft" },
86
+ style: { borderLeft: "1px solid #dddddd" }
87
+ },
88
+ {
89
+ props: { variant: "borderedRight" },
90
+ style: { borderRight: "1px solid #dddddd" }
91
+ }
92
+ ]
93
+ },
94
+ MuiTable: {
95
+ styleOverrides: { root: { borderRadius: allBorderRadius } }
96
+ },
97
+ MuiInputLabel: {
98
+ styleOverrides: {
99
+ root: {
100
+ marginBottom: 10,
101
+ marginTop: 10,
102
+ fontSize: 15
103
+ }
104
+ }
105
+ },
106
+ MuiFormControl: {
107
+ variants: [
108
+ {
109
+ props: { variant: "hawa" },
110
+ style: { width: "100%" }
111
+ }
112
+ ]
113
+ },
114
+ MuiTypography: {
115
+ styleOverrides: {},
116
+ variants: [
117
+ {
118
+ props: { variant: "validation" },
119
+ style: {
120
+ textAlign: "start",
121
+ whiteSpace: "nowrap",
122
+ fontFamily: mainFont,
123
+ color: "red",
124
+ fontSize: 13,
125
+ marginTop: 0
126
+ }
127
+ }
128
+ ]
129
+ },
130
+ MuiSelect: {
131
+ styleOverrides: {
132
+ root: {
133
+ backgroundColor: "white",
134
+ padding: "0px !important",
135
+ paddingRight: 10,
136
+ paddingLeft: 10,
137
+ borderRadius: allBorderRadius,
138
+ "&:hover": { outline: `1px solid ${primaryActionColor}` },
139
+ "&:focus": { outline: `1px solid ${primaryActionColor}` }
140
+ },
141
+ input: {
142
+ margin: 0,
143
+ border: "none",
144
+ padding: 10,
145
+ ":focus": { border: "none" }
146
+ }
147
+ }
148
+ },
149
+ MuiInput: {
150
+ styleOverrides: {
151
+ root: {
152
+ backgroundColor: "white",
153
+ paddingRight: 10,
154
+ paddingLeft: 10,
155
+ borderRadius: allBorderRadius,
156
+ "&:hover": { outline: `1px solid ${primaryActionColor}` },
157
+ "&:focus": { outline: `1px solid ${primaryActionColor}` }
158
+ },
159
+ input: {
160
+ margin: 0,
161
+ border: "none",
162
+ padding: 10,
163
+ ":focus": { border: "none" }
164
+ }
165
+ },
166
+ variants: [
167
+ {
168
+ props: { variant: "unscrollable" },
169
+ style: {
170
+ "& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":
171
+ { display: "none" },
172
+ "& input[type=number]": { MozAppearance: "textfield" }
173
+ }
174
+ },
175
+ {
176
+ props: { variant: "pin" },
177
+ style: {
178
+ height: 60,
179
+ width: 50,
180
+ textAlign: "center",
181
+ "& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":
182
+ { display: "none" },
183
+ "& input[type=number]": { MozAppearance: "textfield" }
184
+ }
185
+ }
186
+ ]
187
+ },
188
+ MuiDialog: {
189
+ styleOverrides: {
190
+ paper: {
191
+ borderRadius: allBorderRadius,
192
+ backgroundColor: primaryLayoutColor,
193
+ minWidth: 300
194
+ }
195
+ }
196
+ },
197
+ MuiContainer: {
198
+ styleOverrides: {
199
+ root: {
200
+ display: "flex",
201
+ flexDirection: "column",
202
+ backgroundColor: primaryLayoutColor,
203
+ borderRadius: allBorderRadius,
204
+ paddingLeft: 20,
205
+ paddingRight: 20,
206
+ padding: 20
207
+ }
208
+ },
209
+ variants: [
210
+ {
211
+ props: { variant: "drop-area" },
212
+ style: {
213
+ display: "flex",
214
+ flexDirection: "column",
215
+ justifyContent: "center",
216
+ alignItems: "center",
217
+ backgroundColor: lighten(primaryLayoutColor, 0.3),
218
+ // fontSize: "2rem",
219
+ // padding: "0px !important",
220
+ // marginBottom: 10,
221
+ border: "1px dashed",
222
+ borderRadius: allBorderRadius,
223
+
224
+ ":-moz-drag-over": {
225
+ backgroundColor: "green"
226
+ }
227
+ }
228
+ },
229
+ {
230
+ props: { variant: "page-controls" },
231
+ style: {
232
+ background: "none",
233
+ fontSize: "2rem",
234
+ padding: "0px !important",
235
+ marginBottom: 10,
236
+ borderRadius: allBorderRadius
237
+ }
238
+ },
239
+ {
240
+ props: { variant: "auth" },
241
+ style: {
242
+ backgroundColor: primaryLayoutColor,
243
+ fontSize: "2rem",
244
+ padding: 20,
245
+ borderRadius: allBorderRadius
246
+ }
247
+ },
248
+ {
249
+ props: { variant: "plain" },
250
+ style: { background: "none" }
251
+ },
252
+
253
+ {
254
+ props: { variant: "panelTabs" },
255
+ style: {
256
+ display: "flex",
257
+ flexDirection: "row",
258
+ width: "fit-content",
259
+ justifyContent: "space-between",
260
+ backgroundColor: primaryLayoutColor,
261
+ alignItems: "center",
262
+ paddingLeft: "10px !important",
263
+ paddingRight: "10px !important",
264
+ padding: 10
265
+ }
266
+ },
267
+ {
268
+ props: { variant: "pricingTabs" },
269
+ style: {
270
+ display: "flex",
271
+ flexDirection: "row",
272
+ width: "fit-content",
273
+ justifyContent: "space-between",
274
+ backgroundColor: primaryLayoutColor,
275
+ alignItems: "center",
276
+ paddingLeft: "10px !important",
277
+ paddingRight: "10px !important",
278
+ padding: 10
279
+ }
280
+ },
281
+ {
282
+ props: { variant: "inSettings" },
283
+ style: {
284
+ display: "flex",
285
+ flexDirection: "row",
286
+ width: "fit-content",
287
+ height: 50,
288
+ marginRight: 0,
289
+ backgroundColor: "white",
290
+ padding: 5,
291
+ paddingLeft: "5px !important",
292
+ paddingRight: "5px !important"
293
+ }
294
+ },
295
+ {
296
+ props: { variant: "inPricing" },
297
+ style: {
298
+ display: "flex",
299
+ flexDirection: "row",
300
+ justifyContent: "space-between",
301
+ alignItems: "center",
302
+ width: "fit-content",
303
+ margin: 0,
304
+ height: 50,
305
+ marginRight: 0,
306
+ marginLeft: 0,
307
+ backgroundColor: primaryLayoutColor,
308
+ padding: 5,
309
+ paddingLeft: "5px !important",
310
+ paddingRight: "5px !important"
311
+ }
312
+ },
313
+ {
314
+ props: { variant: "settingsRow" },
315
+ style: {
316
+ display: "flex",
317
+ flexDirection: "row",
318
+ justifyContent: "space-between",
319
+ alignItems: "center",
320
+ borderRadius: allBorderRadius,
321
+ backgroundColor: lighten(primaryLayoutColor, 0.4),
322
+ height: 70,
323
+ marginTop: 10,
324
+ paddingLeft: "20px !important",
325
+ paddingRight: "10px !important"
326
+ }
327
+ },
328
+ {
329
+ props: { variant: "plan-card" },
330
+ style: {
331
+ display: "flex",
332
+ flexDirection: "column",
333
+ borderRadius: allBorderRadius,
334
+ border: `1px solid ${primaryLayoutColor}`,
335
+ backgroundColor: lighten(primaryLayoutColor, 0.4),
336
+ margin: 10,
337
+ width: 250,
338
+ maxWidth: 200,
339
+ paddingLeft: "0px !important",
340
+ paddingRight: "0px !important",
341
+ padding: 0
342
+ }
343
+ },
344
+ {
345
+ props: { variant: "selected-plan-card" },
346
+ style: {
347
+ display: "flex",
348
+ flexDirection: "column",
349
+ borderRadius: allBorderRadius,
350
+ border: `1px solid ${primaryActionColor}`,
351
+ backgroundColor: lighten(primaryActionColor, 0.4),
352
+ margin: 10,
353
+ width: 250,
354
+ maxWidth: 200,
355
+ paddingLeft: "0px !important",
356
+ paddingRight: "0px !important",
357
+ padding: 0
358
+ }
359
+ },
360
+ {
361
+ props: { variant: "plan-header" },
362
+ style: {
363
+ display: "flex",
364
+ flexDirection: "column",
365
+ position: "relative",
366
+ borderRadius: allBorderRadius,
367
+ borderBottomLeftRadius: 0,
368
+ borderBottomRightRadius: 0,
369
+ border: `1px solid ${primaryLayoutColor}`,
370
+ backgroundColor: "white",
371
+ margin: 0,
372
+ padding: 20
373
+ }
374
+ },
375
+ {
376
+ props: { variant: "card-container" },
377
+ style: {
378
+ display: "flex",
379
+ flexDirection: "column",
380
+ borderRadius: allBorderRadius,
381
+ border: `1px solid ${primaryLayoutColor}`,
382
+ margin: 0,
383
+ padding: "0px !important"
384
+ }
385
+ },
386
+ {
387
+ props: { variant: "card-header" },
388
+ style: {
389
+ display: "flex",
390
+ flexDirection: "column",
391
+ borderRadius: allBorderRadius,
392
+ borderBottomLeftRadius: 0,
393
+ borderBottomRightRadius: 0,
394
+ border: `1px solid ${primaryLayoutColor}`,
395
+ backgroundColor: "white",
396
+ margin: 0,
397
+ padding: "0px !important",
398
+ paddingLeft: "20px !important",
399
+ paddingRight: "20px !important"
400
+ }
401
+ },
402
+ {
403
+ props: { variant: "card-content" },
404
+ style: {
405
+ display: "flex",
406
+ flexDirection: "column",
407
+ borderRadius: allBorderRadius,
408
+ borderBottomLeftRadius: 0,
409
+ borderBottomRightRadius: 0,
410
+ border: `1px solid ${primaryLayoutColor}`,
411
+ margin: 0,
412
+ padding: "0px !important",
413
+ paddingLeft: "20px !important",
414
+ paddingRight: "20px !important"
415
+ }
416
+ },
417
+ {
418
+ props: { variant: "card-actions" },
419
+ style: {
420
+ display: "flex",
421
+ flexDirection: "row",
422
+ justifyContent: "flex-end",
423
+ border: `1px solid ${primaryLayoutColor}`,
424
+ margin: 0
425
+ }
426
+ },
427
+ {
428
+ props: { variant: "selected-plan-header" },
429
+ style: {
430
+ display: "flex",
431
+ flexDirection: "column",
432
+ borderRadius: allBorderRadius,
433
+ borderBottomLeftRadius: 0,
434
+ borderBottomRightRadius: 0,
435
+ border: `1px solid ${primaryLayoutColor}`,
436
+ backgroundColor: "white",
437
+ margin: 0,
438
+ padding: 20
439
+ }
440
+ },
441
+ {
442
+ props: { variant: "pricing" },
443
+ style: {
444
+ display: "flex",
445
+ flexDirection: "row",
446
+ maxWidth: "max-content",
447
+ width: "fit-content",
448
+ padding: 0,
449
+ paddingLeft: "0px !important",
450
+ paddingRight: "0px !important"
451
+ }
452
+ },
453
+ {
454
+ props: { variant: "appbar" },
455
+ style: {
456
+ boxShadow: "none",
457
+ display: "flex",
458
+ flexDirection: "column",
459
+ backgroundColor: "none !important",
460
+ background: "none !important",
461
+ padding: "0px !important",
462
+ paddingRight: "0px !important",
463
+ paddingLeft: "0px !important"
464
+ }
465
+ }
466
+ ]
467
+ },
468
+ MuiSnackbar: {
469
+ styleOverrides: {
470
+ root: { borderWidth: 10, borderRadius: allBorderRadius }
471
+ }
472
+ },
473
+ MuiButton: {
474
+ styleOverrides: {
475
+ root: {
476
+ textTransform: "uppercase",
477
+ borderRadius: allBorderRadius,
478
+ boxShadow: "none",
479
+ "&:hover": { boxShadow: "none" }
480
+ },
481
+ contained: { backgroundColor: primaryActionColor }
482
+ },
483
+ variants: [
484
+ {
485
+ props: { variant: "layout" },
486
+ style: {
487
+ backgroundColor: primaryLayoutColor,
488
+ "&:hover": {
489
+ backgroundColor: darken(primaryLayoutColor, 0.3),
490
+ color: "white"
491
+ }
492
+ }
493
+ },
494
+ {
495
+ props: { variant: "color-picker" },
496
+ style: ({ theme }) => ({
497
+ ...{
498
+ height: 40,
499
+ marginRight: 5,
500
+ marginLeft: 5,
501
+ backgroundColor: theme.palette.error.main,
502
+ color: primaryActionTextColor,
503
+ borderRadius: allBorderRadius,
504
+ "&:hover": {
505
+ backgroundColor: darken(theme.palette.error.main, 0.5),
506
+ color: "white"
507
+ }
508
+ }
509
+ })
510
+ },
511
+ {
512
+ props: { variant: "danger" },
513
+ style: ({ theme }) => ({
514
+ ...{
515
+ backgroundColor: theme.palette.error.main,
516
+ color: primaryActionTextColor,
517
+ borderRadius: allBorderRadius,
518
+ "&:hover": {
519
+ backgroundColor: darken(theme.palette.error.main, 0.5),
520
+ color: "white"
521
+ }
522
+ }
523
+ })
524
+ },
525
+ {
526
+ props: { variant: "last" },
527
+ style: {
528
+ backgroundColor: primaryActionColor,
529
+ color: primaryActionTextColor,
530
+ marginTop: 20,
531
+ borderRadius: allBorderRadius,
532
+ "&:hover": {
533
+ backgroundColor: darken(primaryActionColor, 0.5),
534
+ color: "white"
535
+ }
536
+ }
537
+ },
538
+ {
539
+ props: { variant: "withLogo" },
540
+ style: {
541
+ textTransform: "none",
542
+ border: `1px solid ${darken(primaryActionColor, 0.1)}`,
543
+ fontSize: "2rem",
544
+ backgroundColor: "white",
545
+ marginTop: 10,
546
+ padding: 10,
547
+ height: 50,
548
+ fontFamily: mainFont,
549
+ borderRadius: allBorderRadius
550
+ }
551
+ },
552
+ {
553
+ props: { variant: "selected" },
554
+ style: {
555
+ display: "flex",
556
+ flexDirection: "row",
557
+ width: "fit-content",
558
+ backgroundColor: primaryActionColor,
559
+ justifyContent: "space-between",
560
+ alignItems: "center",
561
+ margin: 0,
562
+ color: "white",
563
+ borderRadius: allBorderRadius,
564
+ "&:hover": {
565
+ backgroundColor: darken(primaryActionColor, 0.5),
566
+ color: "white"
567
+ }
568
+ }
569
+ },
570
+ {
571
+ props: { variant: "unselected" },
572
+ style: {
573
+ display: "flex",
574
+ flexDirection: "row",
575
+ width: "fit-content",
576
+ background: "none",
577
+ justifyContent: "space-between",
578
+ alignItems: "center",
579
+ margin: 0,
580
+ borderRadius: allBorderRadius
581
+ }
582
+ },
583
+ {
584
+ props: { variant: "adaptive-dark" },
585
+ style: {
586
+ backgroundColor: primaryActionColor,
587
+ height: 40,
588
+ color: primaryActionTextColor,
589
+ margin: 0,
590
+ borderRadius: allBorderRadius,
591
+ "&:hover": {
592
+ backgroundColor: darken(primaryActionColor, 0.4)
593
+ }
594
+ }
595
+ },
596
+ {
597
+ props: { variant: "adaptive-light" },
598
+ style: {
599
+ display: "flex",
600
+ flexDirection: "row",
601
+ width: "fit-content",
602
+ backgroundColor: primaryActionColor,
603
+ height: 50,
604
+ color: primaryActionTextColor,
605
+ justifyContent: "space-between",
606
+ alignItems: "center",
607
+ margin: 0,
608
+ borderRadius: allBorderRadius,
609
+ "&:hover": {
610
+ backgroundColor: darken(primaryActionColor, 0.4)
611
+ }
612
+ }
613
+ }
614
+ ]
615
+ },
616
+ MuiSwitch: {
617
+ styleOverrides: {
618
+ root: {
619
+ display: "flex",
620
+ flexDirection: "row",
621
+ alignItems: "center"
622
+ },
623
+ track: {
624
+ backgroundColor: "grey",
625
+ height: 20,
626
+ borderRadius: allBorderRadius
627
+ },
628
+ thumb: { borderRadius: allBorderRadius }
629
+ }
630
+ },
631
+ MuiAlert: {
632
+ styleOverrides: {
633
+ root: { borderRadius: allBorderRadius, marginBottom: 10 },
634
+
635
+ standardError: ({ theme }) => ({
636
+ ...{
637
+ backgroundColor: lighten(theme.palette.error.main, 0.8),
638
+ outline: `1px solid ${darken(theme.palette.error.main, 0.1)}`
639
+ }
640
+ }),
641
+ standardInfo: ({ theme }) => ({
642
+ ...{
643
+ backgroundColor: lighten(theme.palette.info.main, 0.8),
644
+ outline: `1px solid ${darken(theme.palette.info.main, 0.1)}`
645
+ }
646
+ }),
647
+ standardWarning: ({ theme }) => ({
648
+ ...{
649
+ backgroundColor: lighten(theme.palette.warning.main, 0.8),
650
+ outline: `1px solid ${darken(theme.palette.warning.main, 0.1)}`
651
+ }
652
+ }),
653
+ standardSuccess: ({ theme }) => ({
654
+ ...{
655
+ backgroundColor: lighten(theme.palette.success.main, 0.8),
656
+ outline: `1px solid ${darken(theme.palette.success.main, 0.1)}`
657
+ }
658
+ })
659
+ },
660
+ variants: [
661
+ {
662
+ props: { variant: "inContainer" },
663
+ style: { color: "black", borderRadius: allBorderRadius }
664
+ }
665
+ // {
666
+ // props: { variant: "offline" },
667
+ // style: ({ theme }) => ({
668
+ // ...{
669
+ // backgroundColor: lighten(theme.palette.error.main, 0.8),
670
+ // color: "black",
671
+ // borderRadius: allBorderRadius,
672
+ // outline: `1px solid ${theme.palette.error.main}`
673
+ // }
674
+ // })
675
+ // }
676
+ ]
677
+ },
678
+ MuiListItemButton: {
679
+ styleOverrides: {
680
+ root: {
681
+ margin: 5,
682
+ borderRadius: allBorderRadius,
683
+ "&:hover": { backgroundColor: primaryActionColor, color: "white" }
684
+ }
685
+ },
686
+ variants: [
687
+ {
688
+ props: { variant: "clicked" },
689
+ style: { backgroundColor: primaryActionColor, color: "white" }
690
+ }
691
+ ]
692
+ },
693
+ MuiToolbar: {
694
+ variants: [
695
+ {
696
+ props: { variant: "appbar" },
697
+ style: {
698
+ color: "black",
699
+ height: 60,
700
+ backgroundColor: "white",
701
+ display: "flex",
702
+ flexDirection: "row",
703
+ justifyContent: "space-between",
704
+ padding: 0
705
+ }
706
+ }
707
+ ]
708
+ },
709
+ MuiAppBar: {
710
+ styleOverrides: { root: { boxShadow: "none", color: "black" } },
711
+ variants: [
712
+ {
713
+ props: { variant: "appbar" },
714
+ style: {
715
+ color: "black",
716
+ margin: 0,
717
+ padding: 0,
718
+ background: "none"
719
+ }
720
+ }
721
+ ]
722
+ },
723
+
724
+ MuiTextField: {
725
+ styleOverrides: {
726
+ root: {
727
+ backgroundColor: "white",
728
+ paddingRight: 10,
729
+ paddingLeft: 10,
730
+ borderRadius: allBorderRadius,
731
+ "&:hover": { outline: `1px solid ${primaryActionColor}` },
732
+ "&:focus": { outline: `1px solid ${primaryActionColor}` }
733
+ }
734
+ },
735
+ variants: [
736
+ {
737
+ props: { variant: "pinInput" },
738
+ style: {
739
+ height: 60,
740
+ width: 50,
741
+ textAlign: "center",
742
+ "& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":
743
+ { display: "none" },
744
+ "& input[type=number]": { MozAppearance: "textfield" }
745
+ }
746
+ }
747
+ ]
748
+ }
749
+ }
750
+ });
751
+ };
752
+
753
+ export const UpdateHawaTheme = (
754
+ theme,
755
+ allBorderRadius,
756
+ primaryActionColor,
757
+ primaryLayoutColor,
758
+ primaryActionTextColor,
759
+ mainFont
760
+ ) => {
761
+ theme.allBorderRadius = allBorderRadius;
762
+ theme.primaryActionColor = primaryActionColor;
763
+ theme.primaryLayoutColor = primaryLayoutColor;
764
+ theme.primaryActionTextColor = primaryActionTextColor;
765
+ theme.mainFont = mainFont;
766
+ theme.palette.primary.main = primaryActionColor;
767
+ theme.components.MuiStack.variants[0].style.borderRadius = allBorderRadius;
768
+ theme.components.MuiStack.variants[0].style.backgroundColor =
769
+ primaryLayoutColor;
770
+ theme.components.MuiChip.styleOverrides.root.borderRadius = allBorderRadius;
771
+ theme.components.MuiAccordion.styleOverrides.root.borderRadius = `${allBorderRadius}px !important`;
772
+ theme.components.MuiTableContainer.styleOverrides.root.borderRadius =
773
+ allBorderRadius;
774
+ theme.components.MuiTable.styleOverrides.root.borderRadius = allBorderRadius;
775
+ theme.components.MuiTypography.variants[0].style.fontFamily = mainFont;
776
+ theme.components.MuiSelect.styleOverrides.root.borderRadius = allBorderRadius;
777
+ theme.components.MuiSelect.styleOverrides.root[
778
+ "&:hover"
779
+ ].outline = `1px solid ${primaryActionColor}`;
780
+ theme.components.MuiSelect.styleOverrides.root[
781
+ "&:focus"
782
+ ].outline = `1px solid ${primaryActionColor}`;
783
+ theme.components.MuiInput.styleOverrides.root[
784
+ "&:hover"
785
+ ].outline = `1px solid ${primaryActionColor}`;
786
+ theme.components.MuiInput.styleOverrides.root[
787
+ "&:focus"
788
+ ].outline = `1px solid ${primaryActionColor}`;
789
+ theme.components.MuiDialog.styleOverrides.paper.borderRadius =
790
+ allBorderRadius;
791
+ theme.components.MuiDialog.styleOverrides.paper.backgroundColor =
792
+ primaryLayoutColor;
793
+ theme.components.MuiContainer.styleOverrides.root.backgroundColor =
794
+ primaryLayoutColor;
795
+ theme.components.MuiContainer.styleOverrides.root.borderRadius =
796
+ allBorderRadius;
797
+ theme.components.MuiContainer.variants[0].style.backgroundColor = lighten(
798
+ primaryLayoutColor,
799
+ 0.3
800
+ );
801
+ theme.components.MuiContainer.variants[0].style.borderRadius =
802
+ allBorderRadius;
803
+ theme.components.MuiContainer.variants[1].style.borderRadius =
804
+ allBorderRadius;
805
+ theme.components.MuiContainer.variants[2].style.borderRadius =
806
+ allBorderRadius;
807
+ theme.components.MuiContainer.variants[4].style.backgroundColor =
808
+ primaryLayoutColor;
809
+ theme.components.MuiContainer.variants[5].style.backgroundColor =
810
+ primaryLayoutColor;
811
+ theme.components.MuiContainer.variants[7].style.backgroundColor =
812
+ primaryLayoutColor;
813
+ theme.components.MuiContainer.variants[8].style.backgroundColor = lighten(
814
+ primaryLayoutColor,
815
+ 0.4
816
+ );
817
+ theme.components.MuiContainer.variants[8].style.borderRadius =
818
+ allBorderRadius;
819
+ theme.components.MuiContainer.variants[9].style.borderRadius =
820
+ allBorderRadius;
821
+ theme.components.MuiContainer.variants[9].style.border = `1px solid ${primaryLayoutColor}`;
822
+ theme.components.MuiContainer.variants[9].style.backgroundColor = lighten(
823
+ primaryLayoutColor,
824
+ 0.4
825
+ );
826
+ theme.components.MuiContainer.variants[10].style.backgroundColor = lighten(
827
+ primaryActionColor,
828
+ 0.4
829
+ );
830
+ theme.components.MuiContainer.variants[10].style.border = `1px solid ${primaryActionColor}`;
831
+ theme.components.MuiContainer.variants[10].style.borderRadius =
832
+ allBorderRadius;
833
+ theme.components.MuiContainer.variants[11].style.borderRadius =
834
+ allBorderRadius;
835
+ theme.components.MuiContainer.variants[11].style.border = `1px solid ${primaryLayoutColor}`;
836
+ (theme.components.MuiContainer.variants[12].style.border = `1px solid ${primaryLayoutColor}`),
837
+ (theme.components.MuiContainer.variants[12].style.borderRadius =
838
+ allBorderRadius);
839
+ theme.components.MuiContainer.variants[13].style.borderRadius =
840
+ allBorderRadius;
841
+ theme.components.MuiContainer.variants[13].style.border = `1px solid ${primaryLayoutColor}`;
842
+ theme.components.MuiContainer.variants[14].style.borderRadius =
843
+ allBorderRadius;
844
+ theme.components.MuiContainer.variants[15].style.border = `1px solid ${primaryLayoutColor}`;
845
+ theme.components.MuiContainer.variants[16].style.border = `1px solid ${primaryLayoutColor}`;
846
+ theme.components.MuiContainer.variants[16].style.borderRadius =
847
+ allBorderRadius;
848
+ theme.components.MuiSnackbar.styleOverrides.root.borderRadius =
849
+ allBorderRadius;
850
+ theme.components.MuiButton.styleOverrides.root.borderRadius = allBorderRadius;
851
+ theme.components.MuiButton.styleOverrides.contained.backgroundColor =
852
+ primaryActionColor;
853
+ theme.components.MuiButton.variants[0].style.backgroundColor =
854
+ primaryLayoutColor;
855
+ theme.components.MuiButton.variants[0].style["&:hover"].backgroundColor =
856
+ darken(primaryLayoutColor, 0.3);
857
+ theme.components.MuiButton.variants[1].style = ({ theme }) => ({
858
+ ...{
859
+ height: 40,
860
+ marginRight: 5,
861
+ marginLeft: 5,
862
+ backgroundColor: theme.palette.error.main,
863
+ color: primaryActionTextColor,
864
+ borderRadius: allBorderRadius,
865
+ "&:hover": {
866
+ backgroundColor: darken(theme.palette.error.main, 0.5),
867
+ color: "white"
868
+ }
869
+ }
870
+ });
871
+ theme.components.MuiButton.variants[2].style = ({ palette }) => ({
872
+ ...{
873
+ backgroundColor: palette.error.main,
874
+ color: primaryActionTextColor,
875
+ borderRadius: allBorderRadius,
876
+ "&:hover": {
877
+ backgroundColor: darken(palette.error.main, 0.5),
878
+ color: "white"
879
+ }
880
+ }
881
+ });
882
+ backgroundColor: primaryActionColor,
883
+ (theme.components.MuiButton.variants[3].style.backgroundColor =
884
+ primaryActionColor);
885
+ theme.components.MuiButton.variants[3].style.color = primaryActionTextColor;
886
+ theme.components.MuiButton.variants[3].style.borderRadius = allBorderRadius;
887
+ theme.components.MuiButton.variants[3].style["&:hover"].backgroundColor =
888
+ darken(primaryActionColor, 0.5);
889
+ theme.components.MuiButton.variants[4].style.border = `1px solid ${darken(
890
+ primaryActionColor,
891
+ 0.1
892
+ )}`;
893
+ theme.components.MuiButton.variants[4].style.fontFamily = mainFont;
894
+ theme.components.MuiButton.variants[4].style.borderRadius = allBorderRadius;
895
+ theme.components.MuiButton.variants[5].style.backgroundColor =
896
+ primaryActionColor;
897
+ theme.components.MuiButton.variants[5].style.borderRadius = allBorderRadius;
898
+ theme.components.MuiButton.variants[5].style["&:hover"].backgroundColor =
899
+ darken(primaryActionColor, 0.5);
900
+ theme.components.MuiButton.variants[6].style.borderRadius = allBorderRadius;
901
+ theme.components.MuiButton.variants[7].style.backgroundColor =
902
+ primaryActionColor;
903
+ theme.components.MuiButton.variants[7].style.color = primaryActionTextColor;
904
+ theme.components.MuiButton.variants[7].style.borderRadius = allBorderRadius;
905
+ theme.components.MuiButton.variants[7].style["&:hover"].backgroundColor =
906
+ darken(primaryActionColor, 0.4);
907
+ theme.components.MuiButton.variants[8].style.backgroundColor =
908
+ primaryActionColor;
909
+ theme.components.MuiButton.variants[8].style.color = primaryActionTextColor;
910
+ theme.components.MuiButton.variants[8].style.borderRadius = allBorderRadius;
911
+ theme.components.MuiButton.variants[8].style["&:hover"].backgroundColor =
912
+ darken(primaryActionColor, 0.4);
913
+ theme.components.MuiSwitch.styleOverrides.track.borderRadius =
914
+ allBorderRadius;
915
+ theme.components.MuiSwitch.styleOverrides.thumb.borderRadius =
916
+ allBorderRadius;
917
+ theme.components.MuiAlert.styleOverrides.root.borderRadius = allBorderRadius;
918
+ theme.components.MuiAlert.variants[0].style.borderRadius = allBorderRadius;
919
+ theme.components.MuiListItemButton.styleOverrides.root.borderRadius =
920
+ allBorderRadius;
921
+ theme.components.MuiListItemButton.styleOverrides.root[
922
+ "&:hover"
923
+ ].backgroundColor = primaryActionColor;
924
+ theme.components.MuiListItemButton.variants[0].style.backgroundColor =
925
+ primaryActionColor;
926
+ return theme;
927
+ };