primer_view_components 0.0.62 → 0.0.63

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: adce588d18cdf5a429f1cfbf22474252e3bfb96e929c7a991590069b38d7a8c6
4
- data.tar.gz: d7c0ada1fa78d39d82b7beb6ef90b1900b923a4fcc0a401f5dc14a0f7e8d157e
3
+ metadata.gz: 3512259d91cf17fa6a17c0cb75037b3bc438d14ea16da0d8190d6fa7988d4c6e
4
+ data.tar.gz: d0a59b08f193f263b5261c94923d48f613090128e898588b3f1a8132ae7cff63
5
5
  SHA512:
6
- metadata.gz: 1d7a91266039e243395f6a630a1fa7838e1ca8cc6a038e66f22ad286e2b80e7c937408ce6f2f71bd3c2474680818d2a6fd0017a1ccc390432a83a331564309c8
7
- data.tar.gz: 4f9d8101365c03c8fe01cd9b18da13ea6d602e93469511dd3d8b0792861f8d9f34a78b4a6137e6d80ebfa67c0387e46dd3fd391c6547cf232accc24536310b21
6
+ metadata.gz: 20ff155c9aad794c3712b478cedfba3abf2d83888a5b4c20af97600cfc4a2000173582585d1c9656806636f499b2c57505ab609352bc00cfa678bb980030fef7
7
+ data.tar.gz: 0da39969c71bcf2c102606f633d31ff213ade782744df47022c7a09d1178d0c4dc161d4b9c5f03848f5f8ec3c6cac63acc43b3e8d3563b106429800a02147667
data/CHANGELOG.md CHANGED
@@ -30,6 +30,34 @@ The category for changes related to documentation, testing and tooling. Also, fo
30
30
 
31
31
  ## main
32
32
 
33
+ ## 0.0.63
34
+
35
+ ### Breaking Changes
36
+
37
+ * Rename `caret` argument to `dropdown` in `ButtonComponent`.
38
+
39
+ *Manuel Puyol*
40
+
41
+ * Remove `:large` variant from `ButtonComponent`.
42
+
43
+ *Manuel Puyol*
44
+
45
+ * Update `Spinner` to add system arguments to outermost element
46
+
47
+ *Charlotte Dann*
48
+
49
+ ### Deprecations
50
+
51
+ * Deprecate `icon` and `counter` slots in `ButtonComponent` in favor of `leading_visual` and `trailing_visual`.
52
+
53
+ *Manuel Puyol*
54
+
55
+ ### Bug Fixes
56
+
57
+ * Fix `PopoverComponent`, allowing to reset `left` and `right` positioning.
58
+
59
+ *Manuel Puyol*
60
+
33
61
  ## 0.0.62
34
62
 
35
63
  ### New
@@ -60,11 +88,11 @@ The category for changes related to documentation, testing and tooling. Also, fo
60
88
 
61
89
  ### Breaking Changes
62
90
 
63
- * Add a warning to users if they try to use `tag:` parameters on a component where the tag is fixed
91
+ * Add a warning to users if they try to use `tag:` parameters on a component where the tag is fixed.
64
92
 
65
93
  *Owen Niblock*
66
94
 
67
- * Updating to @primer/css@19.0.0 and @primer/primitives@7.1.0. Which removes support for deprecated system color arguments
95
+ * Updating to @primer/css@19.0.0 and @primer/primitives@7.1.0. Which removes support for deprecated system color arguments.
68
96
 
69
97
  *Jon Rohan*
70
98
 
@@ -9,8 +9,6 @@ module Primer
9
9
  # - `secondary_action` can be set to provide more information that is relevant in the context of the `Blankslate`.
10
10
  # - `secondary_action` text should be meaningful out of context and clearly describe the destination. Avoid using vague text like, "Learn more" or "Click here".
11
11
  class Blankslate < Primer::Component
12
- include ViewComponent::PolymorphicSlots
13
-
14
12
  status :beta
