@primer/css 20.0.0-rc.8702fd9a → 20.0.0-rc.e6f567ec
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/CHANGELOG.md +166 -3
- package/CONTRIBUTING.md +6 -4
- package/DEVELOP.md +26 -21
- package/README.md +2 -2
- package/actionlist/action-list-item-divider.scss +8 -2
- package/actionlist/action-list-item.scss +214 -130
- package/actionlist/action-list-tree.scss +118 -0
- package/actionlist/action-list.scss +29 -0
- package/actionlist/index.scss +1 -0
- package/alerts/flash.scss +6 -2
- package/autocomplete/autocomplete.scss +51 -2
- package/avatars/avatar-stack.scss +1 -0
- package/base/base.scss +64 -3
- package/base/index.scss +0 -1
- package/base/kbd.scss +0 -1
- package/base/normalize.scss +13 -53
- package/base/typography-base.scss +3 -2
- package/blankslate/blankslate.scss +20 -1
- package/blankslate/index.scss +0 -1
- package/box/box.scss +0 -3
- package/branch-name/branch-name.scss +1 -0
- package/breadcrumb/breadcrumb.scss +1 -1
- package/buttons/button-group.scss +3 -2
- package/buttons/button.scss +64 -36
- package/buttons/misc.scss +30 -25
- package/color-modes/index.scss +2 -0
- package/color-modes/native.scss +12 -0
- package/color-modes/themes/dark.scss +0 -1
- package/color-modes/themes/dark_colorblind.scss +0 -1
- package/color-modes/themes/dark_dimmed.scss +0 -1
- package/color-modes/themes/dark_high_contrast.scss +0 -1
- package/color-modes/themes/dark_tritanopia.scss +6 -0
- package/color-modes/themes/light.scss +0 -1
- package/color-modes/themes/light_colorblind.scss +0 -1
- package/color-modes/themes/light_high_contrast.scss +0 -1
- package/color-modes/themes/light_tritanopia.scss +6 -0
- package/dist/actionlist.css +1 -1
- package/dist/actionlist.css.map +1 -1
- package/dist/alerts.css +1 -1
- package/dist/alerts.css.map +1 -1
- package/dist/autocomplete.css +1 -1
- package/dist/autocomplete.css.map +1 -1
- package/dist/avatars.css +1 -1
- package/dist/avatars.css.map +1 -1
- package/dist/base.css +1 -1
- package/dist/base.css.map +1 -1
- package/dist/blankslate.css +1 -1
- package/dist/blankslate.css.map +1 -1
- package/dist/box.css.map +1 -1
- package/dist/branch-name.css +1 -1
- package/dist/branch-name.css.map +1 -1
- package/dist/breadcrumb.css.map +1 -1
- package/dist/buttons.css +1 -1
- package/dist/buttons.css.map +1 -1
- package/dist/color-modes.css +1 -1
- package/dist/color-modes.css.map +1 -1
- package/dist/core.css +1 -1
- package/dist/core.css.map +1 -1
- package/dist/dropdown.css +1 -1
- package/dist/dropdown.css.map +1 -1
- package/dist/forms.css +1 -1
- package/dist/forms.css.map +1 -1
- package/dist/header.css.map +1 -1
- package/dist/labels.css +1 -1
- package/dist/labels.css.map +1 -1
- package/dist/layout.css +1 -1
- package/dist/layout.css.map +1 -1
- package/dist/links.css +1 -1
- package/dist/links.css.map +1 -1
- package/dist/loaders.css.map +1 -1
- package/dist/markdown.css +1 -1
- package/dist/markdown.css.map +1 -1
- package/dist/marketing-buttons.css +1 -1
- package/dist/marketing-buttons.css.map +1 -1
- package/dist/marketing-links.css +1 -1
- package/dist/marketing-links.css.map +1 -1
- package/dist/marketing-type.css.map +1 -1
- package/dist/marketing-utilities.css.map +1 -1
- package/dist/marketing.css +1 -1
- package/dist/marketing.css.map +1 -1
- package/dist/meta.json +73 -73
- package/dist/navigation.css +1 -1
- package/dist/navigation.css.map +1 -1
- package/dist/pagination.css +1 -1
- package/dist/pagination.css.map +1 -1
- package/dist/popover.css +1 -1
- package/dist/popover.css.map +1 -1
- package/dist/primer.css +4 -4
- package/dist/primer.css.map +1 -1
- package/dist/product.css +1 -1
- package/dist/product.css.map +1 -1
- package/dist/progress.css.map +1 -1
- package/dist/select-menu.css.map +1 -1
- package/dist/stats/actionlist.json +1 -1
- package/dist/stats/alerts.json +1 -1
- package/dist/stats/autocomplete.json +1 -1
- package/dist/stats/avatars.json +1 -1
- package/dist/stats/base.json +1 -1
- package/dist/stats/blankslate.json +1 -1
- package/dist/stats/branch-name.json +1 -1
- package/dist/stats/buttons.json +1 -1
- package/dist/stats/color-modes.json +1 -1
- package/dist/stats/core.json +1 -1
- package/dist/stats/dropdown.json +1 -1
- package/dist/stats/forms.json +1 -1
- package/dist/stats/labels.json +1 -1
- package/dist/stats/layout.json +1 -1
- package/dist/stats/links.json +1 -1
- package/dist/stats/markdown.json +1 -1
- package/dist/stats/marketing-buttons.json +1 -1
- package/dist/stats/marketing-links.json +1 -1
- package/dist/stats/marketing.json +1 -1
- package/dist/stats/navigation.json +1 -1
- package/dist/stats/pagination.json +1 -1
- package/dist/stats/popover.json +1 -1
- package/dist/stats/primer.json +1 -1
- package/dist/stats/product.json +1 -1
- package/dist/stats/subhead.json +1 -1
- package/dist/stats/toasts.json +1 -1
- package/dist/stats/tooltips.json +1 -1
- package/dist/stats/utilities.json +1 -1
- package/dist/subhead.css +1 -1
- package/dist/subhead.css.map +1 -1
- package/dist/table-object.css.map +1 -1
- package/dist/timeline.css.map +1 -1
- package/dist/toasts.css +1 -1
- package/dist/toasts.css.map +1 -1
- package/dist/tooltips.css +1 -1
- package/dist/tooltips.css.map +1 -1
- package/dist/truncate.css.map +1 -1
- package/dist/utilities.css +1 -1
- package/dist/utilities.css.map +1 -1
- package/dist/variables.json +7 -7
- package/dropdown/dropdown.scss +0 -2
- package/forms/form-control.scss +26 -5
- package/forms/form-group.scss +47 -13
- package/forms/form-validation.scss +1 -1
- package/forms/input-group.scss +18 -0
- package/labels/counters.scss +1 -1
- package/labels/index.scss +0 -1
- package/labels/labels.scss +12 -1
- package/labels/mixins.scss +7 -2
- package/labels/states.scss +2 -2
- package/layout/grid-offset.scss +1 -0
- package/layout/grid.scss +1 -0
- package/layout/index.scss +1 -1
- package/layout/layout.scss +8 -11
- package/layout/mixins.scss +30 -4
- package/layout/page-layout.scss +384 -0
- package/links/link.scss +6 -1
- package/markdown/code.scss +5 -0
- package/markdown/footnotes.scss +38 -26
- package/markdown/headings.scss +17 -0
- package/markdown/images.scss +3 -3
- package/markdown/markdown-body.scss +0 -8
- package/marketing/buttons/button.scss +32 -26
- package/marketing/links/link.scss +5 -5
- package/marketing/type/typography.scss +3 -0
- package/marketing/utilities/layout.scss +1 -0
- package/navigation/filter-list.scss +20 -2
- package/navigation/menu.scss +8 -10
- package/navigation/sidenav.scss +3 -12
- package/navigation/subnav.scss +20 -2
- package/navigation/tabnav.scss +9 -4
- package/navigation/underline-nav.scss +79 -28
- package/package.json +32 -26
- package/pagination/pagination.scss +65 -7
- package/popover/popover.scss +1 -2
- package/select-menu/select-menu.scss +3 -3
- package/stylelint.config.cjs +2 -11
- package/subhead/subhead.scss +3 -0
- package/support/mixins/color-modes.scss +3 -0
- package/support/mixins/misc.scss +48 -1
- package/support/mixins/typography.scss +3 -2
- package/support/variables/layout.scss +2 -3
- package/table-object/table-object.scss +3 -0
- package/timeline/timeline-item.scss +0 -1
- package/toasts/toasts.scss +7 -4
- package/tooltips/tooltips.scss +0 -7
- package/utilities/colors.scss +16 -0
- package/utilities/details.scss +81 -4
- package/utilities/layout.scss +1 -1
- package/utilities/margin.scss +4 -1
- package/utilities/padding.scss +3 -1
- package/utilities/visibility-display.scss +52 -3
- package/table-object/README.md +0 -25
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
position: relative;
|
|
3
|
-
z-index: 1;
|
|
4
|
-
outline: none;
|
|
5
|
-
box-shadow: 0 0 0 2px var(--color-accent-fg); // this color breaks convention
|
|
6
|
-
}
|
|
1
|
+
// stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors
|
|
7
2
|
|
|
8
3
|
@mixin activeIndicatorLine {
|
|
9
4
|
position: absolute;
|
|
@@ -26,48 +21,72 @@
|
|
|
26
21
|
&:hover,
|
|
27
22
|
&:active {
|
|
28
23
|
cursor: pointer;
|
|
29
|
-
|
|
30
|
-
// a href
|
|
31
|
-
.ActionList-content {
|
|
32
|
-
text-decoration: none;
|
|
33
|
-
}
|
|
34
24
|
}
|
|
35
25
|
|
|
36
26
|
// only hover li without list as children
|
|
37
|
-
&:not(.ActionList-item--hasSubItem)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
&:not(.ActionList-item--hasSubItem),
|
|
28
|
+
// target contents of first child li if sub-item (li wraps item label + nested ul)
|
|
29
|
+
&.ActionList-item--hasSubItem > .ActionList-content {
|
|
30
|
+
@media (hover: hover) {
|
|
31
|
+
&:hover {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
background-color: var(--color-action-list-item-default-hover-bg);
|
|
34
|
+
|
|
35
|
+
&:not(.ActionList-item--navActive) {
|
|
36
|
+
// Support for "Windows high contrast mode"
|
|
37
|
+
outline: $border-style $border-width transparent;
|
|
38
|
+
outline-offset: -$border-width;
|
|
39
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
40
|
+
box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
&:active {
|
|
44
46
|
background: var(--color-action-list-item-default-active-bg);
|
|
45
47
|
|
|
48
|
+
&:not(.ActionList-item--navActive) {
|
|
49
|
+
// Support for "Windows high contrast mode" https://sarahmhigley.com/writing/whcm-quick-tips/
|
|
50
|
+
outline: $border-style $border-width transparent;
|
|
51
|
+
outline-offset: -$border-width;
|
|
52
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
53
|
+
box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
@media screen and (prefers-reduced-motion: no-preference) {
|
|
47
57
|
animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
|
|
48
58
|
}
|
|
49
59
|
|
|
50
|
-
// stylelint-disable primer/box-shadow
|
|
51
60
|
@keyframes ActionList-item-active-bg {
|
|
52
|
-
// stylelint-disable-next-line max-nesting-depth
|
|
53
61
|
50% {
|
|
54
|
-
box-shadow
|
|
62
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
63
|
+
box-shadow: inset 0 2px 12px 6px rgba(var(--color-canvas-default), 0.4);
|
|
55
64
|
transform: scale(1);
|
|
56
65
|
}
|
|
57
66
|
|
|
58
|
-
// stylelint-disable-next-line max-nesting-depth
|
|
59
67
|
100% {
|
|
60
|
-
box-shadow: inset 0 3px 9px rgba(#000, 0.04);
|
|
61
68
|
transform: scale(0.97);
|
|
62
69
|
}
|
|
63
70
|
}
|
|
64
|
-
// stylelint-enable primer/box-shadow
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
|
|
73
|
+
// hide dividers
|
|
74
|
+
|
|
75
|
+
@media (hover: hover) {
|
|
76
|
+
&:hover {
|
|
77
|
+
.ActionList-item-label::before,
|
|
78
|
+
+ .ActionList-item .ActionList-item-label::before {
|
|
79
|
+
visibility: hidden;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ActionList-item-descriptionWrap--inline::before,
|
|
83
|
+
+ .ActionList-item .ActionList-item-descriptionWrap--inline::before {
|
|
84
|
+
visibility: hidden;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// stylelint-disable-next-line no-duplicate-selectors
|
|
68
89
|
&:active {
|
|
69
|
-
// hide dividers
|
|
70
|
-
// stylelint-disable-next-line selector-max-specificity
|
|
71
90
|
.ActionList-item-label::before,
|
|
72
91
|
+ .ActionList-item .ActionList-item-label::before {
|
|
73
92
|
visibility: hidden;
|
|
@@ -80,8 +99,16 @@
|
|
|
80
99
|
&.ActionList-item--hasSubItem {
|
|
81
100
|
// first child
|
|
82
101
|
> .ActionList-content {
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
z-index: 1;
|
|
103
|
+
|
|
104
|
+
@media (hover: hover) {
|
|
105
|
+
&:hover {
|
|
106
|
+
background-color: var(--color-action-list-item-default-hover-bg);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:active {
|
|
111
|
+
background-color: var(--color-action-list-item-default-active-bg);
|
|
85
112
|
}
|
|
86
113
|
}
|
|
87
114
|
}
|
|
@@ -98,58 +125,12 @@
|
|
|
98
125
|
&:not(.ActionList-item--danger) {
|
|
99
126
|
background: var(--color-action-list-item-default-selected-bg);
|
|
100
127
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// blue accent line
|
|
108
|
-
&::after {
|
|
109
|
-
@include activeIndicatorLine;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// collapsible item [aria-expanded]
|
|
115
|
-
|
|
116
|
-
&[aria-expanded='true'] {
|
|
117
|
-
.ActionList-item-collapseIcon {
|
|
118
|
-
transition: transform 120ms linear;
|
|
119
|
-
transform: scaleY(-1);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.ActionList--subGroup {
|
|
123
|
-
display: block;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&.ActionList-item--hasActiveSubItem {
|
|
127
|
-
// stylelint-disable-next-line selector-max-specificity
|
|
128
|
-
> .ActionList-content > .ActionList-item-label {
|
|
129
|
-
font-weight: $font-weight-bold;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&[aria-expanded='false'] {
|
|
135
|
-
.ActionList-item-collapseIcon {
|
|
136
|
-
transition: transform 120ms linear;
|
|
137
|
-
transform: scaleY(1);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.ActionList--subGroup {
|
|
141
|
-
display: none;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// show active indicator on parent collapse if child is active
|
|
145
|
-
&.ActionList-item--hasActiveSubItem {
|
|
146
|
-
background: var(--color-action-list-item-default-selected-bg);
|
|
147
|
-
|
|
148
|
-
.ActionList-item-label {
|
|
149
|
-
font-weight: $font-weight-bold;
|
|
128
|
+
@media (hover: hover) {
|
|
129
|
+
&:hover {
|
|
130
|
+
background-color: var(--color-action-list-item-default-hover-bg);
|
|
131
|
+
}
|
|
150
132
|
}
|
|
151
133
|
|
|
152
|
-
// stylelint-disable-next-line selector-max-specificity
|
|
153
134
|
&::before,
|
|
154
135
|
+ .ActionList-item::before {
|
|
155
136
|
visibility: hidden;
|
|
@@ -204,7 +185,7 @@
|
|
|
204
185
|
visibility: hidden;
|
|
205
186
|
opacity: 0;
|
|
206
187
|
transition:
|
|
207
|
-
|
|
188
|
+
visibility 0 linear $actionList-item-checkmark-transition-timing,
|
|
208
189
|
opacity $actionList-item-checkmark-transition-timing;
|
|
209
190
|
}
|
|
210
191
|
|
|
@@ -266,37 +247,19 @@
|
|
|
266
247
|
color: var(--color-danger-fg);
|
|
267
248
|
}
|
|
268
249
|
|
|
269
|
-
@media (hover: hover)
|
|
250
|
+
@media (hover: hover) {
|
|
270
251
|
&:hover {
|
|
271
252
|
background: var(--color-action-list-item-danger-hover-bg);
|
|
272
253
|
|
|
273
|
-
// stylelint-disable-next-line max-nesting-depth
|
|
274
254
|
.ActionList-item-label {
|
|
275
255
|
color: var(--color-action-list-item-danger-hover-text);
|
|
276
256
|
}
|
|
277
257
|
}
|
|
278
258
|
}
|
|
279
259
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// disabled
|
|
286
|
-
&[aria-disabled='true'] {
|
|
287
|
-
.ActionList-item-label,
|
|
288
|
-
.ActionList-item-description {
|
|
289
|
-
color: var(--color-primer-fg-disabled);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.ActionList-item-visual {
|
|
293
|
-
fill: var(--color-primer-fg-disabled);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
@media (hover: hover) and (pointer: fine) {
|
|
297
|
-
&:hover {
|
|
298
|
-
cursor: not-allowed;
|
|
299
|
-
background-color: transparent;
|
|
260
|
+
.ActionList-content {
|
|
261
|
+
&:active {
|
|
262
|
+
background: var(--color-action-list-item-danger-active-bg);
|
|
300
263
|
}
|
|
301
264
|
}
|
|
302
265
|
}
|
|
@@ -308,31 +271,167 @@
|
|
|
308
271
|
}
|
|
309
272
|
}
|
|
310
273
|
|
|
311
|
-
//
|
|
274
|
+
// button or a href
|
|
312
275
|
.ActionList-content {
|
|
313
276
|
position: relative;
|
|
314
277
|
display: grid;
|
|
278
|
+
width: 100%;
|
|
315
279
|
// stylelint-disable-next-line primer/spacing
|
|
316
280
|
padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
|
|
281
|
+
font-size: $body-font-size;
|
|
317
282
|
font-weight: $font-weight-normal;
|
|
318
283
|
color: var(--color-fg-default);
|
|
284
|
+
text-align: left;
|
|
319
285
|
user-select: none;
|
|
286
|
+
background-color: transparent;
|
|
287
|
+
// stylelint-disable-next-line declaration-property-value-disallowed-list
|
|
288
|
+
border: none;
|
|
320
289
|
border-radius: $border-radius;
|
|
321
290
|
transition: $actionList-item-bg-transition;
|
|
291
|
+
touch-action: manipulation;
|
|
292
|
+
touch-action: manipulation;
|
|
293
|
+
-webkit-tap-highlight-color: transparent;
|
|
322
294
|
grid-template-rows: min-content;
|
|
323
295
|
grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
|
|
324
|
-
grid-template-columns: min-content min-content minmax(
|
|
325
|
-
align-items:
|
|
296
|
+
grid-template-columns: min-content min-content minmax(0, auto) min-content min-content;
|
|
297
|
+
align-items: start;
|
|
326
298
|
|
|
327
299
|
// column-gap persists with empty grid-areas, margin applies only when children exist
|
|
328
300
|
> :not(:last-child) {
|
|
329
301
|
margin-right: $spacer-2;
|
|
330
302
|
}
|
|
331
303
|
|
|
304
|
+
// state
|
|
305
|
+
|
|
306
|
+
&:hover {
|
|
307
|
+
text-decoration: none;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&:focus {
|
|
311
|
+
@include focusOutline;
|
|
312
|
+
|
|
313
|
+
// remove fallback :focus if :focus-visible is supported
|
|
314
|
+
&:not(:focus-visible) {
|
|
315
|
+
outline: solid 1px transparent;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// default focus state
|
|
332
320
|
&:focus-visible {
|
|
333
321
|
@include focusOutline;
|
|
334
322
|
}
|
|
335
323
|
|
|
324
|
+
// disabled
|
|
325
|
+
&[aria-disabled='true'] {
|
|
326
|
+
.ActionList-item-label,
|
|
327
|
+
.ActionList-item-description {
|
|
328
|
+
color: var(--color-primer-fg-disabled);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.ActionList-item-visual {
|
|
332
|
+
fill: var(--color-primer-fg-disabled);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@media (hover: hover) {
|
|
336
|
+
&:hover {
|
|
337
|
+
cursor: not-allowed;
|
|
338
|
+
background-color: transparent;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// collapsible item [aria-expanded]
|
|
344
|
+
|
|
345
|
+
// nesting (single level)
|
|
346
|
+
// target items inside expanded subgroups
|
|
347
|
+
&[aria-expanded] {
|
|
348
|
+
+ .ActionList--subGroup {
|
|
349
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
350
|
+
transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.ActionList-content {
|
|
354
|
+
padding-left: $spacer-4;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// has 16px leading visual
|
|
359
|
+
&.ActionList-content--visual16 + .ActionList--subGroup {
|
|
360
|
+
.ActionList-content {
|
|
361
|
+
padding-left: $spacer-5;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// has 20px leading visual
|
|
366
|
+
&.ActionList-content--visual20 + .ActionList--subGroup {
|
|
367
|
+
.ActionList-content {
|
|
368
|
+
padding-left: $spacer-2 * 4.5; // 36px
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// has 24px leading visual
|
|
373
|
+
&.ActionList-content--visual24 + .ActionList--subGroup {
|
|
374
|
+
.ActionList-content {
|
|
375
|
+
padding-left: $spacer-6;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
&[aria-expanded='true'] {
|
|
381
|
+
.ActionList-item-collapseIcon {
|
|
382
|
+
transition: transform 120ms linear;
|
|
383
|
+
transform: scaleY(-1);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
+ .ActionList--subGroup {
|
|
387
|
+
height: auto;
|
|
388
|
+
overflow: visible;
|
|
389
|
+
visibility: visible;
|
|
390
|
+
opacity: 1;
|
|
391
|
+
transform: translateY(0);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
&.ActionList-content--hasActiveSubItem {
|
|
395
|
+
> .ActionList-item-label {
|
|
396
|
+
font-weight: $font-weight-bold;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
&[aria-expanded='false'] {
|
|
402
|
+
.ActionList-item-collapseIcon {
|
|
403
|
+
transition: transform 120ms linear;
|
|
404
|
+
transform: scaleY(1);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
+ .ActionList--subGroup {
|
|
408
|
+
height: 0;
|
|
409
|
+
overflow: hidden;
|
|
410
|
+
visibility: hidden;
|
|
411
|
+
opacity: 0;
|
|
412
|
+
transform: translateY(-$spacer-3);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// show active indicator on parent collapse if child is active
|
|
416
|
+
&.ActionList-content--hasActiveSubItem {
|
|
417
|
+
background: var(--color-action-list-item-default-selected-bg);
|
|
418
|
+
|
|
419
|
+
.ActionList-item-label {
|
|
420
|
+
font-weight: $font-weight-bold;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&::before,
|
|
424
|
+
+ .ActionList-item::before {
|
|
425
|
+
visibility: hidden;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// blue accent line
|
|
429
|
+
&::after {
|
|
430
|
+
@include activeIndicatorLine;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
336
435
|
// sizes
|
|
337
436
|
|
|
338
437
|
&.ActionList-content--sizeMedium {
|
|
@@ -347,6 +446,10 @@
|
|
|
347
446
|
padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
|
|
348
447
|
}
|
|
349
448
|
|
|
449
|
+
&.ActionList-content--fontSmall {
|
|
450
|
+
font-size: $font-size-small;
|
|
451
|
+
}
|
|
452
|
+
|
|
350
453
|
// On pointer:coarse (mobile), all list items are large
|
|
351
454
|
@media (pointer: coarse) {
|
|
352
455
|
// stylelint-disable-next-line primer/spacing
|
|
@@ -401,6 +504,7 @@
|
|
|
401
504
|
|
|
402
505
|
// inline
|
|
403
506
|
.ActionList-item-descriptionWrap--inline {
|
|
507
|
+
position: relative;
|
|
404
508
|
flex-direction: row;
|
|
405
509
|
align-items: baseline;
|
|
406
510
|
|
|
@@ -425,6 +529,7 @@
|
|
|
425
529
|
display: flex;
|
|
426
530
|
min-height: $actionList-item-height-sm;
|
|
427
531
|
color: var(--color-fg-muted); // if visual is text
|
|
532
|
+
pointer-events: none;
|
|
428
533
|
fill: var(--color-fg-muted);
|
|
429
534
|
align-items: center;
|
|
430
535
|
}
|
|
@@ -440,37 +545,16 @@
|
|
|
440
545
|
color: var(--color-fg-default);
|
|
441
546
|
}
|
|
442
547
|
|
|
548
|
+
.ActionList-item-label--truncate {
|
|
549
|
+
overflow: hidden;
|
|
550
|
+
text-overflow: ellipsis;
|
|
551
|
+
white-space: nowrap;
|
|
552
|
+
}
|
|
553
|
+
|
|
443
554
|
// nested lists (only supports 1 level currently)
|
|
444
555
|
// target ActionList-item--subItem for padding-left to maintain :active :after state
|
|
445
556
|
|
|
557
|
+
// TODO: remove with PVC implementation
|
|
446
558
|
.ActionList-item--subItem > .ActionList-content {
|
|
447
559
|
font-size: $font-size-small;
|
|
448
560
|
}
|
|
449
|
-
|
|
450
|
-
// no leading visual
|
|
451
|
-
.ActionList--subGroup {
|
|
452
|
-
.ActionList-item--subItem {
|
|
453
|
-
padding-left: $spacer-3;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// has 16px leading visual
|
|
458
|
-
.ActionList-content--visual16 + .ActionList--subGroup {
|
|
459
|
-
.ActionList-item--subItem {
|
|
460
|
-
padding-left: $spacer-4;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// has 20px leading visual
|
|
465
|
-
.ActionList-content--visual20 + .ActionList--subGroup {
|
|
466
|
-
.ActionList-item--subItem {
|
|
467
|
-
padding-left: $spacer-3 * 1.75;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
// has 24px leading visual
|
|
472
|
-
.ActionList-content--visual24 + .ActionList--subGroup {
|
|
473
|
-
.ActionList-item--subItem {
|
|
474
|
-
padding-left: $spacer-5;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, selector-max-type, primer/spacing
|
|
2
|
+
// tree-view variant
|
|
3
|
+
// renders ActionList with default styling for tree-view
|
|
4
|
+
// collapse/expand icons presents as leadingActions, rotate 90deg
|
|
5
|
+
// connecting vertical lines between collapse groups
|
|
6
|
+
// consistent font-size between nested groups
|
|
7
|
+
|
|
8
|
+
@mixin treeConnectingLine($left) {
|
|
9
|
+
position: absolute;
|
|
10
|
+
left: $left;
|
|
11
|
+
width: 1px;
|
|
12
|
+
height: 100%;
|
|
13
|
+
content: '';
|
|
14
|
+
background: var(--color-action-list-item-inline-divider);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ActionList--tree {
|
|
18
|
+
--ActionList-tree-depth: 1;
|
|
19
|
+
// TODO: remove with PVC implementation
|
|
20
|
+
.ActionList-item--subItem > .ActionList-content {
|
|
21
|
+
font-size: $body-font-size;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ActionList-item {
|
|
25
|
+
// class for single tree items not within a group
|
|
26
|
+
&.ActionList-item--singleton {
|
|
27
|
+
.ActionList-content {
|
|
28
|
+
padding-left: $spacer-5;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// normal font-weight for any active item
|
|
33
|
+
&.ActionList-item--navActive {
|
|
34
|
+
&:not(.ActionList-item--subItem) {
|
|
35
|
+
.ActionList-item-label {
|
|
36
|
+
font-weight: $font-weight-normal;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ActionList-content {
|
|
43
|
+
// nesting (infinite levels)
|
|
44
|
+
// target items inside expanded subgroup
|
|
45
|
+
&[aria-expanded] {
|
|
46
|
+
+ .ActionList--subGroup {
|
|
47
|
+
position: relative;
|
|
48
|
+
|
|
49
|
+
// --ActionList-tree-depth is defined as an inline style referencing the aria-level of each item ie: aria-level="2"
|
|
50
|
+
.ActionList-content {
|
|
51
|
+
padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// tree-view specific collapse icon positioning/animation
|
|
57
|
+
&[aria-expanded='true'] {
|
|
58
|
+
.ActionList-item-collapseIcon {
|
|
59
|
+
transition: transform 120ms linear;
|
|
60
|
+
transform: rotate(0deg);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// normal weight for parent folder containing active child
|
|
64
|
+
&.ActionList-content--hasActiveSubItem {
|
|
65
|
+
> .ActionList-item-label {
|
|
66
|
+
font-weight: $font-weight-normal;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&[aria-expanded='false'] {
|
|
72
|
+
.ActionList-item-collapseIcon {
|
|
73
|
+
transition: transform 120ms linear;
|
|
74
|
+
transform: rotate(-90deg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.ActionList-content--hasActiveSubItem {
|
|
78
|
+
> .ActionList-item-label {
|
|
79
|
+
font-weight: $font-weight-normal;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// expand/collapse group
|
|
86
|
+
.ActionList-item--hasSubItem {
|
|
87
|
+
.ActionList-item--subItem:not(.ActionList-item--hasSubItem) {
|
|
88
|
+
.ActionList-content {
|
|
89
|
+
// increase child padding by targeting content first child span (add to ActionList-content padding, not replace)
|
|
90
|
+
// creates a slight indent of child items
|
|
91
|
+
> span:first-child {
|
|
92
|
+
padding-left: $spacer-4;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// first subitem
|
|
99
|
+
> [aria-level='1'].ActionList-item--hasSubItem {
|
|
100
|
+
> .ActionList--subGroup {
|
|
101
|
+
&::before {
|
|
102
|
+
@include treeConnectingLine($left: $spacer-3);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// all other subitems
|
|
108
|
+
// center connecting line with parent (line is 1px (8px - 1px)
|
|
109
|
+
.ActionList-item--hasSubItem:not([aria-level='1']) {
|
|
110
|
+
> .ActionList--subGroup {
|
|
111
|
+
&::before {
|
|
112
|
+
@include treeConnectingLine(
|
|
113
|
+
$left: calc(#{$spacer-2} * (var(--ActionList-tree-depth)) + #{$spacer-2 - $border-width})
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
padding: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
// nested list within main ActionList
|
|
12
|
+
.ActionList--subGroup {
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
// dividers
|
|
12
17
|
|
|
13
18
|
.ActionList--divided {
|
|
@@ -21,6 +26,24 @@
|
|
|
21
26
|
background: var(--color-action-list-item-inline-divider);
|
|
22
27
|
}
|
|
23
28
|
|
|
29
|
+
// if descriptionWrap--inline exists, move pseudo divider to wrapper
|
|
30
|
+
.ActionList-item-descriptionWrap--inline {
|
|
31
|
+
&::before {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: -$actionList-item-padding-vertical;
|
|
34
|
+
display: block;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: $border-width;
|
|
37
|
+
content: '';
|
|
38
|
+
background: var(--color-action-list-item-inline-divider);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// unset the default label pseudo
|
|
42
|
+
.ActionList-item-label::before {
|
|
43
|
+
content: unset;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
24
47
|
// hide divider if item is active
|
|
25
48
|
.ActionList-item--navActive {
|
|
26
49
|
// stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
|
|
@@ -36,3 +59,9 @@
|
|
|
36
59
|
.ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
|
|
37
60
|
visibility: hidden;
|
|
38
61
|
}
|
|
62
|
+
|
|
63
|
+
// hide if item is first of type with label::before, or is the first item after a sectionDivider
|
|
64
|
+
.ActionList-item:first-of-type .ActionList-item-descriptionWrap--inline::before,
|
|
65
|
+
.ActionList-sectionDivider + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
|
|
66
|
+
visibility: hidden;
|
|
67
|
+
}
|
package/actionlist/index.scss
CHANGED