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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b26233820f7e3fd5f92dbfe2b73b8ee9d4a59804bd93902bd98ab0cb2896d828
4
- data.tar.gz: 114d47251ebb0c4633a0d2b1e59bdddcd85a0c8aba2d2942d52598ef5e62f732
3
+ metadata.gz: 549fdec61b2c1c8c5ae3632f2cc567939f00e7679c7b350e86198e6c50db00fe
4
+ data.tar.gz: e2ea2f9570dbb93b53c5cddc6d4e98f1ed7b6918b4c7f1a879179b48ccfda0b3
5
5
  SHA512:
6
- metadata.gz: b6c4cff16a390f08f54d246a6e195862fa3572091f955ce74c85e47df31516deec98beb93ad8c4a526d51eb41b8ec1f5ef3c2e934d497fb81e6974e5df781aca
7
- data.tar.gz: 1943282801abaaa921514cf116286ad274b7f71ad8e41c8cda9456a9d57364a67039dd9ad53ca2f0108bdefc6e23bbdf56c749e911829a6a4981d1619e9b4167
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
- <%= render Primer::BaseComponent.new(tag: :div, position: :relative, display: :inline_block) do %>
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 %>
@@ -97,5 +97,11 @@ module Primer
97
97
  @tooltip_arguments[:type] = :label
98
98
  end
99
99
  end
100
+
101
+ private
102
+
103
+ def render_tooltip?
104
+ @system_arguments[:tag] != :summary
105
+ end
100
106
  end
101
107
  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) || @variant == :large ? :large : nil || DEFAULT_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)
@@ -6,4 +6,3 @@ import './local_time';
6
6
  import './image_crop';
7
7
  import './dropdown';
8
8
  import './alpha/tool-tip-element';
9
- import './alpha/segmented-control-element';
@@ -6,4 +6,3 @@ import './local_time';
6
6
  import './image_crop';
7
7
  import './dropdown';
8
8
  import './alpha/tool-tip-element';
9
- import './alpha/segmented-control-element';
@@ -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
 
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 88
8
+ PATCH = 89
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
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.88
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,8 +0,0 @@
1
- export default class SegmentedControlElement extends HTMLElement {
2
- constructor();
3
- }
4
- declare global {
5
- interface Window {
6
- SegmentedControlElement: typeof SegmentedControlElement;
7
- }
8
- }
@@ -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
- }