@papillonbits/components 0.16.0 → 0.18.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.
@@ -0,0 +1,96 @@
1
+ @import '../../index.scss';
2
+
3
+ // stylelint-disable no-descending-specificity
4
+
5
+ // Button group
6
+ //
7
+ // A button group is a series of buttons laid out next to each other, all part
8
+ // of one visual button, but separated by rules to be separate.
9
+
10
+ .BtnGroup {
11
+ display: inline-block;
12
+ vertical-align: middle;
13
+
14
+ @include clearfix();
15
+
16
+ // Proper spacing for multiple button groups (a la, gollum editor)
17
+ + .BtnGroup,
18
+ + .btn {
19
+ margin-left: $spacer-1;
20
+ }
21
+ }
22
+
23
+ .BtnGroup-item {
24
+ position: relative;
25
+ float: left;
26
+ border-right-width: 0;
27
+ border-radius: 0;
28
+
29
+ &:first-child {
30
+ border-top-left-radius: $border-radius;
31
+ border-bottom-left-radius: $border-radius;
32
+ }
33
+
34
+ &:last-child {
35
+ border-right-width: $border-width;
36
+ border-top-right-radius: $border-radius;
37
+ border-bottom-right-radius: $border-radius;
38
+ }
39
+
40
+ &.selected,
41
+ &[aria-selected='true'],
42
+ &:focus,
43
+ &:active,
44
+ &:hover {
45
+ border-right-width: $border-width;
46
+
47
+ + .BtnGroup-item,
48
+ + .BtnGroup-parent .BtnGroup-item {
49
+ border-left-width: 0;
50
+ }
51
+ }
52
+ }
53
+
54
+ .BtnGroup-parent {
55
+ float: left;
56
+
57
+ &:first-child .BtnGroup-item {
58
+ border-top-left-radius: $border-radius;
59
+ border-bottom-left-radius: $border-radius;
60
+ }
61
+
62
+ &:last-child .BtnGroup-item {
63
+ border-right-width: $border-width;
64
+ border-top-right-radius: $border-radius;
65
+ border-bottom-right-radius: $border-radius;
66
+ }
67
+
68
+ .BtnGroup-item {
69
+ border-right-width: 0;
70
+ border-radius: 0;
71
+ }
72
+
73
+ &.selected,
74
+ &[aria-selected='true'],
75
+ &:focus,
76
+ &:active,
77
+ &:hover {
78
+ .BtnGroup-item {
79
+ border-right-width: $border-width;
80
+ }
81
+
82
+ + .BtnGroup-item,
83
+ + .BtnGroup-parent .BtnGroup-item {
84
+ border-left-width: 0;
85
+ }
86
+ }
87
+ }
88
+
89
+ // ensure that the focus ring sits above the adjacent buttons
90
+ .BtnGroup-item,
91
+ .BtnGroup-parent {
92
+ &:focus,
93
+ &:active {
94
+ z-index: 1;
95
+ }
96
+ }
@@ -1,3 +1,4 @@
1
+ // stylelint-disable no-descending-specificity
1
2
  // stylelint-disable selector-max-type, function-no-unknown
2
3
 
3
4
  // Link-like buttons
@@ -7,7 +8,7 @@
7
8
  display: inline-block;
8
9
  padding: 0;
9
10
  font-size: inherit;
10
- color: $text-blue;
11
+ color: var(--color-accent-fg);
11
12
  text-decoration: none;
12
13
  white-space: nowrap;
13
14
  cursor: pointer;
@@ -24,34 +25,58 @@
24
25
  &[aria-disabled='true'] {
25
26
  &,
26
27
  &:hover {
27
- // stylelint-disable-next-line primer/colors
28
- color: rgba($gray-600, 0.5);
28
+ color: var(--color-primer-fg-disabled);
29
29
  cursor: default;
30
30
  }
31
31
  }
32
+
33
+ &:not(.dropdown-item) {
34
+ &:focus,
35
+ &:focus-visible {
36
+ border-radius: $border-radius;
37
+ outline-offset: 0;
38
+ }
39
+ }
32
40
  }
33
41
 
34
42
  // Invisible button
35
43
  //
36
44
  // Typically used as a "cancel" button next to a .btn
37
45
  .btn-invisible {
38
- color: $text-blue;
46
+ color: var(--color-accent-fg);
39
47
  background-color: transparent; // Reset default gradient backgrounds and colors
40
48
  border: 0;
41
- border-radius: 0;
49
+ border-radius: $border-radius;
42
50
  box-shadow: none;
43
51
 
44
52
  &:hover,
53
+ &.zeroclipboard-is-hover {
54
+ color: var(--color-accent-fg);
55
+ background-color: var(--color-btn-hover-bg);
56
+ outline: none;
57
+ box-shadow: none;
58
+ }
59
+
45
60
  &:active,
46
- &:focus,
47
61
  &.selected,
48
62
  &[aria-selected='true'],
49
- &.zeroclipboard-is-hover,
50
63
  &.zeroclipboard-is-active {
51
- color: $text-blue;
64
+ color: var(--color-accent-fg);
52
65
  background: none;
53
- outline: none;
54
- box-shadow: none;
66
+ border-color: var(--color-btn-active-border);
67
+
68
+ @include focusOutline;
69
+ }
70
+
71
+ &:active &.zeroclipboard-is-active {
72
+ background-color: var(--color-btn-selected-bg);
73
+ }
74
+
75
+ &:disabled,
76
+ &.disabled,
77
+ &[aria-disabled='true'] {
78
+ color: var(--color-primer-fg-disabled);
79
+ background-color: transparent;
55
80
  }
56
81
  }
