primer_view_components 0.0.88 → 0.0.89
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/components/primer/icon_button.html.erb +8 -2
- data/app/components/primer/icon_button.rb +6 -0
- data/app/components/primer/label_component.rb +2 -1
- data/app/components/primer/primer.d.ts +0 -1
- data/app/components/primer/primer.js +0 -1
- data/lib/primer/view_components/linters/flash_migration_counter.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- metadata +1 -3
- data/app/components/primer/alpha/segmented-control-element.d.ts +0 -8
- data/app/components/primer/alpha/segmented-control-element.js +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 549fdec61b2c1c8c5ae3632f2cc567939f00e7679c7b350e86198e6c50db00fe
|
4
|
+
data.tar.gz: e2ea2f9570dbb93b53c5cddc6d4e98f1ed7b6918b4c7f1a879179b48ccfda0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd33068d7ba46698d4e31afff8bf2edbb51472d04fdddd3a776835721ee80bf56e2fe2c398fd8545a66cdf1250b65b55f567ce488e14791737a6ccc955e54e90
|
7
|
+
data.tar.gz: 7bc316d92551cd6cfd15108fd864ad39a9322f3988936dc8d6aab73583d1ece0f8be035cadd637d2a352ea96ac2722b752926ee6e6136f6c61bdb70b4388f9e5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.0.89
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#1284](https://github.com/primer/view_components/pull/1284) [`401dac2a`](https://github.com/primer/view_components/commit/401dac2a1ab2e026b231399ddb03cfb51bc7742f) Thanks [@jonrohan](https://github.com/jonrohan)! - Don't render tooltip on IconButton when tag is a summary element
|
8
|
+
|
9
|
+
* [#1283](https://github.com/primer/view_components/pull/1283) [`ea1c29d7`](https://github.com/primer/view_components/commit/ea1c29d7fa0d917a729cba684bf5f8ae039bb228) Thanks [@jonrohan](https://github.com/jonrohan)! - Updating label component to not always have large
|
10
|
+
|
3
11
|
## 0.0.88
|
4
12
|
|
5
13
|
### Patch Changes
|
@@ -1,6 +1,12 @@
|
|
1
|
-
|
1
|
+
<% if render_tooltip? %>
|
2
|
+
<%= render Primer::BaseComponent.new(tag: :div, position: :relative, display: :inline_block) do %>
|
3
|
+
<%= render Primer::Beta::BaseButton.new(**@system_arguments) do -%>
|
4
|
+
<%= render Primer::OcticonComponent.new(icon: @icon) %>
|
5
|
+
<% end -%>
|
6
|
+
<%= render Primer::Alpha::Tooltip.new(**@tooltip_arguments) %>
|
7
|
+
<% end %>
|
8
|
+
<% else %>
|
2
9
|
<%= render Primer::Beta::BaseButton.new(**@system_arguments) do -%>
|
3
10
|
<%= render Primer::OcticonComponent.new(icon: @icon) %>
|
4
11
|
<% end -%>
|
5
|
-
<%= render Primer::Alpha::Tooltip.new(**@tooltip_arguments) %>
|
6
12
|
<% end %>
|
@@ -77,7 +77,8 @@ module Primer
|
|
77
77
|
|
78
78
|
@variant = fetch_or_fallback(VARIANT_OPTIONS, variant, nil, deprecated_values: DEPRECATED_VARIANT_OPTIONS)
|
79
79
|
@scheme = fetch_or_fallback(SCHEME_OPTIONS, scheme, DEFAULT_SCHEME, deprecated_values: DEPRECATED_SCHEME_OPTIONS)
|
80
|
-
@size = fetch_or_fallback(SIZE_OPTIONS, size
|
80
|
+
@size = fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)
|
81
|
+
@size = :large if @variant == :large
|
81
82
|
@inline = inline || @variant == :inline
|
82
83
|
|
83
84
|
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
|
@@ -12,7 +12,7 @@ module ERBLint
|
|
12
12
|
|
13
13
|
TAGS = %w[div].freeze
|
14
14
|
CLASSES = %w[flash].freeze
|
15
|
-
MESSAGE = "We are migrating flashes to use [Primer::Beta::Flash](https://primer.style/view-components/components/flash), please try to use that instead of raw HTML."
|
15
|
+
MESSAGE = "We are migrating flashes to use [Primer::Beta::Flash](https://primer.style/view-components/components/beta/flash), please try to use that instead of raw HTML."
|
16
16
|
ARGUMENT_MAPPER = ArgumentMappers::Flash
|
17
17
|
COMPONENT = "Primer::Beta::Flash"
|
18
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.89
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -412,8 +412,6 @@ files:
|
|
412
412
|
- app/components/primer/alpha/button_marketing.rb
|
413
413
|
- app/components/primer/alpha/layout.html.erb
|
414
414
|
- app/components/primer/alpha/layout.rb
|
415
|
-
- app/components/primer/alpha/segmented-control-element.d.ts
|
416
|
-
- app/components/primer/alpha/segmented-control-element.js
|
417
415
|
- app/components/primer/alpha/tab_nav.html.erb
|
418
416
|
- app/components/primer/alpha/tab_nav.rb
|
419
417
|
- app/components/primer/alpha/tab_panels.html.erb
|
@@ -1,27 +0,0 @@
|
|
1
|
-
/* eslint-disable custom-elements/no-constructor */
|
2
|
-
export default class SegmentedControlElement extends HTMLElement {
|
3
|
-
constructor() {
|
4
|
-
super();
|
5
|
-
this.addEventListener('click', (event) => {
|
6
|
-
const controls = Array.from(this.querySelectorAll('[role="toolbar"] button')).filter(tab => tab instanceof HTMLElement && tab.closest(this.tagName) === this);
|
7
|
-
if (!(event.target instanceof Element))
|
8
|
-
return;
|
9
|
-
if (event.target.closest(this.tagName) !== this)
|
10
|
-
return;
|
11
|
-
const selectedControl = event.target.closest('button');
|
12
|
-
if (!(selectedControl instanceof HTMLElement) || !selectedControl.closest('[role="toolbar"]'))
|
13
|
-
return;
|
14
|
-
for (const control of controls) {
|
15
|
-
control.classList.remove('SegmentedControl-button--selected');
|
16
|
-
control.setAttribute('aria-current', 'false');
|
17
|
-
}
|
18
|
-
selectedControl.classList.add('SegmentedControl-button--selected');
|
19
|
-
selectedControl.setAttribute('aria-current', 'true');
|
20
|
-
selectedControl.focus();
|
21
|
-
});
|
22
|
-
}
|
23
|
-
}
|
24
|
-
if (!window.customElements.get('segmented-control')) {
|
25
|
-
window.SegmentedControlElement = SegmentedControlElement;
|
26
|
-
window.customElements.define('segmented-control', SegmentedControlElement);
|
27
|
-
}
|