primer_view_components 0.0.39 → 0.0.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +66 -2
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/components/primer/avatar_stack_component.rb +5 -2
  6. data/app/components/primer/base_component.rb +2 -2
  7. data/app/components/primer/blankslate_component.rb +3 -3
  8. data/app/components/primer/button_group.rb +1 -1
  9. data/app/components/primer/component.rb +5 -0
  10. data/app/components/primer/counter_component.rb +6 -1
  11. data/app/components/primer/flex_component.rb +27 -0
  12. data/app/components/primer/flex_item_component.rb +1 -1
  13. data/app/components/primer/heading_component.rb +11 -18
  14. data/app/components/primer/hidden_text_expander.rb +1 -1
  15. data/app/components/primer/icon_button.rb +20 -3
  16. data/app/components/primer/image_crop.d.ts +1 -0
  17. data/app/components/primer/image_crop.html.erb +12 -0
  18. data/app/components/primer/image_crop.js +1 -0
  19. data/app/components/primer/image_crop.rb +36 -0
  20. data/app/components/primer/image_crop.ts +1 -0
  21. data/app/components/primer/{markdown_component.rb → markdown.rb} +5 -4
  22. data/app/components/primer/octicon_component.html.erb +7 -0
  23. data/app/components/primer/octicon_component.rb +15 -8
  24. data/app/components/primer/octicon_symbols_component.html.erb +3 -0
  25. data/app/components/primer/octicon_symbols_component.rb +61 -0
  26. data/app/components/primer/primer.d.ts +1 -0
  27. data/app/components/primer/primer.js +1 -0
  28. data/app/components/primer/primer.ts +1 -0
  29. data/app/components/primer/spinner_component.rb +2 -2
  30. data/app/components/primer/subhead_component.rb +34 -4
  31. data/app/components/primer/text_component.rb +5 -2
  32. data/app/lib/primer/classify.rb +1 -1
  33. data/app/lib/primer/classify/cache.rb +1 -1
  34. data/app/lib/primer/octicon/cache.rb +4 -0
  35. data/lib/primer/view_components.rb +1 -1
  36. data/lib/primer/view_components/version.rb +1 -1
  37. data/lib/tasks/coverage.rake +14 -0
  38. data/lib/tasks/docs.rake +312 -0
  39. data/lib/tasks/statuses.rake +12 -0
  40. data/lib/yard/docs_helper.rb +57 -0
  41. data/static/statuses.json +52 -1
  42. metadata +15 -3
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :statuses do
4
+ task :dump do
5
+ require File.expand_path("./../../demo/config/environment.rb", __dir__)
6
+ require "primer/view_components"
7
+ # Loads all components for `.descendants` to work properly
8
+ Dir["./app/components/primer/**/*.rb"].sort.each { |file| require file }
9
+
10
+ Primer::ViewComponents.dump_statuses
11
+ end
12
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YARD
4
+ # Helper methods to use for yard documentation
5
+ module DocsHelper
6
+ def one_of(enumerable, lower: false)
7
+ values =
8
+ case enumerable
9
+ when Hash
10
+ enumerable.map do |key, value|
11
+ "#{pretty_value(key)} (#{pretty_value(value)})"
12
+ end
13
+ else
14
+ enumerable.map do |key|
15
+ pretty_value(key)
16
+ end
17
+ end
18
+
19
+ prefix = "One of"
20
+ prefix = prefix.downcase if lower
21
+
22
+ "#{prefix} #{values.to_sentence(last_word_connector: ', or ')}."
23
+ end
24
+
25
+ def link_to_system_arguments_docs
26
+ "[System arguments](/system-arguments)"
27
+ end
28
+
29
+ def link_to_typography_docs
30
+ "[Typography](/system-arguments#typography)"
31
+ end
32
+
33
+ def link_to_component(component)
34
+ short_name = component.name.gsub(/Primer|::|Component/, "")
35
+ "[#{short_name}](/components/#{short_name.downcase})"
36
+ end
37
+
38
+ def link_to_octicons
39
+ "[Octicon](https://primer.style/octicons/)"
40
+ end
41
+
42
+ def link_to_heading_practices
43
+ "[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)"
44
+ end
45
+
46
+ def pretty_value(val)
47
+ case val
48
+ when nil
49
+ "`nil`"
50
+ when Symbol
51
+ "`:#{val}`"
52
+ else
53
+ "`#{val}`"
54
+ end
55
+ end
56
+ end
57
+ end
data/static/statuses.json CHANGED
@@ -1 +1,52 @@
1
- {"Primer::AutoComplete":"beta","Primer::AutoComplete::Item":"beta","Primer::AvatarComponent":"beta","Primer::AvatarStackComponent":"beta","Primer::BaseButton":"beta","Primer::BaseComponent":"beta","Primer::BlankslateComponent":"beta","Primer::BorderBoxComponent":"beta","Primer::BoxComponent":"stable","Primer::BreadcrumbComponent":"beta","Primer::BreadcrumbComponent::ItemComponent":"alpha","Primer::ButtonComponent":"beta","Primer::ButtonGroup":"beta","Primer::ButtonMarketingComponent":"alpha","Primer::ClipboardCopy":"alpha","Primer::CloseButton":"beta","Primer::CounterComponent":"beta","Primer::DetailsComponent":"beta","Primer::Dropdown::MenuComponent":"alpha","Primer::DropdownComponent":"alpha","Primer::DropdownMenuComponent":"deprecated","Primer::FlashComponent":"beta","Primer::FlexComponent":"alpha","Primer::FlexItemComponent":"deprecated","Primer::HeadingComponent":"beta","Primer::HiddenTextExpander":"alpha","Primer::IconButton":"alpha","Primer::LabelComponent":"beta","Primer::LayoutComponent":"alpha","Primer::LinkComponent":"beta","Primer::MarkdownComponent":"alpha","Primer::MenuComponent":"alpha","Primer::Navigation::TabComponent":"alpha","Primer::OcticonComponent":"beta","Primer::PopoverComponent":"beta","Primer::ProgressBarComponent":"beta","Primer::SpinnerComponent":"beta","Primer::StateComponent":"beta","Primer::SubheadComponent":"beta","Primer::TabContainerComponent":"alpha","Primer::TabNavComponent":"alpha","Primer::TextComponent":"beta","Primer::TimeAgoComponent":"beta","Primer::TimelineItemComponent":"beta","Primer::TimelineItemComponent::BadgeComponent":"alpha","Primer::TooltipComponent":"alpha","Primer::Truncate":"beta","Primer::UnderlineNavComponent":"alpha"}
1
+ {
2
+ "Primer::AutoComplete": "beta",
3
+ "Primer::AutoComplete::Item": "beta",
4
+ "Primer::AvatarComponent": "beta",
5
+ "Primer::AvatarStackComponent": "beta",
6
+ "Primer::BaseButton": "beta",
7
+ "Primer::BaseComponent": "beta",
8
+ "Primer::BlankslateComponent": "beta",
9
+ "Primer::BorderBoxComponent": "beta",
10
+ "Primer::BoxComponent": "stable",
11
+ "Primer::BreadcrumbComponent": "beta",
12
+ "Primer::BreadcrumbComponent::ItemComponent": "alpha",
13
+ "Primer::ButtonComponent": "beta",
14
+ "Primer::ButtonGroup": "beta",
15
+ "Primer::ButtonMarketingComponent": "alpha",
16
+ "Primer::ClipboardCopy": "alpha",
17
+ "Primer::CloseButton": "beta",
18
+ "Primer::CounterComponent": "beta",
19
+ "Primer::DetailsComponent": "beta",
20
+ "Primer::Dropdown::MenuComponent": "alpha",
21
+ "Primer::DropdownComponent": "alpha",
22
+ "Primer::DropdownMenuComponent": "deprecated",
23
+ "Primer::FlashComponent": "beta",
24
+ "Primer::FlexComponent": "deprecated",
25
+ "Primer::FlexItemComponent": "deprecated",
26
+ "Primer::HeadingComponent": "beta",
27
+ "Primer::HiddenTextExpander": "alpha",
28
+ "Primer::IconButton": "beta",
29
+ "Primer::ImageCrop": "alpha",
30
+ "Primer::LabelComponent": "beta",
31
+ "Primer::LayoutComponent": "alpha",
32
+ "Primer::LinkComponent": "beta",
33
+ "Primer::Markdown": "beta",
34
+ "Primer::MenuComponent": "alpha",
35
+ "Primer::Navigation::TabComponent": "alpha",
36
+ "Primer::OcticonComponent": "beta",
37
+ "Primer::OcticonSymbolsComponent": "alpha",
38
+ "Primer::PopoverComponent": "beta",
39
+ "Primer::ProgressBarComponent": "beta",
40
+ "Primer::SpinnerComponent": "beta",
41
+ "Primer::StateComponent": "beta",
42
+ "Primer::SubheadComponent": "beta",
43
+ "Primer::TabContainerComponent": "alpha",
44
+ "Primer::TabNavComponent": "alpha",
45
+ "Primer::TextComponent": "beta",
46
+ "Primer::TimeAgoComponent": "beta",
47
+ "Primer::TimelineItemComponent": "beta",
48
+ "Primer::TimelineItemComponent::BadgeComponent": "alpha",
49
+ "Primer::TooltipComponent": "alpha",
50
+ "Primer::Truncate": "beta",
51
+ "Primer::UnderlineNavComponent": "alpha"
52
+ }
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.39
4
+ version: 0.0.40
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-04-29 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -370,16 +370,24 @@ files:
370
370
  - app/components/primer/heading_component.rb
