@mixtint/primer-view-components 0.89.2 → 0.91.1

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 (55) hide show
  1. package/app/assets/javascripts/primer_view_components.js +1 -1
  2. package/app/assets/javascripts/primer_view_components.js.map +1 -1
  3. package/app/assets/styles/primer_view_components.css +206 -646
  4. package/app/assets/styles/primer_view_components.css.map +1 -1
  5. package/app/components/primer/alpha/action_bar.css +9 -3
  6. package/app/components/primer/alpha/action_list.css +92 -2
  7. package/app/components/primer/alpha/action_menu/action_menu_element.js +1 -0
  8. package/app/components/primer/alpha/auto_complete.css +4 -22
  9. package/app/components/primer/alpha/auto_complete.css.json +1 -3
  10. package/app/components/primer/alpha/banner.css +0 -1
  11. package/app/components/primer/alpha/button_marketing.css +4 -4
  12. package/app/components/primer/alpha/dialog.css +63 -0
  13. package/app/components/primer/alpha/dropdown.css +0 -6
  14. package/app/components/primer/alpha/layout.css +3 -1
  15. package/app/components/primer/alpha/menu.css +0 -6
  16. package/app/components/primer/alpha/overlay.css +5 -0
  17. package/app/components/primer/alpha/segmented_control.css +0 -4
  18. package/app/components/primer/alpha/tab_nav.css +0 -8
  19. package/app/components/primer/alpha/text_field.css +97 -5
  20. package/app/components/primer/alpha/text_field.css.json +2 -2
  21. package/app/components/primer/alpha/toggle_switch.css +8 -7
  22. package/app/components/primer/alpha/tree_view.css +1 -0
  23. package/app/components/primer/alpha/underline_nav.css +0 -3
  24. package/app/components/primer/beta/avatar.css +0 -1
  25. package/app/components/primer/beta/avatar_stack.css +33 -0
  26. package/app/components/primer/beta/blankslate.css +2 -61
  27. package/app/components/primer/beta/border_box.css +35 -0
  28. package/app/components/primer/beta/breadcrumbs.css +7 -4
  29. package/app/components/primer/beta/breadcrumbs.css.json +2 -1
  30. package/app/components/primer/beta/button.css +51 -1
  31. package/app/components/primer/beta/flash.css +0 -16
  32. package/app/components/primer/beta/label.css +0 -2
  33. package/app/components/primer/beta/link.css +0 -2
  34. package/app/components/primer/beta/popover.css +138 -85
  35. package/app/components/primer/beta/popover.css.json +22 -16
  36. package/app/components/primer/beta/state.css +0 -1
  37. package/app/components/primer/beta/subhead.css +0 -8
  38. package/app/components/primer/beta/timeline_item.css +0 -5
  39. package/app/components/primer/beta/truncate.css +0 -1
  40. package/app/components/primer/open_project/avatar_stack.css +10 -0
  41. package/app/components/primer/open_project/border_box/collapsible_header.css +3 -1
  42. package/app/components/primer/open_project/border_grid.css +11 -9
  43. package/app/components/primer/open_project/collapsible.d.ts +1 -1
  44. package/app/components/primer/open_project/collapsible.js +8 -4
  45. package/app/components/primer/open_project/filterable_tree_view.css +2 -7
  46. package/app/components/primer/open_project/page_header.css +2 -5
  47. package/app/components/primer/open_project/pagination.css +4 -1
  48. package/app/components/primer/open_project/side_panel/section.css +3 -3
  49. package/package.json +32 -12
  50. package/static/classes.json +21 -0
  51. package/static/classnames.cjs +516 -0
  52. package/static/classnames.d.ts +2 -0
  53. package/static/classnames.js +518 -0
  54. package/static/info_arch.json +39 -0
  55. package/static/previews.json +2411 -2372
@@ -2,17 +2,21 @@
2
2
  /* stylelint-disable max-nesting-depth */
3
3
  /* stylelint-disable selector-max-specificity */
