@primer/css 0.0.0-2022020193741 → 0.0.0-20220202015422

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 (150) hide show
  1. package/CHANGELOG.md +65 -6
  2. package/actionlist/action-list-item-divider.scss +0 -2
  3. package/actionlist/action-list-item.scss +126 -60
  4. package/actionlist/action-list-tree.scss +91 -0
  5. package/actionlist/action-list.scss +24 -0
  6. package/actionlist/index.scss +1 -0
  7. package/autocomplete/autocomplete.scss +1 -1
  8. package/avatars/avatar-stack.scss +1 -0
  9. package/base/base.scss +1 -0
  10. package/base/index.scss +0 -1
  11. package/base/kbd.scss +0 -1
  12. package/base/normalize.scss +1 -1
  13. package/base/typography-base.scss +3 -2
  14. package/blankslate/blankslate.scss +20 -1
  15. package/blankslate/index.scss +0 -1
  16. package/box/box.scss +0 -3
  17. package/breadcrumb/breadcrumb.scss +1 -1
  18. package/buttons/button-group.scss +3 -2
  19. package/buttons/button.scss +1 -35
  20. package/buttons/misc.scss +6 -7
  21. package/color-modes/native.scss +12 -0
  22. package/color-modes/themes/dark.scss +0 -1
  23. package/color-modes/themes/dark_colorblind.scss +0 -1
  24. package/color-modes/themes/dark_dimmed.scss +0 -1
  25. package/color-modes/themes/dark_high_contrast.scss +0 -1
  26. package/color-modes/themes/light.scss +0 -1
  27. package/color-modes/themes/light_colorblind.scss +0 -1
  28. package/color-modes/themes/light_high_contrast.scss +0 -1
  29. package/dist/actionlist.css +1 -1
  30. package/dist/actionlist.css.map +1 -1
  31. package/dist/alerts.css.map +1 -1
  32. package/dist/autocomplete.css.map +1 -1
  33. package/dist/avatars.css +1 -1
  34. package/dist/avatars.css.map +1 -1
  35. package/dist/base.css +1 -1
  36. package/dist/base.css.map +1 -1
  37. package/dist/blankslate.css +1 -1
  38. package/dist/blankslate.css.map +1 -1
  39. package/dist/box.css.map +1 -1
  40. package/dist/branch-name.css.map +1 -1
  41. package/dist/breadcrumb.css.map +1 -1
  42. package/dist/buttons.css +1 -1
  43. package/dist/buttons.css.map +1 -1
  44. package/dist/color-modes.css +1 -1
  45. package/dist/color-modes.css.map +1 -1
  46. package/dist/core.css +1 -1
  47. package/dist/core.css.map +1 -1
  48. package/dist/dropdown.css.map +1 -1
  49. package/dist/forms.css.map +1 -1
  50. package/dist/header.css.map +1 -1
  51. package/dist/labels.css +1 -1
  52. package/dist/labels.css.map +1 -1
  53. package/dist/layout.css +1 -1
  54. package/dist/layout.css.map +1 -1
  55. package/dist/links.css.map +1 -1
  56. package/dist/loaders.css.map +1 -1
  57. package/dist/markdown.css +1 -1
  58. package/dist/markdown.css.map +1 -1
  59. package/dist/marketing-buttons.css +1 -1
  60. package/dist/marketing-buttons.css.map +1 -1
  61. package/dist/marketing-links.css +2 -0
  62. package/dist/marketing-links.css.map +1 -0
  63. package/dist/marketing-links.js +1 -0
  64. package/dist/marketing-type.css.map +1 -1
  65. package/dist/marketing-utilities.css +1 -1
  66. package/dist/marketing-utilities.css.map +1 -1
  67. package/dist/marketing.css +1 -1
  68. package/dist/marketing.css.map +1 -1
  69. package/dist/meta.json +106 -95
  70. package/dist/navigation.css.map +1 -1
  71. package/dist/pagination.css +1 -1
  72. package/dist/pagination.css.map +1 -1
  73. package/dist/popover.css +1 -1
  74. package/dist/popover.css.map +1 -1
  75. package/dist/primer.css +4 -4
  76. package/dist/primer.css.map +1 -1
  77. package/dist/product.css +1 -1
  78. package/dist/product.css.map +1 -1
  79. package/dist/progress.css.map +1 -1
  80. package/dist/select-menu.css.map +1 -1
  81. package/dist/stats/actionlist.json +1 -1
  82. package/dist/stats/avatars.json +1 -1
  83. package/dist/stats/base.json +1 -1
  84. package/dist/stats/blankslate.json +1 -1
  85. package/dist/stats/buttons.json +1 -1
  86. package/dist/stats/color-modes.json +1 -1
  87. package/dist/stats/core.json +1 -1
  88. package/dist/stats/labels.json +1 -1
  89. package/dist/stats/layout.json +1 -1
  90. package/dist/stats/markdown.json +1 -1
  91. package/dist/stats/marketing-buttons.json +1 -1
  92. package/dist/stats/marketing-links.json +1 -0
  93. package/dist/stats/marketing-utilities.json +1 -1
  94. package/dist/stats/marketing.json +1 -1
  95. package/dist/stats/pagination.json +1 -1
  96. package/dist/stats/popover.json +1 -1
  97. package/dist/stats/primer.json +1 -1
  98. package/dist/stats/product.json +1 -1
  99. package/dist/stats/utilities.json +1 -1
  100. package/dist/subhead.css.map +1 -1
  101. package/dist/table-object.css.map +1 -1
  102. package/dist/timeline.css.map +1 -1
  103. package/dist/toasts.css.map +1 -1
  104. package/dist/tooltips.css.map +1 -1
  105. package/dist/truncate.css.map +1 -1
  106. package/dist/utilities.css +1 -1
  107. package/dist/utilities.css.map +1 -1
  108. package/dist/variables.json +7 -7
  109. package/forms/form-control.scss +3 -0
  110. package/forms/form-group.scss +1 -0
  111. package/forms/radio-group.scss +0 -3
  112. package/labels/counters.scss +1 -1
  113. package/labels/index.scss +0 -1
  114. package/labels/labels.scss +1 -0
  115. package/labels/mixins.scss +6 -2
  116. package/layout/grid-offset.scss +1 -0
  117. package/layout/grid.scss +1 -0
  118. package/layout/index.scss +1 -1
  119. package/layout/layout.scss +8 -11
  120. package/layout/mixins.scss +30 -4
  121. package/layout/page-layout.scss +375 -0
  122. package/markdown/code.scss +5 -0
  123. package/markdown/images.scss +2 -2
  124. package/marketing/buttons/button.scss +8 -0
  125. package/marketing/index.scss +1 -0
  126. package/marketing/links/index.scss +3 -0
  127. package/marketing/links/link.scss +50 -0
  128. package/marketing/type/typography.scss +6 -0
  129. package/marketing/utilities/animations.scss +42 -0
  130. package/navigation/filter-list.scss +2 -2
  131. package/navigation/menu.scss +2 -2
  132. package/navigation/sidenav.scss +2 -2
  133. package/navigation/subnav.scss +2 -2
  134. package/navigation/tabnav.scss +2 -2
  135. package/navigation/underline-nav.scss +2 -2
  136. package/package.json +19 -18
  137. package/pagination/pagination.scss +41 -4
  138. package/popover/popover.scss +1 -2
  139. package/select-menu/select-menu.scss +2 -2
  140. package/stylelint.config.cjs +2 -11
  141. package/support/mixins/color-modes.scss +3 -0
  142. package/support/mixins/misc.scss +1 -16
  143. package/support/mixins/typography.scss +3 -2
  144. package/support/variables/layout.scss +1 -2
  145. package/table-object/table-object.scss +3 -0
  146. package/timeline/timeline-item.scss +0 -1
  147. package/utilities/margin.scss +4 -1
  148. package/utilities/padding.scss +3 -1
  149. package/utilities/visibility-display.scss +3 -3
  150. package/table-object/README.md +0 -25