15
13
 
16
14
  VISUAL_OPTIONS = %i[icon spinner image].freeze
@@ -1,3 +1,3 @@
1
1
  <%= render Primer::BaseButton.new(**@system_arguments) do -%>
2
- <%= icon %><%= trimmed_content %><%= counter %><%= primer_octicon("triangle-down", mr: -1) if @caret %>
2
+ <%= leading_visual %><%= trimmed_content %><%= trailing_visual %><%= primer_octicon("triangle-down", mr: -1) if @dropdown %>
3
3
  <% end -%>
@@ -20,28 +20,41 @@ module Primer
20
20
  DEFAULT_VARIANT = :medium
21
21
  VARIANT_MAPPINGS = {
22
22
  :small => "btn-sm",
23
- DEFAULT_VARIANT => "",
24
- :large => "btn-large"
23
+ DEFAULT_VARIANT => ""
25
24
  }.freeze
26
25
  VARIANT_OPTIONS = VARIANT_MAPPINGS.keys
27
26
 
28
- # Icon to be rendered in the button.
27
+ # Leading visuals appear to the left of the button text.
28
+ #
29
+ # Use:
30
+ #
31
+ # - `leading_visual_icon` for a <%= link_to_component(Primer::OcticonComponent) %>.
29
32
  #
30
33
  # @param system_arguments [Hash] Same arguments as <%= link_to_component(Primer::OcticonComponent) %>.