4
4
  /* stylelint-disable primer/spacing */
5
+
5
6
  /* FormControl */
7
+
6
8
  /* groups label, field, caption and inline error message */
7
9
  .FormControl {
8
10
  display: inline-flex;
9
11
  flex-direction: column;
10
12
  gap: var(--base-size-4);
11
13
  }
14
+
12
15
  /* fill container */
13
16
  .FormControl--fullWidth {
14
17
  display: flex;
15
18
  }
19
+
16
20
  /* <label> */
17
21
  .FormControl-label {
18
22
  font-size: var(--text-body-size-medium);
@@ -20,6 +24,7 @@
20
24
  line-height: var(--text-body-lineHeight-medium);
21
25
  color: var(--fgColor-default);
22
26
  }
27
+
23
28
  /* optional caption */
24
29
  .FormControl-caption {
25
30
  margin-bottom: 0;
@@ -28,10 +33,12 @@
28
33
  line-height: var(--text-caption-lineHeight);
29
34
  color: var(--fgColor-muted);
30
35
  }
36
+
31
37
  .FormControl-caption a {
32
38
  -webkit-text-decoration: underline;
33
39
  text-decoration: underline;
34
40
  }
41
+
35
42
  /* inline validation message */
36
43
  .FormControl-inlineValidation {
37
44
  display: flex;
@@ -47,25 +54,33 @@
47
54
  .FormControl-inlineValidation p {
48
55
  margin-bottom: 0;
49
56
  }
57
+
50
58
  .FormControl-inlineValidation--success {
51
59
  color: var(--fgColor-success);
52
60
  fill: var(--fgColor-success);
53
61
  }
62
+
54
63
  .FormControl-inlineValidation--visual {
55
64
  align-items: center;
56
65
  display: flex;
57
66
  min-height: var(--base-size-16);
58
67
  }
68
+
59
69
  .FormControl-spacingWrapper {
60
70
  display: flex;
61
71
  flex-direction: column;
62
72
  row-gap: var(--stack-gap-normal);
63
73
  }
74
+
64
75
  .FormControl-horizontalGroup {
65
76
  display: flex;
66
77
  column-gap: 0.5rem;
67
78
  }
79
+
68
80
  /* shared among all form control components (input, select, textarea, checkbox, radio) */
81
+ /* stylelint-disable nesting-selector-no-missing-scoping-root */
82
+ /* stylelint-enable nesting-selector-no-missing-scoping-root */
83
+
69
84
  /* TextInput structure
70
85
  ** ===================
71
86
  **
@@ -80,6 +95,7 @@
80
95
  ** │ │ ├─ .FormControl-input-trailingAction
81
96
  ** ├─ .FormControl-inlineValidation
82
97
  ** ├─ .FormControl-caption */
98
+
83
99
  /* // Select structure
84
100
  ** ===================
85
101
  **
@@ -89,6 +105,7 @@
89
105
  ** │ │ ├─ .FormControl-select
90
106
  ** ├─ .FormControl-inlineValidation
91
107
  ** ├─ .FormControl-caption */
108
+
92
109
  /* // Textarea structure
93
110
  ** ===================
94
111
  **
@@ -97,6 +114,7 @@
97
114
  ** ├─ .FormControl-textarea
98
115
  ** ├─ .FormControl-inlineValidation
99
116
  ** ├─ .FormControl-caption */
117
+
100
118
  .FormControl-input,
101
119
  .FormControl-select,
102
120
  .FormControl-textarea {
@@ -105,6 +123,7 @@
105
123
  border: var(--borderWidth-thin) solid var(--control-borderColor-rest, var(--color-border-default));
106
124
  box-shadow: var(--shadow-inset);
107
125
  }
126
+
108
127
  [disabled]:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
109
128
  color: var(--control-fgColor-disabled);
110
129
  cursor: not-allowed;
@@ -114,12 +133,15 @@
114
133
  opacity: 1;
115
134
  -webkit-text-fill-color: var(--control-fgColor-disabled);
116
135
  }