package/CHANGELOG.md CHANGED
@@ -1,22 +1,81 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-2022020193741
3
+ ## 0.0.0-20220202015422
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ * [#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
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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
14
+
15
+ * Fake entry to force publishing
16
+
17
+ - [#1906](https://github.com/primer/css/pull/1906) [`89bbf002`](https://github.com/primer/css/commit/89bbf0029beeab29116a460538bbd03e784cef92) Thanks [@jonrohan](https://github.com/jonrohan)! - Upgrading @primer/stylelint-config@12.3.0 and fixing violations
18
+
19
+ * [#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`
20
+
21
+ - [#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
22
+
23
+ * [#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
24
+
25
+ - [#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
26
+
27
+ ## 19.2.0
28
+
29
+ ### Minor Changes
30
+
31
+ - [#1737](https://github.com/primer/css/pull/1737) [`6b4089d8`](https://github.com/primer/css/commit/6b4089d8b37174ca061762c56b5e4134a54cf4ef) Thanks [@vdepizzol](https://github.com/vdepizzol)! - Adds new PageLayout component CSS with Storybook documentation
32
+
33
+ ### Patch Changes
34
+
35
+ - [#1855](https://github.com/primer/css/pull/1855) [`8f2e7534`](https://github.com/primer/css/commit/8f2e7534ecbdb3d0e773d60c725b55dc4bb263e2) Thanks [@simurai](https://github.com/simurai)! - Bump primer/primitives to `7.4.0`
36
+
37
+ * [#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.
38
+
39
+ - [#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
40
+
41
+ * [#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
42
+
43
+ ## 19.1.1
44
+
45
+ ### Patch Changes
46
+
47
+ - [#1827](https://github.com/primer/css/pull/1827) [`69e1fc53`](https://github.com/primer/css/commit/69e1fc539e4bb2fdf78d34a18fc591ebdfddd2f5) Thanks [@simurai](https://github.com/simurai)! - Support fractional viewport sizes for `max-width` media queries
48
+
49
+ * [#1803](https://github.com/primer/css/pull/1803) [`c46fe918`](https://github.com/primer/css/commit/c46fe9186efbcf6e4a482685529bdb0bda28aa9f) Thanks [@langermank](https://github.com/langermank)! - - Adds ActionList tree-view specific CSS
50
+ - Minor bug fixes for ActionList default
51
+
52
+ - [#1827](https://github.com/primer/css/pull/1827) [`69e1fc53`](https://github.com/primer/css/commit/69e1fc539e4bb2fdf78d34a18fc591ebdfddd2f5) Thanks [@simurai](https://github.com/simurai)! - Support fractional viewport sizes for the `hide` utilities
53
+
54
+ ## 19.1.0
4
55
 
5
56
  ### Minor Changes
6
57
 
7
58
  - [#1759](https://github.com/primer/css/pull/1759) [`74724ce7`](https://github.com/primer/css/commit/74724ce7c72b1cb540a9ef3d845169f1df17b55e) Thanks [@langermank](https://github.com/langermank)! - Remove `popover` responsive hack
8
59
 
60
+ * [#1807](https://github.com/primer/css/pull/1807) [`13a4654f`](https://github.com/primer/css/commit/13a4654fa0854accfaabbbd2f21d2e0a1c90442d) Thanks [@enstyled](https://github.com/enstyled)! - Marketing: Add link components
61
+ Marketing: Add animated arrow utility
62
+ Marketing: Document button components with arrows
63
+
9
64
  ### Patch Changes
10
65
 
11
- - Fake entry to force publishing
66
+ - [#1780](https://github.com/primer/css/pull/1780) [`8e9ba62d`](https://github.com/primer/css/commit/8e9ba62d30ed10c012b99dd998751df01ad6aa99) Thanks [@langermank](https://github.com/langermank)! - ActionList followup
67
+
68
+ * [#1805](https://github.com/primer/css/pull/1805) [`99537d31`](https://github.com/primer/css/commit/99537d317f04ff5474a076ab96d3ea315b2181e2) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Fix local dev (revert webpack 5.5.0 → 6.0.0)
69
+
70
+ - [#1781](https://github.com/primer/css/pull/1781) [`4d8dcf24`](https://github.com/primer/css/commit/4d8dcf24bc9e0732a9a2f34c94f6bcad7d3382dd) Thanks [@simurai](https://github.com/simurai)! - Reformat `rgba()` colors for `.btn-mktg`
12
71
 
13
- * [#1780](https://github.com/primer/css/pull/1780) [`8e9ba62d`](https://github.com/primer/css/commit/8e9ba62d30ed10c012b99dd998751df01ad6aa99) Thanks [@langermank](https://github.com/langermank)! - ActionList followup
72
+ * [#1768](https://github.com/primer/css/pull/1768) [`4abb1af9`](https://github.com/primer/css/commit/4abb1af95b9b3c8c38512fa5e1e4fae9e7d01f4f) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Marketing: Add disabled states for buttons (and tweak hover)
14
73
 
15
- - [#1805](https://github.com/primer/css/pull/1805) [`99537d31`](https://github.com/primer/css/commit/99537d317f04ff5474a076ab96d3ea315b2181e2) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Fix local dev (revert webpack 5.5.0 → 6.0.0)
74
+ - [#1792](https://github.com/primer/css/pull/1792) [`b1c43f1f`](https://github.com/primer/css/commit/b1c43f1f8d9b07b58b275665ca69abd5d4f7a5fc) Thanks [@simurai](https://github.com/simurai)! - Use `counter-border` for LHC
16
75
 
17
- * [#1781](https://github.com/primer/css/pull/1781) [`4d8dcf24`](https://github.com/primer/css/commit/4d8dcf24bc9e0732a9a2f34c94f6bcad7d3382dd) Thanks [@simurai](https://github.com/simurai)! - Reformat `rgba()` colors for `.btn-mktg`
76
+ * [#1808](https://github.com/primer/css/pull/1808) [`ee27583f`](https://github.com/primer/css/commit/ee27583f594248bd44122ea5dc81b12382c02b09) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Add hover and active states to btn-invisible
18
77
 
19
- - [#1808](https://github.com/primer/css/pull/1808) [`ee27583f`](https://github.com/primer/css/commit/ee27583f594248bd44122ea5dc81b12382c02b09) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Add hover and active states to btn-invisible
78
+ - [#1818](https://github.com/primer/css/pull/1818) [`22c29e7a`](https://github.com/primer/css/commit/22c29e7a8b1b6a0df1dd61d400cc0dd132e0c909) Thanks [@vdepizzol](https://github.com/vdepizzol)! - [Layout component] Avoid resizing `main` while loading
20
79
 
21
80
  ## 19.0.0
22
81
 
@@ -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;
@@ -16,7 +15,6 @@
16
15
  &:empty {
17
16
  height: 1px;
18
17
  padding: 0;
19
- // stylelint-disable-next-line primer/spacing
20
18
  margin: ($spacer-2 - 1px) ($spacer-2 * -1) $spacer-2;
21
19
  list-style: none;
22
20
  background: var(--color-action-list-item-inline-divider);
@@ -1,3 +1,5 @@
1
+ // stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors
2
+
1
3
  @mixin focusOutline {
2
4
  position: relative;
3
5
  z-index: 1;
@@ -22,6 +24,8 @@
22
24
  list-style: none;
23
25
  background-color: transparent;
24
26
  border-radius: $border-radius;
27
+ touch-action: manipulation;
28
+ -webkit-tap-highlight-color: transparent;
25
29
 
26
30
  &:hover,
27
31
  &:active {
@@ -34,40 +38,69 @@
34
38
  }
35
39
 
36
40
  // only hover li without list as children
37
- &:not(.ActionList-item--hasSubItem) {
38
- &:hover {
39
- cursor: pointer;
40
- background-color: var(--color-action-list-item-default-hover-bg);
41
+ &:not(.ActionList-item--hasSubItem),
42
+ // target contents of first child li if sub-item (li wraps item label + nested ul)
43
+ &.ActionList-item--hasSubItem > .ActionList-content {
44
+ @media (hover: hover) {
45
+ &:hover {
46
+ cursor: pointer;
47
+ background-color: var(--color-action-list-item-default-hover-bg);
48
+
49
+ &:not(.ActionList-item--navActive) {
50
+ // Support for "Windows high contrast mode"
51
+ outline: $border-style $border-width transparent;
52
+ outline-offset: -$border-width;
53
+ // stylelint-disable-next-line primer/box-shadow
54
+ box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
55
+ }
56
+ }
41
57
  }
42
58
 
43
59
  &:active {
44
60
  background: var(--color-action-list-item-default-active-bg);
45
61
 
62
+ &:not(.ActionList-item--navActive) {
63
+ // Support for "Windows high contrast mode" https://sarahmhigley.com/writing/whcm-quick-tips/
64
+ outline: $border-style $border-width transparent;
65
+ outline-offset: -$border-width;
66
+ // stylelint-disable-next-line primer/box-shadow
67
+ box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
68
+ }
69
+
46
70
  @media screen and (prefers-reduced-motion: no-preference) {
47
71
  animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
48
72
  }
49
73
 
50
- // stylelint-disable primer/box-shadow
51
74
  @keyframes ActionList-item-active-bg {
52
- // stylelint-disable-next-line max-nesting-depth
53
75
  50% {
54
- box-shadow: inset 0 0 0 rgba(#000, 0.04);
76
+ // stylelint-disable-next-line primer/box-shadow
77
+ box-shadow: inset 0 2px 12px 6px rgba(var(--color-canvas-default), 0.4);
55
78
  transform: scale(1);
56
79
  }
57
80
 
58
- // stylelint-disable-next-line max-nesting-depth
59
81
  100% {
60
- box-shadow: inset 0 3px 9px rgba(#000, 0.04);
61
82
  transform: scale(0.97);
62
83
  }
63
84
  }
64
- // stylelint-enable primer/box-shadow
65
85
  }
66
86
 
67
- &:hover,
87
+ // hide dividers
88
+
89
+ @media (hover: hover) {
90
+ &:hover {
91
+ .ActionList-item-label::before,
92
+ + .ActionList-item .ActionList-item-label::before {
93
+ visibility: hidden;
94
+ }
95
+
96
+ .ActionList-item-descriptionWrap--inline::before,
97
+ + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
98
+ visibility: hidden;
99
+ }
100
+ }
101
+ }
102
+ // stylelint-disable-next-line no-duplicate-selectors
68
103
  &:active {
69
- // hide dividers
70
- // stylelint-disable-next-line selector-max-specificity
71
104
  .ActionList-item-label::before,
72
105
  + .ActionList-item .ActionList-item-label::before {
73
106
  visibility: hidden;
@@ -80,8 +113,16 @@
80
113
  &.ActionList-item--hasSubItem {
81
114
  // first child
82
115
  > .ActionList-content {
83
- &:hover {
84
- background-color: var(--color-action-list-item-default-hover-bg);
116
+ z-index: 1;
117
+
118
+ @media (hover: hover) {
119
+ &:hover {
120
+ background-color: var(--color-action-list-item-default-hover-bg);
121
+ }
122
+ }
123
+
124
+ &:active {
125
+ background-color: var(--color-action-list-item-default-active-bg);
85
126
  }
86
127
  }
87
128
  }
@@ -98,7 +139,12 @@
98
139
  &:not(.ActionList-item--danger) {
99
140
  background: var(--color-action-list-item-default-selected-bg);
100
141
 
101
- // stylelint-disable-next-line selector-max-specificity
142
+ @media (hover: hover) {
143
+ &:hover {
144
+ background-color: var(--color-action-list-item-default-hover-bg);
145
+ }
146
+ }
147
+
102
148
  &::before,
103
149
  + .ActionList-item::before {
104
150
  visibility: hidden;
@@ -113,6 +159,41 @@
113
159
 
114
160
  // collapsible item [aria-expanded]
115
161
 
162
+ // nesting (single level)
163
+ // target items inside expanded subgroups
164
+ &[aria-expanded] {
165
+ .ActionList--subGroup {
166
+ @media screen and (prefers-reduced-motion: no-preference) {
167
+ transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
168
+ }
169
+
170
+ .ActionList-content {
171
+ padding-left: $spacer-4;
172
+ }
173
+ }
174
+
175
+ // has 16px leading visual
176
+ .ActionList-content--visual16 + .ActionList--subGroup {
177
+ .ActionList-content {
178
+ padding-left: $spacer-5;
179
+ }
180
+ }
181
+
182
+ // has 20px leading visual
183
+ .ActionList-content--visual20 + .ActionList--subGroup {
184
+ .ActionList-content {
185
+ padding-left: $spacer-2 * 4.5; // 36px
186
+ }
187
+ }
188
+
189
+ // has 24px leading visual
190
+ .ActionList-content--visual24 + .ActionList--subGroup {
191
+ .ActionList-content {
192
+ padding-left: $spacer-6;
193
+ }
194
+ }
195
+ }
196
+
116
197
  &[aria-expanded='true'] {
117
198
  .ActionList-item-collapseIcon {
118
199
  transition: transform 120ms linear;
@@ -120,11 +201,14 @@
120
201
  }
121
202
 
122
203
  .ActionList--subGroup {
123
- display: block;
204
+ height: auto;
205
+ overflow: visible;
206
+ visibility: visible;
207
+ opacity: 1;
208
+ transform: translateY(0);
124
209
  }
125
210
 
126
211
  &.ActionList-item--hasActiveSubItem {
127
- // stylelint-disable-next-line selector-max-specificity
128
212
  > .ActionList-content > .ActionList-item-label {
129
213
  font-weight: $font-weight-bold;
130
214
  }
@@ -138,7 +222,11 @@
138
222
  }
139
223
 
140
224
  .ActionList--subGroup {
141
- display: none;
225
+ height: 0;
226
+ overflow: hidden;
227
+ visibility: hidden;
228
+ opacity: 0;
229
+ transform: translateY(-$spacer-3);
142
230
  }
143
231
 
144
232
  // show active indicator on parent collapse if child is active
@@ -149,7 +237,6 @@
149
237
  font-weight: $font-weight-bold;
150
238
  }
151
239
 
152
- // stylelint-disable-next-line selector-max-specificity
153
240
  &::before,
154
241
  + .ActionList-item::before {
155
242
  visibility: hidden;
@@ -204,7 +291,7 @@
204
291
  visibility: hidden;
205
292
  opacity: 0;
206
293
  transition:
207
- visibility 0 linear $actionList-item-checkmark-transition-timing,
294
+ visibility 0 linear $actionList-item-checkmark-transition-timing,
208
295
  opacity $actionList-item-checkmark-transition-timing;
209
296
  }
210
297
 
@@ -266,11 +353,10 @@
266
353
  color: var(--color-danger-fg);
267
354
  }
268
355
 
269
- @media (hover: hover) and (pointer: fine) {
356
+ @media (hover: hover) {
270
357
  &:hover {
271
358
  background: var(--color-action-list-item-danger-hover-bg);
272
359
 
273
- // stylelint-disable-next-line max-nesting-depth
274
360
  .ActionList-item-label {
275
361
  color: var(--color-action-list-item-danger-hover-text);
276
362
  }
@@ -293,7 +379,7 @@
293
379
  fill: var(--color-primer-fg-disabled);
294
380
  }
295
381
 
296
- @media (hover: hover) and (pointer: fine) {
382
+ @media (hover: hover) {
297
383
  &:hover {
298
384
  cursor: not-allowed;
299
385
  background-color: transparent;
@@ -303,7 +389,6 @@
303
389
 
304
390
  // if nested list exists, remove default padding
305
391
  .ActionList {
306
- // stylelint-disable-next-line primer/spacing
307
392
  padding: unset;
308
393
  }
309
394
  }
@@ -312,17 +397,18 @@
312
397
  .ActionList-content {
313
398
  position: relative;
314
399
  display: grid;
315
- // stylelint-disable-next-line primer/spacing
316
400
  padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
401
+ font-size: $body-font-size;
317
402
  font-weight: $font-weight-normal;
318
403
  color: var(--color-fg-default);
319
404
  user-select: none;
405
+ touch-action: manipulation;
320
406
  border-radius: $border-radius;
321
407
  transition: $actionList-item-bg-transition;
322
408
  grid-template-rows: min-content;
323
409
  grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
324
- grid-template-columns: min-content min-content minmax(min-content, auto) min-content min-content;
325
- align-items: center;
410
+ grid-template-columns: min-content min-content minmax(0, auto) min-content min-content;
411
+ align-items: start;
326
412
 
327
413
  // column-gap persists with empty grid-areas, margin applies only when children exist
328
414
  > :not(:last-child) {
@@ -337,19 +423,20 @@
337
423
 
338
424
  &.ActionList-content--sizeMedium {
339
425
  // 44px total height
340
- // stylelint-disable-next-line primer/spacing
341
426
  padding: $actionList-item-padding-vertical-md $actionList-item-padding-horizontal;
342
427
  }
343
428
 
344
429
  &.ActionList-content--sizeLarge {
345
430
  // 48px total height
346
- // stylelint-disable-next-line primer/spacing
347
431
  padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
348
432
  }
349
433
 
434
+ &.ActionList-content--fontSmall {
435
+ font-size: $font-size-small;
436
+ }
437
+
350
438
  // On pointer:coarse (mobile), all list items are large
351
439
  @media (pointer: coarse) {
352
- // stylelint-disable-next-line primer/spacing
353
440
  padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
354
441
  }
355
442
 
@@ -401,11 +488,11 @@
401
488
 
402
489
  // inline
403
490
  .ActionList-item-descriptionWrap--inline {
491
+ position: relative;
404
492
  flex-direction: row;
405
493
  align-items: baseline;
406
494
 
407
495
  .ActionList-item-description {
408
- // stylelint-disable-next-line primer/spacing
409
496
  margin-left: $actionList-item-padding-horizontal;
410
497
  }
411
498
  }
@@ -440,37 +527,16 @@
440
527
  color: var(--color-fg-default);
441
528
  }
442
529
 
530
+ .ActionList-item-label--truncate {
531
+ overflow: hidden;
532
+ text-overflow: ellipsis;
533
+ white-space: nowrap;
534
+ }
535
+
443
536
  // nested lists (only supports 1 level currently)
444
537
  // target ActionList-item--subItem for padding-left to maintain :active :after state
445
538
 
539
+ // TODO: remove with PVC implementation
446
540
  .ActionList-item--subItem > .ActionList-content {
447
541
  font-size: $font-size-small;
448
542
  }
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,91 @@
1
+ // tree-view variant
2
+ // renders ActionList with default styling for tree-view
3
+ // collapse/expand icons presents as leadingActions, rotate 90deg
4
+ // connecting vertical lines between collapse groups
5
+ // consistent font-size between nested groups
6
+
7
+ @mixin treeConnectingLine($left) {
8
+ position: absolute;
9
+ left: $left;
10
+ width: 1px;
11
+ height: 100%;
12
+ content: '';
13
+ background: var(--color-action-list-item-inline-divider);
14
+ }
15
+
16
+ .ActionList--tree {
17
+ --ActionList-tree-depth: 1;
18
+ // TODO: remove with PVC implementation
19
+ .ActionList-item--subItem > .ActionList-content {
20
+ font-size: $body-font-size;
21
+ }
22
+
23
+ .ActionList-item {
24
+ // nesting (infinate levels)
25
+ // target items inside expanded subgroup
26
+ &[aria-expanded] {
27
+ .ActionList--subGroup {
28
+ position: relative;
29
+
30
+ // --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
+ .ActionList-content {
33
+ padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
34
+ }
35
+ }
36
+ }
37
+
38
+ // tree-view specific collapse icon positioning/animation
39
+ &[aria-expanded='true'] {
40
+ .ActionList-item-collapseIcon {
41
+ transition: transform 120ms linear;
42
+ transform: rotate(0deg);
43
+ }
44
+ }
45
+
46
+ &[aria-expanded='false'] {
47
+ .ActionList-item-collapseIcon {
48
+ transition: transform 120ms linear;
49
+ transform: rotate(-90deg);
50
+ }
51
+ }
52
+ }
53
+
54
+ // expand/collapse group
55
+ .ActionList-item--hasSubItem {
56
+ .ActionList-item--subItem:not(.ActionList-item--hasSubItem) {
57
+ // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
58
+ .ActionList-content {
59
+ // increase child padding by targeting content first child span (add to ActionList-content padding, not replace)
60
+ // creates a slight indent of child items
61
+ // stylelint-disable-next-line selector-max-specificity, selector-max-type, max-nesting-depth, selector-max-compound-selectors
62
+ > span:first-child {
63
+ padding-left: $spacer-4;
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ // first subitem
70
+ > [aria-level='1'].ActionList-item--hasSubItem {
71
+ > .ActionList--subGroup {
72
+ // stylelint-disable-next-line selector-max-specificity
73
+ &::before {
74
+ @include treeConnectingLine($left: $spacer-3);
75
+ }
76
+ }
77
+ }
78
+
79
+ // all other subitems
80
+ // center connecting line with parent (line is 1px (8px - 1px)
81
+ .ActionList-item--hasSubItem:not([aria-level='1']) {
82
+ > .ActionList--subGroup {
83
+ // stylelint-disable-next-line selector-max-specificity
84
+ &::before {
85
+ @include treeConnectingLine(
86
+ $left: calc(#{$spacer-2} * (var(--ActionList-tree-depth)) + #{$spacer-2 - $border-width})
87
+ );
88
+ }
89
+ }
90
+ }
91
+ }
@@ -21,6 +21,24 @@
21
21
  background: var(--color-action-list-item-inline-divider);
22
22
  }
23
23
 
24
+ // if descriptionWrap--inline exists, move pseudo divider to wrapper
25
+ .ActionList-item-descriptionWrap--inline {
26
+ &::before {
27
+ position: absolute;
28
+ top: -$actionList-item-padding-vertical;
29
+ display: block;
30
+ width: 100%;
31
+ height: $border-width;
32
+ content: '';
33
+ background: var(--color-action-list-item-inline-divider);
34
+ }
35
+
36
+ // unset the default label pseudo
37
+ .ActionList-item-label::before {
38
+ content: unset;
39
+ }
40
+ }
41
+
24
42
  // hide divider if item is active
25
43
  .ActionList-item--navActive {
26
44
  // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
@@ -36,3 +54,9 @@
36
54
  .ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
37
55
  visibility: hidden;
38
56
  }
57
+
58
+ // hide if item is first of type with label::before, or is the first item after a sectionDivider
59
+ .ActionList-item:first-of-type .ActionList-item-descriptionWrap--inline::before,
60
+ .ActionList-sectionDivider + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
61
+ visibility: hidden;
62
+ }
@@ -1,5 +1,6 @@
1
1
  @import '../support/index.scss';
2
2
  @import './action-list-variables.scss';
3
3
  @import './action-list.scss';
4
+ @import './action-list-tree.scss';
4
5
  @import './action-list-item.scss';
5
6
  @import './action-list-item-divider.scss';
@@ -44,7 +44,7 @@
44
44
  }
45
45
 
46
46
  &.selected,
47
- &[aria-selected=true],
47
+ &[aria-selected='true'],
48
48
  &.navigation-focus {
49
49
  color: var(--color-fg-on-emphasis);
50
50
  text-decoration: none;
@@ -36,6 +36,7 @@
36
36
  border-right: $border-width $border-style var(--color-canvas-default);
37
37
  // stylelint-disable-next-line primer/borders
38
38
  border-radius: $border-radius-1;
39
+ box-shadow: none;
39
40
  transition: margin 0.1s ease-in-out;
40
41
 
41
42
  &:first-child {
package/base/base.scss CHANGED
@@ -46,6 +46,7 @@ hr,
46
46
  background: transparent;
47
47
  border: 0;
48
48
  border-bottom: $border-width $border-style var(--color-border-muted);
49
+
49
50
  @include clearfix();
50
51
  }
51
52
 
package/base/index.scss CHANGED
@@ -1,5 +1,4 @@
1
1
  @import '../support/index.scss';
2
-
3
2
  @import './normalize.scss';
4
3
  @import './base.scss';
5
4
  @import './kbd.scss';
package/base/kbd.scss CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
  kbd {
5
5
  display: inline-block;
6
- // stylelint-disable-next-line primer/spacing
7
6
  padding: ($spacer-1 - 1) ($spacer-1 + 1);
8
7
  font: 11px $mono-font;
9
8
  // stylelint-disable-next-line primer/typography
@@ -225,7 +225,7 @@ code,
225
225
  kbd,
226
226
  pre,
227
227
  samp {
228
- font-family: monospace, monospace; /* 1 */
228
+ font-family: monospace; /* 1 */
229
229
  font-size: 1em; /* 2 */
230
230
  }
231
231
 
@@ -62,11 +62,12 @@ dd {
62
62
  margin-left: 0;
63
63
  }
64
64
 
65
- // Code
65
+ // Monospaced
66
66
  // --------------------------------------------------
67
67
 
68
68
  tt,
69
- code {
69
+ code,
70
+ samp {
70
71
  font-family: $mono-font;
71
72
  font-size: $font-size-small;
72
73
  }