31
- renders_one :icon, lambda { |**system_arguments|
32
- system_arguments[:mr] = 2
34
+ renders_one :leading_visual, types: {
35
+ icon: lambda { |**system_arguments|
36
+ system_arguments[:mr] = 2
33
37
 
34
- Primer::OcticonComponent.new(**system_arguments)
38
+ Primer::OcticonComponent.new(**system_arguments)
39
+ }
35
40
  }
41
+ alias icon leading_visual_icon # remove alias when all buttons are migrated to new slot names
36
42
 
37
- # Counter to be rendered in the button.
43
+ # Trailing visuals appear to the right of the button text.
44
+ #
45
+ # Use:
46
+ #
47
+ # - `trailing_visual_counter` for a <%= link_to_component(Primer::CounterComponent) %>.
38
48
  #
39
49
  # @param system_arguments [Hash] Same arguments as <%= link_to_component(Primer::CounterComponent) %>.
40
- renders_one :counter, lambda { |**system_arguments|
41
- system_arguments[:ml] = 2
50
+ renders_one :trailing_visual, types: {
51
+ counter: lambda { |**system_arguments|
52
+ system_arguments[:ml] = 2
42
53
 
43
- Primer::CounterComponent.new(**system_arguments)
54
+ Primer::CounterComponent.new(**system_arguments)
55
+ }
44
56
  }
57
+ alias counter trailing_visual_counter # remove alias when all buttons are migrated to new slot names
45
58
 
46
59
  # @example Schemes
47
60
  # <%= render(Primer::ButtonComponent.new) { "Default" } %>
@@ -54,33 +67,32 @@ module Primer
54
67
  # @example Variants
55
68
  # <%= render(Primer::ButtonComponent.new(variant: :small)) { "Small" } %>
56
69
  # <%= render(Primer::ButtonComponent.new(variant: :medium)) { "Medium" } %>
57
- # <%= render(Primer::ButtonComponent.new(variant: :large)) { "Large" } %>
58
70
  #
59
71
  # @example Block
60
72
  # <%= render(Primer::ButtonComponent.new(block: :true)) { "Block" } %>
61
73
  # <%= render(Primer::ButtonComponent.new(block: :true, scheme: :primary)) { "Primary block" } %>
62
74
  #
63
- # @example With icons
75
+ # @example With leading visual
64
76
  # <%= render(Primer::ButtonComponent.new) do |c| %>
65
- # <% c.icon(icon: :star) %>
77
+ # <% c.leading_visual_icon(icon: :star) %>
66
78
  # Button
67
79
  # <% end %>
68
80
  #
69
- # @example With counter
81
+ # @example With trailing visual
70
82
  # <%= render(Primer::ButtonComponent.new) do |c| %>
71
- # <% c.counter(count: 15) %>
83
+ # <% c.trailing_visual_counter(count: 15) %>
72
84
  # Button
73
85
  # <% end %>
74
86
  #
75
- # @example With icons and counter
87
+ # @example With leading and trailing visuals
76
88
  # <%= render(Primer::ButtonComponent.new) do |c| %>
77
- # <% c.icon(icon: :star) %>
78
- # <% c.counter(count: 15) %>
89
+ # <% c.leading_visual_icon(icon: :star) %>
90
+ # <% c.trailing_visual_counter(count: 15) %>
79
91
  # Button
80
92
  # <% end %>
81
93
  #
82
- # @example With caret
83
- # <%= render(Primer::ButtonComponent.new(caret: true)) do %>
94
+ # @example With dropdown caret
95
+ # <%= render(Primer::ButtonComponent.new(dropdown: true)) do %>
84
96
  # Button
85
97
  # <% end %>
86
98
  #
@@ -90,18 +102,18 @@ module Primer
90
102
  # @param type [Symbol] (Primer::BaseButton::DEFAULT_TYPE) <%= one_of(Primer::BaseButton::TYPE_OPTIONS) %>
91
103
  # @param group_item [Boolean] Whether button is part of a ButtonGroup.
92
104
  # @param block [Boolean] Whether button is full-width with `display: block`.
93
- # @param caret [Boolean] Whether or not to render a caret.
105
+ # @param dropdown [Boolean] Whether or not to render a dropdown caret.
94
106
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
95
107
  def initialize(
96
108
  scheme: DEFAULT_SCHEME,
97
109
  variant: DEFAULT_VARIANT,
98
110
  group_item: false,
99
111
  block: false,
100
- caret: false,
112
+ dropdown: false,
101
113
  **system_arguments
102
114
  )
103
115
  @scheme = scheme
104
- @caret = caret
116
+ @dropdown = dropdown
105
117
 
106
118
  @system_arguments = system_arguments
107
119
  @system_arguments[:classes] = class_names(
@@ -34,13 +34,6 @@ module Primer
34
34
  # <% component.button(scheme: :outline) { "Outline" } %>
35
35
  # <% end %>
36
36
  #
37
- # <%= render(Primer::ButtonGroup.new(variant: :large)) do |component| %>
38
- # <% component.button { "Default" } %>
39
- # <% component.button(scheme: :primary) { "Primary" } %>
40
- # <% component.button(scheme: :danger) { "Danger" } %>
41
- # <% component.button(scheme: :outline) { "Outline" } %>
42
- # <% end %>
43
- #
44
37
  # @param variant [Symbol] <%= one_of(Primer::ButtonComponent::VARIANT_OPTIONS) %>
45
38
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
46
39
  def initialize(variant: Primer::ButtonComponent::DEFAULT_VARIANT, **system_arguments)
@@ -6,6 +6,7 @@ module Primer
6
6
  # @private
7
7
  class Component < ViewComponent::Base
8
8
  include ViewComponent::SlotableV2 unless ViewComponent::Base < ViewComponent::SlotableV2
9
+ include ViewComponent::PolymorphicSlots
9
10
  include ClassNameHelper
10
11
  include FetchOrFallbackHelper
11
12
  include TestSelectorHelper
@@ -9,7 +9,7 @@ module Primer
9
9
  renders_one :button, lambda { |**system_arguments, &block|
10
10
  @button_arguments = system_arguments
11
11
  @button_arguments[:button] = true
12
- @button_arguments[:caret] = @with_caret
12
+ @button_arguments[:dropdown] = @with_caret
13
13
 
14
14
  view_context.capture { block&.call }
15
15
  }
@@ -115,8 +115,8 @@ module Primer
115
115
  "Popover"
116
116
  )
117
117
  @system_arguments[:position] ||= :relative
118
- @system_arguments[:right] = false unless system_arguments.key?(:right)
119
- @system_arguments[:left] = false unless system_arguments.key?(:left)
118
+ @system_arguments[:right] = false unless @system_arguments.delete(:right)
119
+ @system_arguments[:left] = false unless @system_arguments.delete(:left)
120
120
  end
121
121
 
122
122
  def render?
@@ -1,7 +1,15 @@
1
- <span role="status">
1
+ <%= render Primer::BaseComponent.new(**@system_arguments) do %>
2
2
  <span class="sr-only">Loading</span>
3
- <%= render Primer::BaseComponent.new(**@system_arguments) do %>
3
+ <%= render Primer::BaseComponent.new(
4
+ tag: :svg,
5
+ viewBox: '0 0 16 16',
6
+ fill: :none,
7
+ animation: :rotate,
8
+ width: @size,
9
+ height: @size,
10
+ vertical_align: :bottom
11
+ ) do %>
4
12
  <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-opacity="0.25" stroke-width="2" vector-effect="non-scaling-stroke" />
5
13
  <path d="M15 8a7.002 7.002 0 00-7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke" />
6
14
  <% end %>
7
- </span>
15
+ <% end %>
@@ -31,13 +31,12 @@ module Primer
31
31
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
32
32
  def initialize(size: DEFAULT_SIZE, style: DEFAULT_STYLE, **system_arguments)
33
33
  @system_arguments = deny_tag_argument(**system_arguments)
34
- @system_arguments[:tag] = :svg
34
+ @system_arguments[:tag] = :span
35
+ @system_arguments[:role] = :status
36
+ @system_arguments[:display] = :inline_block
35
37
  @system_arguments[:style] ||= style
36
- @system_arguments[:animation] = :rotate
37
- @system_arguments[:width] = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
38
- @system_arguments[:height] = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
39
- @system_arguments[:viewBox] = "0 0 16 16"
40
- @system_arguments[:fill] = :none
38
+
39
+ @size = SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, DEFAULT_SIZE)]
41
40
  end
