@primer/css 0.0.0-20220322221248 → 0.0.0-20220323012846

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 (111) hide show
  1. package/CHANGELOG.md +64 -2
  2. package/README.md +2 -2
  3. package/actionlist/action-list-item-divider.scss +7 -1
  4. package/actionlist/action-list-item.scss +157 -130
  5. package/actionlist/action-list-tree.scss +100 -5
  6. package/actionlist/action-list.scss +29 -0
  7. package/base/kbd.scss +0 -1
  8. package/base/normalize.scss +1 -1
  9. package/base/typography-base.scss +3 -2
  10. package/blankslate/blankslate.scss +20 -1
  11. package/box/box.scss +0 -3
  12. package/buttons/button.scss +1 -0
  13. package/color-modes/native.scss +11 -0
  14. package/core/index.scss +1 -5
  15. package/dist/actionlist.css +1 -1
  16. package/dist/actionlist.css.map +1 -1
  17. package/dist/alerts.css.map +1 -1
  18. package/dist/autocomplete.css.map +1 -1
  19. package/dist/avatars.css.map +1 -1
  20. package/dist/base.css +1 -1
  21. package/dist/base.css.map +1 -1
  22. package/dist/blankslate.css +1 -1
  23. package/dist/blankslate.css.map +1 -1
  24. package/dist/box.css.map +1 -1
  25. package/dist/branch-name.css.map +1 -1
  26. package/dist/breadcrumb.css.map +1 -1
  27. package/dist/buttons.css.map +1 -1
  28. package/dist/color-modes.css +1 -1
  29. package/dist/color-modes.css.map +1 -1
  30. package/dist/core.css +1 -1
  31. package/dist/core.css.map +1 -1
  32. package/dist/dropdown.css.map +1 -1
  33. package/dist/forms.css +1 -1
  34. package/dist/forms.css.map +1 -1
  35. package/dist/header.css.map +1 -1
  36. package/dist/labels.css +1 -1
  37. package/dist/labels.css.map +1 -1
  38. package/dist/layout.css +1 -1
  39. package/dist/layout.css.map +1 -1
  40. package/dist/links.css.map +1 -1
  41. package/dist/loaders.css.map +1 -1
  42. package/dist/markdown.css +1 -1
  43. package/dist/markdown.css.map +1 -1
  44. package/dist/marketing-buttons.css.map +1 -1
  45. package/dist/marketing-links.css.map +1 -1
  46. package/dist/marketing-type.css.map +1 -1
  47. package/dist/marketing-utilities.css.map +1 -1
  48. package/dist/meta.json +53 -53
  49. package/dist/navigation.css.map +1 -1
  50. package/dist/pagination.css +1 -1
  51. package/dist/pagination.css.map +1 -1
  52. package/dist/popover.css.map +1 -1
  53. package/dist/primer.css +3 -3
  54. package/dist/primer.css.map +1 -1
  55. package/dist/product.css +1 -1
  56. package/dist/product.css.map +1 -1
  57. package/dist/progress.css.map +1 -1
  58. package/dist/select-menu.css.map +1 -1
  59. package/dist/stats/actionlist.json +1 -1
  60. package/dist/stats/base.json +1 -1
  61. package/dist/stats/blankslate.json +1 -1
  62. package/dist/stats/color-modes.json +1 -1
  63. package/dist/stats/core.json +1 -1
  64. package/dist/stats/forms.json +1 -1
  65. package/dist/stats/labels.json +1 -1
  66. package/dist/stats/layout.json +1 -1
  67. package/dist/stats/markdown.json +1 -1
  68. package/dist/stats/pagination.json +1 -1
  69. package/dist/stats/primer.json +1 -1
  70. package/dist/stats/product.json +1 -1
  71. package/dist/stats/subhead.json +1 -1
  72. package/dist/subhead.css +1 -1
  73. package/dist/subhead.css.map +1 -1
  74. package/dist/table-object.css.map +1 -1
  75. package/dist/timeline.css.map +1 -1
  76. package/dist/toasts.css.map +1 -1
  77. package/dist/tooltips.css.map +1 -1
  78. package/dist/truncate.css.map +1 -1
  79. package/dist/utilities.css.map +1 -1
  80. package/dist/variables.json +7 -7
  81. package/forms/form-control.scss +1 -0
  82. package/forms/form-group.scss +2 -0
  83. package/labels/mixins.scss +7 -2
  84. package/layout/grid-offset.scss +1 -0
  85. package/layout/grid.scss +1 -0
  86. package/layout/index.scss +1 -0
  87. package/layout/layout.scss +2 -1
  88. package/layout/page-header.scss +201 -0
  89. package/layout/page-layout.scss +3 -2
  90. package/markdown/code.scss +5 -0
  91. package/markdown/footnotes.scss +38 -26
  92. package/markdown/headings.scss +17 -0
  93. package/markdown/markdown-body.scss +0 -8
  94. package/marketing/type/typography.scss +3 -0
  95. package/marketing/utilities/layout.scss +1 -0
  96. package/package.json +20 -15
  97. package/pagination/pagination.scss +38 -1
  98. package/popover/popover.scss +0 -1
  99. package/subhead/subhead.scss +3 -0
  100. package/support/mixins/misc.scss +1 -23
  101. package/table-object/table-object.scss +3 -0
  102. package/timeline/timeline-item.scss +0 -1
  103. package/utilities/margin.scss +4 -1
  104. package/utilities/padding.scss +3 -1
  105. package/button-refactor/ButtonsLinksAPI.md +0 -115
  106. package/button-refactor/button-group.scss +0 -27
  107. package/button-refactor/button.scss +0 -332
  108. package/button-refactor/icon-button.scss +0 -14
  109. package/button-refactor/link-styled-as-button.scss +0 -75
  110. package/button-refactor/link.scss +0 -25
  111. package/table-object/README.md +0 -25
