primer_view_components 0.0.19 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -1
- data/app/assets/javascripts/primer_view_components.js +2 -0
- data/app/assets/javascripts/primer_view_components.js.map +1 -0
- data/app/components/primer/avatar_component.rb +7 -7
- data/app/components/primer/avatar_stack_component.rb +3 -3
- data/app/components/primer/base_component.rb +1 -1
- data/app/components/primer/blankslate_component.html.erb +3 -3
- data/app/components/primer/blankslate_component.rb +16 -24
- data/app/components/primer/border_box_component.html.erb +4 -18
- data/app/components/primer/border_box_component.rb +58 -67
- data/app/components/primer/box_component.rb +2 -2
- data/app/components/primer/breadcrumb_component.html.erb +1 -2
- data/app/components/primer/breadcrumb_component.rb +24 -13
- data/app/components/primer/button_component.rb +2 -2
- data/app/components/primer/button_group_component.rb +1 -1
- data/app/components/primer/button_marketing_component.rb +2 -2
- data/app/components/primer/component.rb +4 -0
- data/app/components/primer/counter_component.rb +1 -1
- data/app/components/primer/details_component.html.erb +2 -6
- data/app/components/primer/details_component.rb +22 -35
- data/app/components/primer/dropdown_component.html.erb +2 -2
- data/app/components/primer/dropdown_component.rb +4 -6
- data/app/components/primer/dropdown_menu_component.rb +4 -4
- data/app/components/primer/flash_component.html.erb +4 -7
- data/app/components/primer/flash_component.rb +16 -20
- data/app/components/primer/flex_component.rb +4 -4
- data/app/components/primer/flex_item_component.rb +1 -1
- data/app/components/primer/heading_component.rb +3 -1
- data/app/components/primer/label_component.rb +15 -25
- data/app/components/primer/layout_component.rb +2 -2
- data/app/components/primer/link_component.rb +2 -2
- data/app/components/primer/markdown_component.rb +8 -8
- data/app/components/primer/menu_component.rb +1 -1
- data/app/components/primer/octicon_component.rb +5 -3
- data/app/components/primer/popover_component.rb +3 -3
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/app/components/primer/progress_bar_component.html.erb +1 -1
- data/app/components/primer/progress_bar_component.rb +27 -31
- data/app/components/primer/spinner_component.rb +3 -3
- data/app/components/primer/state_component.rb +21 -10
- data/app/components/primer/subhead_component.html.erb +3 -15
- data/app/components/primer/subhead_component.rb +45 -61
- data/app/components/primer/tab_container_component.js +1 -0
- data/app/components/primer/tab_container_component.rb +41 -0
- data/app/components/primer/tab_container_component.ts +1 -0
- data/app/components/primer/tab_nav_component.html.erb +17 -0
- data/app/components/primer/tab_nav_component.rb +108 -0
- data/app/components/primer/text_component.rb +1 -1
- data/app/components/primer/timeline_item_component.html.erb +4 -16
- data/app/components/primer/timeline_item_component.rb +41 -52
- data/app/components/primer/tooltip_component.rb +5 -5
- data/app/components/primer/truncate_component.rb +4 -4
- data/app/components/primer/underline_nav_component.rb +2 -2
- data/{lib → app/lib}/primer/class_name_helper.rb +0 -0
- data/{lib → app/lib}/primer/classify.rb +1 -3
- data/{lib → app/lib}/primer/classify/cache.rb +0 -0
- data/{lib → app/lib}/primer/fetch_or_fallback_helper.rb +0 -0
- data/{lib → app/lib}/primer/join_style_arguments_helper.rb +0 -0
- data/app/lib/primer/view_helper.rb +22 -0
- data/app/lib/primer/view_helper/dsl.rb +34 -0
- data/lib/primer/view_components/engine.rb +10 -2
- data/lib/primer/view_components/version.rb +5 -1
- data/static/statuses.json +1 -1
- metadata +18 -8
- data/app/components/primer/view_components.rb +0 -60
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
|
5
|
+
module Primer
|
6
|
+
# :nodoc:
|
7
|
+
module ViewHelper
|
8
|
+
# DSL to allow components to register a View Helper for shorthand calls.
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
#
|
12
|
+
# class MyComponent < ViewComponent::Base
|
13
|
+
# include Primer::ViewHelper::Dsl
|
14
|
+
# view_helper :my_component
|
15
|
+
# end
|
16
|
+
module Dsl
|
17
|
+
extend ActiveSupport::Concern
|
18
|
+
|
19
|
+
class ViewHelperAlreadyDefined < StandardError; end
|
20
|
+
|
21
|
+
included do
|
22
|
+
class_attribute :primer_helpers, instance_writer: false, default: {}
|
23
|
+
end
|
24
|
+
|
25
|
+
class_methods do
|
26
|
+
def view_helper(name)
|
27
|
+
raise ViewHelperAlreadyDefined, "#{name} is already defined" if primer_helpers[name].present?
|
28
|
+
|
29
|
+
primer_helpers[name] = self
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,12 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "rails/engine"
|
4
|
+
|
3
5
|
module Primer
|
4
6
|
module ViewComponents
|
5
7
|
# :nodoc:
|
6
8
|
class Engine < ::Rails::Engine
|
7
9
|
isolate_namespace Primer::ViewComponents
|
10
|
+
config.autoload_once_paths = %W[
|
11
|
+
#{root}/app/components
|
12
|
+
#{root}/app/lib
|
13
|
+
]
|
14
|
+
|
15
|
+
initializer "primer_view_components.assets" do |app|
|
16
|
+
app.config.assets.precompile += %w[primer_view_components] if app.config.respond_to?(:assets)
|
17
|
+
end
|
8
18
|
end
|
9
19
|
end
|
10
20
|
end
|
11
|
-
|
12
|
-
require "#{Primer::ViewComponents::Engine.root}/app/components/primer/view_components.rb"
|
@@ -5,9 +5,13 @@ module Primer
|
|
5
5
|
module VERSION
|
6
6
|
MAJOR = 0
|
7
7
|
MINOR = 0
|
8
|
-
PATCH =
|
8
|
+
PATCH = 24
|
9
9
|
|
10
10
|
STRING = [MAJOR, MINOR, PATCH].join(".")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
# rubocop:disable Rails/Output
|
16
|
+
puts Primer::ViewComponents::VERSION::STRING if __FILE__ == $PROGRAM_NAME
|
17
|
+
# rubocop:enable Rails/Output
|
data/static/statuses.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"Primer::AvatarComponent":"beta","Primer::AvatarStackComponent":"alpha","Primer::BaseComponent":"alpha","Primer::BlankslateComponent":"alpha","Primer::BorderBoxComponent":"beta","Primer::BoxComponent":"stable","Primer::BreadcrumbComponent":"alpha","Primer::ButtonComponent":"alpha","Primer::ButtonGroupComponent":"alpha","Primer::ButtonMarketingComponent":"alpha","Primer::CounterComponent":"beta","Primer::DetailsComponent":"alpha","Primer::Dropdown::MenuComponent":"alpha","Primer::DropdownComponent":"alpha","Primer::DropdownMenuComponent":"deprecated","Primer::FlashComponent":"beta","Primer::FlexComponent":"alpha","Primer::FlexItemComponent":"alpha","Primer::HeadingComponent":"alpha","Primer::LabelComponent":"
|
1
|
+
{"Primer::AvatarComponent":"beta","Primer::AvatarStackComponent":"alpha","Primer::BaseComponent":"alpha","Primer::BlankslateComponent":"alpha","Primer::BorderBoxComponent":"beta","Primer::BoxComponent":"stable","Primer::BreadcrumbComponent":"alpha","Primer::BreadcrumbComponent::ItemComponent":"alpha","Primer::ButtonComponent":"alpha","Primer::ButtonGroupComponent":"alpha","Primer::ButtonMarketingComponent":"alpha","Primer::CounterComponent":"beta","Primer::DetailsComponent":"alpha","Primer::Dropdown::MenuComponent":"alpha","Primer::DropdownComponent":"alpha","Primer::DropdownMenuComponent":"deprecated","Primer::FlashComponent":"beta","Primer::FlexComponent":"alpha","Primer::FlexItemComponent":"alpha","Primer::HeadingComponent":"alpha","Primer::LabelComponent":"beta","Primer::LayoutComponent":"alpha","Primer::LinkComponent":"beta","Primer::MarkdownComponent":"alpha","Primer::MenuComponent":"alpha","Primer::OcticonComponent":"beta","Primer::PopoverComponent":"alpha","Primer::ProgressBarComponent":"alpha","Primer::SpinnerComponent":"beta","Primer::StateComponent":"beta","Primer::SubheadComponent":"alpha","Primer::TabContainerComponent":"alpha","Primer::TabNavComponent":"alpha","Primer::TabNavComponent::TabComponent":"alpha","Primer::TextComponent":"alpha","Primer::TimelineItemComponent":"alpha","Primer::TimelineItemComponent::BadgeComponent":"alpha","Primer::TooltipComponent":"alpha","Primer::TruncateComponent":"alpha","Primer::UnderlineNavComponent":"alpha"}
|
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.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02
|
11
|
+
date: 2021-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octicons_helper
|
@@ -234,6 +234,8 @@ files:
|
|
234
234
|
- CHANGELOG.md
|
235
235
|
- LICENSE.txt
|
236
236
|
- README.md
|
237
|
+
- app/assets/javascripts/primer_view_components.js
|
238
|
+
- app/assets/javascripts/primer_view_components.js.map
|
237
239
|
- app/components/primer/avatar_component.rb
|
238
240
|
- app/components/primer/avatar_stack_component.html.erb
|
239
241
|
- app/components/primer/avatar_stack_component.rb
|
@@ -274,6 +276,8 @@ files:
|
|
274
276
|
- app/components/primer/octicon_component.rb
|
275
277
|
- app/components/primer/popover_component.html.erb
|
276
278
|
- app/components/primer/popover_component.rb
|
279
|
+
- app/components/primer/primer.js
|
280
|
+
- app/components/primer/primer.ts
|
277
281
|
- app/components/primer/progress_bar_component.html.erb
|
278
282
|
- app/components/primer/progress_bar_component.rb
|
279
283
|
- app/components/primer/slot.rb
|
@@ -282,6 +286,11 @@ files:
|
|
282
286
|
- app/components/primer/state_component.rb
|
283
287
|
- app/components/primer/subhead_component.html.erb
|
284
288
|
- app/components/primer/subhead_component.rb
|
289
|
+
- app/components/primer/tab_container_component.js
|
290
|
+
- app/components/primer/tab_container_component.rb
|
291
|
+
- app/components/primer/tab_container_component.ts
|
292
|
+
- app/components/primer/tab_nav_component.html.erb
|
293
|
+
- app/components/primer/tab_nav_component.rb
|
285
294
|
- app/components/primer/text_component.rb
|
286
295
|
- app/components/primer/timeline_item_component.html.erb
|
287
296
|
- app/components/primer/timeline_item_component.rb
|
@@ -289,12 +298,13 @@ files:
|
|
289
298
|
- app/components/primer/truncate_component.rb
|
290
299
|
- app/components/primer/underline_nav_component.html.erb
|
291
300
|
- app/components/primer/underline_nav_component.rb
|
292
|
-
- app/
|
293
|
-
- lib/primer/
|
294
|
-
- lib/primer/classify.rb
|
295
|
-
- lib/primer/
|
296
|
-
- lib/primer/
|
297
|
-
- lib/primer/
|
301
|
+
- app/lib/primer/class_name_helper.rb
|
302
|
+
- app/lib/primer/classify.rb
|
303
|
+
- app/lib/primer/classify/cache.rb
|
304
|
+
- app/lib/primer/fetch_or_fallback_helper.rb
|
305
|
+
- app/lib/primer/join_style_arguments_helper.rb
|
306
|
+
- app/lib/primer/view_helper.rb
|
307
|
+
- app/lib/primer/view_helper/dsl.rb
|
298
308
|
- lib/primer/view_components.rb
|
299
309
|
- lib/primer/view_components/engine.rb
|
300
310
|
- lib/primer/view_components/version.rb
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "active_support/core_ext"
|
4
|
-
|
5
|
-
# ViewComponent
|
6
|
-
|
7
|
-
require "view_component/engine"
|
8
|
-
|
9
|
-
# Octicons
|
10
|
-
|
11
|
-
require "octicons_helper/helper"
|
12
|
-
|
13
|
-
# Helpers
|
14
|
-
|
15
|
-
require "primer/class_name_helper"
|
16
|
-
require "primer/classify"
|
17
|
-
require "primer/fetch_or_fallback_helper"
|
18
|
-
require "primer/join_style_arguments_helper"
|
19
|
-
|
20
|
-
# Base configurations
|
21
|
-
|
22
|
-
require_relative "component"
|
23
|
-
require_relative "base_component"
|
24
|
-
require_relative "slot"
|
25
|
-
|
26
|
-
# Components
|
27
|
-
|
28
|
-
require_relative "avatar_component"
|
29
|
-
require_relative "avatar_stack_component"
|
30
|
-
require_relative "blankslate_component"
|
31
|
-
require_relative "border_box_component"
|
32
|
-
require_relative "box_component"
|
33
|
-
require_relative "breadcrumb_component"
|
34
|
-
require_relative "button_component"
|
35
|
-
require_relative "button_group_component"
|
36
|
-
require_relative "button_marketing_component"
|
37
|
-
require_relative "counter_component"
|
38
|
-
require_relative "details_component"
|
39
|
-
require_relative "dropdown_component"
|
40
|
-
require_relative "dropdown_menu_component"
|
41
|
-
require_relative "flash_component"
|
42
|
-
require_relative "flex_component"
|
43
|
-
require_relative "flex_item_component"
|
44
|
-
require_relative "heading_component"
|
45
|
-
require_relative "label_component"
|
46
|
-
require_relative "layout_component"
|
47
|
-
require_relative "link_component"
|
48
|
-
require_relative "markdown_component"
|
49
|
-
require_relative "menu_component"
|
50
|
-
require_relative "octicon_component"
|
51
|
-
require_relative "popover_component"
|
52
|
-
require_relative "progress_bar_component"
|
53
|
-
require_relative "spinner_component"
|
54
|
-
require_relative "state_component"
|
55
|
-
require_relative "subhead_component"
|
56
|
-
require_relative "text_component"
|
57
|
-
require_relative "timeline_item_component"
|
58
|
-
require_relative "tooltip_component"
|
59
|
-
require_relative "truncate_component"
|
60
|
-
require_relative "underline_nav_component"
|