primer_view_components 0.0.49 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +158 -0
- data/app/components/primer/base_component.rb +2 -2
- data/app/components/primer/beta/avatar_stack.rb +9 -9
- data/app/components/primer/beta/truncate.html.erb +5 -0
- data/app/components/primer/beta/truncate.rb +110 -0
- data/app/components/primer/border_box_component.rb +27 -1
- data/app/components/primer/clipboard_copy.html.erb +2 -2
- data/app/components/primer/clipboard_copy.rb +1 -1
- data/app/components/primer/dropdown.rb +7 -7
- data/app/components/primer/icon_button.rb +1 -1
- data/app/components/primer/label_component.rb +13 -12
- data/app/components/primer/navigation/tab_component.rb +1 -1
- data/app/components/primer/progress_bar_component.rb +0 -3
- data/app/components/primer/tab_nav_component.rb +1 -1
- data/app/lib/primer/fetch_or_fallback_helper.rb +2 -0
- data/app/lib/primer/octicon/cache.rb +1 -1
- data/app/lib/primer/tabbed_component_helper.rb +1 -1
- data/app/lib/primer/view_helper.rb +1 -0
- data/lib/primer/classify/cache.rb +0 -5
- data/lib/primer/classify/flex.rb +1 -1
- data/lib/primer/classify/functional_colors.rb +1 -1
- data/lib/primer/classify/utilities.rb +19 -2
- data/lib/primer/classify/utilities.yml +16 -0
- data/lib/primer/classify/validation.rb +18 -0
- data/lib/primer/classify.rb +4 -18
- data/lib/primer/view_components/constants.rb +1 -1
- data/lib/primer/view_components/linters/argument_mappers/base.rb +63 -2
- data/lib/primer/view_components/linters/argument_mappers/button.rb +7 -11
- data/lib/primer/view_components/linters/argument_mappers/clipboard_copy.rb +2 -6
- data/lib/primer/view_components/linters/argument_mappers/close_button.rb +43 -0
- data/lib/primer/view_components/linters/argument_mappers/flash.rb +32 -0
- data/lib/primer/view_components/linters/argument_mappers/helpers/erb_block.rb +67 -0
- data/lib/primer/view_components/linters/argument_mappers/label.rb +5 -12
- data/lib/primer/view_components/linters/argument_mappers/system_arguments.rb +6 -5
- data/lib/primer/view_components/linters/autocorrectable.rb +6 -4
- data/lib/primer/view_components/linters/{helpers.rb → base_linter.rb} +69 -29
- data/lib/primer/view_components/linters/button_component_migration_counter.rb +4 -3
- data/lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb +3 -4
- data/lib/primer/view_components/linters/close_button_component_migration_counter.rb +123 -0
- data/lib/primer/view_components/linters/flash_component_migration_counter.rb +18 -3
- data/lib/primer/view_components/linters/label_component_migration_counter.rb +2 -3
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/config/default.yml +5 -0
- data/lib/rubocop/cop/primer/deprecated_arguments.rb +173 -0
- data/lib/rubocop/cop/primer/no_tag_memoize.rb +1 -0
- data/lib/rubocop/cop/primer/primer_octicon.rb +178 -0
- data/lib/rubocop/cop/primer/system_argument_instead_of_class.rb +12 -16
- data/lib/rubocop/cop/primer.rb +1 -2
- data/lib/tasks/coverage.rake +4 -0
- data/lib/tasks/docs.rake +3 -2
- data/lib/tasks/utilities.rake +7 -3
- data/lib/yard/docs_helper.rb +6 -3
- data/static/arguments.yml +7 -4
- data/static/classes.yml +8 -0
- data/static/constants.json +13 -1
- data/static/statuses.json +3 -1
- metadata +32 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4df5bb105c8b48aed71b4652afbf6814257fcb2c344085b328c27f8f109a80c1
|
4
|
+
data.tar.gz: 72ff93288cac5eb1cabdc7cb8031c488452499203d768fcf3795bbe18cb31a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3af26e886cc8998ef3d449471400319615c0e820ce7265316e6de6fda2b55340f7f7a82d3c7c78f5c4e393f60d7638126bd8e8a88675735bfe570d2958ee2484
|
7
|
+
data.tar.gz: aff9d0ca813126c33daab60f57bb01915ea8b779f17df99e648ec236f0da12bb9b16f54af24dfa871a50253663d71813533386457424f09f46a5458d5556a5b2
|
data/CHANGELOG.md
CHANGED
@@ -30,6 +30,164 @@ The category for changes related to documentation, testing and tooling. Also, fo
|
|
30
30
|
|
31
31
|
## main
|
32
32
|
|
33
|
+
## 0.0.53
|
34
|
+
|
35
|
+
### New
|
36
|
+
|
37
|
+
* Add autocorrection to `FlashComponent` linter when the context is basic text.
|
38
|
+
|
39
|
+
*Manuel Puyol*
|
40
|
+
|
41
|
+
### Updates
|
42
|
+
|
43
|
+
* Linters won't mark offenses when the ignore count is correct unless explicitly configured to do so.
|
44
|
+
|
45
|
+
*Manuel Puyol*
|
46
|
+
|
47
|
+
* Map the `for` argument when autofixing `ClipboardCopy` migrations.
|
48
|
+
|
49
|
+
*Kristján Oddsson*
|
50
|
+
|
51
|
+
* Add autocorrection for `CloseButton` linter.
|
52
|
+
|
53
|
+
*Manuel Puyol*
|
54
|
+
|
55
|
+
### Bug fixes
|
56
|
+
|
57
|
+
* Linters won't convert HTML special elements.
|
58
|
+
|
59
|
+
*Manuel Puyol*
|
60
|
+
|
61
|
+
### Misc
|
62
|
+
|
63
|
+
* Only run CHANGELOG CI on pull requests.
|
64
|
+
|
65
|
+
*Manuel Puyol*
|
66
|
+
|
67
|
+
* Run CI actions on pushes to main.
|
68
|
+
|
69
|
+
*Cameron Dutro*
|
70
|
+
|
71
|
+
* Get to 100% code coverage.
|
72
|
+
|
73
|
+
*Cameron Dutro*
|
74
|
+
|
75
|
+
## 0.0.52
|
76
|
+
|
77
|
+
### New
|
78
|
+
|
79
|
+
* Adding `Primer::Beta::Truncate` component to reflect changes in primer/css component [Truncate](https://primer.style/css/components/truncate).
|
80
|
+
|
81
|
+
*Jon Rohan*
|
82
|
+
|
83
|
+
* Add cop to look for deprecated system arguments and suggest replacements.
|
84
|
+
|
85
|
+
*Jon Rohan*
|
86
|
+
|
87
|
+
* Add cop to use `primer_octicon` in favor of `octicon`.
|
88
|
+
|
89
|
+
*Manuel Puyol*
|
90
|
+
|
91
|
+
* Fix release script so it doesn't loop continuously.
|
92
|
+
|
93
|
+
*Cameron Dutro*
|
94
|
+
|
95
|
+
### Updates
|
96
|
+
|
97
|
+
* Promote `ClipboardCopy` to beta.
|
98
|
+
|
99
|
+
*Manuel Puyol*
|
100
|
+
|
101
|
+
* PrimerOcticon linter supports `aria-` and `data-` attributes.
|
102
|
+
|
103
|
+
*Manuel Puyol*
|
104
|
+
|
105
|
+
* Linters can:
|
106
|
+
* convert values with ERB interpolations.
|
107
|
+
* autocorrect cases with custom classes.
|
108
|
+
|
109
|
+
*Manuel Puyol*
|
110
|
+
|
111
|
+
* Add a `scheme` option to `BorderBoxComponent` rows.
|
112
|
+
|
113
|
+
*Cameron Dutro*
|
114
|
+
|
115
|
+
* Upgrade rubocop and support Ruby 3.0.
|
116
|
+
|
117
|
+
*Cameron Dutro*
|
118
|
+
|
119
|
+
* Linters will not autocorrect cases where a required argument is missing.
|
120
|
+
|
121
|
+
*Manuel Puyol*
|
122
|
+
|
123
|
+
### Misc
|
124
|
+
|
125
|
+
* Update benchmarks to run in every supported Ruby version.
|
126
|
+
|
127
|
+
*Manuel Puyol*
|
128
|
+
|
129
|
+
* Add a linter generator.
|
130
|
+
|
131
|
+
*Manuel Puyol*
|
132
|
+
|
133
|
+
## 0.0.51
|
134
|
+
|
135
|
+
### Breaking changes
|
136
|
+
|
137
|
+
* Rename `width` and `height` System Arguments to `w` and `h`, resolving conflict with HTML attribute names.
|
138
|
+
|
139
|
+
*Manuel Puyol*
|
140
|
+
|
141
|
+
### Updates
|
142
|
+
|
143
|
+
* `SystemArgumentInsteadOfClass` linter will check for arguments in ViewHelpers.
|
144
|
+
|
145
|
+
*Manuel Puyol*
|
146
|
+
|
147
|
+
## 0.0.50
|
148
|
+
|
149
|
+
### Updates
|
150
|
+
|
151
|
+
* Fix incorrect slots syntax in docs.
|
152
|
+
|
153
|
+
*Joel Hawksley*, *Blake Williams*
|
154
|
+
|
155
|
+
### New
|
156
|
+
|
157
|
+
* Add linter suggestions for `CloseButton` component.
|
158
|
+
|
159
|
+
*Manuel Puyol*
|
160
|
+
|
161
|
+
### Breaking changes
|
162
|
+
|
163
|
+
* Update to `octicons` `v15`, removing open-ended dependency. See [https://github.com/primer/octicons/releases/tag/v15.0.0] for icon name changes in release.
|
164
|
+
|
165
|
+
*Joel Hawksley*
|
166
|
+
|
167
|
+
### Updates
|
168
|
+
|
169
|
+
* Don't require `title` for `Label`.
|
170
|
+
|
171
|
+
*Manuel Puyol*
|
172
|
+
|
173
|
+
* Improve autocorrectable linters to convert known SystemArgument classes.
|
174
|
+
|
175
|
+
*Manuel Puyol*
|
176
|
+
|
177
|
+
* Add support for `width: :full` and `height: :full` to System Arguments.
|
178
|
+
|
179
|
+
*Joel Hawksley*
|
180
|
+
|
181
|
+
### Bug fixes
|
182
|
+
|
183
|
+
* Update linters to not autocorrect attributes with ERB blocks.
|
184
|
+
|
185
|
+
*Manuel Puyol*
|
186
|
+
|
187
|
+
* Fix `:height` and `:width` docs to pull from Utilities
|
188
|
+
|
189
|
+
*Jon Rohan*
|
190
|
+
|
33
191
|
## 0.0.49
|
34
192
|
|
35
193
|
### New
|
@@ -79,7 +79,6 @@ module Primer
|
|
79
79
|
# | `flex_shrink` | Integer | To enable, set to `0`. |
|
80
80
|
# | `flex_wrap` | Symbol | <%= one_of(Primer::Classify::Flex::WRAP_MAPPINGS.keys) %> |
|
81
81
|
# | `justify_content` | Symbol | <%= one_of(Primer::Classify::Flex::JUSTIFY_CONTENT_VALUES) %> |
|
82
|
-
# | `width` | Symbol | <%= one_of([:fit]) %> |
|
83
82
|
#
|
84
83
|
# ## Grid
|
85
84
|
#
|
@@ -94,7 +93,8 @@ module Primer
|
|
94
93
|
# | Name | Type | Description |
|
95
94
|
# | :- | :- | :- |
|
96
95
|
# | `display` | Symbol | <%= one_of(Primer::Classify::Utilities.mappings(:display)) %> |
|
97
|
-
# | `
|
96
|
+
# | `w` | Symbol | <%= one_of(Primer::Classify::Utilities.mappings(:w)) %> Also supports integer values. |
|
97
|
+
# | `h` | Symbol | <%= one_of(Primer::Classify::Utilities.mappings(:h)) %> Also supports integer values. |
|
98
98
|
# | `hide` | Symbol | Hide the element at a specific breakpoint. <%= one_of(Primer::Classify::Utilities.mappings(:hide)) %> |
|
99
99
|
# | `visibility` | Symbol | Visibility. <%= one_of(Primer::Classify::Utilities.mappings(:visibility)) %> |
|
100
100
|
# | `vertical_align` | Symbol | <%= one_of(Primer::Classify::Utilities.mappings(:vertical_align)) %> |
|
@@ -21,23 +21,23 @@ module Primer
|
|
21
21
|
|
22
22
|
# @example Default
|
23
23
|
# <%= render(Primer::Beta::AvatarStack.new) do |c| %>
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
24
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
25
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
26
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
27
27
|
# <% end %>
|
28
28
|
#
|
29
29
|
# @example Align right
|
30
30
|
# <%= render(Primer::Beta::AvatarStack.new(align: :right)) do |c| %>
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
31
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
32
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
33
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
34
34
|
# <% end %>
|
35
35
|
#
|
36
36
|
# @example With tooltip
|
37
37
|
# <%= render(Primer::Beta::AvatarStack.new(tooltipped: true, body_arguments: { label: 'This is a tooltip!' })) do |c| %>
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
38
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
39
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
40
|
+
# <% c.avatar(src: "http://placekitten.com/200/200", alt: "@kittenuser") %>
|
41
41
|
# <% end %>
|
42
42
|
#
|
43
43
|
# @param tag [Symbol] <%= one_of(Primer::Beta::AvatarStack::TAG_OPTIONS) %>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Beta
|
5
|
+
# Use `Truncate` to shorten overflowing text with an ellipsis.
|
6
|
+
class Truncate < Primer::Component
|
7
|
+
status :beta
|
8
|
+
|
9
|
+
# Text slot used for the truncated text.
|
10
|
+
#
|
11
|
+
# @param priority [Boolean] if true, the text will be given priority
|
12
|
+
# @param expandable [Boolean] if true, the text will expand on hover or focus
|
13
|
+
# @param max_width [Integer] if provided, the text will be truncated at a maximum width
|
14
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
15
|
+
renders_many :items, "TruncateText"
|
16
|
+
|
17
|
+
# @example Default
|
18
|
+
# <%= render(Primer::Beta::Truncate.new) { "branch-name-that-is-really-long" } %>
|
19
|
+
#
|
20
|
+
# @example Multiple items
|
21
|
+
# <%= render(Primer::Beta::Truncate.new) do |component| %>
|
22
|
+
# <% component.item do %>really-long-repository-owner-name<% end %>
|
23
|
+
# <% component.item(font_weight: :bold) do %>
|
24
|
+
# <%= render(Primer::BaseComponent.new(tag: :span, font_weight: :normal)) { "/" } %> really-long-repository-name
|
25
|
+
# <% end %>
|
26
|
+
# <% end %>
|
27
|
+
#
|
28
|
+
# @example Advanced multiple items
|
29
|
+
# <%= render(Primer::Beta::Truncate.new(tag: :ol)) do |component| %>
|
30
|
+
# <% component.item(tag: :li) do %>primer<% end %>
|
31
|
+
# <% component.item(tag: :li, priority: true) do %>/ css<% end %>
|
32
|
+
# <% component.item(tag: :li) do %>/ Issues<% end %>
|
33
|
+
# <% component.item(tag: :li) do %>/ #123 —<% end %>
|
34
|
+
# <% component.item(tag: :li, priority: true) do %>
|
35
|
+
# Visual bug on primer.style found in lists
|
36
|
+
# <% end %>
|
37
|
+
# <% end %>
|
38
|
+
#
|
39
|
+
# @example Expand on hover or focus
|
40
|
+
# <%= render(Primer::Beta::Truncate.new) do |component| %>
|
41
|
+
# <% component.item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
|
42
|
+
# <% component.item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
|
43
|
+
# <% component.item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
|
44
|
+
# <% component.item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
|
45
|
+
# <% end %>
|
46
|
+
#
|
47
|
+
# @example Max widths
|
48
|
+
# <%= render(Primer::Beta::Truncate.new) do |component| %>
|
49
|
+
# <% component.item(max_width: 300, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
|
50
|
+
# <% component.item(max_width: 200, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
|
51
|
+
# <% component.item(max_width: 100, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
|
52
|
+
# <% end %>
|
53
|
+
#
|
54
|
+
# @example Max widths on new lines
|
55
|
+
# <%= render(Primer::Beta::Truncate.new) do |component| %>
|
56
|
+
# <% component.item(max_width: 300, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
|
57
|
+
# <% end %>
|
58
|
+
# <br/>
|
59
|
+
# <%= render(Primer::Beta::Truncate.new) do |component| %>
|
60
|
+
# <% component.item(max_width: 200, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
|
61
|
+
# <% end %>
|
62
|
+
# <br/>
|
63
|
+
# <%= render(Primer::Beta::Truncate.new) do |component| %>
|
64
|
+
# <% component.item(max_width: 100, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
|
65
|
+
# <% end %>
|
66
|
+
#
|
67
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
68
|
+
def initialize(**system_arguments)
|
69
|
+
@system_arguments = system_arguments
|
70
|
+
@system_arguments[:tag] = system_arguments[:tag] || :span
|
71
|
+
@system_arguments[:classes] = class_names(
|
72
|
+
"Truncate",
|
73
|
+
system_arguments[:classes]
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
def before_render
|
78
|
+
return unless content.present? && items.empty?
|
79
|
+
|
80
|
+
item { content }
|
81
|
+
end
|
82
|
+
|
83
|
+
def render?
|
84
|
+
items.any?
|
85
|
+
end
|
86
|
+
|
87
|
+
# This component is part of `Primer::Beta::Truncate` and should not be
|
88
|
+
# used as a standalone component.
|
89
|
+
class TruncateText < Primer::Component
|
90
|
+
def initialize(priority: false, expandable: false, max_width: nil, **system_arguments)
|
91
|
+
@system_arguments = system_arguments
|
92
|
+
@system_arguments[:tag] = system_arguments[:tag] || :span
|
93
|
+
@system_arguments[:classes] = class_names(
|
94
|
+
"Truncate-text",
|
95
|
+
"Truncate-text--primary": priority,
|
96
|
+
"Truncate-text--expandable": expandable
|
97
|
+
)
|
98
|
+
|
99
|
+
@system_arguments[:style] = join_style_arguments(@system_arguments[:style], "max-width: #{max_width}px;") unless max_width.nil?
|
100
|
+
end
|
101
|
+
|
102
|
+
def call
|
103
|
+
render(Primer::BaseComponent.new(**@system_arguments)) do
|
104
|
+
content
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -13,6 +13,14 @@ module Primer
|
|
13
13
|
}.freeze
|
14
14
|
PADDING_SUGGESTION = "Perhaps you could consider using :padding options of #{PADDING_MAPPINGS.keys.to_sentence}?"
|
15
15
|
|
16
|
+
DEFAULT_ROW_SCHEME = :default
|
17
|
+
ROW_SCHEME_MAPPINGS = {
|
18
|
+
DEFAULT_ROW_SCHEME => "",
|
19
|
+
:neutral => "Box-row--gray",
|
20
|
+
:info => "Box-row--blue",
|
21
|
+
:warning => "Box-row--yellow"
|
22
|
+
}.freeze
|
23
|
+
|
16
24
|
# Optional Header.
|
17
25
|
#
|
18
26
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
@@ -54,11 +62,13 @@ module Primer
|
|
54
62
|
|
55
63
|
# Use Rows to add rows with borders and maintain the same padding.
|
56
64
|
#
|
65
|
+
# @param scheme [Symbol] Color scheme. <%= one_of(Primer::BorderBoxComponent::ROW_SCHEME_MAPPINGS.keys) %>
|
57
66
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
58
|
-
renders_many :rows, lambda {
|
67
|
+
renders_many :rows, lambda { |scheme: DEFAULT_ROW_SCHEME, **system_arguments|
|
59
68
|
system_arguments[:tag] = :li
|
60
69
|
system_arguments[:classes] = class_names(
|
61
70
|
"Box-row",
|
71
|
+
ROW_SCHEME_MAPPINGS[fetch_or_fallback(ROW_SCHEME_MAPPINGS.keys, scheme, DEFAULT_ROW_SCHEME)],
|
62
72
|
system_arguments[:classes]
|
63
73
|
)
|
64
74
|
|
@@ -102,6 +112,22 @@ module Primer
|
|
102
112
|
# <% end %>
|
103
113
|
# <% end %>
|
104
114
|
#
|
115
|
+
# @example Row colors
|
116
|
+
# <%= render(Primer::BorderBoxComponent.new) do |component| %>
|
117
|
+
# <% component.row do %>
|
118
|
+
# Default
|
119
|
+
# <% end %>
|
120
|
+
# <% component.row(scheme: :neutral) do %>
|
121
|
+
# Neutral
|
122
|
+
# <% end %>
|
123
|
+
# <% component.row(scheme: :info) do %>
|
124
|
+
# Info
|
125
|
+
# <% end %>
|
126
|
+
# <% component.row(scheme: :warning) do %>
|
127
|
+
# Warning
|
128
|
+
# <% end %>
|
129
|
+
# <% end %>
|
130
|
+
#
|
105
131
|
# @param padding [Symbol] <%= one_of(Primer::BorderBoxComponent::PADDING_MAPPINGS.keys) %>
|
106
132
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
107
133
|
def initialize(padding: DEFAULT_PADDING, **system_arguments)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% if content.present? %>
|
3
3
|
<%= content %>
|
4
4
|
<% else %>
|
5
|
-
<%= render Primer::OcticonComponent.new(
|
6
|
-
<%= render Primer::OcticonComponent.new(
|
5
|
+
<%= render Primer::OcticonComponent.new(:paste) %>
|
6
|
+
<%= render Primer::OcticonComponent.new(:check, color: :icon_success, style: "display: none;") %>
|
7
7
|
<% end %>
|
8
8
|
<% end %>
|
@@ -6,7 +6,7 @@ module Primer
|
|
6
6
|
# @accessibility
|
7
7
|
# Always set an accessible label to help the user interact with the component.
|
8
8
|
class ClipboardCopy < Primer::Component
|
9
|
-
status :
|
9
|
+
status :beta
|
10
10
|
|
11
11
|
# @example Default
|
12
12
|
# <%= render(Primer::ClipboardCopy.new(value: "Text to copy", "aria-label": "Copy text to the system clipboard")) %>
|
@@ -28,7 +28,7 @@ module Primer
|
|
28
28
|
# Dropdown
|
29
29
|
# <% end %>
|
30
30
|
#
|
31
|
-
#
|
31
|
+
# <% c.menu(header: "Options") do |menu|
|
32
32
|
# menu.item { "Item 1" }
|
33
33
|
# menu.item { "Item 2" }
|
34
34
|
# menu.item { "Item 3" }
|
@@ -45,7 +45,7 @@ module Primer
|
|
45
45
|
# Dropdown
|
46
46
|
# <% end %>
|
47
47
|
#
|
48
|
-
#
|
48
|
+
# <% c.menu(header: "Options") do |menu|
|
49
49
|
# menu.item { "Item 1" }
|
50
50
|
# menu.item { "Item 2" }
|
51
51
|
# menu.item(divider: true)
|
@@ -63,7 +63,7 @@ module Primer
|
|
63
63
|
# Dropdown
|
64
64
|
# <% end %>
|
65
65
|
#
|
66
|
-
#
|
66
|
+
# <% c.menu(header: "Options", direction: :s) do |menu|
|
67
67
|
# menu.item { "Item 1" }
|
68
68
|
# menu.item { "Item 2" }
|
69
69
|
# menu.item { "Item 3" }
|
@@ -77,7 +77,7 @@ module Primer
|
|
77
77
|
# Dropdown
|
78
78
|
# <% end %>
|
79
79
|
#
|
80
|
-
#
|
80
|
+
# <% c.menu(header: "Options") do |menu|
|
81
81
|
# menu.item { "Item 1" }
|
82
82
|
# menu.item { "Item 2" }
|
83
83
|
# menu.item { "Item 3" }
|
@@ -91,7 +91,7 @@ module Primer
|
|
91
91
|
# Dropdown
|
92
92
|
# <% end %>
|
93
93
|
#
|
94
|
-
#
|
94
|
+
# <% c.menu(header: "Options") do |menu|
|
95
95
|
# menu.item { "Item 1" }
|
96
96
|
# menu.item { "Item 2" }
|
97
97
|
# menu.item { "Item 3" }
|
@@ -105,7 +105,7 @@ module Primer
|
|
105
105
|
# Dropdown
|
106
106
|
# <% end %>
|
107
107
|
#
|
108
|
-
#
|
108
|
+
# <% c.menu(as: :list, header: "Options") do |menu|
|
109
109
|
# menu.item { "Item 1" }
|
110
110
|
# menu.item { "Item 2" }
|
111
111
|
# menu.item(divider: true)
|
@@ -120,7 +120,7 @@ module Primer
|
|
120
120
|
# Dropdown
|
121
121
|
# <% end %>
|
122
122
|
#
|
123
|
-
#
|
123
|
+
# <% c.menu(header: "Options") do |menu|
|
124
124
|
# menu.item(tag: :button) { "Item 1" }
|
125
125
|
# menu.item(classes: "custom-class") { "Item 2" }
|
126
126
|
# menu.item { "Item 3" }
|