@fluentui/react-avatar 9.8.7 → 9.9.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.
Files changed (20) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/lib/components/Avatar/Avatar.types.js.map +1 -1
  3. package/lib/components/Avatar/useAvatarStyles.styles.raw.js +702 -0
  4. package/lib/components/Avatar/useAvatarStyles.styles.raw.js.map +1 -0
  5. package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js +31 -0
  6. package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js.map +1 -0
  7. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js +266 -0
  8. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js.map +1 -0
  9. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js +188 -0
  10. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js.map +1 -0
  11. package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
  12. package/lib-commonjs/components/Avatar/useAvatarStyles.styles.raw.js +723 -0
  13. package/lib-commonjs/components/Avatar/useAvatarStyles.styles.raw.js.map +1 -0
  14. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js +47 -0
  15. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.raw.js.map +1 -0
  16. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js +282 -0
  17. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.raw.js.map +1 -0
  18. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js +204 -0
  19. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.raw.js.map +1 -0
  20. package/package.json +5 -5
@@ -0,0 +1,702 @@
1
+ import { tokens } from '@fluentui/react-theme';
2
+ import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';
3
+ export const avatarClassNames = {
4
+ root: 'fui-Avatar',
5
+ image: 'fui-Avatar__image',
6
+ initials: 'fui-Avatar__initials',
7
+ icon: 'fui-Avatar__icon',
8
+ badge: 'fui-Avatar__badge'
9
+ };
10
+ // CSS variables used internally in Avatar's styles
11
+ const vars = {
12
+ badgeRadius: '--fui-Avatar-badgeRadius',
13
+ badgeGap: '--fui-Avatar-badgeGap',
14
+ badgeAlign: '--fui-Avatar-badgeAlign',
15
+ ringWidth: '--fui-Avatar-ringWidth'
16
+ };
17
+ const useRootClassName = makeResetStyles({
18
+ display: 'inline-block',
19
+ flexShrink: 0,
20
+ position: 'relative',
21
+ verticalAlign: 'middle',
22
+ borderRadius: tokens.borderRadiusCircular,
23
+ fontFamily: tokens.fontFamilyBase,
24
+ fontWeight: tokens.fontWeightSemibold,
25
+ fontSize: tokens.fontSizeBase300,
26
+ width: '32px',
27
+ height: '32px',
28
+ // ::before is the ring, and ::after is the shadow.
29
+ // These are not displayed by default; the ring and shadow clases set content: "" to display them when appropriate.
30
+ '::before,::after': {
31
+ position: 'absolute',
32
+ top: 0,
33
+ left: 0,
34
+ bottom: 0,
35
+ right: 0,
36
+ zIndex: -1,
37
+ margin: `calc(-2 * var(${vars.ringWidth}, 0px))`,
38
+ borderRadius: 'inherit',
39
+ transitionProperty: 'margin, opacity',
40
+ transitionTimingFunction: `${tokens.curveEasyEaseMax}, ${tokens.curveLinear}`,
41
+ transitionDuration: `${tokens.durationUltraSlow}, ${tokens.durationSlower}`,
42
+ '@media screen and (prefers-reduced-motion: reduce)': {
43
+ transitionDuration: '0.01ms'
44
+ }
45
+ },
46
+ '::before': {
47
+ borderStyle: 'solid',
48
+ borderWidth: `var(${vars.ringWidth})`
49
+ }
50
+ });
51
+ const useImageClassName = makeResetStyles({
52
+ position: 'absolute',
53
+ top: 0,
54
+ left: 0,
55
+ width: '100%',
56
+ height: '100%',
57
+ borderRadius: 'inherit',
58
+ objectFit: 'cover',
59
+ verticalAlign: 'top'
60
+ });
61
+ const useIconInitialsClassName = makeResetStyles({
62
+ position: 'absolute',
63
+ boxSizing: 'border-box',
64
+ top: 0,
65
+ left: 0,
66
+ width: '100%',
67
+ height: '100%',
68
+ lineHeight: '1',
69
+ border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,
70
+ display: 'flex',
71
+ alignItems: 'center',
72
+ justifyContent: 'center',
73
+ verticalAlign: 'center',
74
+ textAlign: 'center',
75
+ userSelect: 'none',
76
+ borderRadius: 'inherit'
77
+ });
78
+ /**
79
+ * Helper to create a maskImage that punches out a circle larger than the badge by `badgeGap`.
80
+ * This creates a transparent gap between the badge and Avatar.
81
+ *
82
+ * Used by the icon, initials, and image slots, as well as the ring ::before pseudo-element.
83
+ */ const badgeMask = (margin)=>{
84
+ // Center the cutout at the badge's radius away from the edge.
85
+ // The ring (::before) also has a 2 * ringWidth margin that also needs to be offset.
86
+ const centerOffset = margin ? `calc(var(${vars.badgeRadius}) + ${margin})` : `var(${vars.badgeRadius})`;
87
+ // radial-gradient does not have anti-aliasing, so the transparent and opaque gradient stops are offset by +/- 0.25px
88
+ // to "fade" from transparent to opaque over a half-pixel and ease the transition.
89
+ const innerRadius = `calc(var(${vars.badgeRadius}) + var(${vars.badgeGap}) - 0.25px)`;
90
+ const outerRadius = `calc(var(${vars.badgeRadius}) + var(${vars.badgeGap}) + 0.25px)`;
91
+ return `radial-gradient(circle at bottom ${centerOffset} var(${vars.badgeAlign}) ${centerOffset}, ` + `transparent ${innerRadius}, white ${outerRadius})`;
92
+ };
93
+ const useStyles = makeStyles({
94
+ textCaption2Strong: {
95
+ fontSize: tokens.fontSizeBase100
96
+ },
97
+ textCaption1Strong: {
98
+ fontSize: tokens.fontSizeBase200
99
+ },
100
+ textSubtitle2: {
101
+ fontSize: tokens.fontSizeBase400
102
+ },
103
+ textSubtitle1: {
104
+ fontSize: tokens.fontSizeBase500
105
+ },
106
+ textTitle3: {
107
+ fontSize: tokens.fontSizeBase600
108
+ },
109
+ squareSmall: {
110
+ borderRadius: tokens.borderRadiusSmall
111
+ },
112
+ squareMedium: {
113
+ borderRadius: tokens.borderRadiusMedium
114
+ },
115
+ squareLarge: {
116
+ borderRadius: tokens.borderRadiusLarge
117
+ },
118
+ squareXLarge: {
119
+ borderRadius: tokens.borderRadiusXLarge
120
+ },
121
+ activeOrInactive: {
122
+ transform: 'perspective(1px)',
123
+ transitionProperty: 'transform, opacity',
124
+ transitionDuration: `${tokens.durationUltraSlow}, ${tokens.durationFaster}`,
125
+ transitionTimingFunction: `${tokens.curveEasyEaseMax}, ${tokens.curveLinear}`,
126
+ '@media screen and (prefers-reduced-motion: reduce)': {
127
+ transitionDuration: '0.01ms'
128
+ }
129
+ },
130
+ ring: {
131
+ // Show the ::before pseudo-element, which is the ring
132
+ '::before': {
133
+ content: '""'
134
+ }
135
+ },
136
+ ringBadgeCutout: {
137
+ '::before': {
138
+ maskImage: badgeMask(/*margin =*/ `2 * var(${vars.ringWidth})`)
139
+ }
140
+ },
141
+ ringThick: {
142
+ [vars.ringWidth]: tokens.strokeWidthThick
143
+ },
144
+ ringThicker: {
145
+ [vars.ringWidth]: tokens.strokeWidthThicker
146
+ },
147
+ ringThickest: {
148
+ [vars.ringWidth]: tokens.strokeWidthThickest
149
+ },
150
+ shadow: {
151
+ // Show the ::after pseudo-element, which is the shadow
152
+ '::after': {
153
+ content: '""'
154
+ }
155
+ },
156
+ shadow4: {
157
+ '::after': {
158
+ boxShadow: tokens.shadow4
159
+ }
160
+ },
161
+ shadow8: {
162
+ '::after': {
163
+ boxShadow: tokens.shadow8
164
+ }
165
+ },
166
+ shadow16: {
167
+ '::after': {
168
+ boxShadow: tokens.shadow16
169
+ }
170
+ },
171
+ shadow28: {
172
+ '::after': {
173
+ boxShadow: tokens.shadow28
174
+ }
175
+ },
176
+ inactive: {
177
+ opacity: '0.8',
178
+ transform: 'scale(0.875)',
179
+ transitionTimingFunction: `${tokens.curveDecelerateMin}, ${tokens.curveLinear}`,
180
+ '::before,::after': {
181
+ margin: 0,
182
+ opacity: 0,
183
+ transitionTimingFunction: `${tokens.curveDecelerateMin}, ${tokens.curveLinear}`
184
+ }
185
+ },
186
+ // Applied to the badge slot
187
+ badge: {
188
+ position: 'absolute',
189
+ bottom: 0,
190
+ right: 0
191
+ },
192
+ // Applied to the image, initials, or icon slot when there is a badge
193
+ badgeCutout: {
194
+ maskImage: badgeMask()
195
+ },
196
+ // Applied to the root when there is a badge
197
+ badgeAlign: {
198
+ // Griffel won't auto-flip the "right" alignment to "left" in RTL if it is inline in the maskImage,
199
+ // so split it out into a css variable that will auto-flip.
200
+ [vars.badgeAlign]: 'right'
201
+ },
202
+ // Badge size: applied to root when there is a badge
203
+ tiny: {
204
+ [vars.badgeRadius]: '3px',
205
+ [vars.badgeGap]: tokens.strokeWidthThin
206
+ },
207
+ 'extra-small': {
208
+ [vars.badgeRadius]: '5px',
209
+ [vars.badgeGap]: tokens.strokeWidthThin
210
+ },
211
+ small: {
212
+ [vars.badgeRadius]: '6px',
213
+ [vars.badgeGap]: tokens.strokeWidthThin
214
+ },
215
+ medium: {
216
+ [vars.badgeRadius]: '8px',
217
+ [vars.badgeGap]: tokens.strokeWidthThin
218
+ },
219
+ large: {
220
+ [vars.badgeRadius]: '10px',
221
+ [vars.badgeGap]: tokens.strokeWidthThick
222
+ },
223
+ 'extra-large': {
224
+ [vars.badgeRadius]: '14px',
225
+ [vars.badgeGap]: tokens.strokeWidthThick
226
+ },
227
+ icon12: {
228
+ fontSize: '12px'
229
+ },
230
+ icon16: {
231
+ fontSize: '16px'
232
+ },
233
+ icon20: {
234
+ fontSize: '20px'
235
+ },
236
+ icon24: {
237
+ fontSize: '24px'
238
+ },
239
+ icon28: {
240
+ fontSize: '28px'
241
+ },
242
+ icon32: {
243
+ fontSize: '32px'
244
+ },
245
+ icon48: {
246
+ fontSize: '48px'
247
+ }
248
+ });
249
+ export const useSizeStyles = makeStyles({
250
+ 16: {
251
+ width: '16px',
252
+ height: '16px'
253
+ },
254
+ 20: {
255
+ width: '20px',
256
+ height: '20px'
257
+ },
258
+ 24: {
259
+ width: '24px',
260
+ height: '24px'
261
+ },
262
+ 28: {
263
+ width: '28px',
264
+ height: '28px'
265
+ },
266
+ 32: {
267
+ width: '32px',
268
+ height: '32px'
269
+ },
270
+ 36: {
271
+ width: '36px',
272
+ height: '36px'
273
+ },
274
+ 40: {
275
+ width: '40px',
276
+ height: '40px'
277
+ },
278
+ 48: {
279
+ width: '48px',
280
+ height: '48px'
281
+ },
282
+ 56: {
283
+ width: '56px',
284
+ height: '56px'
285
+ },
286
+ 64: {
287
+ width: '64px',
288
+ height: '64px'
289
+ },
290
+ 72: {
291
+ width: '72px',
292
+ height: '72px'
293
+ },
294
+ 96: {
295
+ width: '96px',
296
+ height: '96px'
297
+ },
298
+ 120: {
299
+ width: '120px',
300
+ height: '120px'
301
+ },
302
+ 128: {
303
+ width: '128px',
304
+ height: '128px'
305
+ }
306
+ });
307
+ const useColorStyles = makeStyles({
308
+ neutral: {
309
+ color: tokens.colorNeutralForeground3,
310
+ backgroundColor: tokens.colorNeutralBackground6
311
+ },
312
+ brand: {
313
+ color: tokens.colorNeutralForegroundStaticInverted,
314
+ backgroundColor: tokens.colorBrandBackgroundStatic
315
+ },
316
+ 'dark-red': {
317
+ color: tokens.colorPaletteDarkRedForeground2,
318
+ backgroundColor: tokens.colorPaletteDarkRedBackground2
319
+ },
320
+ cranberry: {
321
+ color: tokens.colorPaletteCranberryForeground2,
322
+ backgroundColor: tokens.colorPaletteCranberryBackground2
323
+ },
324
+ red: {
325
+ color: tokens.colorPaletteRedForeground2,
326
+ backgroundColor: tokens.colorPaletteRedBackground2
327
+ },
328
+ pumpkin: {
329
+ color: tokens.colorPalettePumpkinForeground2,
330
+ backgroundColor: tokens.colorPalettePumpkinBackground2
331
+ },
332
+ peach: {
333
+ color: tokens.colorPalettePeachForeground2,
334
+ backgroundColor: tokens.colorPalettePeachBackground2
335
+ },
336
+ marigold: {
337
+ color: tokens.colorPaletteMarigoldForeground2,
338
+ backgroundColor: tokens.colorPaletteMarigoldBackground2
339
+ },
340
+ gold: {
341
+ color: tokens.colorPaletteGoldForeground2,
342
+ backgroundColor: tokens.colorPaletteGoldBackground2
343
+ },
344
+ brass: {
345
+ color: tokens.colorPaletteBrassForeground2,
346
+ backgroundColor: tokens.colorPaletteBrassBackground2
347
+ },
348
+ brown: {
349
+ color: tokens.colorPaletteBrownForeground2,
350
+ backgroundColor: tokens.colorPaletteBrownBackground2
351
+ },
352
+ forest: {
353
+ color: tokens.colorPaletteForestForeground2,
354
+ backgroundColor: tokens.colorPaletteForestBackground2
355
+ },
356
+ seafoam: {
357
+ color: tokens.colorPaletteSeafoamForeground2,
358
+ backgroundColor: tokens.colorPaletteSeafoamBackground2
359
+ },
360
+ 'dark-green': {
361
+ color: tokens.colorPaletteDarkGreenForeground2,
362
+ backgroundColor: tokens.colorPaletteDarkGreenBackground2
363
+ },
364
+ 'light-teal': {
365
+ color: tokens.colorPaletteLightTealForeground2,
366
+ backgroundColor: tokens.colorPaletteLightTealBackground2
367
+ },
368
+ teal: {
369
+ color: tokens.colorPaletteTealForeground2,
370
+ backgroundColor: tokens.colorPaletteTealBackground2
371
+ },
372
+ steel: {
373
+ color: tokens.colorPaletteSteelForeground2,
374
+ backgroundColor: tokens.colorPaletteSteelBackground2
375
+ },
376
+ blue: {
377
+ color: tokens.colorPaletteBlueForeground2,
378
+ backgroundColor: tokens.colorPaletteBlueBackground2
379
+ },
380
+ 'royal-blue': {
381
+ color: tokens.colorPaletteRoyalBlueForeground2,
382
+ backgroundColor: tokens.colorPaletteRoyalBlueBackground2
383
+ },
384
+ cornflower: {
385
+ color: tokens.colorPaletteCornflowerForeground2,
386
+ backgroundColor: tokens.colorPaletteCornflowerBackground2
387
+ },
388
+ navy: {
389
+ color: tokens.colorPaletteNavyForeground2,
390
+ backgroundColor: tokens.colorPaletteNavyBackground2
391
+ },
392
+ lavender: {
393
+ color: tokens.colorPaletteLavenderForeground2,
394
+ backgroundColor: tokens.colorPaletteLavenderBackground2
395
+ },
396
+ purple: {
397
+ color: tokens.colorPalettePurpleForeground2,
398
+ backgroundColor: tokens.colorPalettePurpleBackground2
399
+ },
400
+ grape: {
401
+ color: tokens.colorPaletteGrapeForeground2,
402
+ backgroundColor: tokens.colorPaletteGrapeBackground2
403
+ },
404
+ lilac: {
405
+ color: tokens.colorPaletteLilacForeground2,
406
+ backgroundColor: tokens.colorPaletteLilacBackground2
407
+ },
408
+ pink: {
409
+ color: tokens.colorPalettePinkForeground2,
410
+ backgroundColor: tokens.colorPalettePinkBackground2
411
+ },
412
+ magenta: {
413
+ color: tokens.colorPaletteMagentaForeground2,
414
+ backgroundColor: tokens.colorPaletteMagentaBackground2
415
+ },
416
+ plum: {
417
+ color: tokens.colorPalettePlumForeground2,
418
+ backgroundColor: tokens.colorPalettePlumBackground2
419
+ },
420
+ beige: {
421
+ color: tokens.colorPaletteBeigeForeground2,
422
+ backgroundColor: tokens.colorPaletteBeigeBackground2
423
+ },
424
+ mink: {
425
+ color: tokens.colorPaletteMinkForeground2,
426
+ backgroundColor: tokens.colorPaletteMinkBackground2
427
+ },
428
+ platinum: {
429
+ color: tokens.colorPalettePlatinumForeground2,
430
+ backgroundColor: tokens.colorPalettePlatinumBackground2
431
+ },
432
+ anchor: {
433
+ color: tokens.colorPaletteAnchorForeground2,
434
+ backgroundColor: tokens.colorPaletteAnchorBackground2
435
+ }
436
+ });
437
+ const useRingColorStyles = makeStyles({
438
+ neutral: {
439
+ '::before': {
440
+ color: tokens.colorBrandStroke1
441
+ }
442
+ },
443
+ brand: {
444
+ '::before': {
445
+ color: tokens.colorBrandStroke1
446
+ }
447
+ },
448
+ 'dark-red': {
449
+ '::before': {
450
+ color: tokens.colorPaletteDarkRedBorderActive
451
+ }
452
+ },
453
+ cranberry: {
454
+ '::before': {
455
+ color: tokens.colorPaletteCranberryBorderActive
456
+ }
457
+ },
458
+ red: {
459
+ '::before': {
460
+ color: tokens.colorPaletteRedBorderActive
461
+ }
462
+ },
463
+ pumpkin: {
464
+ '::before': {
465
+ color: tokens.colorPalettePumpkinBorderActive
466
+ }
467
+ },
468
+ peach: {
469
+ '::before': {
470
+ color: tokens.colorPalettePeachBorderActive
471
+ }
472
+ },
473
+ marigold: {
474
+ '::before': {
475
+ color: tokens.colorPaletteMarigoldBorderActive
476
+ }
477
+ },
478
+ gold: {
479
+ '::before': {
480
+ color: tokens.colorPaletteGoldBorderActive
481
+ }
482
+ },
483
+ brass: {
484
+ '::before': {
485
+ color: tokens.colorPaletteBrassBorderActive
486
+ }
487
+ },
488
+ brown: {
489
+ '::before': {
490
+ color: tokens.colorPaletteBrownBorderActive
491
+ }
492
+ },
493
+ forest: {
494
+ '::before': {
495
+ color: tokens.colorPaletteForestBorderActive
496
+ }
497
+ },
498
+ seafoam: {
499
+ '::before': {
500
+ color: tokens.colorPaletteSeafoamBorderActive
501
+ }
502
+ },
503
+ 'dark-green': {
504
+ '::before': {
505
+ color: tokens.colorPaletteDarkGreenBorderActive
506
+ }
507
+ },
508
+ 'light-teal': {
509
+ '::before': {
510
+ color: tokens.colorPaletteLightTealBorderActive
511
+ }
512
+ },
513
+ teal: {
514
+ '::before': {
515
+ color: tokens.colorPaletteTealBorderActive
516
+ }
517
+ },
518
+ steel: {
519
+ '::before': {
520
+ color: tokens.colorPaletteSteelBorderActive
521
+ }
522
+ },
523
+ blue: {
524
+ '::before': {
525
+ color: tokens.colorPaletteBlueBorderActive
526
+ }
527
+ },
528
+ 'royal-blue': {
529
+ '::before': {
530
+ color: tokens.colorPaletteRoyalBlueBorderActive
531
+ }
532
+ },
533
+ cornflower: {
534
+ '::before': {
535
+ color: tokens.colorPaletteCornflowerBorderActive
536
+ }
537
+ },
538
+ navy: {
539
+ '::before': {
540
+ color: tokens.colorPaletteNavyBorderActive
541
+ }
542
+ },
543
+ lavender: {
544
+ '::before': {
545
+ color: tokens.colorPaletteLavenderBorderActive
546
+ }
547
+ },
548
+ purple: {
549
+ '::before': {
550
+ color: tokens.colorPalettePurpleBorderActive
551
+ }
552
+ },
553
+ grape: {
554
+ '::before': {
555
+ color: tokens.colorPaletteGrapeBorderActive
556
+ }
557
+ },
558
+ lilac: {
559
+ '::before': {
560
+ color: tokens.colorPaletteLilacBorderActive
561
+ }
562
+ },
563
+ pink: {
564
+ '::before': {
565
+ color: tokens.colorPalettePinkBorderActive
566
+ }
567
+ },
568
+ magenta: {
569
+ '::before': {
570
+ color: tokens.colorPaletteMagentaBorderActive
571
+ }
572
+ },
573
+ plum: {
574
+ '::before': {
575
+ color: tokens.colorPalettePlumBorderActive
576
+ }
577
+ },
578
+ beige: {
579
+ '::before': {
580
+ color: tokens.colorPaletteBeigeBorderActive
581
+ }
582
+ },
583
+ mink: {
584
+ '::before': {
585
+ color: tokens.colorPaletteMinkBorderActive
586
+ }
587
+ },
588
+ platinum: {
589
+ '::before': {
590
+ color: tokens.colorPalettePlatinumBorderActive
591
+ }
592
+ },
593
+ anchor: {
594
+ '::before': {
595
+ color: tokens.colorPaletteAnchorBorderActive
596
+ }
597
+ }
598
+ });
599
+ export const useAvatarStyles_unstable = (state)=>{
600
+ 'use no memo';
601
+ const { size, shape, active, activeAppearance, color } = state;
602
+ const rootClassName = useRootClassName();
603
+ const imageClassName = useImageClassName();
604
+ const iconInitialsClassName = useIconInitialsClassName();
605
+ const styles = useStyles();
606
+ const sizeStyles = useSizeStyles();
607
+ const colorStyles = useColorStyles();
608
+ const ringColorStyles = useRingColorStyles();
609
+ const rootClasses = [
610
+ rootClassName,
611
+ size !== 32 && sizeStyles[size]
612
+ ];
613
+ if (state.badge) {
614
+ rootClasses.push(styles.badgeAlign, styles[state.badge.size || 'medium']);
615
+ }
616
+ if (size <= 24) {
617
+ rootClasses.push(styles.textCaption2Strong);
618
+ } else if (size <= 28) {
619
+ rootClasses.push(styles.textCaption1Strong);
620
+ } else if (size <= 40) {
621
+ // Default text size included in useRootClassName
622
+ } else if (size <= 56) {
623
+ rootClasses.push(styles.textSubtitle2);
624
+ } else if (size <= 96) {
625
+ rootClasses.push(styles.textSubtitle1);
626
+ } else {
627
+ rootClasses.push(styles.textTitle3);
628
+ }
629
+ if (shape === 'square') {
630
+ if (size <= 24) {
631
+ rootClasses.push(styles.squareSmall);
632
+ } else if (size <= 48) {
633
+ rootClasses.push(styles.squareMedium);
634
+ } else if (size <= 72) {
635
+ rootClasses.push(styles.squareLarge);
636
+ } else {
637
+ rootClasses.push(styles.squareXLarge);
638
+ }
639
+ }
640
+ if (active === 'active' || active === 'inactive') {
641
+ rootClasses.push(styles.activeOrInactive);
642
+ if (activeAppearance === 'ring' || activeAppearance === 'ring-shadow') {
643
+ rootClasses.push(styles.ring, ringColorStyles[color]);
644
+ if (state.badge) {
645
+ rootClasses.push(styles.ringBadgeCutout);
646
+ }
647
+ if (size <= 48) {
648
+ rootClasses.push(styles.ringThick);
649
+ } else if (size <= 64) {
650
+ rootClasses.push(styles.ringThicker);
651
+ } else {
652
+ rootClasses.push(styles.ringThickest);
653
+ }
654
+ }
655
+ if (activeAppearance === 'shadow' || activeAppearance === 'ring-shadow') {
656
+ rootClasses.push(styles.shadow);
657
+ if (size <= 28) {
658
+ rootClasses.push(styles.shadow4);
659
+ } else if (size <= 48) {
660
+ rootClasses.push(styles.shadow8);
661
+ } else if (size <= 64) {
662
+ rootClasses.push(styles.shadow16);
663
+ } else {
664
+ rootClasses.push(styles.shadow28);
665
+ }
666
+ }
667
+ // Note: The inactive style overrides some of the activeAppearance styles and must be applied after them
668
+ if (active === 'inactive') {
669
+ rootClasses.push(styles.inactive);
670
+ }
671
+ }
672
+ state.root.className = mergeClasses(avatarClassNames.root, ...rootClasses, state.root.className);
673
+ if (state.badge) {
674
+ state.badge.className = mergeClasses(avatarClassNames.badge, styles.badge, state.badge.className);
675
+ }
676
+ if (state.image) {
677
+ state.image.className = mergeClasses(avatarClassNames.image, imageClassName, colorStyles[color], state.badge && styles.badgeCutout, state.image.className);
678
+ }
679
+ if (state.initials) {
680
+ state.initials.className = mergeClasses(avatarClassNames.initials, iconInitialsClassName, colorStyles[color], state.badge && styles.badgeCutout, state.initials.className);
681
+ }
682
+ if (state.icon) {
683
+ let iconSizeClass;
684
+ if (size <= 16) {
685
+ iconSizeClass = styles.icon12;
686
+ } else if (size <= 24) {
687
+ iconSizeClass = styles.icon16;
688
+ } else if (size <= 40) {
689
+ iconSizeClass = styles.icon20;
690
+ } else if (size <= 48) {
691
+ iconSizeClass = styles.icon24;
692
+ } else if (size <= 56) {
693
+ iconSizeClass = styles.icon28;
694
+ } else if (size <= 72) {
695
+ iconSizeClass = styles.icon32;
696
+ } else {
697
+ iconSizeClass = styles.icon48;
698
+ }
699
+ state.icon.className = mergeClasses(avatarClassNames.icon, iconInitialsClassName, iconSizeClass, colorStyles[color], state.badge && styles.badgeCutout, state.icon.className);
700
+ }
701
+ return state;
702
+ };