cozy-ui 123.0.0 → 123.1.0

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,1025 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
- import { alpha, darken } from "cozy-ui/transpiled/react/styles";
8
- import { makeAlertColor, makeChipStyleByColor, makeSecondaryButtonStyle, makeTextButtonStyle, makeContainedButtonStyle, getFlagshipCssVar } from "cozy-ui/transpiled/react/MuiCozyTheme/helpers";
9
- var SWITCH_BAR_WIDTH = 25;
10
- export var makeLightNormalCozyOverrides = function makeLightNormalCozyOverrides(theme) {
11
- var _root, _objectSpread2, _root2, _root3;
12
-
13
- return {
14
- MuiSelect: {
15
- iconOutlined: {
16
- top: 'auto',
17
- right: 14
18
- },
19
- outlined: {
20
- '&&': {
21
- paddingRight: 39
22
- }
23
- }
24
- },
25
- MuiOutlinedInput: {
26
- root: {
27
- borderRadius: 4,
28
- '&$disabled': {
29
- background: theme.palette.background.contrast
30
- },
31
- '&$focused $notchedOutline': {
32
- borderWidth: '0.0625rem'
33
- },
34
- '&$error $notchedOutline': {
35
- borderColor: alpha(theme.palette.error.main, theme.palette.border.opacity)
36
- },
37
- '&$focused&$error $notchedOutline': {
38
- borderColor: theme.palette.error.main
39
- },
40
- '&:hover $notchedOutline': {
41
- borderColor: theme.palette.text.hint
42
- },
43
- '&:hover&$error $notchedOutline': {
44
- borderColor: theme.palette.error.main
45
- }
46
- },
47
- notchedOutline: {
48
- borderColor: theme.palette.border.main,
49
- transition: "border-color ".concat(theme.transitions.duration.shorter, "ms")
50
- },
51
- input: {
52
- textAlign: 'left',
53
- padding: '18.5px 16px'
54
- },
55
- inputMarginDense: {
56
- paddingTop: 14,
57
- paddingBottom: 15
58
- }
59
- },
60
- MuiInputLabel: {
61
- outlined: {
62
- '&$marginDense': {
63
- transform: 'translate(14px, 14px) scale(1)'
64
- },
65
- '&:not($shrink)': {
66
- '&$error': {
67
- color: theme.palette.text.secondary
68
- }
69
- }
70
- }
71
- },
72
- MuiToggleButtonGroup: {
73
- groupedHorizontal: {
74
- '&.rounded': {
75
- marginRight: 12,
76
- '&:last-child': {
77
- marginRight: 0
78
- },
79
- '&:not(:first-child)': {
80
- borderTopLeftRadius: 'inherit',
81
- borderBottomLeftRadius: 'inherit',
82
- marginLeft: 'inherit',
83
- borderLeft: 'inherit'
84
- },
85
- '&:not(:last-child)': {
86
- '&.rounded': {
87
- borderTopRightRadius: 'inherit',
88
- borderBottomRightRadius: 'inherit'
89
- }
90
- }
91
- }
92
- }
93
- },
94
- MuiToggleButton: {
95
- root: {
96
- borderRadius: 0,
97
- color: theme.palette.text.secondary,
98
- border: "1px solid ".concat(theme.palette.border.main),
99
- padding: 15,
100
- '&$selected': {
101
- color: theme.palette.text.primary,
102
- backgroundColor: 'transparent',
103
- '&:not($disabled)': {
104
- '&.customColor': {
105
- '&-primary': {
106
- color: theme.palette.primary.main
107
- }
108
- }
109
- }
110
- },
111
- '&$disabled': {
112
- color: theme.palette.text.disabled
113
- },
114
- '&.rounded': {
115
- border: 0,
116
- borderRadius: theme.shape.borderRadius,
117
- padding: '10px 12px',
118
- '&$selected': {
119
- backgroundColor: theme.palette.action.selected,
120
- '&:not($disabled)': {
121
- '&.customColor': {
122
- '&-primary': {
123
- color: theme.palette.text.primary,
124
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
125
- '&:hover': {
126
- textDecoration: 'none',
127
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity),
128
- '@media (hover: none)': {
129
- backgroundColor: 'transparent'
130
- }
131
- }
132
- }
133
- }
134
- }
135
- }
136
- }
137
- },
138
- sizeSmall: {
139
- padding: 11,
140
- '&.rounded': {
141
- padding: '7px 10px'
142
- }
143
- },
144
- sizeLarge: {
145
- padding: 19,
146
- '&.rounded': {
147
- padding: 12
148
- }
149
- }
150
- },
151
- MuiButton: {
152
- root: {
153
- borderRadius: 2,
154
- lineHeight: 'normal',
155
- padding: '0 1rem',
156
- '&.customSize': {
157
- '&-default': {
158
- height: '2.5rem'
159
- },
160
- '&-auto': {
161
- minHeight: '2.5rem'
162
- }
163
- },
164
- '&.ghost': {
165
- borderStyle: 'dashed !important',
166
- // important needed to override disable state
167
- '&:hover': {
168
- borderStyle: 'dashed !important' // important needed to override disable state
169
-
170
- }
171
- }
172
- },
173
- sizeSmall: {
174
- padding: '0 0.75rem',
175
- '&.customSize': {
176
- '&-default': {
177
- height: '2rem'
178
- },
179
- '&-auto': {
180
- minHeight: '2rem'
181
- }
182
- },
183
- '&$text': {
184
- padding: '8px 6px'
185
- }
186
- },
187
- sizeLarge: {
188
- padding: '0 1.25rem',
189
- '&.customSize': {
190
- '&-default': {
191
- height: '3rem'
192
- },
193
- '&-auto': {
194
- minHeight: '3rem'
195
- }
196
- },
197
- '&$text': {
198
- padding: '14px 10px'
199
- }
200
- },
201
- text: {
202
- minWidth: 'auto',
203
- padding: '11px 8px',
204
- '&:not($disabled)': {
205
- '&.customColor': {
206
- '&-success': makeTextButtonStyle(theme, 'success'),
207
- '&-warning': makeTextButtonStyle(theme, 'warning'),
208
- '&-error': makeTextButtonStyle(theme, 'error'),
209
- '&-info': makeTextButtonStyle(theme, 'info')
210
- }
211
- }
212
- },
213
- outlined: {
214
- '&:not($disabled)': {
215
- '&.ghost': {
216
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.ghostOpacity),
217
- '&:hover': {
218
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverGhostOpacity),
219
- '@media (hover: none)': {
220
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.ghostOpacity)
221
- }
222
- }
223
- },
224
- '&.customColor': {
225
- '&-primary': {
226
- color: theme.palette.text.primary,
227
- borderColor: theme.palette.border.main,
228
- '&:hover': {
229
- backgroundColor: theme.palette.action.hover,
230
- '@media (hover: none)': {
231
- backgroundColor: 'transparent'
232
- }
233
- },
234
- '&.ghost': {
235
- color: theme.palette.primary.main,
236
- borderColor: alpha(theme.palette.primary.main, theme.palette.border.ghostOpacity)
237
- }
238
- },
239
- '&-success': makeSecondaryButtonStyle(theme, 'success'),
240
- '&-warning': makeSecondaryButtonStyle(theme, 'warning'),
241
- '&-error': makeSecondaryButtonStyle(theme, 'error'),
242
- '&-info': makeSecondaryButtonStyle(theme, 'info')
243
- }
244
- }
245
- },
246
- contained: {
247
- boxShadow: 0,
248
- '&:not($disabled)': {
249
- '&.customColor': {
250
- '&-success': makeContainedButtonStyle(theme, 'success'),
251
- '&-warning': makeContainedButtonStyle(theme, 'warning'),
252
- '&-error': makeContainedButtonStyle(theme, 'error'),
253
- '&-info': makeContainedButtonStyle(theme, 'info')
254
- }
255
- }
256
- },
257
- startIcon: {
258
- // !important needed to override all sizes
259
- // should be remove when https://github.com/cozy/cozy-ui/issues/1808 is fixed
260
- marginLeft: '0 !important'
261
- }
262
- },
263
- MuiTabs: {
264
- root: {
265
- '&.segmented': {
266
- borderRadius: '99px',
267
- backgroundColor: theme.palette.background.contrast,
268
- overflow: 'visible',
269
- minHeight: '2.5rem',
270
- '& $indicator': {
271
- top: '1px',
272
- height: 'calc(100% - 2px)',
273
- transform: 'scale(0.99)',
274
- borderRadius: '99px',
275
- zIndex: 0,
276
- boxShadow: theme.shadows[1],
277
- backgroundColor: theme.palette.background.paper
278
- },
279
- '& $fixed': {
280
- overflow: 'visible !important'
281
- },
282
- '& $scrollButtons': {
283
- borderRadius: '99px'
284
- }
285
- }
286
- }
287
- },
288
- MuiTab: {
289
- root: _objectSpread(_objectSpread({}, theme.typography.subtitle2), {}, {
290
- '&:hover': {
291
- color: theme.palette.text.primary,
292
- opacity: 1
293
- },
294
- '&:focus': {
295
- color: theme.palette.text.primary
296
- },
297
- '&.narrowed': _defineProperty({
298
- minWidth: 'auto'
299
- }, theme.breakpoints.up('sm'), {
300
- minWidth: 'auto'
301
- }),
302
- '&.segmented': _objectSpread(_objectSpread({}, theme.typography.body2), {}, {
303
- textTransform: 'initial',
304
- zIndex: 1,
305
- borderRadius: '99px',
306
- minHeight: '2.5rem',
307
- '&$selected': {
308
- color: theme.palette.text.primary
309
- }
310
- })
311
- })
312
- },
313
- MuiAccordion: {
314
- rounded: {
315
- borderRadius: theme.shape.borderRadius
316
- },
317
- root: {
318
- boxShadow: '0 4px 12px 0 rgba(0, 0, 0, 0.08)',
319
- borderWidth: '0.0625rem',
320
- borderStyle: 'solid',
321
- borderColor: theme.palette.border.main,
322
- overflow: 'hidden',
323
- marginBottom: '1rem'
324
- }
325
- },
326
- MuiAccordionSummary: {
327
- expanded: {},
328
- root: {
329
- backgroundColor: theme.palette.grey[100],
330
- textTransform: 'uppercase',
331
- fontWeight: 'bold',
332
- fontSize: '0.875rem',
333
- minHeight: '3.5rem',
334
- padding: 0,
335
- color: theme.palette.text.primary,
336
- '&$expanded': {
337
- minHeight: '3.5rem'
338
- }
339
- },
340
- expandIcon: {
341
- order: 0,
342
- '&&': {
343
- marginLeft: '0.3125rem'
344
- },
345
- transform: 'rotate(-90deg)',
346
- '&$expanded': {
347
- marginLeft: '0.3125rem',
348
- transform: 'rotate(0)'
349
- }
350
- },
351
- content: {
352
- margin: '0.75rem 0',
353
- paddingLeft: '0.5rem',
354
- paddingRight: '0.25rem',
355
- order: 1,
356
- '& > :last-child': {
357
- paddingRight: 0
358
- },
359
- '&$expanded': {
360
- margin: '0.75rem 0'
361
- }
362
- }
363
- },
364
- MuiAccordionDetails: {
365
- root: {
366
- padding: 0,
367
- borderTop: "0.0625rem solid ".concat(theme.palette.border.main)
368
- }
369
- },
370
- MuiStepConnector: {
371
- line: {
372
- borderColor: theme.palette.divider
373
- }
374
- },
375
- MuiStepContent: {
376
- root: {
377
- borderColor: theme.palette.divider
378
- }
379
- },
380
- MuiStepLabel: {
381
- label: _objectSpread(_objectSpread({}, theme.typography.body1), {}, {
382
- '&$active': _objectSpread({}, theme.typography.h6),
383
- '&$completed': _objectSpread({}, theme.typography.h6)
384
- })
385
- },
386
- MuiListItemIcon: {
387
- root: {
388
- minWidth: 'auto',
389
- width: 32,
390
- height: 32,
391
- alignItems: 'center',
392
- justifyContent: 'center',
393
- color: theme.palette.text.icon
394
- }
395
- },
396
- MuiListItem: {
397
- root: {
398
- gap: 16,
399
- paddingTop: 12,
400
- paddingBottom: 12,
401
- minHeight: 56,
402
- '&.small': {
403
- paddingTop: 8,
404
- paddingBottom: 8,
405
- minHeight: 48
406
- },
407
- '&.large': {
408
- paddingTop: 16,
409
- paddingBottom: 16,
410
- minHeight: 64
411
- },
412
- '&.cozyActionsItem': {
413
- wordBreak: 'break-word'
414
- }
415
- },
416
- dense: {
417
- paddingTop: 8,
418
- paddingBottom: 8,
419
- minHeight: 48,
420
- '&.small': {
421
- paddingTop: 4,
422
- paddingBottom: 4,
423
- minHeight: 40
424
- },
425
- '&.large': {
426
- paddingTop: 12,
427
- paddingBottom: 12,
428
- minHeight: 56
429
- }
430
- }
431
- },
432
- MuiListSubheader: {
433
- root: _objectSpread(_objectSpread({}, theme.typography.subtitle2), {}, {
434
- paddingBottom: 8,
435
- paddingTop: 8,
436
- marginBottom: '0.5rem',
437
- backgroundColor: theme.palette.background.contrast
438
- }),
439
- sticky: {
440
- backgroundColor: theme.palette.background.default
441
- }
442
- },
443
- MuiListItemText: {
444
- root: {
445
- marginTop: 1,
446
- marginBottom: 1
447
- },
448
- multiline: {
449
- marginTop: 1,
450
- marginBottom: 1
451
- },
452
- secondary: {
453
- marginTop: 1
454
- }
455
- },
456
- MuiListItemSecondaryAction: {
457
- root: {
458
- right: 0
459
- }
460
- },
461
- MuiMenu: {
462
- paper: {
463
- maxWidth: 320
464
- }
465
- },
466
- MuiMenuItem: {
467
- root: (_root = {
468
- whiteSpace: 'normal',
469
- overflow: 'auto',
470
- wordBreak: 'break-word',
471
- paddingTop: 4,
472
- paddingBottom: 4
473
- }, _defineProperty(_root, theme.breakpoints.up('sm'), {
474
- minHeight: 40
475
- }), _defineProperty(_root, '&.cozyActionsItem', {
476
- minWidth: 256
477
- }), _defineProperty(_root, '& .cozyListItemIcon', {
478
- width: 16,
479
- height: 16
480
- }), _root),
481
- gutters: {
482
- paddingLeft: 16,
483
- paddingRight: 16
484
- }
485
- },
486
- MuiFormLabel: {
487
- root: {
488
- color: theme.palette.text.secondary,
489
- '&$disabled&$error': {
490
- color: theme.palette.text.disabled
491
- }
492
- }
493
- },
494
- MuiFormHelperText: {
495
- root: {
496
- fontStyle: 'italic',
497
- fontSize: '0.875rem',
498
- marginTop: 4,
499
- '&$disabled&$error': {
500
- color: theme.palette.text.disabled
501
- }
502
- }
503
- },
504
- MuiDialog: {
505
- paper: {
506
- '&.small': _defineProperty({
507
- width: '480px',
508
- maxWidth: '480px'
509
- }, theme.breakpoints.down('md'), {
510
- margin: '16px',
511
- padding: '0 8px 8px',
512
- height: 'auto',
513
- maxHeight: 'calc(100% - 32px)',
514
- borderRadius: '6px',
515
- '& .divider--dialog': {
516
- marginLeft: '-8px',
517
- marginRight: '-8px'
518
- }
519
- }),
520
- '&.medium': _defineProperty({}, theme.breakpoints.up('md'), {
521
- width: '544px',
522
- maxWidth: '544px'
523
- }),
524
- '&.large': _defineProperty({}, theme.breakpoints.up('md'), {
525
- width: '800px',
526
- maxWidth: '800px'
527
- }),
528
- '&.full': {
529
- width: '100%',
530
- maxWidth: '100%'
531
- }
532
- },
533
- scrollPaper: {
534
- '&.alignTop': {
535
- alignItems: 'start'
536
- }
537
- },
538
- paperFullScreen: {
539
- '& .cozyDialogActions': {
540
- paddingBottom: "calc(env(safe-area-inset-bottom) + ".concat(getFlagshipCssVar('bottom'), ")")
541
- },
542
- // Can't do that within the stylus file because we need to only target
543
- // the fullscreen dialog
544
- '& [class*="DialogCloseButton"]': {
545
- transform: "translateY(".concat(getFlagshipCssVar('top'), ")")
546
- },
547
- '& [class*="DialogBackButton"]': {
548
- transform: "translateY(".concat(getFlagshipCssVar('top'), ")")
549
- },
550
- // 0.75rm === MuiDialogTitle.root.sm
551
- // we should not target specifically flagship-app since
552
- // we should only rely on the css var. But this is for
553
- // another time.
554
- '.flagship-app & .cozyDialogTitle': {
555
- paddingTop: "calc(".concat(getFlagshipCssVar('top'), " + 0.75rem) !important")
556
- },
557
- '.flagship-app & .cozyDialogContent': {
558
- marginBottom: "".concat(getFlagshipCssVar('bottom'), " !important")
559
- }
560
- }
561
- },
562
- MuiDialogTitle: {
563
- root: _objectSpread(_objectSpread({}, theme.typography.h3), {}, (_objectSpread2 = {
564
- boxSizing: 'border-box',
565
- width: '100%',
566
- padding: '1.5rem 2rem'
567
- }, _defineProperty(_objectSpread2, theme.breakpoints.down('sm'), _objectSpread(_objectSpread({}, theme.typography.h4), {}, {
568
- padding: '0.75rem 1rem'
569
- })), _defineProperty(_objectSpread2, '&.dialogTitleWithBack', _defineProperty({
570
- paddingLeft: '4rem'
571
- }, theme.breakpoints.down('sm'), {
572
- paddingLeft: '3rem' // padding base (1rem) + buttonWidth (1rem) + buttonMargin (1rem)
573
-
574
- })), _defineProperty(_objectSpread2, '&.dialogTitleWithClose', _defineProperty({
575
- paddingRight: '4rem'
576
- }, theme.breakpoints.down('sm'), {
577
- paddingRight: '3rem' // padding base (1rem) + buttonWidth (1rem) + buttonMargin (1rem)
578
-
579
- })), _defineProperty(_objectSpread2, '&.dialogTitleFluid', {
580
- paddingTop: 0
581
- }), _objectSpread2))
582
- },
583
- MuiDialogContent: {
584
- root: (_root2 = {
585
- padding: '24px 32px 0'
586
- }, _defineProperty(_root2, theme.breakpoints.down('sm'), {
587
- padding: '24px 16px 0'
588
- }), _defineProperty(_root2, '&.disableGutters', {
589
- padding: 0,
590
- '& .dialogContentInner': {
591
- marginBottom: 0
592
- },
593
- '& .dialogTitleFluidContainer': {
594
- marginLeft: 0,
595
- marginRight: 0,
596
- marginTop: 0
597
- }
598
- }), _defineProperty(_root2, '& .dialogContentInner', {
599
- marginBottom: '24px',
600
- '&.withFluidActions': _defineProperty({}, theme.breakpoints.down('sm'), {
601
- marginBottom: 0,
602
- display: 'flex',
603
- flexDirection: 'column',
604
- height: '100%',
605
- '& .dialogContentWrapper': {
606
- flexGrow: 1,
607
- '&:not(.withActions)': {
608
- paddingBottom: "calc(env(safe-area-inset-bottom) + ".concat(getFlagshipCssVar('bottom'), " + 16px)")
609
- }
610
- },
611
- '& .cozyDialogActions': {
612
- paddingBottom: "calc(env(safe-area-inset-bottom) + ".concat(getFlagshipCssVar('bottom'), " + 16px)")
613
- }
614
- }),
615
- '& .dialogTitleFluidContainer': _defineProperty({
616
- marginLeft: '-2rem',
617
- marginRight: '-2rem'
618
- }, theme.breakpoints.down('sm'), {
619
- marginLeft: '-1rem',
620
- marginRight: '-1rem',
621
- marginTop: '-0.75rem'
622
- })
623
- }), _root2)
624
- },
625
- MuiDialogActions: {
626
- root: (_root3 = {
627
- margin: '16px 32px',
628
- padding: 0
629
- }, _defineProperty(_root3, theme.breakpoints.down('sm'), {
630
- margin: '8px 16px',
631
- '& button': {
632
- flexGrow: 1
633
- }
634
- }), _defineProperty(_root3, '&.dialogActionsFluid', {
635
- margin: '24px 0 0'
636
- }), _defineProperty(_root3, '&.columnLayout', {
637
- display: 'flex',
638
- flexDirection: 'column-reverse',
639
- '& button': {
640
- width: '100%',
641
- margin: 0,
642
- '&:not(:first-child)': {
643
- marginBottom: '8px'
644
- }
645
- }
646
- }), _defineProperty(_root3, '&:not(.columnLayout) > :not(:first-child):not(:first-child)', {
647
- marginLeft: 4
648
- }), _root3)
649
- },
650
- MuiDivider: {
651
- inset: {
652
- marginLeft: 64,
653
- '&.divider--dialog': {
654
- marginLeft: 80
655
- }
656
- }
657
- },
658
- MuiAvatarGroup: {
659
- avatar: {
660
- border: "2px solid ".concat(theme.palette.background.paper)
661
- }
662
- },
663
- MuiAvatar: {
664
- root: {
665
- fontWeight: 600,
666
- '&.size': {
667
- '&-xs': {
668
- width: 16,
669
- height: 16,
670
- fontSize: 8,
671
- '& svg': {
672
- width: 8,
673
- height: 8
674
- }
675
- },
676
- '&-s': {
677
- width: 24,
678
- height: 24,
679
- fontSize: 12,
680
- '& svg': {
681
- width: 12,
682
- height: 12
683
- }
684
- },
685
- '&-m': {
686
- width: 32,
687
- height: 32,
688
- fontSize: 16,
689
- '& svg': {
690
- width: 16,
691
- height: 16
692
- }
693
- },
694
- '&-l': {
695
- width: 48,
696
- height: 48,
697
- fontSize: 24,
698
- '& svg': {
699
- width: 24,
700
- height: 24
701
- }
702
- },
703
- '&-xl': {
704
- width: 64,
705
- height: 64,
706
- fontSize: 32,
707
- '& svg': {
708
- width: 32,
709
- height: 32
710
- }
711
- }
712
- },
713
- '&.disabled': {
714
- color: theme.palette.primary.contrastText,
715
- background: 'var(--silver)',
716
- // should be semantic but used legacy component color for now
717
- '& img': {
718
- filter: 'grayscale(1) brightness(2)',
719
- opacity: 0.5
720
- }
721
- },
722
- '&.border': {
723
- border: "2px solid ".concat(theme.palette.background.paper)
724
- },
725
- '&.innerBorder': {
726
- boxShadow: "inset 0px 0px 0px 1px ".concat(theme.palette.border.main)
727
- }
728
- }
729
- },
730
- MuiCheckbox: {
731
- colorSecondary: {
732
- '&$checked': {
733
- color: theme.palette.error.main
734
- }
735
- }
736
- },
737
- MuiSwitch: {
738
- checked: {
739
- '& + $track$track': {
740
- opacity: 1
741
- }
742
- },
743
- switchBase: {
744
- top: 1,
745
- '&$checked': {
746
- transform: 'translateX(15px)'
747
- }
748
- },
749
- thumb: {
750
- width: 16,
751
- height: 16,
752
- backgroundColor: theme.palette.common.white
753
- },
754
- track: {
755
- width: SWITCH_BAR_WIDTH,
756
- height: 12,
757
- opacity: 1,
758
- backgroundColor: theme.palette.text.disabled
759
- },
760
- colorSecondary: {
761
- '&$checked': {
762
- '& + $track': {
763
- backgroundColor: theme.palette.success.main
764
- }
765
- }
766
- },
767
- disabled: {
768
- '&$checked + $track': {
769
- backgroundColor: "".concat(theme.palette.grey[200], " !important")
770
- },
771
- '& $thumb': {
772
- backgroundColor: theme.palette.common.white
773
- }
774
- }
775
- },
776
- MuiTooltip: {
777
- tooltip: {
778
- borderRadius: '8px',
779
- fontSize: '1rem',
780
- lineHeight: '1.3',
781
- padding: '16px'
782
- }
783
- },
784
- MuiIconButton: {
785
- root: {
786
- color: theme.palette.text.secondary,
787
- '&.small': {
788
- padding: 3
789
- },
790
- '&.medium': {
791
- padding: 12
792
- },
793
- '&.large': {
794
- padding: 16
795
- },
796
- '&.dialogIconButton': {
797
- backgroundColor: theme.palette.background.paper,
798
- '&:hover': {
799
- backgroundColor: theme.palette.action.selected
800
- }
801
- },
802
- '&.cozyStyles': {
803
- '&-error': {
804
- color: theme.palette.error.main,
805
- '&:hover': {
806
- backgroundColor: alpha(theme.palette.error.main, theme.palette.action.hoverOpacity),
807
- '@media (hover: none)': {
808
- backgroundColor: 'transparent'
809
- }
810
- }
811
- }
812
- }
813
- }
814
- },
815
- MuiBadge: {
816
- badge: {
817
- boxSizing: 'content-box',
818
- padding: 0,
819
- borderRadius: '100%',
820
- '&.badgeBorder': {
821
- border: "2px solid ".concat(theme.palette.background.paper)
822
- },
823
- '&.badgeSizeLarge': {
824
- fontSize: '.6875rem',
825
- height: '1rem',
826
- minWidth: '1rem'
827
- },
828
- '&.badgeSizeMedium': {
829
- height: '.875rem',
830
- minWidth: '.875rem',
831
- fontSize: '.625rem'
832
- },
833
- '&.badgeSizeSmall': {
834
- height: '.75rem',
835
- minWidth: '.75rem',
836
- fontSize: '.5rem'
837
- }
838
- },
839
- colorPrimary: {
840
- '&.colorSuccess': {
841
- backgroundColor: theme.palette.success.main,
842
- color: theme.palette.success.contrastText
843
- },
844
- '&.colorWarning': {
845
- backgroundColor: theme.palette.warning.main,
846
- color: theme.palette.warning.contrastText
847
- },
848
- '&.colorInfo': {
849
- backgroundColor: theme.palette.info.main,
850
- color: theme.palette.info.contrastText
851
- }
852
- },
853
- anchorOriginTopRightRectangular: {
854
- transform: 'scale(1) translate(37%, -37%)'
855
- },
856
- anchorOriginBottomRightRectangular: {
857
- transform: 'scale(1) translate(37%, 37%)'
858
- },
859
- anchorOriginBottomLeftRectangular: {
860
- transform: 'scale(1) translate(-37%, 37%)'
861
- },
862
- anchorOriginTopLeftRectangular: {
863
- transform: 'scale(1) translate(-37%, -37%)'
864
- },
865
- dot: {
866
- borderRadius: '100%',
867
- padding: 0,
868
- '&.badgeSizeLarge': {
869
- height: '.625rem',
870
- minWidth: '.625rem'
871
- },
872
- '&.badgeSizeMedium': {
873
- height: '.5rem',
874
- minWidth: '.5rem'
875
- },
876
- '&.badgeSizeSmall': {
877
- height: '.375rem',
878
- minWidth: '.375rem'
879
- }
880
- }
881
- },
882
- MuiRadio: {
883
- root: {
884
- padding: '12px',
885
- '&$disabled svg': {
886
- borderRadius: '50%',
887
- backgroundColor: theme.palette.background.contrast,
888
- fill: theme.palette.border.disabled
889
- },
890
- '&:not($checked) svg': {
891
- fill: theme.palette.border.main
892
- }
893
- },
894
- colorPrimary: {
895
- '&$checked svg': {
896
- fill: theme.palette.primary.main
897
- },
898
- '&$disabled&$checked svg': {
899
- fill: theme.palette.text.disabled
900
- }
901
- },
902
- colorSecondary: {
903
- '&$checked svg': {
904
- fill: theme.palette.error.main
905
- },
906
- '&$disabled&$checked svg': {
907
- fill: theme.palette.text.disabled
908
- }
909
- }
910
- },
911
- MuiChip: {
912
- root: {
913
- '&.noLabel': {
914
- width: '32px',
915
- '& $label': {
916
- display: 'none'
917
- },
918
- '& $icon': {
919
- margin: 0
920
- }
921
- },
922
- '&.customColor': {
923
- '&-primary': makeChipStyleByColor(theme, 'primary'),
924
- '&-success': makeChipStyleByColor(theme, 'success'),
925
- '&-error': makeChipStyleByColor(theme, 'error'),
926
- '&-warning': makeChipStyleByColor(theme, 'warning'),
927
- '&-info': makeChipStyleByColor(theme, 'info')
928
- }
929
- }
930
- },
931
- MuiAlert: {
932
- root: {
933
- padding: '8px 16px',
934
- '&.cozyStyles': {
935
- '&-primary': makeAlertColor(theme, 'primary'),
936
- '&-secondary': makeAlertColor(theme, 'secondary'),
937
- '&-success': makeAlertColor(theme, 'success'),
938
- '&-error': makeAlertColor(theme, 'error'),
939
- '&-warning': makeAlertColor(theme, 'warning'),
940
- '&-info': makeAlertColor(theme, 'info')
941
- },
942
- '& $icon': {
943
- paddingTop: '9px'
944
- },
945
- '&.block': {
946
- flexWrap: 'wrap',
947
- '& $action': {
948
- width: '100%',
949
- paddingLeft: 0,
950
- justifyContent: 'end'
951
- }
952
- }
953
- },
954
- message: {
955
- flex: 'auto',
956
- display: 'flex',
957
- alignItems: 'center',
958
- flexWrap: 'wrap'
959
- },
960
- action: {
961
- marginRight: '-8px'
962
- }
963
- },
964
- MuiAlertTitle: {
965
- root: {
966
- width: '100%',
967
- fontWeight: 'bold'
968
- }
969
- },
970
- MuiSnackbarContent: {
971
- root: {
972
- padding: '4px 12px',
973
- backgroundColor: theme.palette.grey[600]
974
- }
975
- },
976
- MuiFab: {
977
- root: {
978
- color: theme.palette.text.primary,
979
- backgroundColor: theme.palette.background.paper,
980
- '&:hover': {
981
- backgroundColor: darken(theme.palette.background.paper, 0.05)
982
- },
983
- '@media (hover: none)': {
984
- backgroundColor: theme.palette.background.paper
985
- }
986
- },
987
- extended: {
988
- borderRadius: 56 / 2,
989
- height: 56,
990
- minWidth: 56,
991
- padding: '0 20px',
992
- '&$sizeSmall': {
993
- borderRadius: 40 / 2,
994
- height: 40,
995
- minWidth: 40,
996
- padding: '0 12px'
997
- },
998
- '&$sizeMedium': {
999
- borderRadius: 48 / 2,
1000
- height: 48,
1001
- minWidth: 48,
1002
- padding: '0 16px'
1003
- }
1004
- }
1005
- },
1006
- MuiMobileStepper: {
1007
- root: {
1008
- background: 'transparent',
1009
- height: 40,
1010
- padding: 0
1011
- },
1012
- dot: {
1013
- backgroundColor: 'transparent',
1014
- width: '10px',
1015
- height: '10px',
1016
- margin: '0 3px',
1017
- border: "1px solid ".concat(theme.palette.border.main),
1018
- boxSizing: 'border-box'
1019
- },
1020
- dotActive: {
1021
- border: 'none'
1022
- }
1023
- }
1024
- };
1025
- };