136
+
117
137
  [invalid='true']:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus) {
118
138
  border-color: var(--control-borderColor-danger);
119
139
  }
140
+
120
141
  [invalid='false']:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus) {
121
142
  border-color: var(--control-borderColor-success);
122
143
  }
144
+
123
145
  :is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type='checkbox'],[type='radio']):focus {
124
146
  border-color: var(--focus-outlineColor);
125
147
  outline: none;
@@ -127,6 +149,7 @@
127
149
 
128
150
  /* remove fallback :focus if :focus-visible is supported */
129
151
  }
152
+
130
153
  :is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type='checkbox'],[type='radio']):focus:not(:focus-visible) {
131
154
  border-color: transparent;
132
155
 
@@ -136,12 +159,15 @@
136
159
 
137
160
  box-shadow: inset 0 0 0 1px transparent var(--focus-outlineColor);
138
161
  }
162
+
139
163
  /* default focus state */
164
+
140
165
  :is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type='checkbox'],[type='radio']):focus-visible {
141
166
  border-color: var(--focus-outlineColor);
142
167
  outline: none;
143
168
  box-shadow: inset 0 0 0 1px var(--focus-outlineColor);
144
169
  }
170
+
145
171
  .FormControl-input,
146
172
  .FormControl-select,
147
173
  .FormControl-textarea {
@@ -155,57 +181,77 @@
155
181
  padding-inline: var(--control-medium-paddingInline-condensed);
156
182
  padding-block: calc(var(--control-medium-paddingBlock) - var(--borderWidth-thin));
157
183
  }
184
+
158
185
  [disabled]:is(.FormControl-input,.FormControl-select,.FormControl-textarea)::placeholder {
159
186
  color: var(--control-fgColor-disabled);
160
187
  }
188
+
161
189
  [readonly]:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
162
190
  background-color: var(--control-bgColor-disabled);
163
191
  }
192
+
164
193
  :is(.FormControl-input,.FormControl-select,.FormControl-textarea)::placeholder {
165
194
  color: var(--control-fgColor-placeholder);
166
195
  opacity: 1;
167
196
  }
197
+
168
198
  /* sizes */
199
+
169
200
  .FormControl-small:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
170
201
  height: var(--control-small-size);
171
202
  padding-inline: var(--control-small-paddingInline-normal);
172
203
  padding-block: var(--control-small-paddingBlock);
173
204
  font-size: var(--text-body-size-small);
174
205
  }
206
+
175
207
  .FormControl-medium:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
176
208
  height: var(--control-medium-size);
177
209
  }
210
+
178
211
  .FormControl-large:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
179
212
  height: var(--control-large-size);
180
213
  padding-inline: var(--control-large-paddingInline-normal);
181
214
  padding-block: var(--control-large-paddingBlock);
182
215
  }
216
+
183
217
  /* variants */
218
+
184
219
  .FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
185
220
  background-color: var(--bgColor-muted);
186
221
  }
222
+
187
223
  .FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus-visible,.FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus {
188
224
  background-color: var(--bgColor-default);
189
225
  }
226
+
190
227
  .FormControl-monospace:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
191
228
  font-family: var(--fontStack-monospace);
192
229
  }
230
+
193
231
  /* validation states */
232
+
194
233
  .FormControl-error:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
195
234
  border-color: var(--control-borderColor-danger);
196
235
  }
236
+
197
237
  .FormControl-success:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
198
238
  border-color: var(--control-borderColor-success);
199
239
  }
240
+
200
241
  .FormControl-warning:is(.FormControl-input,.FormControl-select,.FormControl-textarea) {
201
242
  border-color: var(--control-borderColor-warning);
202
243
  }
244
+
203
245
  .FormControl-toggleSwitchInput {
204
246
  display: flex;
205
247
  align-items: flex-start;
206
248
  gap: var(--base-size-16);
207
249
  }
250
+
208
251
  /* widths */