42
41
  end
43
42
  end
@@ -1497,15 +1497,23 @@
1497
1497
  :normal:
1498
1498
  - text-normal
1499
1499
  :top:
1500
+ 0:
1501
+ - top-0
1500
1502
  false:
1501
1503
  - top-0
1502
1504
  :bottom:
1505
+ 0:
1506
+ - bottom-0
1503
1507
  false:
1504
1508
  - bottom-0
1505
1509
  :left:
1510
+ 0:
1511
+ - left-0
1506
1512
  false:
1507
1513
  - left-0
1508
1514
  :right:
1515
+ 0:
1516
+ - right-0
1509
1517
  false:
1510
1518
  - right-0
1511
1519
  :underline:
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 62
8
+ PATCH = 63
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
@@ -18,17 +18,25 @@
18
18
  :normal:
19
19
  - text-normal
20
20
  :top:
21
+ 0:
22
+ - top-0
21
23
  false:
22
24
  - top-0
23
25
  :bottom:
26
+ 0:
27
+ - bottom-0
24
28
  false:
25
29
  - bottom-0
26
30
  :left:
31
+ 0:
32
+ - left-0
27
33
  false:
28
34
  - left-0
29
35
  :right:
36
+ 0:
37
+ - right-0
30
38
  false:
31
- - right-0
39
+ - right-0
32
40
  :underline:
33
41
  true:
34
42
  - text-underline
data/static/arguments.yml CHANGED
@@ -326,7 +326,7 @@
326
326
  - name: variant
327
327
  type: Symbol
328
328
  default: "`:medium`"
329
- description: One of `:large`, `:medium`, or `:small`.
329
+ description: One of `:medium` and `:small`.
330
330
  - name: tag
331
331
  type: Symbol
332
332
  default: "`:button`"
