Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump/primer upstream #46

Merged
merged 8 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hot-dots-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': patch
---

Prevent scrolling when activating ActionMenu form items via space
5 changes: 5 additions & 0 deletions .changeset/loud-starfishes-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': patch
---

Fix bug in ActionMenu/Tooltip/Overlay being always visible in Firefox on ios 17
33 changes: 33 additions & 0 deletions .github/workflows/add-to-inbox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Add to Inbox 📥
on:
issues:
types: [opened, reopened]

jobs:
add-to-inbox:
if: ${{ github.repository == 'primer/view_components' }}
runs-on: ubuntu-latest
env:
ISSUE_URL: ${{ github.event.issue.html_url }}
PROJECT_ID: 4503
steps:
- id: get-primer-access-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.PRIMER_ISSUE_TRIAGE_APP_ID }}
private-key: ${{ secrets.PRIMER_ISSUE_TRIAGE_APP_PRIVATE_KEY }}
- name: Add rails label to issue
run: |
gh issue edit $ISSUE_URL --add-label rails
env:
GH_TOKEN: ${{ steps.get-primer-access-token.outputs.token }}
- id: get-github-access-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.PRIMER_ISSUE_TRIAGE_APP_ID_FOR_GITHUB }}
private-key: ${{ secrets.PRIMER_ISSUE_TRIAGE_APP_PRIVATE_KEY_FOR_GITHUB }}
owner: github
- name: Add issue to project
run: gh project item-add $PROJECT_ID --url $ISSUE_URL --owner github
env:
GH_TOKEN: ${{ steps.get-github-access-token.outputs.token }}
15 changes: 9 additions & 6 deletions app/components/primer/alpha/action_menu/action_menu_element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,16 @@ export class ActionMenuElement extends HTMLElement {
this.#activateItem(event, item)
this.#handleItemActivated(event, item)

// Pressing the space key on a button will cause the page to scroll unless preventDefault()
// is called. Unfortunately, calling preventDefault() will also skip form submission. The
// code below therefore only calls preventDefault() if the button submits a form and the
// button is being activated by the space key.
if (item.getAttribute('type') === 'submit' && this.#isKeyboardActivationViaSpace(event)) {
// Pressing the space key on a button or link will cause the page to scroll unless preventDefault()
// is called. While calling preventDefault() appears to have no effect on link navigation, it skips
// form submission. The code below therefore only calls preventDefault() if the button has been
// activated by the space key, and manually submits the form if the button is a submit button.
if (this.#isKeyboardActivationViaSpace(event)) {
event.preventDefault()
item.closest('form')?.submit()

if (item.getAttribute('type') === 'submit') {
item.closest('form')?.submit()
}
}

return
Expand Down
12 changes: 0 additions & 12 deletions app/components/primer/alpha/overlay.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ anchored-position[popover] {
padding: 0;
position: absolute;
min-width: 192px;
inset: auto;
overflow: visible;
background: none;
}
Expand All @@ -12,17 +11,6 @@ anchored-position[popover] {
display: flex;
}

anchored-position[popover]:not(.\:popover-open) {
display: none;
}

anchored-position.not-anchored::backdrop {
background-color: var(--overlay-backdrop-bgColor, var(--color-neutral-muted));
}

/* This reverts the declaration above for native popover, where `:popover-open` is supported */
@supports selector(:popover-open) {
anchored-position[popover]:not(.\:popover-open) {
display: revert;
}
}
2 changes: 0 additions & 2 deletions app/components/primer/primer.pcss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "@oddbird/popover-polyfill/dist/popover.css";

/* CSS component styles here */

/* alpha */
Expand Down
1 change: 0 additions & 1 deletion app/components/primer/primer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '@github/include-fragment-element'
import '@oddbird/popover-polyfill'
import './alpha/action_bar_element'
import './alpha/dropdown'
import './anchored_position'
Expand Down
7 changes: 6 additions & 1 deletion lib/primer/static/generate_info_arch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ def call
render_erb_ignoring_markdown_code_fences(docs.base_docstring)
end

accessibility_docs =
if (accessibility_tag_text = docs.tags(:accessibility)&.first&.text)
render_erb_ignoring_markdown_code_fences(accessibility_tag_text)
end

memo[component] = {
"fully_qualified_name" => component.name,
"description" => description,
"accessibility_docs" => docs.tags(:accessibility)&.first&.text,
"accessibility_docs" => accessibility_docs,
"is_form_component" => docs.manifest_entry.form_component?,
"is_published" => docs.manifest_entry.published?,
"requires_js" => docs.manifest_entry.requires_js?,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@github/include-fragment-element": "^6.1.1",
"@github/relative-time-element": "^4.0.0",
"@github/tab-container-element": "^3.1.2",
"@oddbird/popover-polyfill": "^0.2.3",
"@oddbird/popover-polyfill": "^0.3.0",
"@primer/behaviors": "^1.3.4"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions static/info_arch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7062,7 +7062,7 @@
{
"fully_qualified_name": "Primer::Alpha::TabNav",
"description": "Use `TabNav` to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.\nFor panel navigation, use {{#link_to_component}}Primer::Alpha::TabPanels{{/link_to_component}} instead.",
"accessibility_docs": "- By default, `TabNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See <%= link_to_component(Primer::Alpha::Navigation::Tab) %> for additional\n accessibility considerations.",
"accessibility_docs": "- By default, `TabNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See {{#link_to_component}}Primer::Alpha::Navigation::Tab{{/link_to_component}} for additional\n accessibility considerations.",
"is_form_component": false,
"is_published": true,
"requires_js": false,
Expand Down Expand Up @@ -8461,7 +8461,7 @@
{
"fully_qualified_name": "Primer::Alpha::UnderlineNav",
"description": "Use `UnderlineNav` to style navigation links with a minimal\nunderlined selected state, typically placed at the top\nof the page.\n\nFor panel navigation, use {{#link_to_component}}Primer::Alpha::UnderlinePanels{{/link_to_component}} instead.",
"accessibility_docs": "- By default, `UnderlineNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See <%= link_to_component(Primer::Alpha::Navigation::Tab) %> for additional\n accessibility considerations.",
"accessibility_docs": "- By default, `UnderlineNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See {{#link_to_component}}Primer::Alpha::Navigation::Tab{{/link_to_component}} for additional\n accessibility considerations.",
"is_form_component": false,
"is_published": true,
"requires_js": false,
Expand Down Expand Up @@ -10189,7 +10189,7 @@
{
"fully_qualified_name": "Primer::Beta::BorderBox::Header",
"description": "`BorderBox::Header` is used inside `BorderBox` to render its header slot.",
"accessibility_docs": "When using `header.with_title`, set `tag` to one of `h1`, `h2`, `h3`, etc. based on what is appropriate for the page context. <%= link_to_heading_practices %>",
"accessibility_docs": "When using `header.with_title`, set `tag` to one of `h1`, `h2`, `h3`, etc. based on what is appropriate for the page context. [Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
"is_form_component": false,
"is_published": true,
"requires_js": false,
Expand Down Expand Up @@ -11589,7 +11589,7 @@
{
"fully_qualified_name": "Primer::Beta::Heading",
"description": "`Heading` should be used to communicate page organization and hierarchy.\n\n- Set tag to one of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, `:h6` based on what is appropriate for the page context.\n- Use `Heading` as the title of a section or sub section.\n- Do not use `Heading` for styling alone. For simply styling text, consider using {{#link_to_component}}Primer::Beta::Text{{/link_to_component}} with relevant {{link_to_typography_docs}}\n such as `font_size` and `font_weight`.\n- Do not jump heading levels. For instance, do not follow a `<h1>` with an `<h3>`. Heading levels should increase by one in ascending order.",
"accessibility_docs": "While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out.\nWhen text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be\nconsistent. [See WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)\n\nHeadings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience.\n<%= link_to_heading_practices %>",
"accessibility_docs": "While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out.\nWhen text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be\nconsistent. [See WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)\n\nHeadings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience.\n[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
"is_form_component": false,
"is_published": true,
"requires_js": false,
Expand Down Expand Up @@ -13751,7 +13751,7 @@
{
"fully_qualified_name": "Primer::Beta::Subhead",
"description": "Use `Subhead` as the start of a section. The `:heading` slot will render an `<h2>` font-sized text.\n\n- Optionally set the `:description` slot to render a short description and the `:actions` slot for a related action.\n- Use a succinct, one-line description for the `:description` slot. For longer descriptions, omit the description slot and render a paragraph below the `Subhead`.\n- Use the actions slot to render a related action to the right of the heading. Use {{#link_to_component}}Primer::ButtonComponent{{/link_to_component}} or {{#link_to_component}}Primer::Beta::Link{{/link_to_component}}.",
"accessibility_docs": "The `:heading` slot defaults to rendering a `<div>`. Update the tag to a heading element with the appropriate level to improve page navigation for assistive technologies.\n<%= link_to_heading_practices %>",
"accessibility_docs": "The `:heading` slot defaults to rendering a `<div>`. Update the tag to a heading element with the appropriate level to improve page navigation for assistive technologies.\n[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
"is_form_component": false,
"is_published": true,
"requires_js": false,
Expand Down Expand Up @@ -14288,7 +14288,7 @@
{
"fully_qualified_name": "Primer::BlankslateComponent",
"description": "Use `Blankslate` when there is a lack of content within a page or section. Use as placeholder to tell users why something isn't there.",
"accessibility_docs": "`Blankslate` renders an `<h3>` element for the title by default. Update the heading level based on what is appropriate for your page hierarchy by setting `title_tag`.\n<%= link_to_heading_practices %>",
"accessibility_docs": "`Blankslate` renders an `<h3>` element for the title by default. Update the heading level based on what is appropriate for your page hierarchy by setting `title_tag`.\n[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
"is_form_component": false,
"is_published": true,
"requires_js": false,
Expand Down
Loading