Skip to content

Commit

Permalink
Merge pull request #152 from opf/bump/primer-upstream
Browse files Browse the repository at this point in the history
Bump/primer upstream 0.29.0
  • Loading branch information
HDinger authored Jul 24, 2024
2 parents 5ba923b + 18cab5a commit 0837f7b
Show file tree
Hide file tree
Showing 21 changed files with 212 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-maps-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': minor
---

Add defaults to SelectPanel::ItemLists; fix issue showing no results label for local fetch strategy
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/[email protected].5
uses: tj-actions/[email protected].6
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/[email protected].5
uses: tj-actions/[email protected].6
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/[email protected].5
uses: tj-actions/[email protected].6
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/[email protected].5
uses: tj-actions/[email protected].6
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/[email protected].5
uses: tj-actions/[email protected].6
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.
19 changes: 16 additions & 3 deletions app/components/primer/alpha/select_panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,22 @@ module Alpha
# )
# ```
class SelectPanel < Primer::Component
status :alpha

# The component that should be used to render the list of items in the body of a SelectPanel.
ItemList = Primer::Alpha::ActionList
class ItemList < Primer::Alpha::ActionList
# @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::ActionList) %>.
def initialize(**system_arguments)
select_variant = system_arguments[:select_variant] || Primer::Alpha::ActionList::DEFAULT_SELECT_VARIANT

super(
p: 2,
role: "listbox",
aria_selection_variant: select_variant == :single ? :selected : :checked,
**system_arguments
)
end
end

status :alpha

DEFAULT_PRELOAD = false

Expand Down Expand Up @@ -328,6 +340,7 @@ class SelectPanel < Primer::Component
# @param open_on_load [Boolean] Open the panel when the page loads.
# @param anchor_align [Symbol] The anchor alignment of the Overlay. <%= one_of(Primer::Alpha::Overlay::ANCHOR_ALIGN_OPTIONS) %>
# @param anchor_side [Symbol] The side to anchor the Overlay to. <%= one_of(Primer::Alpha::Overlay::ANCHOR_SIDE_OPTIONS) %>
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
def initialize(
src: nil,
title: "Menu",
Expand Down
4 changes: 4 additions & 0 deletions app/components/primer/alpha/select_panel_element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ export class SelectPanelElement extends HTMLElement {
const elem = entry.target
if (entry.isIntersecting && elem === this.dialog) {
this.updateAnchorPosition()

if (this.#fetchStrategy === FetchStrategy.LOCAL) {
this.#updateItemVisibility()
}
}
}
})
Expand Down
10 changes: 5 additions & 5 deletions demo/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ GEM
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.7.2)
irb (1.13.2)
irb (1.14.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jsonpath (1.1.5)
Expand Down Expand Up @@ -223,7 +223,7 @@ GEM
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0507)
minitest (5.24.0)
minitest (5.24.1)
ms_rest (0.7.6)
concurrent-ruby (~> 1.0)
faraday (>= 0.9, < 2.0.0)
Expand Down Expand Up @@ -261,7 +261,7 @@ GEM
puma (6.4.2)
nio4r (~> 2.0)
racc (1.8.0)
rack (3.1.4)
rack (3.1.7)
rack-cors (2.0.2)
rack (>= 2.0.0)
rack-session (2.0.0)
Expand Down Expand Up @@ -325,13 +325,13 @@ GEM
stringio (3.1.1)
thor (1.3.1)
timeliness (0.3.10)
turbo-rails (2.0.5)
turbo-rails (2.0.6)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
view_component (3.12.1)
view_component (3.13.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
Expand Down
4 changes: 1 addition & 3 deletions demo/app/views/select_panel_items/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<% unless results.empty? %>
<%= render(Primer::Alpha::SelectPanel::ItemList.new(
select_variant: :multiple,
p: 2,
role: "listbox",
select_variant: (params[:select_variant] || :multiple).to_sym,
aria: {
label: "options",
},
Expand Down
96 changes: 48 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

<%= render(Primer::Alpha::SelectPanel.new(
data: { interaction_subject: subject_id },
src: select_panel_items_path(show_results: !simulate_no_results, fail: simulate_failure),
src: select_panel_items_path(
select_variant: :single,
show_results: !simulate_no_results,
fail: simulate_failure
),
select_variant: :single,
fetch_strategy: :remote,
**system_arguments
Expand Down
22 changes: 22 additions & 0 deletions static/arguments.json
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,28 @@
"type": "Symbol",
"default": "`:outside_bottom`",
"description": "The side to anchor the Overlay to. One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
},
{
"name": "system_arguments",
"type": "Hash",
"default": "N/A",
"description": "[System arguments](/system-arguments)"
}
]
},
{
"component": "SelectPanel::ItemList",
"status": "alpha",
"a11y_reviewed": true,
"short_name": "SelectPanelItemList",
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/select_panel/item_list.rb",
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/select_panel/item_list/default/",
"parameters": [
{
"name": "system_arguments",
"type": "Hash",
"default": "N/A",
"description": "The arguments accepted by [ActionList](/components/alpha/actionlist)."
}
]
},
Expand Down
1 change: 1 addition & 0 deletions static/audited_at.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"Primer::Alpha::SegmentedControl::Item": "2023-02-01",
"Primer::Alpha::Select": "",
"Primer::Alpha::SelectPanel": "",
"Primer::Alpha::SelectPanel::ItemList": "2023-07-10",
"Primer::Alpha::SubmitButton": "",
"Primer::Alpha::TabContainer": "",
"Primer::Alpha::TabNav": "",
Expand Down
Loading

0 comments on commit 0837f7b

Please sign in to comment.