Skip to content

Commit fcd3cc6

Browse files
authored
Merge pull request #389 from opf/bump/primer-upstream
Bump/primer upstream
2 parents 5ac6339 + 14beda8 commit fcd3cc6

File tree

17 files changed

+183
-107
lines changed

17 files changed

+183
-107
lines changed

.changeset/rotten-banks-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openproject/primer-view-components': minor
3+
---
4+
5+
Add `disable_expand` param to AvatarStack for React component parity

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
# Initializes the CodeQL tools for scanning.
1919
- name: Initialize CodeQL
20-
uses: github/codeql-action/init@v3
20+
uses: github/codeql-action/init@v4
2121
with:
2222
languages: javascript
2323

@@ -29,4 +29,4 @@ jobs:
2929
npm ci
3030
3131
- name: Perform CodeQL Analysis
32-
uses: github/codeql-action/analyze@v3
32+
uses: github/codeql-action/analyze@v4

.github/workflows/publish.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 72 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,58 @@
11
name: Release
22
on:
33
push:
4-
branches:
5-
- 'main'
6-
jobs:
74
release:
8-
name: Final
9-
if: ${{ github.repository == 'opf/primer_view_components' }}
5+
types: [published]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
id-token: write # Required for OIDC
13+
contents: read
14+
checks: write
15+
statuses: write
16+
17+
jobs:
18+
publish-main:
19+
if: ${{ github.event_name == 'release' }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
- name: Setup Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: "3.3"
27+
bundler-cache: true
28+
- uses: actions/setup-node@v5
29+
with:
30+
node-version: 20
31+
cache: "npm"
32+
- name: Create .gem credentials
33+
run: |
34+
mkdir -p $HOME/.gem
35+
cat << EOF > $HOME/.gem/credentials
36+
---
37+
:rubygems_api_key: ${RUBYGEMS_TOKEN}
38+
EOF
39+
chmod 0600 $HOME/.gem/credentials
40+
env:
41+
RUBYGEMS_TOKEN: ${{ secrets.RUBYGEMS_TOKEN_SHARED }}
42+
- uses: actions/setup-node@v6
43+
with:
44+
node-version: 24
45+
- name: NPM install
46+
run: |
47+
npm ci
48+
- name: Publish Gem
49+
run: bundle exec rake release
50+
- name: Publish NPM
51+
run: npm publish --access public
52+
53+
release-main:
54+
name: Main
55+
if: ${{ github.repository == 'opf/primer_view_components' && github.ref_name == 'main' && github.event_name == 'push' }}
1056

1157
runs-on: ubuntu-latest
1258
steps:
@@ -18,15 +64,15 @@ jobs:
1864
persist-credentials: false
1965

2066
- name: Set up Node.js
21-
uses: actions/setup-node@v5
67+
uses: actions/setup-node@v6
2268
with:
23-
node-version: 20
24-
cache: 'npm'
69+
node-version: 24
70+
cache: "npm"
2571

2672
- name: Setup Ruby
2773
uses: ruby/setup-ruby@v1
2874
with:
29-
ruby-version: '3.3'
75+
ruby-version: "3.3"
3076

3177
- name: Install dependencies
3278
run: |
@@ -41,5 +87,20 @@ jobs:
4187
version: npm run changeset:version
4288
publish: script/changeset-publish
4389
env:
44-
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
45-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
90+
GITHUB_TOKEN: ${{ steps.get-access-token.outputs.token }}
91+
92+
release-canary:
93+
name: Canary
94+
if: ${{ github.repository == 'opf/primer_view_components' && github.ref_name != 'main' && github.ref_name != 'changeset-release/main' && github.event_name == 'push' }}
95+
uses: primer/.github/.github/workflows/release_canary.yml@v2.4.0
96+
with:
97+
install: npm i
98+
secrets:
99+
gh_token: ${{ secrets.GITHUB_TOKEN }}
100+
101+
release-candidate:
102+
name: Candidate
103+
if: ${{ github.repository == 'opf/primer_view_components' && github.ref_name == 'changeset-release/main' && github.event_name == 'push' }}
104+
uses: primer/.github/.github/workflows/release_candidate.yml@v2.4.0
105+
secrets:
106+
gh_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release_canary.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/release_candidate.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/release_tracking.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ on:
1414
jobs:
1515
release-tracking:
1616
name: Release Tracking
17-
uses: primer/.github/.github/workflows/release_tracking.yml@v2.2.0
17+
uses: primer/.github/.github/workflows/release_tracking.yml@v2.4.0
1818
secrets:
1919
datadog_api_key: ${{ secrets.DATADOG_API_KEY }}

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ jobs:
193193
USE_BROWSER=firefox bundle exec rake test:system
194194
visual:
195195
name: Visual and Semantic Markup Regressions
196-
if: ${{ github.event_name == 'pull_request' }}
196+
# Temp skip this run
197+
if: ${{ github.event_name == 'pull_request' && false }}
197198
timeout-minutes: 20
198199
runs-on: ubuntu-latest
199200
steps:

app/components/primer/beta/avatar_stack.pcss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* stylelint-disable selector-max-specificity */
2+
/* The selector-max-specificity rule is disabled here because the nested selectors
3+
in AvatarStack require high specificity to properly override default styles and
4+
achieve the intended visual stacking. */
5+
16
/* AvatarStack */
27

38
/* Stacked avatars can be used to show who is participating in thread when
@@ -60,7 +65,7 @@
6065
}
6166
}
6267

63-
&:hover {
68+
&:hover:not([data-disable-expand]) {
6469
& .avatar {
6570
margin-right: var(--base-size-4);
6671
}
@@ -74,6 +79,10 @@
7479
display: none !important;
7580
}
7681
}
82+
83+
&[data-disable-expand] {
84+
position: relative;
85+
}
7786
}
7887

7988
.avatar.avatar-more {
@@ -110,7 +119,7 @@
110119
right: 0;
111120
flex-direction: row-reverse;
112121

113-
&:hover .avatar {
122+
&:hover:not([data-disable-expand]) .avatar {
114123
margin-right: 0;
115124
margin-left: var(--base-size-4);
116125
}

app/components/primer/beta/avatar_stack.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ class AvatarStack < Primer::Component
2222
# @param tag [Symbol] <%= one_of(Primer::Beta::AvatarStack::TAG_OPTIONS) %>
2323
# @param align [Symbol] <%= one_of(Primer::Beta::AvatarStack::ALIGN_OPTIONS) %>
2424
# @param tooltipped [Boolean] Whether to add a tooltip to the stack or not.
25+
# @param disable_expand [Boolean] Whether to disable the expand behavior on hover. If true, avatars will not expand.
2526
# @param body_arguments [Hash] Parameters to add to the Body. If `tooltipped` is set, has the same arguments as <%= link_to_component(Primer::Tooltip) %>.
2627
# The default tag is <%= pretty_value(Primer::Beta::AvatarStack::DEFAULT_BODY_TAG) %> but can be changed using `tag:`
2728
# to <%= one_of(Primer::Beta::AvatarStack::BODY_TAG_OPTIONS, lower: true) %>
2829
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
29-
def initialize(tag: DEFAULT_TAG, align: ALIGN_DEFAULT, tooltipped: false, body_arguments: {}, **system_arguments)
30+
def initialize(tag: DEFAULT_TAG, align: ALIGN_DEFAULT, tooltipped: false, disable_expand: false, body_arguments: {}, **system_arguments)
3031
@align = fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT)
3132
@system_arguments = system_arguments
3233
@tooltipped = tooltipped
34+
@disable_expand = disable_expand
3335
@body_arguments = body_arguments
3436
@direction = @body_arguments[:direction]
3537

@@ -39,6 +41,7 @@ def initialize(tag: DEFAULT_TAG, align: ALIGN_DEFAULT, tooltipped: false, body_a
3941
"AvatarStack-body",
4042
@body_arguments[:classes]
4143
)
44+
@body_arguments[:"data-disable-expand"] = true if @disable_expand
4245

4346
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
4447
@system_arguments[:classes] = class_names(

0 commit comments

Comments
 (0)