252
+ /* stylelint-disable nesting-selector-no-missing-scoping-root -- inside @define-mixin the & resolves at the @mixin include site, so there is a scoping root */
253
+ /* stylelint-enable nesting-selector-no-missing-scoping-root */
254
+
209
255
  /* positioning for leading/trailing items for TextInput */
210
256
  .FormControl-input-wrap {
211
257
  position: relative;
@@ -506,32 +552,42 @@
506
552
  top: unset;
507
553
  height: var(--base-size-20);
508
554
  }
555
+
509
556
  .FormControl-select-wrap {
510
557
  display: grid;
511
558
  grid-template-columns: minmax(0, auto) var(--base-size-16);
512
559
  }
560
+
513
561
  .FormControl-select-wrap.FormControl-input-width--auto {
514
562
  width: auto;
515
563
  }
564
+
516
565
  .FormControl-select-wrap.FormControl-input-width--xsmall {
517
566
  max-width: min(144px, 100vw - 2rem);
518
567
  }
568
+
519
569
  .FormControl-select-wrap.FormControl-input-width--small {
520
570
  max-width: min(256px, 100vw - 2rem);
521
571
  }
572
+
522
573
  .FormControl-select-wrap.FormControl-input-width--medium {
523
574
  max-width: min(320px, 100vw - 2rem);
524
575
  }
576
+
525
577
  .FormControl-select-wrap.FormControl-input-width--large {
526
578
  max-width: min(480px, 100vw - 2rem);
527
579
  }
580
+
528
581
  .FormControl-select-wrap.FormControl-input-width--xlarge {
529
582
  max-width: min(680px, 100vw - 2rem);
530
583
  }
584
+
531
585
  .FormControl-select-wrap.FormControl-input-width--xxlarge {
532
586
  max-width: min(960px, 100vw - 2rem);
533
587
  }
588
+
534
589
  /* mask allows for background-color to respect themes */
590
+
535
591
  .FormControl-select-wrap::after {
536
592
  width: var(--base-size-16);
537
593
  height: var(--base-size-16);
@@ -546,20 +602,26 @@
546
602
  grid-row: 1;
547
603
  place-self: center end;
548
604
  }
605
+
549
606
  /* spans entire grid below mask */
607
+
550
608
  .FormControl-select-wrap .FormControl-select {
551
609
  grid-column: 1/-1;
552
610
  grid-row: 1;
553
611
  appearance: none;
554
612
  padding-right: var(--base-size-20);
555
613
  }
614
+
556
615
  .FormControl-select-wrap[data-multiple]::after {
557
616
  content: none;
558
617
  }
618
+
559
619
  .FormControl-select-wrap[data-multiple] .FormControl-select {
560
620
  padding-right: var(--base-size-8);
561
621
  }
622
+
562
623
  /* checkbox + radio specific styles */
624
+
563
625
  /* // Checkbox + Radio structure
564
626
  ** ===================
565
627
  **
@@ -568,30 +630,40 @@
568
630
  ** ├─ .FormControl-radio-labelWrap
569
631
  ** │ ├─ .FormControl-label
570
632
  ** │ ├─ .FormControl-caption */
633
+
571
634
  .FormControl-checkbox-wrap,
572
635
  .FormControl-radio-wrap {
573
636
  display: inline-grid;
574
637
  grid-template-columns: min-content auto;
575
638
  gap: var(--base-size-8);
576
639
  }
577
- :is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-checkbox-labelWrap,:is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-radio-labelWrap {
578
- display: flex;
579
- flex-direction: column;
580
- gap: var(--base-size-4);
581
- }
640
+
582
641
  :is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-label {
583
642
  cursor: pointer;
584
643
  }
644
+
645
+ /* Expanded per-class so the subject buckets by a single class during style
646
+ ** recalc, instead of compiling to a merged `:is(...)` subject that Blink
647
+ ** cannot fast-reject. */
648
+ .FormControl-checkbox-wrap .FormControl-checkbox-labelWrap,
649
+ .FormControl-radio-wrap .FormControl-radio-labelWrap {
650
+ display: flex;
651
+ flex-direction: column;
652
+ gap: var(--base-size-4);
653
+ }
654
+
585
655
  .FormControl-radio-group-wrap fieldset {
586
656
  padding: 0;
587
657
  margin: 0;
588
658
  border: 0;
589
659
  }