57
82
 
@@ -65,32 +90,36 @@
65
90
  // stylelint-disable-next-line primer/spacing
66
91
  margin-left: 5px;
67
92
  line-height: $lh-condensed-ultra;
68
- color: $text-gray;
93
+ color: var(--color-fg-muted);
69
94
  vertical-align: middle;
70
95
 
71
96
  // For `<button>` elements
72
97
  background: transparent;
73
98
  border: 0;
99
+ box-shadow: none;
74
100
 
75
101
  &:hover {
76
- color: $text-blue;
102
+ color: var(--color-accent-fg);
103
+ }
104
+
105
+ &:focus,
106
+ &:focus-visible {
107
+ border-radius: $border-radius;
77
108
  }
78
109
 
79
110
  &.disabled,
80
111
  &[aria-disabled='true'] {
81
- // stylelint-disable-next-line primer/colors
82
- color: $gray-400;
112
+ color: var(--color-primer-fg-disabled);
83
113
  cursor: default;
84
114
 
85
- // stylelint-disable-next-line primer/colors
86
115
  &:hover {
87
- color: $gray-400;
116
+ color: var(--color-primer-fg-disabled);
88
117
  }
89
118
  }
90
119
  }
91
120
 
92
121
  .btn-octicon-danger:hover {
93
- color: $text-red;
122
+ color: var(--color-danger-fg);
94
123
  }
95
124
 
96
125
  // Close button
@@ -98,9 +127,17 @@
98
127
  // Typically used with an octicon-x
99
128
  .close-button {
100
129
  padding: 0;
130
+ color: var(--color-fg-muted);
101
131
  background: transparent;
102
132
  border: 0;
103
- outline: none;
133
+
134
+ &:hover {
135
+ color: var(--color-fg-default);
136
+ }
137
+
138
+ &:active {
139
+ @include focusOutline;
140
+ }
104
141
  }
105
142
 
106
143
  // Hidden text button
@@ -129,26 +166,22 @@
129
166
  font-weight: $font-weight-bold;
130
167
  // stylelint-disable-next-line primer/typography
131
168
  line-height: 6px;
132
- // stylelint-disable-next-line primer/colors
133
- color: $gray-700;
169
+ color: var(--color-fg-default);
134
170
  text-decoration: none;
135
171
  vertical-align: middle;
136
- // stylelint-disable-next-line primer/colors
137
- background: lighten($gray-300, 5%);
172
+ background: var(--color-neutral-muted);
138
173
  border: 0;
139
174
  // stylelint-disable-next-line primer/borders
140
175
  border-radius: 1px;
141
176
 
142
177
  &:hover {
143
178
  text-decoration: none;
144
- // stylelint-disable-next-line primer/colors
145
- background-color: darken($gray-300, 4%);
179
+ background-color: var(--color-accent-muted);
146
180
  }
147
181
 
148
182
  &:active {
149
- color: $text-white;
150
- // stylelint-disable-next-line primer/colors
151
- background-color: $blue-400;
183
+ color: var(--color-fg-on-emphasis);
184
+ background-color: var(--color-accent-emphasis);
152
185
  }
153
186
  }
154
187
 
@@ -178,14 +211,14 @@
178
211
  font-weight: $font-weight-bold;
179
212
  // stylelint-disable-next-line primer/typography
180
213
  line-height: 20px;
181
- color: $text-gray-dark;
214
+ color: var(--color-fg-default);
182
215
  vertical-align: middle;
183
- background-color: $bg-white;
184
- border: $border-width $border-style $border-color-button;
216
+ background-color: var(--color-canvas-default);
217
+ border: $border-width $border-style var(--color-btn-border);
185
218
  border-left: 0;
186
219
  border-top-right-radius: $border-radius;
187
220
  border-bottom-right-radius: $border-radius;
188
- box-shadow: $box-shadow, $box-shadow-highlight;
221
+ box-shadow: var(--color-shadow-small), var(--color-primer-shadow-highlight);
189
222
 
190
223
  &:hover,
191
224
  &:active {
@@ -193,13 +226,7 @@
193
226
  }
194
227
 
195
228
  &:hover {
196
- color: $text-blue;
229
+ color: var(--color-accent-fg);
197
230
  cursor: pointer;
198
231
  }
199
-
200
- &:focus {
201
- z-index: 1;
202
- outline: 0;
203
- box-shadow: $box-shadow-focus;
204
- }
205
232
  }