@papillonbits/components 0.6.0 → 0.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.
- package/build/index.scss +1 -1
- package/build/primer/BranchName/branch-name.scss +1 -0
- package/build/primer/Button/Button.scss +54 -27
- package/build/primer/Dropdown/Dropdown.scss +0 -2
- package/build/primer/Form/Checkbox/__tests__/__snapshots__/Checkbox.int.test.js.snap +54 -56
- package/build/primer/Form/Input/__tests__/__snapshots__/Input.int.test.js.snap +18 -24
- package/build/primer/Form/Radio/__tests__/__snapshots__/Radio.int.test.js.snap +18 -28
- package/build/primer/Form/form-control.scss +24 -5
- package/build/primer/Form/form-group.scss +13 -2
- package/build/primer/Form/form-validation.scss +8 -3
- package/build/primer/Form/input-group.scss +18 -0
- package/build/primer/Grid/DisplayTable/__tests__/__snapshots__/DisplayTable.int.test.js.snap +82 -82
- package/build/primer/Grid/FlexGrid/__tests__/__snapshots__/FlexGrid.int.test.js.snap +4532 -5510
- package/build/primer/Icon/Icon.part.js +177 -66
- package/build/primer/Icon/Icon.prop.js +62 -25
- package/build/primer/Navigation/Menu/Menu.scss +0 -6
- package/build/primer/Navigation/Menu/__tests__/__snapshots__/Menu.int.test.js.snap +101 -107
- package/build/primer/Navigation/TabNav/TabNav.scss +7 -2
- package/build/primer/Navigation/TabNav/__tests__/__snapshots__/TabNav.int.test.js.snap +177 -177
- package/build/primer/Navigation/UnderlineNav/UnderlineNav.scss +72 -23
- package/build/primer/Navigation/UnderlineNav/__tests__/__snapshots__/UnderlineNav.int.test.js.snap +213 -225
- package/build/primer/Pagination/PreviousNext/PreviousNext.scss +0 -1
- package/build/primer/Pagination/PreviousNext/__tests__/__snapshots__/PreviousNext.int.test.js.snap +52 -52
- package/build/primer/Popover/Popover.scss +1 -2
- package/build/primer/SVG/icon/accessibility-16.svg +1 -0
- package/build/primer/SVG/icon/alert-fill-12.svg +1 -0
- package/build/primer/SVG/icon/apps-16.svg +1 -0
- package/build/primer/SVG/icon/bell-fill-16.svg +1 -0
- package/build/primer/SVG/icon/check-circle-fill-12.svg +1 -0
- package/build/primer/SVG/icon/cloud-16.svg +1 -0
- package/build/primer/SVG/icon/cloud-24.svg +1 -0
- package/build/primer/SVG/icon/cloud-offline-16.svg +1 -0
- package/build/primer/SVG/icon/cloud-offline-24.svg +1 -0
- package/build/primer/SVG/icon/code-of-conduct-16.svg +1 -0
- package/build/primer/SVG/icon/code-of-conduct-24.svg +1 -0
- package/build/primer/SVG/icon/copy-16.svg +1 -0
- package/build/primer/SVG/icon/copy-24.svg +1 -1
- package/build/primer/SVG/icon/duplicate-16.svg +1 -1
- package/build/primer/SVG/icon/duplicate-24.svg +1 -1
- package/build/primer/SVG/icon/feed-discussion-16.svg +1 -0
- package/build/primer/SVG/icon/feed-forked-16.svg +1 -0
- package/build/primer/SVG/icon/feed-heart-16.svg +1 -0
- package/build/primer/SVG/icon/feed-merged-16.svg +1 -0
- package/build/primer/SVG/icon/feed-person-16.svg +1 -0
- package/build/primer/SVG/icon/feed-repo-16.svg +1 -0
- package/build/primer/SVG/icon/feed-rocket-16.svg +1 -0
- package/build/primer/SVG/icon/feed-star-16.svg +1 -0
- package/build/primer/SVG/icon/feed-tag-16.svg +1 -0
- package/build/primer/SVG/icon/feed-trophy-16.svg +1 -0
- package/build/primer/SVG/icon/file-directory-16.svg +1 -1
- package/build/primer/SVG/icon/file-directory-fill-16.svg +1 -0
- package/build/primer/SVG/icon/file-directory-open-fill-16.svg +1 -0
- package/build/primer/SVG/icon/id-badge-16.svg +1 -0
- package/build/primer/SVG/icon/issue-reopened-16.svg +1 -1
- package/build/primer/SVG/icon/issue-reopened-24.svg +1 -1
- package/build/primer/SVG/icon/iterations-16.svg +1 -0
- package/build/primer/SVG/icon/iterations-24.svg +1 -0
- package/build/primer/SVG/icon/key-asterisk-16.svg +1 -0
- package/build/primer/SVG/icon/log-16.svg +1 -0
- package/build/primer/SVG/icon/no-entry-16.svg +1 -1
- package/build/primer/SVG/icon/no-entry-fill-12.svg +1 -0
- package/build/primer/SVG/icon/{clippy-16.svg → paste-16.svg} +0 -0
- package/build/primer/SVG/icon/{clippy-24.svg → paste-24.svg} +0 -0
- package/build/primer/SVG/icon/person-fill-16.svg +1 -0
- package/build/primer/SVG/icon/person-fill-24.svg +1 -0
- package/build/primer/SVG/icon/repo-deleted-16.svg +1 -0
- package/build/primer/SVG/icon/repo-locked-16.svg +1 -0
- package/build/primer/SVG/icon/{select-single-16.svg → single-select-16.svg} +0 -0
- package/build/primer/SVG/icon/sort-asc-16.svg +1 -0
- package/build/primer/SVG/icon/sort-asc-24.svg +1 -0
- package/build/primer/SVG/icon/sort-desc-16.svg +1 -0
- package/build/primer/SVG/icon/sort-desc-24.svg +1 -0
- package/build/primer/SVG/icon/stack-16.svg +1 -0
- package/build/primer/SVG/icon/stack-24.svg +1 -0
- package/build/primer/SVG/icon/tab-external-16.svg +1 -0
- package/build/primer/SVG/icon/telescope-fill-16.svg +1 -0
- package/build/primer/SVG/icon/telescope-fill-24.svg +1 -0
- package/build/primer/SVG/icon/trophy-16.svg +1 -0
- package/build/primer/SVG/icon/trophy-24.svg +1 -0
- package/build/primer/SVG/icon/upload-24.svg +1 -1
- package/build/primer/SVG/icon/webhook-16.svg +1 -0
- package/build/primer/SVG/icon/x-circle-fill-12.svg +1 -0
- package/build/primer/Toast/Toast.scss +1 -2
- package/package.json +5 -5
- package/build/primer/SVG/icon/eye-slash-24.svg +0 -1
- package/build/primer/SVG/icon/file-symlink-24.svg +0 -1
- package/build/primer/SVG/icon/fire-24.svg +0 -1
- package/build/primer/SVG/icon/git-fork-24.svg +0 -1
- package/build/primer/SVG/icon/index.js +0 -1248
- package/build/primer/SVG/icon/insights-24.svg +0 -1
- package/build/primer/SVG/icon/octoface-16.svg +0 -1
- package/build/primer/SVG/icon/octoface-24.svg +0 -1
- package/build/primer/SVG/icon/settings-24.svg +0 -1
- package/build/primer/SVG/icon/trashcan-16.svg +0 -1
- package/build/primer/SVG/icon/unverifed-24.svg +0 -1
- package/build/primer/SVG/index.js +0 -13
package/build/index.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '../../css/src/primer/index.scss';
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
background-color: var(--color-btn-bg);
|
|
70
70
|
border-color: var(--color-btn-border);
|
|
71
71
|
box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
|
|
72
|
-
transition:
|
|
73
|
-
transition-property: color, background-color, border-color;
|
|
72
|
+
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
|
73
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
74
74
|
|
|
75
75
|
&:hover,
|
|
76
76
|
&.hover,
|
|
@@ -103,14 +103,6 @@
|
|
|
103
103
|
color: var(--color-primer-fg-disabled);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
// Keep :focus after :disabled. Allows to see the focus ring even on disabled buttons
|
|
108
|
-
&:focus,
|
|
109
|
-
&.focus {
|
|
110
|
-
border-color: var(--color-btn-focus-border);
|
|
111
|
-
outline: none;
|
|
112
|
-
box-shadow: var(--color-btn-focus-shadow);
|
|
113
|
-
}
|
|
114
106
|
}
|
|
115
107
|
|
|
116
108
|
// Primary button
|
|
@@ -128,6 +120,22 @@
|
|
|
128
120
|
border-color: var(--color-btn-primary-hover-border);
|
|
129
121
|
}
|
|
130
122
|
|
|
123
|
+
// fallback :focus state
|
|
124
|
+
&:focus {
|
|
125
|
+
@include focusOutlineOnEmphasis;
|
|
126
|
+
|
|
127
|
+
// remove fallback :focus if :focus-visible is supported
|
|
128
|
+
&:not(:focus-visible) {
|
|
129
|
+
outline: solid 1px transparent;
|
|
130
|
+
box-shadow: none;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// default focus state
|
|
135
|
+
&:focus-visible {
|
|
136
|
+
@include focusOutlineOnEmphasis;
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
&:active,
|
|
132
140
|
&.selected,
|
|
133
141
|
&[aria-selected='true'] {
|
|
@@ -147,13 +155,6 @@
|
|
|
147
155
|
}
|
|
148
156
|
}
|
|
149
157
|
|
|
150
|
-
&:focus,
|
|
151
|
-
&.focus {
|
|
152
|
-
background-color: var(--color-btn-primary-focus-bg);
|
|
153
|
-
border-color: var(--color-btn-primary-focus-border);
|
|
154
|
-
box-shadow: var(--color-btn-primary-focus-shadow);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
158
|
.Counter {
|
|
158
159
|
color: inherit;
|
|
159
160
|
background-color: var(--color-btn-primary-counter-bg);
|
|
@@ -164,6 +165,26 @@
|
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
// ensure links styled as button primary gets proper focus style
|
|
169
|
+
// stylelint-disable-next-line selector-no-qualifying-type
|
|
170
|
+
a.btn-primary {
|
|
171
|
+
// fallback :focus state
|
|
172
|
+
&:focus {
|
|
173
|
+
@include focusOutlineOnEmphasis;
|
|
174
|
+
|
|
175
|
+
// remove fallback :focus if :focus-visible is supported
|
|
176
|
+
&:not(:focus-visible) {
|
|
177
|
+
outline: solid 1px transparent;
|
|
178
|
+
box-shadow: none;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// default focus state
|
|
183
|
+
&:focus-visible {
|
|
184
|
+
@include focusOutlineOnEmphasis;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
167
188
|
// Outline button
|
|
168
189
|
|
|
169
190
|
.btn-outline {
|
|
@@ -192,6 +213,22 @@
|
|
|
192
213
|
background-color: var(--color-btn-outline-selected-bg);
|
|
193
214
|
border-color: var(--color-btn-outline-selected-border);
|
|
194
215
|
box-shadow: var(--color-btn-outline-selected-shadow);
|
|
216
|
+
|
|
217
|
+
// fallback :focus state
|
|
218
|
+
&:focus {
|
|
219
|
+
@include focusOutlineOnEmphasis;
|
|
220
|
+
|
|
221
|
+
// remove fallback :focus if :focus-visible is supported
|
|
222
|
+
&:not(:focus-visible) {
|
|
223
|
+
outline: solid 1px transparent;
|
|
224
|
+
box-shadow: none;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// default focus state
|
|
229
|
+
&:focus-visible {
|
|
230
|
+
@include focusOutlineOnEmphasis;
|
|
231
|
+
}
|
|
195
232
|
}
|
|
196
233
|
|
|
197
234
|
&:disabled,
|
|
@@ -207,11 +244,6 @@
|
|
|
207
244
|
}
|
|
208
245
|
}
|
|
209
246
|
|
|
210
|
-
&:focus {
|
|
211
|
-
border-color: var(--color-btn-outline-focus-border);
|
|
212
|
-
box-shadow: var(--color-btn-outline-focus-shadow);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
247
|
.Counter {
|
|
216
248
|
color: inherit;
|
|
217
249
|
background-color: var(--color-btn-outline-counter-bg);
|
|
@@ -269,11 +301,6 @@
|
|
|
269
301
|
}
|
|
270
302
|
}
|
|
271
303
|
|
|
272
|
-
&:focus {
|
|
273
|
-
border-color: var(--color-btn-danger-focus-border);
|
|
274
|
-
box-shadow: var(--color-btn-danger-focus-shadow);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
304
|
.Counter {
|
|
278
305
|
color: inherit;
|
|
279
306
|
background-color: var(--color-btn-danger-counter-bg);
|
|
@@ -86,12 +86,10 @@
|
|
|
86
86
|
text-overflow: ellipsis;
|
|
87
87
|
white-space: nowrap;
|
|
88
88
|
|
|
89
|
-
&:focus,
|
|
90
89
|
&:hover {
|
|
91
90
|
color: var(--color-fg-on-emphasis);
|
|
92
91
|
text-decoration: none;
|
|
93
92
|
background-color: var(--color-accent-emphasis);
|
|
94
|
-
outline: none;
|
|
95
93
|
|
|
96
94
|
> .octicon {
|
|
97
95
|
color: inherit;
|
|
@@ -1,77 +1,75 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<Checkbox /> Render must match isChecked() 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
<label
|
|
9
|
-
htmlFor="checkbox"
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="m-0 form-checkbox"
|
|
10
7
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
<label
|
|
9
|
+
for="checkbox"
|
|
10
|
+
>
|
|
11
|
+
<input
|
|
12
|
+
aria-describedby="help-text-for-checkbox"
|
|
13
|
+
checked=""
|
|
14
|
+
type="checkbox"
|
|
15
|
+
/>
|
|
16
|
+
is checked
|
|
17
|
+
</label>
|
|
18
|
+
</div>
|
|
19
19
|
</div>
|
|
20
20
|
`;
|
|
21
21
|
|
|
22
22
|
exports[`<Checkbox /> Render must match isCheckedInactive() 1`] = `
|
|
23
|
-
<div
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
>
|
|
27
|
-
<label
|
|
28
|
-
htmlFor="checkbox"
|
|
23
|
+
<div>
|
|
24
|
+
<div
|
|
25
|
+
class="m-0 form-checkbox checkbox-inactive"
|
|
29
26
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
<label
|
|
28
|
+
for="checkbox"
|
|
29
|
+
>
|
|
30
|
+
<input
|
|
31
|
+
aria-describedby="help-text-for-checkbox"
|
|
32
|
+
checked=""
|
|
33
|
+
type="checkbox"
|
|
34
|
+
/>
|
|
35
|
+
is checked
|
|
36
|
+
</label>
|
|
37
|
+
</div>
|
|
38
38
|
</div>
|
|
39
39
|
`;
|
|
40
40
|
|
|
41
41
|
exports[`<Checkbox /> Render must match isNotChecked() 1`] = `
|
|
42
|
-
<div
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
>
|
|
46
|
-
<label
|
|
47
|
-
htmlFor="checkbox"
|
|
42
|
+
<div>
|
|
43
|
+
<div
|
|
44
|
+
class="m-0 form-checkbox"
|
|
48
45
|
>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
<label
|
|
47
|
+
for="checkbox"
|
|
48
|
+
>
|
|
49
|
+
<input
|
|
50
|
+
aria-describedby="help-text-for-checkbox"
|
|
51
|
+
type="checkbox"
|
|
52
|
+
/>
|
|
53
|
+
is not checked
|
|
54
|
+
</label>
|
|
55
|
+
</div>
|
|
57
56
|
</div>
|
|
58
57
|
`;
|
|
59
58
|
|
|
60
59
|
exports[`<Checkbox /> Render must match isNotCheckedInactive() 1`] = `
|
|
61
|
-
<div
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
>
|
|
65
|
-
<label
|
|
66
|
-
htmlFor="checkbox"
|
|
60
|
+
<div>
|
|
61
|
+
<div
|
|
62
|
+
class="m-0 form-checkbox checkbox-inactive"
|
|
67
63
|
>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
<label
|
|
65
|
+
for="checkbox"
|
|
66
|
+
>
|
|
67
|
+
<input
|
|
68
|
+
aria-describedby="help-text-for-checkbox"
|
|
69
|
+
type="checkbox"
|
|
70
|
+
/>
|
|
71
|
+
is not checked
|
|
72
|
+
</label>
|
|
73
|
+
</div>
|
|
76
74
|
</div>
|
|
77
75
|
`;
|
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<Input /> Render must match inactive() 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
placeholder="Fantastic placeholder"
|
|
14
|
-
type="text"
|
|
15
|
-
/>
|
|
4
|
+
<div>
|
|
5
|
+
<input
|
|
6
|
+
aria-label="Repository description"
|
|
7
|
+
class="form-control input-inactive"
|
|
8
|
+
placeholder="Fantastic placeholder"
|
|
9
|
+
type="text"
|
|
10
|
+
value=""
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
16
13
|
`;
|
|
17
14
|
|
|
18
15
|
exports[`<Input /> Render must match regular() 1`] = `
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
placeholder="Fantastic placeholder"
|
|
29
|
-
type="text"
|
|
30
|
-
/>
|
|
16
|
+
<div>
|
|
17
|
+
<input
|
|
18
|
+
aria-label="Repository description"
|
|
19
|
+
class="form-control"
|
|
20
|
+
placeholder="Fantastic placeholder"
|
|
21
|
+
type="text"
|
|
22
|
+
value=""
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
31
25
|
`;
|
|
@@ -1,75 +1,65 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<Radio /> Render must match inactive() 1`] = `
|
|
4
|
-
|
|
4
|
+
<div>
|
|
5
5
|
<div
|
|
6
|
-
|
|
7
|
-
data-test={null}
|
|
6
|
+
class="m-0 form-checkbox radio-inactive"
|
|
8
7
|
>
|
|
9
8
|
<label
|
|
10
|
-
|
|
9
|
+
for="checkbox"
|
|
11
10
|
>
|
|
12
11
|
<input
|
|
13
|
-
checked={false}
|
|
14
12
|
name="fantastic-name"
|
|
15
|
-
onChange={[Function]}
|
|
16
13
|
type="radio"
|
|
17
14
|
/>
|
|
18
15
|
White
|
|
19
16
|
</label>
|
|
20
|
-
</div
|
|
17
|
+
</div>
|
|
21
18
|
<div
|
|
22
|
-
|
|
23
|
-
data-test={null}
|
|
19
|
+
class="m-0 form-checkbox radio-inactive"
|
|
24
20
|
>
|
|
25
21
|
<label
|
|
26
|
-
|
|
22
|
+
for="checkbox"
|
|
27
23
|
>
|
|
28
24
|
<input
|
|
29
|
-
checked=
|
|
25
|
+
checked=""
|
|
30
26
|
name="fantastic-name"
|
|
31
|
-
onChange={[Function]}
|
|
32
27
|
type="radio"
|
|
33
28
|
/>
|
|
34
29
|
Black
|
|
35
30
|
</label>
|
|
36
|
-
</div
|
|
37
|
-
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
38
33
|
`;
|
|
39
34
|
|
|
40
35
|
exports[`<Radio /> Render must match regular() 1`] = `
|
|
41
|
-
|
|
36
|
+
<div>
|
|
42
37
|
<div
|
|
43
|
-
|
|
44
|
-
data-test={null}
|
|
38
|
+
class="m-0 form-checkbox"
|
|
45
39
|
>
|
|
46
40
|
<label
|
|
47
|
-
|
|
41
|
+
for="checkbox"
|
|
48
42
|
>
|
|
49
43
|
<input
|
|
50
|
-
checked={false}
|
|
51
44
|
name="fantastic-name"
|
|
52
|
-
onChange={[Function]}
|
|
53
45
|
type="radio"
|
|
54
46
|
/>
|
|
55
47
|
White
|
|
56
48
|
</label>
|
|
57
|
-
</div
|
|
49
|
+
</div>
|
|
58
50
|
<div
|
|
59
|
-
|
|
60
|
-
data-test={null}
|
|
51
|
+
class="m-0 form-checkbox"
|
|
61
52
|
>
|
|
62
53
|
<label
|
|
63
|
-
|
|
54
|
+
for="checkbox"
|
|
64
55
|
>
|
|
65
56
|
<input
|
|
66
|
-
checked=
|
|
57
|
+
checked=""
|
|
67
58
|
name="fantastic-name"
|
|
68
|
-
onChange={[Function]}
|
|
69
59
|
type="radio"
|
|
70
60
|
/>
|
|
71
61
|
Black
|
|
72
62
|
</label>
|
|
73
|
-
</div
|
|
74
|
-
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
75
65
|
`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Needs refactoring
|
|
2
|
+
// stylelint-disable no-descending-specificity
|
|
2
3
|
// stylelint-disable selector-no-qualifying-type, selector-max-compound-selectors
|
|
3
4
|
// stylelint-disable selector-max-type
|
|
4
5
|
// Base form controls
|
|
@@ -29,14 +30,32 @@ label {
|
|
|
29
30
|
background-position: right 8px center; // For form validation. This keeps images 8px from right and centered vertically.
|
|
30
31
|
border: $border-width $border-style var(--color-border-default);
|
|
31
32
|
border-radius: $border-radius;
|
|
32
|
-
outline: none;
|
|
33
33
|
box-shadow: var(--color-primer-shadow-inset);
|
|
34
|
+
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
|
35
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
34
36
|
|
|
35
|
-
&.focus,
|
|
36
37
|
&:focus {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
@include focusBoxShadowInset;
|
|
39
|
+
|
|
40
|
+
// remove fallback :focus if :focus-visible is supported
|
|
41
|
+
&:not(:focus-visible) {
|
|
42
|
+
border-color: transparent;
|
|
43
|
+
|
|
44
|
+
@include focusBoxShadowInset(1px, transparent);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// default focus state
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
@include focusBoxShadowInset;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// override form controls with no border in focused state
|
|
54
|
+
&.border-0 {
|
|
55
|
+
&:focus,
|
|
56
|
+
&:focus-visible {
|
|
57
|
+
border: $border-width $border-style var(--color-accent-fg) !important;
|
|
58
|
+
}
|
|
40
59
|
}
|
|
41
60
|
|
|
42
61
|
&[disabled] {
|
|
@@ -15,8 +15,16 @@
|
|
|
15
15
|
// stylelint-disable-next-line primer/spacing
|
|
16
16
|
margin: 15px 0;
|
|
17
17
|
|
|
18
|
+
// Autocomplete with embedded icon
|
|
19
|
+
.form-control.autocomplete-embedded-icon-wrap {
|
|
20
|
+
&:focus-within {
|
|
21
|
+
background-color: var(--color-canvas-default);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
// Text fields
|
|
19
26
|
.form-control {
|
|
27
|
+
// stylelint-disable-next-line primer/responsive-widths
|
|
20
28
|
width: 440px;
|
|
21
29
|
max-width: 100%;
|
|
22
30
|
// stylelint-disable-next-line primer/spacing
|
|
@@ -210,6 +218,7 @@
|
|
|
210
218
|
&::after {
|
|
211
219
|
border-bottom-color: var(--color-success-subtle);
|
|
212
220
|
}
|
|
221
|
+
|
|
213
222
|
&::before {
|
|
214
223
|
border-bottom-color: var(--color-success-muted);
|
|
215
224
|
}
|
|
@@ -217,7 +226,7 @@
|
|
|
217
226
|
}
|
|
218
227
|
|
|
219
228
|
&.warn {
|
|
220
|
-
.form-control {
|
|
229
|
+
.form-control:not(:focus, :focus-visible) {
|
|
221
230
|
border-color: var(--color-attention-emphasis);
|
|
222
231
|
}
|
|
223
232
|
|
|
@@ -230,6 +239,7 @@
|
|
|
230
239
|
&::after {
|
|
231
240
|
border-bottom-color: var(--color-attention-subtle);
|
|
232
241
|
}
|
|
242
|
+
|
|
233
243
|
&::before {
|
|
234
244
|
border-bottom-color: var(--color-attention-muted);
|
|
235
245
|
}
|
|
@@ -237,7 +247,7 @@
|
|
|
237
247
|
}
|
|
238
248
|
|
|
239
249
|
&.errored {
|
|
240
|
-
.form-control {
|
|
250
|
+
.form-control:not(:focus, :focus-visible) {
|
|
241
251
|
border-color: var(--color-danger-emphasis);
|
|
242
252
|
}
|
|
243
253
|
|
|
@@ -254,6 +264,7 @@
|
|
|
254
264
|
&::after {
|
|
255
265
|
border-bottom-color: var(--color-danger-subtle);
|
|
256
266
|
}
|
|
267
|
+
|
|
257
268
|
&::before {
|
|
258
269
|
border-bottom-color: var(--color-danger-muted);
|
|
259
270
|
}
|
|
@@ -236,15 +236,20 @@ dl.form-group > dd, // TODO: Deprecate
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
&.focused {
|
|
239
|
+
border-color: var(--color-accent-fg);
|
|
239
240
|
border-radius: $border-radius;
|
|
240
|
-
|
|
241
|
+
outline: none;
|
|
242
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
243
|
+
box-shadow: 0 0 0 2px var(--color-accent-fg);
|
|
241
244
|
|
|
242
245
|
.form-control {
|
|
246
|
+
border-color: transparent;
|
|
247
|
+
border-bottom-color: var(--color-accent-fg);
|
|
243
248
|
box-shadow: none;
|
|
244
249
|
}
|
|
245
250
|
|
|
246
251
|
.drag-and-drop {
|
|
247
|
-
border-color:
|
|
252
|
+
border-color: transparent;
|
|
248
253
|
}
|
|
249
254
|
}
|
|
250
255
|
}
|
|
@@ -320,8 +325,8 @@ div.composer {
|
|
|
320
325
|
min-height: 200px;
|
|
321
326
|
}
|
|
322
327
|
|
|
323
|
-
// stylelint-disable-next-line primer/spacing
|
|
324
328
|
.composer .tabnav {
|
|
329
|
+
// stylelint-disable-next-line primer/spacing
|
|
325
330
|
margin: 0 0 10px;
|
|
326
331
|
}
|
|
327
332
|
|
|
@@ -20,6 +20,20 @@
|
|
|
20
20
|
&.inline {
|
|
21
21
|
display: inline-table;
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
// within input group, if button exists change focus styles to match input (no offset)
|
|
25
|
+
&:focus-within {
|
|
26
|
+
// stylelint-disable-next-line selector-max-type
|
|
27
|
+
button {
|
|
28
|
+
outline-offset: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Autocomplete with embedded icon
|
|
33
|
+
.form-control.autocomplete-embedded-icon-wrap {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
padding: $spacer-1 * 1.25 $spacer-2;
|
|
36
|
+
}
|
|
23
37
|
}
|
|
24
38
|
|
|
25
39
|
.input-group .form-control,
|
|
@@ -32,6 +46,10 @@
|
|
|
32
46
|
vertical-align: middle; // Match the inputs
|
|
33
47
|
}
|
|
34
48
|
|
|
49
|
+
.input-group-button--autocomplete-embedded-icon {
|
|
50
|
+
vertical-align: bottom;
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
.input-group .form-control:first-child,
|
|
36
54
|
.input-group-button:first-child .btn {
|
|
37
55
|
border-top-right-radius: 0;
|