660
+
590
661
  .FormControl-check-group-wrap fieldset {
591
662
  padding: 0;
592
663
  margin: 0;
593
664
  border: 0;
594
665
  }
666
+
595
667
  /* these selectors are temporary to override base.scss
596
668
  ** once Field styles are widely adopted, we can adjust this and the global base styles */
597
669
  .FormControl-checkbox {
@@ -722,12 +794,14 @@
722
794
  mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMiIgdmlld0JveD0iMCAwIDEwIDIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMCAxQzAgMC40NDc3MTUgMC40NDc3MTUgMCAxIDBIOUM5LjU1MjI5IDAgMTAgMC40NDc3MTUgMTAgMUMxMCAxLjU1MjI4IDkuNTUyMjkgMiA5IDJIMUMwLjQ0NzcxNSAyIDAgMS41NTIyOCAwIDFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K');
723
795
  visibility: visible;
724
796
  }
797
+
725
798
  .FormControl-radio {
726
799
  color: var(--fgColor-default);
727
800
  background-color: var(--bgColor-default);
728
801
  border: var(--borderWidth-thin) solid var(--control-borderColor-rest, var(--color-border-default));
729
802
  box-shadow: var(--shadow-inset);
730
803
  }
804
+
731
805
  .FormControl-radio[disabled] {
732
806
  color: var(--control-fgColor-disabled);
733
807
  cursor: not-allowed;
@@ -737,12 +811,15 @@
737
811
  opacity: 1;
738
812
  -webkit-text-fill-color: var(--control-fgColor-disabled);
739
813
  }
814
+
740
815
  .FormControl-radio[invalid='true']:not(:focus) {
741
816
  border-color: var(--control-borderColor-danger);
742
817
  }
818
+
743
819
  .FormControl-radio[invalid='false']:not(:focus) {
744
820
  border-color: var(--control-borderColor-success);
745
821
  }
822
+
746
823
  .FormControl-radio:not([type='checkbox'],[type='radio']):focus {
747
824
  border-color: var(--focus-outlineColor);
748
825
  outline: none;
@@ -750,6 +827,7 @@
750
827
 
751
828
  /* remove fallback :focus if :focus-visible is supported */
752
829
  }
830
+
753
831
  .FormControl-radio:not([type='checkbox'],[type='radio']):focus:not(:focus-visible) {
754
832
  border-color: transparent;
755
833
 
@@ -759,12 +837,15 @@
759
837
 
760
838
  box-shadow: inset 0 0 0 1px transparent var(--focus-outlineColor);
761
839
  }
840
+
762
841
  /* default focus state */
842
+
763
843
  .FormControl-radio:not([type='checkbox'],[type='radio']):focus-visible {
764
844
  border-color: var(--focus-outlineColor);
765
845
  outline: none;
766
846
  box-shadow: inset 0 0 0 1px var(--focus-outlineColor);
767
847
  }
848
+
768
849
  .FormControl-radio {
769
850
 
770
851
  position: relative;
@@ -778,6 +859,7 @@
778
859
  transition: background-color, border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */
779
860
  appearance: none;
780
861
  }
862
+
781
863
  :is(.FormControl-radio::after) {
782
864
  position: absolute;
783
865
  top: 50%;
@@ -788,36 +870,45 @@
788
870
  content: "";
789
871
  transform: translateX(-50%) translateY(-50%);
790
872
  }
873
+
791
874
  :is(.FormControl-radio[disabled] ~ .FormControl-radio-labelWrap) .FormControl-label {
792
875
  color: var(--control-fgColor-disabled);
793
876
  cursor: not-allowed;
794
877
  }
