Skip to content

Commit

Permalink
Merge branch 'main' into layout-pcss
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan authored Dec 7, 2022
2 parents 3606610 + e5144a3 commit 0059d13
Show file tree
Hide file tree
Showing 130 changed files with 2,720 additions and 1,867 deletions.
5 changes: 0 additions & 5 deletions .changeset/four-clouds-yell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gentle-pugs-happen.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/happy-houses-judge.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/neat-fireants-bake.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/rich-waves-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Moving `Primer::MenuComponent` to `Primer::Alpha::Menu` and deprecating the original
5 changes: 0 additions & 5 deletions .changeset/small-lemons-change.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/swift-dryers-invite.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/young-dryers-add.md

This file was deleted.

2 changes: 1 addition & 1 deletion .erb-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ linters:
AllCops:
DisabledByDefault: true
Primer/DeprecatedComponents:
Enabled: true
Enabled: false
Exclude:
- app/components/primer/layout_component.html.erb
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.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# CHANGELOG

## 0.0.114

### Patch Changes

- [#1685](https://github.com/primer/view_components/pull/1685) [`5f062fed`](https://github.com/primer/view_components/commit/5f062fed16980bd1ec437636eef1851dfea56388) Thanks [@simurai](https://github.com/simurai)! - Revert moving `button` styles to PVC

* [#1681](https://github.com/primer/view_components/pull/1681) [`0c9611f5`](https://github.com/primer/view_components/commit/0c9611f5a08c78452be999c08d9f24703b5bd671) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Moving Primer::Markdown to Primer::Beta::Markdown, and deprecating the original

## 0.0.113

### Patch Changes

- [#1650](https://github.com/primer/view_components/pull/1650) [`2941ba2b`](https://github.com/primer/view_components/commit/2941ba2b9f98cb62f315e6b6ff90913e854da67d) Thanks [@keithamus](https://github.com/keithamus)! - Add RelativeTime component

* [#1665](https://github.com/primer/view_components/pull/1665) [`f9759ff0`](https://github.com/primer/view_components/commit/f9759ff0e4c2d33990a4b1cc22f5341239324b3d) Thanks [@camertron](https://github.com/camertron)! - Add a button input to the forms framework

- [#1636](https://github.com/primer/view_components/pull/1636) [`0af266a7`](https://github.com/primer/view_components/commit/0af266a7d6a75e351b35b620043f545dcaa8d03f) Thanks [@simurai](https://github.com/simurai)! - Remove `ActionListItem` animation

* [#1638](https://github.com/primer/view_components/pull/1638) [`5c421277`](https://github.com/primer/view_components/commit/5c4212777189c62c420f4e756cccef7c48a356fd) Thanks [@simurai](https://github.com/simurai)! - Move `FormControl` styles to PVC

- [#1664](https://github.com/primer/view_components/pull/1664) [`d56dfa60`](https://github.com/primer/view_components/commit/d56dfa606019b4951783ac2d581b74b5234a8d6c) Thanks [@camertron](https://github.com/camertron)! - Allow form inputs to be hidden

* [#1630](https://github.com/primer/view_components/pull/1630) [`e744c14f`](https://github.com/primer/view_components/commit/e744c14f72de7052fa52e14776675924e04ff269) Thanks [@simurai](https://github.com/simurai)! - Move `button` styles to PVC

- [#1666](https://github.com/primer/view_components/pull/1666) [`5a7c5320`](https://github.com/primer/view_components/commit/5a7c532075a5208e5aad9d801d79b2ce7e9a1c19) Thanks [@camertron](https://github.com/camertron)! - Add the primer_fields_for helper

* [#1671](https://github.com/primer/view_components/pull/1671) [`e0be2776`](https://github.com/primer/view_components/commit/e0be2776d46c390cbfc0a3fcfa278b3b5874f428) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Add a migration guide for moving from Primer::DropdownMenuComponent to Primer::Beta::Dropdown

- [#1635](https://github.com/primer/view_components/pull/1635) [`653ac92b`](https://github.com/primer/view_components/commit/653ac92b2db6853715221a579913839631db4fd6) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Converting deprecations list to a .yml file, and updating all code around deprecations to use this new structure

* [#1668](https://github.com/primer/view_components/pull/1668) [`84cd95ed`](https://github.com/primer/view_components/commit/84cd95ed641444a8acd602acd00389ce65173460) Thanks [@camertron](https://github.com/camertron)! - Allow form components and entire forms to skip rendering

- [#1643](https://github.com/primer/view_components/pull/1643) [`7e20e148`](https://github.com/primer/view_components/commit/7e20e1483caf000800c67e0a465b8f45587655cf) Thanks [@camertron](https://github.com/camertron)! - Fix disabled ToggleSwitch behavior

* [#1673](https://github.com/primer/view_components/pull/1673) [`7a26cbb6`](https://github.com/primer/view_components/commit/7a26cbb69b090d017f753d9f6a190ed197ad5563) Thanks [@camertron](https://github.com/camertron)! - Ensure nested forms can be hidden independently of their radio button or check box

- [#1651](https://github.com/primer/view_components/pull/1651) [`7e430ac1`](https://github.com/primer/view_components/commit/7e430ac18af9ec49396f89383cebfa976e69e059) Thanks [@simurai](https://github.com/simurai)! - Move `Overlay` styles to PVC

* [#1674](https://github.com/primer/view_components/pull/1674) [`a6c5bb52`](https://github.com/primer/view_components/commit/a6c5bb52bd3c941133bfedf05c0e107e6d7f1fbd) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Moving `Primer::ClipboardCopy` to `Primer::Beta::ClipboardCopy`, and deprecating the original

- [#1663](https://github.com/primer/view_components/pull/1663) [`15392142`](https://github.com/primer/view_components/commit/1539214202031b7646f2a709bf333283603a76e3) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Adding a migration guide and updating deprecation settings for Primer::ButtonComponent -> Primer::Beta::Button

* [#1662](https://github.com/primer/view_components/pull/1662) [`d2b33606`](https://github.com/primer/view_components/commit/d2b336065aacbe3dab3d67d9a53f3122a0dc31db) Thanks [@jonrohan](https://github.com/jonrohan)! - Adding `Primer::ViewComponents::AUDITED` variable to access when a component was last audited. Get's data from the `static/audited_at.json` file.

- [#1639](https://github.com/primer/view_components/pull/1639) [`ddc30dd5`](https://github.com/primer/view_components/commit/ddc30dd5fa485966ead559d6de204df86c6aeddb) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Adding "guide" to PVC deprecation configuration, and providing a much more detailed deprecation notice based on configuration for each component

## 0.0.112

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
primer_view_components (0.0.112)
primer_view_components (0.0.114)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
octicons (>= 17.0.0)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

STDOUT.sync = true
$stdout.sync = true

require "bundler/gem_tasks"
require "rake/testtask"
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/alpha/auto_complete.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

/* Switch to stacked at smaller viewport */
@media (--primer-viewportRange-narrow-viewport) {
@media (max-width: 543.98px) {
.autocomplete-label-inline {
display: block;
margin-bottom: 6px;
Expand Down
4 changes: 2 additions & 2 deletions app/components/primer/alpha/banner.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
grid-template-rows: min-content;

/* `sm` breakpoint variantion */
@media (--primer-viewportRange-narrow-viewport) {
@media (max-width: 543.98px) {
grid-template-areas:
'visual message close'
'. actions actions';
Expand Down Expand Up @@ -115,7 +115,7 @@
border-radius: 0;
}

@media (--primer-viewportRange-narrowLandscape) {
@media (max-width: 767.98px) {
&.Banner--full-whenNarrow {
margin-top: calc(var(--primer-borderWidth-thin, max(1px, 0.0625rem)) * -1);
border-right: 0;
Expand Down
8 changes: 4 additions & 4 deletions app/components/primer/alpha/dialog.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
@define-mixin Overlay-backdrop--anchor {
@mixin Overlay-backdrop--transparent;

.Overlay {
& .Overlay {
width: auto;
}
}
Expand Down Expand Up @@ -411,7 +411,7 @@
@define-mixin Overlay-backdrop--full {
@mixin Overlay-backdrop;

.Overlay {
& .Overlay {
width: 100%;
max-width: 100vw;
height: 100%;
Expand Down Expand Up @@ -440,8 +440,8 @@

/* responsive variants */

/* up to 767px */
@media (--primer-viewportRange-narrowLandscape) {
/* --primer-viewportRange-narrowLandscape */
@media (max-width: 767px) {
.Overlay-backdrop--center-whenNarrow {
@mixin Overlay-backdrop--center;
}
Expand Down
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions app/components/primer/alpha/menu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# frozen_string_literal: true

module Primer
module Alpha
# Use `Menu` to create vertical lists of navigational links.
class Menu < Primer::Component
HEADING_TAG_OPTIONS = [:h1, :h2, :h3, :h4, :h5, :h6].freeze
HEADING_TAG_FALLBACK = :h2

# Optional menu heading
#
# @param tag [Symbol] <%= one_of(Primer::Alpha::Menu::HEADING_TAG_OPTIONS) %>
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
renders_one :heading, lambda { |tag:, **system_arguments|
system_arguments[:tag] = fetch_or_fallback(HEADING_TAG_OPTIONS, tag, HEADING_TAG_FALLBACK)
system_arguments[:classes] = class_names(
"menu-heading",
system_arguments[:classes]
)

Primer::BaseComponent.new(**system_arguments)
}

# Required list of navigational links
#
# @param href [String] URL to be used for the Link
# @param selected [Boolean] Whether the item is the current selection
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
renders_many :items, lambda { |href:, selected: false, **system_arguments|
deny_tag_argument(**system_arguments)
system_arguments[:tag] = :a
system_arguments[:href] = href
system_arguments[:"aria-current"] = :page if selected
system_arguments[:classes] = class_names(
"menu-item",
system_arguments[:classes]
)

Primer::BaseComponent.new(**system_arguments)
}

# @example Default
# <%= render(Primer::Alpha::Menu.new) do |c| %>
# <% c.with_heading(tag: :h2) do %>
# Heading
# <% end %>
# <% c.with_item(selected: true, href: "#url") do %>
# Item 1
# <% end %>
# <% c.with_item(href: "#url") do %>
# <%= render(Primer::OcticonComponent.new("check")) %>
# With Icon
# <% end %>
# <% c.with_item(href: "#url") do %>
# <%= render(Primer::OcticonComponent.new("check")) %>
# With Icon and Counter
# <%= render(Primer::Beta::Counter.new(count: 25)) %>
# <% end %>
# <% end %>
#
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
def initialize(**system_arguments)
@system_arguments = deny_tag_argument(**system_arguments)
@system_arguments[:tag] = :nav
@system_arguments[:classes] = class_names(
"menu",
@system_arguments[:classes]
)
end

def render?
items.any?
end
end
end
end
92 changes: 0 additions & 92 deletions app/components/primer/beta/button_group.pcss

This file was deleted.

Loading

0 comments on commit 0059d13

Please sign in to comment.