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