@@ -343,10 +343,10 @@
343
343
  type: Boolean
344
344
  default: "`false`"
345
345
  description: 'Whether button is full-width with `display: block`.'
346
- - name: caret
346
+ - name: dropdown
347
347
  type: Boolean
348
348
  default: "`false`"
349
- description: Whether or not to render a caret.
349
+ description: Whether or not to render a dropdown caret.
350
350
  - name: system_arguments
351
351
  type: Hash
352
352
  default: N/A
@@ -357,7 +357,7 @@
357
357
  - name: variant
358
358
  type: Symbol
359
359
  default: "`:medium`"
360
- description: One of `:large`, `:medium`, or `:small`.
360
+ description: One of `:medium` and `:small`.
361
361
  - name: system_arguments
362
362
  type: Hash
363
363
  default: N/A
data/static/classes.yml CHANGED
@@ -96,7 +96,6 @@
96
96
  - ".btn-block"
97
97
  - ".btn-danger"
98
98
  - ".btn-invisible"
99
- - ".btn-large"
100
99
  - ".btn-large-mktg"
101
100
  - ".btn-link"
102
101
  - ".btn-mktg"
@@ -203,3 +202,4 @@
203
202
  - ".tooltipped-n"
204
203
  - ".tooltipped-no-delay"
205
204
  - ".tooltipped-s"
205
+ - ".v-align-bottom"
@@ -299,13 +299,11 @@
299
299
  ],
300
300
  "VARIANT_MAPPINGS": {
301
301
  "small": "btn-sm",
302
- "medium": "",
303
- "large": "btn-large"
302
+ "medium": ""
304
303
  },
305
304
  "VARIANT_OPTIONS": [
306
305
  "small",
307
- "medium",
308
- "large"
306
+ "medium"
309
307
  ]
310
308
  },
311
309
  "Primer::ButtonGroup": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.62
4
+ version: 0.0.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-02 00:00:00.000000000 Z
11
+ date: 2021-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -366,7 +366,7 @@ dependencies:
366
366
  - - "~>"
367
367
  - !ruby/object:Gem::Version
368
368
  version: 0.9.25
369
- description:
369
+ description:
370
370
  email:
371
371
  - opensource+primer_view_components@github.com
372
372
  executables: []
@@ -391,10 +391,6 @@ files:
391
391
  - app/components/primer/alpha/underline_nav.rb
392
392
  - app/components/primer/alpha/underline_panels.html.erb
393
393
  - app/components/primer/alpha/underline_panels.rb
394
- - app/components/primer/auto_complete/auto_complete.d.ts
395
- - app/components/primer/auto_complete/auto_complete.js
396
- - app/components/primer/auto_complete/auto_component.d.ts
397
- - app/components/primer/auto_complete/auto_component.js
398
394
  - app/components/primer/base_button.rb
399
395
  - app/components/primer/base_component.rb
400
396
  - app/components/primer/beta/auto_complete.rb
@@ -573,7 +569,7 @@ licenses:
573
569
  - MIT
574
570
  metadata:
575
571
  allowed_push_host: https://rubygems.org
576
- post_install_message:
572
+ post_install_message:
577
573
  rdoc_options: []
578
574
  require_paths:
579
575
  - lib
@@ -588,8 +584,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
588
584
  - !ruby/object:Gem::Version
589
585
  version: '0'
590
586
  requirements: []
591
- rubygems_version: 3.1.2
592
- signing_key:
587
+ rubygems_version: 3.1.6
588
+ signing_key:
593
589
  specification_version: 4
594
590
  summary: ViewComponents for the Primer Design System
595
591
  test_files: []
@@ -1 +0,0 @@
1
- import '@github/auto-complete-element';
@@ -1 +0,0 @@
1
- import '@github/auto-complete-element';
@@ -1 +0,0 @@
1
- import '@github/auto-complete-element';
@@ -1 +0,0 @@
1
- import '@github/auto-complete-element';