371
371
  - app/components/primer/hidden_text_expander.rb
372
372
  - app/components/primer/icon_button.rb
373
+ - app/components/primer/image_crop.d.ts
374
+ - app/components/primer/image_crop.html.erb
375
+ - app/components/primer/image_crop.js
376
+ - app/components/primer/image_crop.rb
377
+ - app/components/primer/image_crop.ts
373
378
  - app/components/primer/label_component.rb
374
379
  - app/components/primer/layout_component.html.erb
375
380
  - app/components/primer/layout_component.rb
376
381
  - app/components/primer/link_component.rb
377
- - app/components/primer/markdown_component.rb
382
+ - app/components/primer/markdown.rb
378
383
  - app/components/primer/menu_component.html.erb
379
384
  - app/components/primer/menu_component.rb
380
385
  - app/components/primer/navigation/tab_component.html.erb
381
386
  - app/components/primer/navigation/tab_component.rb
387
+ - app/components/primer/octicon_component.html.erb
382
388
  - app/components/primer/octicon_component.rb
389
+ - app/components/primer/octicon_symbols_component.html.erb
390
+ - app/components/primer/octicon_symbols_component.rb
383
391
  - app/components/primer/popover_component.html.erb
384
392
  - app/components/primer/popover_component.rb
385
393
  - app/components/primer/primer.d.ts
@@ -428,6 +436,10 @@ files:
428
436
  - lib/primer/view_components.rb
429
437
  - lib/primer/view_components/engine.rb
430
438
  - lib/primer/view_components/version.rb
439
+ - lib/tasks/coverage.rake
440
+ - lib/tasks/docs.rake
441
+ - lib/tasks/statuses.rake
442
+ - lib/yard/docs_helper.rb
431
443
  - lib/yard/renders_many_handler.rb
432
444
  - lib/yard/renders_one_handler.rb
433
445
  - static/statuses.json