@primer/brand-css 0.79.1-rc.5d6b749b → 0.80.0-rc.e1dc6447

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.
@@ -84,23 +84,19 @@
84
84
  height: var(--brand-IconButton-icon-size-large);
85
85
  }
86
86
 
87
- .IconButton__loadingIndicator.IconButton__loadingIndicator {
87
+ .IconButton__spinner.IconButton__spinner {
88
88
  display: block;
89
- box-sizing: border-box;
90
89
  width: var(--brand-IconButton-icon-size-medium);
91
90
  height: var(--brand-IconButton-icon-size-medium);
92
- border: var(--brand-borderWidth-thin) solid currentcolor;
93
- border-inline-end-color: transparent;
94
- border-radius: 50%;
95
- animation: IconButton-spin var(--brand-IconButton-loadingIndicator-animationDuration-default) linear infinite;
91
+ animation-duration: var(--brand-IconButton-spinner-animationDuration-default);
96
92
  }
97
93
 
98
- .IconButton--small .IconButton__loadingIndicator {
94
+ .IconButton--small .IconButton__spinner {
99
95
  width: var(--brand-IconButton-icon-size-small);
100
96
  height: var(--brand-IconButton-icon-size-small);
101
97
  }
102
98
 
103
- .IconButton--large .IconButton__loadingIndicator {
99
+ .IconButton--large .IconButton__spinner {
104
100
  width: var(--brand-IconButton-icon-size-large);
105
101
  height: var(--brand-IconButton-icon-size-large);
106
102
  }
@@ -117,26 +113,19 @@
117
113
  border: 0;
118
114
  }
119
115
 
120
- @keyframes IconButton-spin {
121
- to {
122
- transform: rotate(360deg);
123
- }
124
- }
125
-
126
116
  @media (forced-colors: active) {
127
117
  .IconButton--inactive {
128
118
  color: GrayText;
129
119
  border-color: GrayText;
130
120
  }
131
121
 
132
- .IconButton__loadingIndicator {
133
- border-color: ButtonText;
134
- border-inline-end-color: transparent;
122
+ .IconButton__spinner {
123
+ color: ButtonText;
135
124
  }
136
125
  }
137
126
 
138
127
  @media (prefers-reduced-motion: reduce) {
139
- .IconButton__loadingIndicator {
140
- animation-duration: var(--brand-IconButton-loadingIndicator-animationDuration-reducedMotion);
128
+ .IconButton__spinner {
129
+ animation-duration: var(--brand-IconButton-spinner-animationDuration-reducedMotion);
141
130
  }
142
131
  }
@@ -0,0 +1,41 @@
1
+ .Spinner__box {
2
+ display: inline-flex;
3
+ }
4
+
5
+ .Spinner {
6
+ display: block;
7
+ box-sizing: border-box;
8
+ overflow: visible;
9
+ color: var(--brand-Spinner-fgColor);
10
+ animation-name: Spinner-spin;
11
+ animation-duration: var(--brand-Spinner-animationDuration-default);
12
+ animation-timing-function: linear;
13
+ animation-iteration-count: infinite;
14
+ }
15
+
16
+ .Spinner--small {
17
+ width: var(--brand-Spinner-size-small);
18
+ height: var(--brand-Spinner-size-small);
19
+ }
20
+
21
+ .Spinner--medium {
22
+ width: var(--brand-Spinner-size-medium);
23
+ height: var(--brand-Spinner-size-medium);
24
+ }
25
+
26
+ .Spinner--large {
27
+ width: var(--brand-Spinner-size-large);
28
+ height: var(--brand-Spinner-size-large);
29
+ }
30
+
31
+ @keyframes Spinner-spin {
32
+ to {
33
+ transform: rotate(360deg);
34
+ }
35
+ }
36
+
37
+ @media (prefers-reduced-motion: reduce) {
38
+ .Spinner {
39
+ animation-duration: var(--brand-Spinner-animationDuration-reducedMotion);
40
+ }
41
+ }
@@ -14,6 +14,44 @@
14
14
  grid-template-columns: auto 1fr;
15
15
  }
16
16
 
17
+ .FormControl--toggle-switch {
18
+ display: grid;
19
+ grid-template-columns: auto minmax(0, 1fr);
20
+ -moz-column-gap: var(--brand-ToggleSwitch-label-gap);
21
+ column-gap: var(--brand-ToggleSwitch-label-gap);
22
+ align-items: center;
23
+ }
24
+
25
+ .FormControl-control--toggle-switch {
26
+ grid-column: 1;
27
+ grid-row: 1;
28
+ align-self: start;
29
+ }
30
+
31
+ .FormControl-label--toggle-switch {
32
+ grid-column: 2;
33
+ grid-row: 1;
34
+ min-width: 0;
35
+ cursor: pointer;
36
+ overflow-wrap: anywhere;
37
+ }
38
+
39
+ .FormControl-label--medium.FormControl-label--toggle-switch {
40
+ font-size: var(--brand-ToggleSwitch-label-fontSize);
41
+ line-height: max(var(--brand-ToggleSwitch-label-lineHeight), var(--brand-ToggleSwitch-target-minHeight));
42
+ }
43
+
44
+ .FormControl-toggleSwitch-spinnerSlot {
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ width: var(--brand-ToggleSwitch-loading-size);
49
+ height: var(--brand-ToggleSwitch-loading-size);
50
+ margin-inline-start: var(--brand-ToggleSwitch-loading-gap);
51
+ vertical-align: middle;
52
+ pointer-events: none;
53
+ }
54
+
17
55
  .FormControl--border {
18
56
  border: 1px solid var(--brand-control-color-border-default);
19
57
  border-radius: var(--brand-borderRadius-medium);
@@ -71,6 +109,7 @@
71
109
 
72
110
  /*Validation*/
73
111
  .FormControl-validation {
112
+ grid-column: 1 / 3;
74
113
  display: flex;
75
114
  gap: var(--base-size-4);
76
115
  align-items: center;
@@ -81,7 +120,7 @@
81
120
  }
82
121
 
83
122
  .FormControl-validation--error {
84
- color: var(--brand-color-danger-fg);
123
+ color: var(--brand-control-color-validation-error);
85
124
  }
86
125
 
87
126
  .FormControl-validation-success-icon {
@@ -106,7 +145,3 @@
106
145
  transform: translateY(0);
107
146
  }
108
147
  }
109
-
110
- .FormControl-validation-checkbox {
111
- grid-column: 1 / 3;
112
- }
@@ -0,0 +1,162 @@
1
+ .ToggleSwitch {
2
+ display: inline-flex;
3
+ flex-shrink: 0;
4
+ align-items: center;
5
+ gap: var(--brand-ToggleSwitch-loading-gap);
6
+ vertical-align: middle;
7
+ }
8
+
9
+ .ToggleSwitch-button {
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ min-height: var(--brand-ToggleSwitch-target-minHeight);
14
+ padding: 0;
15
+ border: 0;
16
+ background: transparent;
17
+ cursor: pointer;
18
+ -webkit-appearance: none;
19
+ -moz-appearance: none;
20
+ appearance: none;
21
+ }
22
+
23
+ .ToggleSwitch-button:focus-visible {
24
+ outline: none;
25
+ }
26
+
27
+ .ToggleSwitch-button:focus-visible .ToggleSwitch-track {
28
+ outline: var(--brand-ToggleSwitch-focus-width) solid var(--brand-color-focus);
29
+ outline-offset: var(--brand-ToggleSwitch-focus-offset);
30
+ }
31
+
32
+ .ToggleSwitch-button--unavailable {
33
+ cursor: not-allowed;
34
+ }
35
+
36
+ .ToggleSwitch-track {
37
+ position: relative;
38
+ display: block;
39
+ box-sizing: border-box;
40
+ border: var(--brand-ToggleSwitch-track-borderWidth) solid var(--brand-ToggleSwitch-track-borderColor);
41
+ border-radius: var(--brand-ToggleSwitch-track-borderRadius);
42
+ background: var(--brand-ToggleSwitch-track-bgColor);
43
+ }
44
+
45
+ .ToggleSwitch-thumb {
46
+ position: absolute;
47
+ top: 50%;
48
+ box-sizing: border-box;
49
+ border: var(--brand-ToggleSwitch-thumb-borderWidth) solid var(--brand-ToggleSwitch-thumb-borderColor);
50
+ border-radius: var(--brand-ToggleSwitch-thumb-borderRadius);
51
+ background: var(--brand-ToggleSwitch-thumb-off-bgColor-rest);
52
+ transform: translateY(-50%);
53
+ transition: inset-inline-start var(--brand-animation-duration-faster) var(--brand-animation-easing-default);
54
+ }
55
+
56
+ .ToggleSwitch-thumb--checked {
57
+ background: var(--brand-ToggleSwitch-thumb-on-bgColor-rest);
58
+ }
59
+
60
+ .ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb {
61
+ background: var(--brand-ToggleSwitch-thumb-off-bgColor-hover);
62
+ }
63
+
64
+ .ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb--checked {
65
+ background: var(--brand-ToggleSwitch-thumb-on-bgColor-hover);
66
+ }
67
+
68
+ .ToggleSwitch-thumb--disabled {
69
+ background: var(--brand-ToggleSwitch-thumb-disabled-bgColor);
70
+ }
71
+
72
+ .ToggleSwitch--medium .ToggleSwitch-track {
73
+ width: var(--brand-ToggleSwitch-track-width-medium);
74
+ height: var(--brand-ToggleSwitch-track-height-medium);
75
+ }
76
+
77
+ .ToggleSwitch--small .ToggleSwitch-track {
78
+ width: var(--brand-ToggleSwitch-track-width-small);
79
+ height: var(--brand-ToggleSwitch-track-height-small);
80
+ }
81
+
82
+ .ToggleSwitch--medium .ToggleSwitch-thumb {
83
+ inset-inline-start: calc(var(--brand-ToggleSwitch-thumb-inset-medium) - var(--brand-ToggleSwitch-track-borderWidth));
84
+ width: var(--brand-ToggleSwitch-thumb-size-medium);
85
+ height: var(--brand-ToggleSwitch-thumb-size-medium);
86
+ }
87
+
88
+ .ToggleSwitch--small .ToggleSwitch-thumb {
89
+ inset-inline-start: calc(var(--brand-ToggleSwitch-thumb-inset-small) - var(--brand-ToggleSwitch-track-borderWidth));
90
+ width: var(--brand-ToggleSwitch-thumb-size-small);
91
+ height: var(--brand-ToggleSwitch-thumb-size-small);
92
+ }
93
+
94
+ .ToggleSwitch--medium .ToggleSwitch-thumb--checked {
95
+ inset-inline-start: calc(
96
+ var(--brand-ToggleSwitch-thumb-inset-medium) - var(--brand-ToggleSwitch-track-borderWidth) +
97
+ var(--brand-ToggleSwitch-thumb-travel-medium)
98
+ );
99
+ }
100
+
101
+ .ToggleSwitch--small .ToggleSwitch-thumb--checked {
102
+ inset-inline-start: calc(
103
+ var(--brand-ToggleSwitch-thumb-inset-small) - var(--brand-ToggleSwitch-track-borderWidth) +
104
+ var(--brand-ToggleSwitch-thumb-travel-small)
105
+ );
106
+ }
107
+
108
+ .ToggleSwitch-spinnerSlot {
109
+ display: flex;
110
+ align-items: center;
111
+ justify-content: center;
112
+ flex: 0 0 var(--brand-ToggleSwitch-loading-size);
113
+ width: var(--brand-ToggleSwitch-loading-size);
114
+ height: var(--brand-ToggleSwitch-loading-size);
115
+ pointer-events: none;
116
+ }
117
+
118
+ .ToggleSwitch-spinner {
119
+ color: var(--brand-ToggleSwitch-loading-fgColor);
120
+ animation-duration: var(--brand-ToggleSwitch-loading-duration);
121
+ }
122
+
123
+ @media (prefers-reduced-motion: reduce) {
124
+ .ToggleSwitch-thumb {
125
+ transition: none;
126
+ }
127
+
128
+ .ToggleSwitch-spinner {
129
+ animation: none;
130
+ }
131
+ }
132
+
133
+ @media (forced-colors: active) {
134
+ .ToggleSwitch-track {
135
+ border-color: ButtonText;
136
+ background: Canvas;
137
+ }
138
+
139
+ .ToggleSwitch-thumb,
140
+ .ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb {
141
+ forced-color-adjust: none;
142
+ border-color: ButtonText;
143
+ background: ButtonText;
144
+ }
145
+
146
+ .ToggleSwitch-thumb--checked,
147
+ .ToggleSwitch-button:not(.ToggleSwitch-button--unavailable):hover .ToggleSwitch-thumb--checked {
148
+ background: Highlight;
149
+ }
150
+
151
+ .ToggleSwitch-thumb--disabled {
152
+ background: GrayText;
153
+ }
154
+
155
+ .ToggleSwitch-button:focus-visible .ToggleSwitch-track {
156
+ outline-color: Highlight;
157
+ }
158
+
159
+ .ToggleSwitch-spinner {
160
+ color: CanvasText;
161
+ }
162
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/brand-css",
3
- "version": "0.79.1-rc.5d6b749b",
3
+ "version": "0.80.0-rc.e1dc6447",
4
4
  "description": "CSS stylesheets for Primer Brand components",
5
5
  "keywords": [
6
6
  "primer",