878
+
795
879
  .FormControl-radio:checked {
796
880
  border-color: var(--control-checked-borderColor-rest, var(--color-accent-fg));
797
881
  /* stylelint-disable-next-line primer/borders */
798
882
  border-width: var(--base-size-4);
799
883
  }
884
+
800
885
  .FormControl-radio[disabled]:checked,.FormControl-radio:checked:disabled {
801
886
  cursor: not-allowed;
802
887
  /* stylelint-disable-next-line primer/colors */
803
888
  border-color: var(--control-fgColor-disabled);
804
889
  }
890
+
805
891
  :is(:is(.FormControl-radio[disabled]:checked,.FormControl-radio:checked:disabled) ~ .FormControl-radio-labelWrap) .FormControl-label {
806
892
  color: var(--control-fgColor-disabled);
807
893
  cursor: not-allowed;
808
894
  }
895
+
809
896
  .FormControl-radio:focus-visible {
810
897
  outline: 2px solid var(--focus-outlineColor);
811
898
  outline-offset: 2px;
812
899
  box-shadow: none;
813
900
  }
901
+
814
902
  /* Windows High Contrast mode */
903
+
815
904
  @media (forced-colors: active) {
905
+
816
906
  .FormControl-radio {
817
907
  background-color: canvastext;
818
908
  border-color: canvastext;
819
909
  }
820
910
  }
911
+
821
912
  @keyframes checkmarkIn {
822
913
  from {
823
914
  clip-path: inset(var(--base-size-16) 0 0 0);
@@ -827,6 +918,7 @@
827
918
  clip-path: inset(0 0 0 0);
828
919
  }
829
920
  }