package/CHANGELOG.md CHANGED
@@ -1,6 +1,68 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-20220322221248
3
+ ## 0.0.0-20220323012846
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1961](https://github.com/primer/css/pull/1961) [`a35a8bdc`](https://github.com/primer/css/commit/a35a8bdcc17906848fcb486842d2345db0441c7c) Thanks [@jonrohan](https://github.com/jonrohan)! - Default .PageLayout to display block
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1954](https://github.com/primer/css/pull/1954) [`30f29d38`](https://github.com/primer/css/commit/30f29d383256a7d4023a859fdeee44471307159d) Thanks [@simurai](https://github.com/simurai)! - Fix `input-block` in `form-group`
12
+
13
+ * [#1956](https://github.com/primer/css/pull/1956) [`39063461`](https://github.com/primer/css/commit/3906346182ed983d9725fd95da41b21424378b3e) Thanks [@jonrohan](https://github.com/jonrohan)! - Upgrading @primer/stylelint-config@12.3.2
14
+
15
+ - [#1931](https://github.com/primer/css/pull/1931) [`e5c5312e`](https://github.com/primer/css/commit/e5c5312ec8bf139f6c94d2f70ceecd4b3cd9fd82) Thanks [@vdepizzol](https://github.com/vdepizzol)! - Page layout api updates renaming spacing options in storybook
16
+
17
+ * Fake entry to force publishing
18
+
19
+ - [#1950](https://github.com/primer/css/pull/1950) [`7c85c500`](https://github.com/primer/css/commit/7c85c500569fe6e1b29665c2eed37d58625ab06f) Thanks [@hectahertz](https://github.com/hectahertz)! - Fix sequence of content in Subhead
20
+
21
+ * [#1942](https://github.com/primer/css/pull/1942) [`0450ccbb`](https://github.com/primer/css/commit/0450ccbb86104564c7d4038eb68989f370014fa1) Thanks [@reeceatkinson](https://github.com/reeceatkinson)! - Added line break to docs
22
+
23
+ - [#1953](https://github.com/primer/css/pull/1953) [`3a91a29a`](https://github.com/primer/css/commit/3a91a29a822a28ea9679fbbb90250fc039057f23) Thanks [@hectahertz](https://github.com/hectahertz)! - Use `<h2>` instead of `<div>` on Subhead-heading docs
24
+
25
+ * [#1949](https://github.com/primer/css/pull/1949) [`dab83198`](https://github.com/primer/css/commit/dab83198c3bf1c7e03826b8cd498b8c48c9a2869) Thanks [@heiskr](https://github.com/heiskr)! - Render headings inline when in a `<summary>`
26
+
27
+ - [#1977](https://github.com/primer/css/pull/1977) [`80bf9d9d`](https://github.com/primer/css/commit/80bf9d9dea6fe7fbb0837fea265ec95cbbbd75d6) Thanks [@jonrohan](https://github.com/jonrohan)! - [Bug Fix] Adding white-space nowrap to Labels
28
+
29
+ ## 19.4.0
30
+
31
+ ### Minor Changes
32
+
33
+ - [#1937](https://github.com/primer/css/pull/1937) [`67f08009`](https://github.com/primer/css/commit/67f08009ef458088b9fda6267ab25ad6d0a514aa) Thanks [@langermank](https://github.com/langermank)! - TreeView single item nesting
34
+
35
+ * [#1905](https://github.com/primer/css/pull/1905) [`50221a54`](https://github.com/primer/css/commit/50221a5486d28c54dc1f578b459addd867bd01d3) Thanks [@langermank](https://github.com/langermank)! - Refactors NavigationList to better handle accessibility. Backwards compatible for TreeView CSS.
36
+
37
+ - [#1936](https://github.com/primer/css/pull/1936) [`c53ecdff`](https://github.com/primer/css/commit/c53ecdff5442cf4ac5da0d1e2ba45871ab662855) Thanks [@khiga8](https://github.com/khiga8)! - Deprecating `.tooltipped` CSS classes
38
+
39
+ ### Patch Changes
40
+
41
+ - [#1928](https://github.com/primer/css/pull/1928) [`0fb67895`](https://github.com/primer/css/commit/0fb6789555652860cfa5178b60433eb2c3d2575c) Thanks [@simurai](https://github.com/simurai)! - Fix `<sup><a>` from getting wrapped with `[ ]`
42
+
43
+ ## 19.3.0
44
+
45
+ ### Minor Changes
46
+
47
+ - [#1876](https://github.com/primer/css/pull/1876) [`bcf447ab`](https://github.com/primer/css/commit/bcf447ab226e6043dd47c1fcc395ba104af866d4) Thanks [@vdepizzol](https://github.com/vdepizzol)! - Add mono font stack to <samp> tag
48
+
49
+ * [#1919](https://github.com/primer/css/pull/1919) [`21085f5c`](https://github.com/primer/css/commit/21085f5c6cc538b5014a47de76642554a4291cc6) Thanks [@hectahertz](https://github.com/hectahertz)! - Add blankslate classes to replace utilities
50
+
51
+ ### Patch Changes
52
+
53
+ - [#1892](https://github.com/primer/css/pull/1892) [`55bd498b`](https://github.com/primer/css/commit/55bd498b7357e86659ac574f0f745f7b420fb6d3) Thanks [@langermank](https://github.com/langermank)! - Patch: Fix ActionList--divided for label with inline description scenarios
54
+
55
+ * [#1906](https://github.com/primer/css/pull/1906) [`f02d9a3e`](https://github.com/primer/css/commit/f02d9a3e4e86c2659a9f507995bcb90c5226e34e) Thanks [@jonrohan](https://github.com/jonrohan)! - Upgrading @primer/stylelint-config@12.3.0 and fixing violations
56
+
57
+ - [#1908](https://github.com/primer/css/pull/1908) [`84581e96`](https://github.com/primer/css/commit/84581e96aee50ff3883907dfe1069701edd1c24a) Thanks [@simurai](https://github.com/simurai)! - Reduce size of `Label--inline`
58
+
59
+ * [#1890](https://github.com/primer/css/pull/1890) [`74d0438b`](https://github.com/primer/css/commit/74d0438bd4dbaed447b553c5d3c8b945da282836) Thanks [@andrialexandrou](https://github.com/andrialexandrou)! - Adds --color-accent-emphasis and --color-fg-on-emphasis rules for Windows High Contrast Mode
60
+
61
+ - [#1882](https://github.com/primer/css/pull/1882) [`4a06aba1`](https://github.com/primer/css/commit/4a06aba1d3f80bcc228ff4360d0e02d5ace158ff) Thanks [@tqwewe](https://github.com/tqwewe)! - Fix layout gutter none styles
62
+
63
+ * [#1894](https://github.com/primer/css/pull/1894) [`d1adf595`](https://github.com/primer/css/commit/d1adf595308afb97f83c5ca172222944189a5961) Thanks [@simurai](https://github.com/simurai)! - Make `pagination` responsive by default
64
+
65
+ ## 19.2.0
4
66
 
5
67
  ### Minor Changes
6
68
 
@@ -12,7 +74,7 @@
12
74
 
13
75
  * [#1869](https://github.com/primer/css/pull/1869) [`868f61a1`](https://github.com/primer/css/commit/868f61a199df14862922d52905de66cdb1e1c192) Thanks [@jdanyow](https://github.com/jdanyow)! - Minor bugfix for AvatarStack. Removing the box-shadow from the AvatarStack-body on hover.
14
76
 
15
- - Fake entry to force publishing
77
+ - [#1856](https://github.com/primer/css/pull/1856) [`cbe3fb56`](https://github.com/primer/css/commit/cbe3fb56e4c7ee6bfe803eb0c15e15ab95d84157) Thanks [@langermank](https://github.com/langermank)! - ActionList item outlines for high contrast theme
16
78
 
17
79
  * [#1870](https://github.com/primer/css/pull/1870) [`815daff9`](https://github.com/primer/css/commit/815daff9f07d8096d572cf75bee17284f36492f6) Thanks [@vdepizzol](https://github.com/vdepizzol)! - [ActionList] Add hover to `aria-current` elements and other micro interactions
18
80
 
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img width="300px" src="./docs/src/readme.png">
2
+ <img width="300px" alt="" src="./docs/src/readme.png">
3
3
  </p>
4
4
 
5
5
  <h1 align="center">Primer CSS</h1>
@@ -14,7 +14,7 @@
14
14
  <img alt="" src="https://github.com/primer/css/actions/workflows/ci.yml/badge.svg">
15
15
  </a>
16
16
  <a aria-label="contributors graph" href="https://github.com/primer/css/graphs/contributors">
17
- <img src="https://img.shields.io/github/contributors/primer/css.svg">
17
+ <img alt="" src="https://img.shields.io/github/contributors/primer/css.svg">
18
18
  </a>
19
19
  <a aria-label="last commit" href="https://github.com/primer/css/commits/main">
20
20
  <img alt="" src="https://img.shields.io/github/last-commit/primer/css.svg">
@@ -4,7 +4,6 @@
4
4
  // has children
5
5
  &:not(:empty) {
6
6
  display: flex;
7
- // stylelint-disable-next-line primer/spacing
8
7
  padding: ($spacer-1 * 1.5) $spacer-2;
9
8
  font-size: $font-size-small;
10
9
  font-weight: $font-weight-bold;
@@ -14,6 +13,7 @@
14
13
 
15
14
  // no children
16
15
  &:empty {
16
+ display: block;
17
17
  height: 1px;
18
18
  padding: 0;
19
19
  // stylelint-disable-next-line primer/spacing
@@ -22,6 +22,12 @@
22
22
  background: var(--color-action-list-item-inline-divider);
23
23
  border: 0;
24
24
  }
25
+
26
+ .ActionList-sectionDivider-title {
27
+ font-size: $font-size-small;
28
+ font-weight: $font-weight-bold;
29
+ color: var(--color-fg-muted);
30
+ }
25
31
  }
26
32
 
27
33
  .ActionList-sectionDivider--filled {
@@ -1,4 +1,4 @@
1
- // stylelint-disable max-nesting-depth, selector-max-specificity
1
+ // stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors
2
2
 
3
3
  @mixin focusOutline {
4
4
  position: relative;
@@ -24,48 +24,57 @@
24
24
  list-style: none;
25
25
  background-color: transparent;
26
26
  border-radius: $border-radius;
27
- touch-action: manipulation;
28
- -webkit-tap-highlight-color: transparent;
29
27
 
30
28
  &:hover,
31
29
  &:active {
32
30
  cursor: pointer;
33
-
34
- // a href
35
- .ActionList-content {
36
- text-decoration: none;
37
- }
38
31
  }
39
32
 
40
33
  // only hover li without list as children
41
- &:not(.ActionList-item--hasSubItem) {
34
+ &:not(.ActionList-item--hasSubItem),
35
+ // target contents of first child li if sub-item (li wraps item label + nested ul)
36
+ &.ActionList-item--hasSubItem > .ActionList-content {
42
37
  @media (hover: hover) {
43
38
  &:hover {
44
39
  cursor: pointer;
45
40
  background-color: var(--color-action-list-item-default-hover-bg);
41
+
42
+ &:not(.ActionList-item--navActive) {
43
+ // Support for "Windows high contrast mode"
44
+ outline: $border-style $border-width transparent;
45
+ outline-offset: -$border-width;
46
+ // stylelint-disable-next-line primer/box-shadow
47
+ box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
48
+ }
46
49
  }
47
50
  }
48
51
 
49
52
  &:active {
50
53
  background: var(--color-action-list-item-default-active-bg);
51
54
 
55
+ &:not(.ActionList-item--navActive) {
56
+ // Support for "Windows high contrast mode" https://sarahmhigley.com/writing/whcm-quick-tips/
57
+ outline: $border-style $border-width transparent;
58
+ outline-offset: -$border-width;
59
+ // stylelint-disable-next-line primer/box-shadow
60
+ box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
61
+ }
62
+
52
63
  @media screen and (prefers-reduced-motion: no-preference) {
53
64
  animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
54
65
  }
55
66
 
56
- // stylelint-disable primer/box-shadow
57
67
  @keyframes ActionList-item-active-bg {
58
68
  50% {
59
- box-shadow: inset 0 0 0 rgba(#000, 0.04);
69
+ // stylelint-disable-next-line primer/box-shadow
70
+ box-shadow: inset 0 2px 12px 6px rgba(var(--color-canvas-default), 0.4);
60
71
  transform: scale(1);
61
72
  }
62
73
 
63
74
  100% {
64
- box-shadow: inset 0 3px 9px rgba(#000, 0.04);
65
75
  transform: scale(0.97);
66
76
  }
67
77
  }
68
- // stylelint-enable primer/box-shadow
69
78
  }
70
79
 
71
80
  // hide dividers
@@ -76,6 +85,11 @@
76
85
  + .ActionList-item .ActionList-item-label::before {
77
86
  visibility: hidden;
78
87
  }
88
+
89
+ .ActionList-item-descriptionWrap--inline::before,
90
+ + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
91
+ visibility: hidden;
92
+ }
79
93
  }
80
94
  }
81
95
  // stylelint-disable-next-line no-duplicate-selectors
@@ -136,101 +150,6 @@
136
150
  }
137
151
  }
138
152
 
139
- // collapsible item [aria-expanded]
140
-
141
- // nesting (single level)
142
- // target items inside expanded subgroups
143
- &[aria-expanded] {
144
- .ActionList--subGroup {
145
- @media screen and (prefers-reduced-motion: no-preference) {
146
- transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
147
- }
148
-
149
- .ActionList-content {
150
- padding-left: $spacer-4;
151
- }
152
- }
153
-
154
- // has 16px leading visual
155
- .ActionList-content--visual16 + .ActionList--subGroup {
156
- // stylelint-disable-next-line selector-max-compound-selectors
157
- .ActionList-content {
158
- padding-left: $spacer-5;
159
- }
160
- }
161
-
162
- // has 20px leading visual
163
- .ActionList-content--visual20 + .ActionList--subGroup {
164
- // stylelint-disable-next-line selector-max-compound-selectors
165
- .ActionList-content {
166
- padding-left: $spacer-2 * 4.5; // 36px
167
- }
168
- }
169
-
170
- // has 24px leading visual
171
- .ActionList-content--visual24 + .ActionList--subGroup {
172
- // stylelint-disable-next-line selector-max-compound-selectors
173
- .ActionList-content {
174
- padding-left: $spacer-6;
175
- }
176
- }
177
- }
178
-
179
- &[aria-expanded='true'] {
180
- .ActionList-item-collapseIcon {
181
- transition: transform 120ms linear;
182
- transform: scaleY(-1);
183
- }
184
-
185
- .ActionList--subGroup {
186
- height: auto;
187
- overflow: visible;
188
- visibility: visible;
189
- opacity: 1;
190
- transform: translateY(0);
191
- }
192
-
193
- &.ActionList-item--hasActiveSubItem {
194
- > .ActionList-content > .ActionList-item-label {
195
- font-weight: $font-weight-bold;
196
- }
197
- }
198
- }
199
-
200
- &[aria-expanded='false'] {
201
- .ActionList-item-collapseIcon {
202
- transition: transform 120ms linear;
203
- transform: scaleY(1);
204
- }
205
-
206
- .ActionList--subGroup {
207
- height: 0;
208
- overflow: hidden;
209
- visibility: hidden;
210
- opacity: 0;
211
- transform: translateY(-$spacer-3);
212
- }
213
-
214
- // show active indicator on parent collapse if child is active
215
- &.ActionList-item--hasActiveSubItem {
216
- background: var(--color-action-list-item-default-selected-bg);
217
-
218
- .ActionList-item-label {
219
- font-weight: $font-weight-bold;
220
- }
221
-
222
- &::before,
223
- + .ActionList-item::before {
224
- visibility: hidden;
225
- }
226
-
227
- // blue accent line
228
- &::after {
229
- @include activeIndicatorLine;
230
- }
231
- }
232
- }
233
-
234
153
  // checkbox item [aria-checked]
235
154
  // listbox [aria-selected]
236
155
 
@@ -345,26 +264,9 @@
345
264
  }
346
265
  }
347
266
 
348
- &:active {
349
- background: var(--color-action-list-item-danger-active-bg);
350
- }
351
- }
352
-
353
- // disabled
354
- &[aria-disabled='true'] {
355
- .ActionList-item-label,
356
- .ActionList-item-description {
357
- color: var(--color-primer-fg-disabled);
358
- }
359
-
360
- .ActionList-item-visual {
361
- fill: var(--color-primer-fg-disabled);
362
- }
363
-
364
- @media (hover: hover) {
365
- &:hover {
366
- cursor: not-allowed;
367
- background-color: transparent;
267
+ .ActionList-content {
268
+ &:active {
269
+ background: var(--color-action-list-item-danger-active-bg);
368
270
  }
369
271
  }
370
272
  }
@@ -376,19 +278,26 @@
376
278
  }
377
279
  }
378
280
 
379
- // span or a href
281
+ // button or a href
380
282
  .ActionList-content {
381
283
  position: relative;
382
284
  display: grid;
285
+ width: 100%;
383
286
  // stylelint-disable-next-line primer/spacing
384
287
  padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
385
288
  font-size: $body-font-size;
386
289
  font-weight: $font-weight-normal;
387
290
  color: var(--color-fg-default);
291
+ text-align: left;
388
292
  user-select: none;
389
- touch-action: manipulation;
293
+ background-color: transparent;
294
+ // stylelint-disable-next-line declaration-property-value-disallowed-list
295
+ border: none;
390
296
  border-radius: $border-radius;
391
297
  transition: $actionList-item-bg-transition;
298
+ touch-action: manipulation;
299
+ touch-action: manipulation;
300
+ -webkit-tap-highlight-color: transparent;
392
301
  grid-template-rows: min-content;
393
302
  grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
394
303
  grid-template-columns: min-content min-content minmax(0, auto) min-content min-content;
@@ -399,10 +308,127 @@
399
308
  margin-right: $spacer-2;
400
309
  }
401
310
 
311
+ // state
312
+
313
+ &:hover {
314
+ text-decoration: none;
315
+ }
316
+
402
317
  &:focus-visible {
403
318
  @include focusOutline;
404
319
  }
405
320
 
321
+ // disabled
322
+ &[aria-disabled='true'] {
323
+ .ActionList-item-label,
324
+ .ActionList-item-description {
325
+ color: var(--color-primer-fg-disabled);
326
+ }
327
+
328
+ .ActionList-item-visual {
329
+ fill: var(--color-primer-fg-disabled);
330
+ }
331
+
332
+ @media (hover: hover) {
333
+ &:hover {
334
+ cursor: not-allowed;
335
+ background-color: transparent;
336
+ }
337
+ }
338
+ }
339
+
340
+ // collapsible item [aria-expanded]
341
+
342
+ // nesting (single level)
343
+ // target items inside expanded subgroups
344
+ &[aria-expanded] {
345
+ + .ActionList--subGroup {
346
+ @media screen and (prefers-reduced-motion: no-preference) {
347
+ transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
348
+ }
349
+
350
+ .ActionList-content {
351
+ padding-left: $spacer-4;
352
+ }
353
+ }
354
+
355
+ // has 16px leading visual
356
+ &.ActionList-content--visual16 + .ActionList--subGroup {
357
+ .ActionList-content {
358
+ padding-left: $spacer-5;
359
+ }
360
+ }
361
+
362
+ // has 20px leading visual
363
+ &.ActionList-content--visual20 + .ActionList--subGroup {
364
+ .ActionList-content {
365
+ padding-left: $spacer-2 * 4.5; // 36px
366
+ }
367
+ }
368
+
369
+ // has 24px leading visual
370
+ &.ActionList-content--visual24 + .ActionList--subGroup {
371
+ .ActionList-content {
372
+ padding-left: $spacer-6;
373
+ }
374
+ }
375
+ }
376
+
377
+ &[aria-expanded='true'] {
378
+ .ActionList-item-collapseIcon {
379
+ transition: transform 120ms linear;
380
+ transform: scaleY(-1);
381
+ }
382
+
383
+ + .ActionList--subGroup {
384
+ height: auto;
385
+ overflow: visible;
386
+ visibility: visible;
387
+ opacity: 1;
388
+ transform: translateY(0);
389
+ }
390
+
391
+ &.ActionList-content--hasActiveSubItem {
392
+ > .ActionList-item-label {
393
+ font-weight: $font-weight-bold;
394
+ }
395
+ }
396
+ }
397
+
398
+ &[aria-expanded='false'] {
399
+ .ActionList-item-collapseIcon {
400
+ transition: transform 120ms linear;
401
+ transform: scaleY(1);
402
+ }
403
+
404
+ + .ActionList--subGroup {
405
+ height: 0;
406
+ overflow: hidden;
407
+ visibility: hidden;
408
+ opacity: 0;
409
+ transform: translateY(-$spacer-3);
410
+ }
411
+
412
+ // show active indicator on parent collapse if child is active
413
+ &.ActionList-content--hasActiveSubItem {
414
+ background: var(--color-action-list-item-default-selected-bg);
415
+
416
+ .ActionList-item-label {
417
+ font-weight: $font-weight-bold;
418
+ }
419
+
420
+ &::before,
421
+ + .ActionList-item::before {
422
+ visibility: hidden;
423
+ }
424
+
425
+ // blue accent line
426
+ &::after {
427
+ @include activeIndicatorLine;
428
+ }
429
+ }
430
+ }
431
+
406
432
  // sizes
407
433
 
408
434
  &.ActionList-content--sizeMedium {
@@ -475,6 +501,7 @@
475
501
 
476
502
  // inline
477
503
  .ActionList-item-descriptionWrap--inline {
504
+ position: relative;
478
505
  flex-direction: row;
479
506
  align-items: baseline;
480
507
 
@@ -1,9 +1,21 @@
1
+ // stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, no-duplicate-selectors, selector-max-type
1
2
  // tree-view variant
2
3
  // renders ActionList with default styling for tree-view
3
4
  // collapse/expand icons presents as leadingActions, rotate 90deg
4
5
  // connecting vertical lines between collapse groups
5
6
  // consistent font-size between nested groups
6
7
 
8
+ @mixin activeIndicatorLine {
9
+ position: absolute;
10
+ top: calc(50% - 12px);
11
+ left: -$actionList-item-padding-horizontal;
12
+ width: $spacer-1;
13
+ height: $spacer-4;
14
+ content: '';
15
+ background: var(--color-accent-fg);
16
+ border-radius: $border-radius;
17
+ }
18
+
7
19
  @mixin treeConnectingLine($left) {
8
20
  position: absolute;
9
21
  left: $left;
@@ -21,6 +33,94 @@
21
33
  }
22
34
 
23
35
  .ActionList-item {
36
+ // class for single tree items not within a group
37
+ &.ActionList-item--singleton {
38
+ .ActionList-content {
39
+ padding-left: $spacer-5;
40
+ }
41
+ }
42
+
43
+ // start: copy from ActionList proper- backwards compatible for treeview with different markup structure
44
+ &[aria-expanded] {
45
+ .ActionList--subGroup {
46
+ @media screen and (prefers-reduced-motion: no-preference) {
47
+ transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
48
+ }
49
+
50
+ .ActionList-content {
51
+ padding-left: $spacer-4;
52
+ }
53
+ }
54
+
55
+ // has 16px leading visual
56
+ .ActionList-content--visual16 + .ActionList--subGroup {
57
+ .ActionList-content {
58
+ padding-left: $spacer-5;
59
+ }
60
+ }
61
+
62
+ // has 20px leading visual
63
+ .ActionList-content--visual20 + .ActionList--subGroup {
64
+ .ActionList-content {
65
+ padding-left: $spacer-2 * 4.5; // 36px
66
+ }
67
+ }
68
+
69
+ // has 24px leading visual
70
+ .ActionList-content--visual24 + .ActionList--subGroup {
71
+ .ActionList-content {
72
+ padding-left: $spacer-6;
73
+ }
74
+ }
75
+ }
76
+
77
+ &[aria-expanded='true'] {
78
+ .ActionList-item-collapseIcon {
79
+ transition: transform 120ms linear;
80
+ transform: scaleY(-1);
81
+ }
82
+
83
+ .ActionList--subGroup {
84
+ height: auto;
85
+ overflow: visible;
86
+ visibility: visible;
87
+ opacity: 1;
88
+ transform: translateY(0);
89
+ }
90
+ }
91
+
92
+ &[aria-expanded='false'] {
93
+ .ActionList-item-collapseIcon {
94
+ transition: transform 120ms linear;
95
+ transform: scaleY(1);
96
+ }
97
+
98
+ .ActionList--subGroup {
99
+ height: 0;
100
+ overflow: hidden;
101
+ visibility: hidden;
102
+ opacity: 0;
103
+ transform: translateY(-$spacer-3);
104
+ }
105
+
106
+ // show active indicator on parent collapse if child is active
107
+ // this class changed in ActionList proper
108
+ &.ActionList-item--hasActiveSubItem {
109
+ background: var(--color-action-list-item-default-selected-bg);
110
+
111
+ &::before,
112
+ + .ActionList-item::before {
113
+ visibility: hidden;
114
+ }
115
+
116
+ // blue accent line
117
+ &::after {
118
+ @include activeIndicatorLine;
119
+ }
120
+ }
121
+ }
122
+ // end copy
123
+
24
124
  // nesting (infinate levels)
25
125
  // target items inside expanded subgroup
26
126
  &[aria-expanded] {
@@ -28,7 +128,6 @@
28
128
  position: relative;
29
129
 
30
130
  // --ActionList-tree-depth is defined as an inline style referencing the aria-level of each item ie: aria-level="2"
31
- // stylelint-disable-next-line selector-max-specificity, max-nesting-depth, selector-max-compound-selectors
32
131
  .ActionList-content {
33
132
  // stylelint-disable-next-line primer/spacing
34
133
  padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
@@ -55,11 +154,9 @@
55
154
  // expand/collapse group
56
155
  .ActionList-item--hasSubItem {
57
156
  .ActionList-item--subItem:not(.ActionList-item--hasSubItem) {
58
- // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
59
157
  .ActionList-content {
60
158
  // increase child padding by targeting content first child span (add to ActionList-content padding, not replace)
61
159
  // creates a slight indent of child items
62
- // stylelint-disable-next-line selector-max-specificity, selector-max-type, max-nesting-depth, selector-max-compound-selectors
63
160
  > span:first-child {
64
161
  padding-left: $spacer-4;
65
162
  }
@@ -70,7 +167,6 @@
70
167
  // first subitem
71
168
  > [aria-level='1'].ActionList-item--hasSubItem {
72
169
  > .ActionList--subGroup {
73
- // stylelint-disable-next-line selector-max-specificity
74
170
  &::before {
75
171
  @include treeConnectingLine($left: $spacer-3);
76
172
  }
@@ -81,7 +177,6 @@
81
177
  // center connecting line with parent (line is 1px (8px - 1px)
82
178
  .ActionList-item--hasSubItem:not([aria-level='1']) {
83
179
  > .ActionList--subGroup {
84
- // stylelint-disable-next-line selector-max-specificity
85
180
  &::before {
86
181
  @include treeConnectingLine(
87
182
  $left: calc(#{$spacer-2} * (var(--ActionList-tree-depth)) + #{$spacer-2 - $border-width})