Skip to content

Commit

Permalink
Merge pull request #72 from opf/bump/primer-upstream
Browse files Browse the repository at this point in the history
Bump/primer upstream
  • Loading branch information
HDinger authored Jan 31, 2024
2 parents 3b5b110 + 91936a5 commit 4f7d0f1
Show file tree
Hide file tree
Showing 92 changed files with 2,783 additions and 2,154 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-needles-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Allow setting `test_selector` on select list options
5 changes: 5 additions & 0 deletions .changeset/late-windows-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Prevent ActionMenu's show_button slot from rendering its content more than once
5 changes: 5 additions & 0 deletions .changeset/nine-turtles-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Allow `Banner` to be rendered as a section
5 changes: 5 additions & 0 deletions .changeset/rotten-shirts-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Update @oddbird/popover-polyfill to v0.3.8
5 changes: 5 additions & 0 deletions .changeset/silent-lies-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": minor
---

Use latest version of @primer/primitives
5 changes: 5 additions & 0 deletions .changeset/tall-bugs-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Fixing the utilities build not matching properly for `font_size`
5 changes: 5 additions & 0 deletions .changeset/wet-fishes-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/primer-view-components": patch
---

Only attach validation IDs to form elements that support validation
5 changes: 5 additions & 0 deletions .changeset/wise-coats-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': minor
---

Primer::Alpha::Dialog uses <dialog> internally
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Choice] Ruby version: 3, 3.0, 2, 2.7, 2.6
ARG VARIANT="2.7"
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}
ARG VARIANT="3"
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}

ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l

# Install gems
ARG BUNDLER_VERSION=2.2.11
RUN gem install bundler:${BUNDLER_VERSION} solargraph
RUN gem install bundler:${BUNDLER_VERSION} solargraph:'~> 0.50.0'

# Install chrome
RUN curl --silent --show-error --location --fail --retry 3 --output /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "2.7",
"VARIANT": "3",
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*"
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/demo-production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
with:
ruby-version: '3.2'
bundler-cache: true
- uses: actions/[email protected].2
- uses: actions/[email protected].3
with:
path: demo/gemfiles/vendor/bundle
key: gems-build-kuby-main-ruby-3.2.x-${{ hashFiles('demo/gemfiles/kuby.gemfile.lock') }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
uses: tj-actions/changed-files@v42.0.0
with:
files: |
docs/**/*.md
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
uses: tj-actions/changed-files@v42.0.0
with:
files: |
app/**/*.rb
Expand All @@ -62,7 +62,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
uses: tj-actions/changed-files@v42.0.0
with:
files: |
app/components/**/*.erb
Expand All @@ -82,7 +82,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
uses: tj-actions/changed-files@v42.0.0
with:
files: |
app/components/**/*.ts
Expand All @@ -103,7 +103,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.0
uses: tj-actions/changed-files@v42.0.0
with:
files: |
app/components/**/*.pcss
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end
# rubocop:enable Bundler/DuplicatedGem

# Use Puma as the app server
gem "puma", "~> 6.4.0"
gem "puma", "~> 6.4.2"
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem "webpacker", "~> 5.0"

Expand All @@ -50,7 +50,7 @@ group :test do
# Disallow v5.19 for now since it breaks mocha.
# See: https://github.com/freerange/mocha/issues/614
# Remove this line when mocha has fixed the issue
gem "minitest", "< 5.21"
gem "minitest", "< 5.22"
end

# development dependencies
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GEM
parser (>= 2.4)
smart_properties
bigdecimal (3.1.4)
bootsnap (1.17.0)
bootsnap (1.17.1)
msgpack (~> 1.2)
builder (3.2.4)
capybara (3.39.2)
Expand Down Expand Up @@ -130,12 +130,12 @@ GEM
method_source (1.0.0)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.20.0)
minitest (5.21.1)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
msgpack (1.7.2)
mutex_m (0.1.2)
nio4r (2.5.9)
nio4r (2.7.0)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
Expand All @@ -152,7 +152,7 @@ GEM
psych (5.1.1.1)
stringio
public_suffix (5.0.3)
puma (6.4.0)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.2)
rack (2.2.8)
Expand Down Expand Up @@ -293,11 +293,11 @@ DEPENDENCIES
listen (~> 3.0)
lookbook (~> 2.1.1)
matrix (~> 0.4.2)
minitest (< 5.21)
minitest (< 5.22)
mocha
openproject-primer_view_components!
pry
puma (~> 6.4.0)
puma (~> 6.4.2)
rack (~> 2.2)
rack-cors
railties (= 7.1.1)
Expand Down
4 changes: 3 additions & 1 deletion app/components/primer/alpha/action_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ def initialize(
#
# @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::Overlay) %>'s `show_button` slot.
def with_show_button(**system_arguments, &block)
@overlay.with_show_button(**system_arguments, id: "#{@menu_id}-button", controls: "#{@menu_id}-list", &block)
@overlay.with_show_button(**system_arguments, id: "#{@menu_id}-button", controls: "#{@menu_id}-list") do |button|
evaluate_block(button, &block)
end
end

# @!parse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,15 @@ export class ActionMenuElement extends HTMLElement {
if (this.#isOpen()) {
this.#hide()
}
const activeElement = this.ownerDocument.activeElement
const lostFocus = this.ownerDocument.activeElement === this.ownerDocument.body
const focusInClosedMenu = this.contains(activeElement)
if (lostFocus || focusInClosedMenu) {
setTimeout(() => this.invokerElement?.focus(), 0)
}
}
// a modal <dialog> element will close all popovers
setTimeout(() => this.#show(), 0)
dialog.addEventListener('close', handleDialogClose, {signal})
dialog.addEventListener('cancel', handleDialogClose, {signal})
}
Expand Down
10 changes: 7 additions & 3 deletions app/components/primer/alpha/banner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class Banner < Primer::Component
}
}