921
+
830
922
  @keyframes checkmarkOut {
831
923
  from {
832
924
  clip-path: inset(0 0 0 0);
@@ -95,9 +95,9 @@
95
95
  ".FormControl-select-wrap[data-multiple] .FormControl-select",
96
96
  ".FormControl-checkbox-wrap",
97
97
  ".FormControl-radio-wrap",
98
- ":is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-checkbox-labelWrap",
99
- ":is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-radio-labelWrap",
100
98
  ":is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-label",
99
+ ".FormControl-checkbox-wrap .FormControl-checkbox-labelWrap",
100
+ ".FormControl-radio-wrap .FormControl-radio-labelWrap",
101
101
  ".FormControl-radio-group-wrap fieldset",
102
102
  ".FormControl-check-group-wrap fieldset",
103
103
  ".FormControl-checkbox",
@@ -2,12 +2,14 @@
2
2
 
3
3
  /* Catalyst in dotcom applies a display: block to all web component elements. This
4
4
  ** rule overrides it so the status label and toggle switch are laid out correctly. */
5
-
6
5
  .ToggleSwitch.ToggleSwitch {
7
6
  display: inline-flex;
8
7
  }
9
8
 
10
9
  .ToggleSwitch {
10
+ --toggleSwitch-knob-inset: var(--borderWidth-thin);
11
+ --toggleSwitch-knob-offset: calc(2 * var(--toggleSwitch-knob-inset));
12
+
11
13
  align-items: center;
12
14
  display: inline-flex;
13
15
  gap: var(--controlStack-medium-gap-condensed);
@@ -102,7 +104,7 @@
102
104
  .ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-knob {
103
105
  background-color: var(--controlKnob-bgColor-checked);
104
106
  border-color: var(--controlKnob-borderColor-checked);
105
- transform: translateX(100%);
107
+ transform: translateX(calc(100% - var(--toggleSwitch-knob-offset)));
106
108
  }
107
109
 
108
110
  .ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-lineIcon {
@@ -122,7 +124,6 @@
122
124
 
123
125
  .ToggleSwitch-track[disabled] .ToggleSwitch-knob {
124
126
  border-color: var(--borderColor-default);
125
- box-shadow: none;
126
127
  }
127
128
 
128
129
  .ToggleSwitch-track[disabled] .ToggleSwitch-lineIcon {
@@ -163,14 +164,14 @@
163
164
 
164
165
  .ToggleSwitch-knob {
165
166
  position: absolute;
166
- top: 0;
167
- bottom: 0;
167
+ inset-block: var(--toggleSwitch-knob-inset);
168
+ inset-inline-start: var(--toggleSwitch-knob-inset);
168
169
  z-index: 1;
169
170
  width: 50%;
170
171
  background-color: var(--controlKnob-bgColor-rest);
171
172
  border: var(--borderWidth-thin) solid var(--controlKnob-borderColor-rest);
172
- border-radius: var(--borderRadius-medium);
173
- box-shadow: var(--shadow-resting-medium), var(--button-default-shadow-inset);
173
+ /* stylelint-disable-next-line primer/borders */
174
+ border-radius: calc(var(--borderRadius-medium) - var(--toggleSwitch-knob-offset));
174
175
  transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);
175
176
  transition-duration: 80ms;
176
177
  transition-property: transform;
@@ -369,6 +369,7 @@
369
369
  /* stylelint-disable-next-line primer/spacing */
370
370
  margin: -1px;
371
371
  overflow: hidden;
372
+ /* stylelint-disable-next-line property-no-deprecated -- `clip` is the widely-supported visually-hidden idiom; kept for older-browser screen-reader support */
372
373
  clip: rect(0, 0, 0, 0);
373
374
  white-space: nowrap;
374
375
  border-width: 0;
@@ -12,7 +12,6 @@
12
12
  }
13
13
 
14
14
  .UnderlineNav .Counter {
15
- /* stylelint-disable-next-line primer/spacing */
16
15
  margin-left: var(--control-medium-gap);
17
16
  color: var(--fgColor-default);
18
17
  background-color: var(--bgColor-neutral-muted, var(--color-neutral-muted));
@@ -33,7 +32,6 @@
33
32
  .UnderlineNav-item {
34
33
  position: relative;
35
34
  display: flex;
36
- /* stylelint-disable-next-line primer/spacing */
37
35
  padding: 0 var(--control-medium-paddingInline-condensed);
38
36
  font-size: var(--text-body-size-medium);
39
37
  /* stylelint-disable-next-line primer/typography */
@@ -138,7 +136,6 @@
138
136
 
139
137
  .UnderlineNav-octicon {
140
138
  display: inline !important;
141
- /* stylelint-disable-next-line primer/spacing */
142
139
  margin-right: var(--control-medium-gap);
143
140
  color: var(--fgColor-muted);
144
141
  fill: var(--fgColor-muted);
@@ -20,7 +20,6 @@
20
20
  }
21
21
 
22
22
  /* User for example on /stars and /user for grids of avatars */
23
-
24
23
  .avatar-group-item {
25
24
  display: inline-block;
26
25
  margin-bottom: var(--base-size-4);
@@ -2,29 +2,37 @@
2
2
  /* The selector-max-specificity rule is disabled here because the nested selectors
3
3
  in AvatarStack require high specificity to properly override default styles and
4
4
  achieve the intended visual stacking. */
5
+
5
6
  /* AvatarStack */
7
+
6
8
  /* Stacked avatars can be used to show who is participating in thread when
7
9
  ** there is limited space available. */
10
+
8
11
  .AvatarStack {
9
12
  position: relative;
10
13
  min-width: 26px;
11
14
  height: 20px;
12
15
  }
16
+
13
17
  .AvatarStack .AvatarStack-body {
14
18
  position: absolute;
15
19
  }
20
+
16
21
  .AvatarStack.AvatarStack--two {
17
22
  min-width: 36px;
18
23
  }
24
+
19
25
  .AvatarStack.AvatarStack--three-plus {
20
26
  min-width: 46px;
21
27
  }
28
+
22
29
  .AvatarStack-body {
23
30
  display: flex;
24
31
  background: var(--bgColor-default);
25
32
  /* stylelint-disable-next-line primer/borders */
26
33
  border-radius: 100px;
27
34
  }
35
+
28
36
  .AvatarStack-body .avatar {
29
37
  position: relative;
30
38
  z-index: 2;
@@ -38,49 +46,65 @@
38
46
  border-radius: var(--borderRadius-small);
39
47
  transition: margin 0.1s ease-in-out;
40
48
  }
49
+
41
50
  :is(.AvatarStack-body .avatar):first-child {
42
51
  z-index: 3;
43
52
  }
53
+
44
54
  :is(.AvatarStack-body .avatar):last-child {
45
55
  z-index: 1;
46
56
  }
57
+
47
58
  /* stylelint-disable-next-line selector-max-type */
59
+
48
60
  :is(.AvatarStack-body .avatar) img {
49
61
  border-radius: var(--borderRadius-small);
50
62
  }
63
+
51
64
  /* Account for 4+ avatars */
65
+
52
66
  :is(.AvatarStack-body .avatar):nth-child(n + 4) {
53
67
  display: none;
54
68
  opacity: 0;
55
69
  }
70
+
56
71
  /* stylelint-disable-next-line selector-max-type */
72
+
57
73
  .AvatarStack-body span:nth-child(n + 4) .avatar {
58
74
  display: none;
59
75
  opacity: 0;
60
76
  }
77
+
61
78
  :is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) .avatar {
62
79
  margin-right: var(--base-size-4);
63
80
  }
81
+
64
82
  :is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) .avatar:nth-child(n + 4) {
65
83
  display: flex;
66
84
  opacity: 1;
67
85
  }
86
+
68
87
  /* stylelint-disable-next-line selector-max-type */
88
+
69
89
  :is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) span:nth-child(n + 4) .avatar {
70
90
  display: flex;
71
91
  opacity: 1;
72
92
  }
93
+
73
94
  :is(.AvatarStack-body:hover:not([data-disable-expand]),.AvatarStack-body:focus-within:not([data-disable-expand])) .avatar-more {
74
95
  display: none !important;
75
96
  }
97
+
76
98
  .AvatarStack-body[data-disable-expand] {
77
99
  position: relative;
78
100
  }
101
+
79
102
  .avatar.avatar-more {
80
103
  z-index: 1;
81
104
  margin-right: 0;
82
105
  background: var(--bgColor-muted);
83
106
  }
107
+
84
108
  .avatar.avatar-more::before,.avatar.avatar-more::after {
85
109
  position: absolute;
86
110
  display: block;
@@ -90,33 +114,42 @@
90
114
  border-radius: 2px;
91
115
  outline: var(--borderWidth-thin) solid var(--bgColor-default);
92
116
  }
117
+
93
118
  .avatar.avatar-more::before {
94
119
  width: 17px;
95
120
  background: var(--avatarStack-fade-bgColor-muted);
96
121
  }
122
+
97
123
  .avatar.avatar-more::after {
98
124
  width: 14px;
99
125
  background: var(--avatarStack-fade-bgColor-default);
100
126
  }
127
+
101
128
  /* Right aligned variation */
129
+
102
130
  .AvatarStack--right .AvatarStack-body {
103
131
  right: 0;
104
132
  flex-direction: row-reverse;
105
133
  }
134
+
106
135
  :is(.AvatarStack--right .AvatarStack-body):hover:not([data-disable-expand]) .avatar {
107
136
  margin-right: 0;
108
137
  margin-left: var(--base-size-4);
109
138
  }
139
+
110
140
  .AvatarStack--right .avatar.avatar-more {
111
141
  background: var(--avatarStack-fade-bgColor-default);
112
142
  }
143
+
113
144
  :is(.AvatarStack--right .avatar.avatar-more)::before {
114
145
  width: 5px;
115
146
  }
147
+
116
148
  :is(.AvatarStack--right .avatar.avatar-more)::after {
117
149
  width: 2px;
118
150
  background: var(--bgColor-muted);
119
151
  }
152
+
120
153
  .AvatarStack--right .avatar {
121
154
  margin-right: 0;
122
155
  /* stylelint-disable-next-line primer/spacing */