DEFAULT_TAG = :div
TAG_OPTIONS = [DEFAULT_TAG, :section].freeze

DEFAULT_SCHEME = :default
SCHEME_MAPPINGS = {
DEFAULT_SCHEME => "",
Expand Down Expand Up @@ -57,6 +60,7 @@ class Banner < Primer::Component

DEFAULT_DISMISS_LABEL = "Dismiss"

# @param tag [Symbol] <%= one_of(Primer::Alpha::Banner::TAG_OPTIONS) %>
# @param full [Boolean] Whether the component should take up the full width of the screen.
# @param full_when_narrow [Boolean] Whether the component should take up the full width of the screen when rendered inside smaller viewports.
# @param dismiss_scheme [Symbol] Whether the component can be dismissed with an "x" button. <%= one_of(Primer::Alpha::Banner::DISMISS_SCHEMES) %>
Expand All @@ -65,15 +69,15 @@ class Banner < Primer::Component
# @param icon [Symbol] The name of an <%= link_to_octicons %> icon to use. If no icon is provided, a default one will be chosen based on the scheme.
# @param scheme [Symbol] <%= one_of(Primer::Alpha::Banner::SCHEME_MAPPINGS.keys) %>
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
def initialize(full: false, full_when_narrow: false, dismiss_scheme: DEFAULT_DISMISS_SCHEME, dismiss_label: DEFAULT_DISMISS_LABEL, description: nil, icon: nil, scheme: DEFAULT_SCHEME, **system_arguments)
def initialize(tag: DEFAULT_TAG, full: false, full_when_narrow: false, dismiss_scheme: DEFAULT_DISMISS_SCHEME, dismiss_label: DEFAULT_DISMISS_LABEL, description: nil, icon: nil, scheme: DEFAULT_SCHEME, **system_arguments)
@scheme = fetch_or_fallback(SCHEME_MAPPINGS.keys, scheme, DEFAULT_SCHEME)
@icon = icon || DEFAULT_ICONS[@scheme]
@dismiss_scheme = dismiss_scheme
@dismiss_label = dismiss_label
@description = description

@system_arguments = deny_tag_argument(**system_arguments)
@system_arguments[:tag] = :div
@system_arguments = system_arguments
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
@system_arguments[:classes] = class_names(
@system_arguments[:classes],
"Banner",
Expand Down
4 changes: 2 additions & 2 deletions app/components/primer/alpha/dialog.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= show_button %>
<div class="Overlay--hidden <%= @backdrop_classes %>" data-modal-dialog-overlay>
<dialog-helper>
<%= render Primer::BaseComponent.new(**@system_arguments) do %>
<%= header %>
<% if content.present? %>
Expand All @@ -11,4 +11,4 @@
<%= footer %>
<% end %>
<% end %>
</div>
</dialog-helper>
Loading

0 comments on commit 4f7d0f1

Please sign in to comment.