primer_view_components 0.0.104 → 0.0.105
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +2 -2
- data/app/components/primer/alpha/action_list.rb +2 -0
- data/app/components/primer/alpha/image.rb +50 -0
- data/app/components/primer/{image_crop.d.ts → alpha/image_crop.d.ts} +0 -0
- data/app/components/primer/{image_crop.html.erb → alpha/image_crop.html.erb} +0 -0
- data/app/components/primer/{image_crop.js → alpha/image_crop.js} +0 -0
- data/app/components/primer/alpha/image_crop.rb +39 -0
- data/app/components/primer/{image_crop.ts → alpha/image_crop.ts} +0 -0
- data/app/components/primer/alpha/nav_list/item.rb +2 -0
- data/app/components/primer/alpha/nav_list/section.rb +2 -0
- data/app/components/primer/alpha/segmented_control/item.html.erb +13 -0
- data/app/components/primer/alpha/segmented_control/item.rb +29 -0
- data/app/components/primer/alpha/segmented_control.css +1 -0
- data/app/components/primer/alpha/segmented_control.css.map +1 -0
- data/app/components/primer/alpha/segmented_control.d.ts +11 -0
- data/app/components/primer/alpha/segmented_control.html.erb +7 -0
- data/app/components/primer/alpha/segmented_control.js +48 -0
- data/app/components/primer/alpha/segmented_control.pcss +121 -0
- data/app/components/primer/alpha/segmented_control.rb +92 -0
- data/app/components/primer/alpha/segmented_control.ts +41 -0
- data/app/components/primer/alpha/tooltip.rb +2 -2
- data/app/components/primer/beta/auto_complete/item.rb +2 -2
- data/app/components/primer/beta/avatar.rb +1 -1
- data/app/components/primer/beta/blankslate.rb +4 -4
- data/app/components/primer/beta/breadcrumbs.rb +1 -1
- data/app/components/primer/beta/button.rb +1 -1
- data/app/components/primer/beta/label.rb +100 -0
- data/app/components/primer/beta/link.rb +99 -0
- data/app/components/primer/component.rb +1 -0
- data/app/components/primer/image.rb +2 -41
- data/app/components/primer/image_crop.rb +2 -32
- data/app/components/primer/label_component.rb +2 -93
- data/app/components/primer/link_component.rb +2 -92
- data/app/components/primer/primer.d.ts +2 -1
- data/app/components/primer/primer.js +2 -1
- data/app/components/primer/primer.pcss +1 -0
- data/app/components/primer/primer.ts +2 -1
- data/app/components/primer/subhead_component.rb +1 -1
- data/app/components/primer/time_ago_component.rb +2 -0
- data/app/helpers/primer/form_helper.rb +1 -0
- data/app/lib/primer/view_helper.rb +1 -1
- data/lib/primer/deprecations.rb +4 -0
- data/lib/primer/form_components.rb +1 -0
- data/lib/primer/view_components/linters/argument_mappers/label.rb +4 -4
- data/lib/primer/view_components/linters/label_component_migration_counter.rb +3 -3
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/config/default.yml +0 -3
- data/lib/rubocop/cop/primer/deprecated_label_schemes.rb +3 -3
- data/lib/rubocop/cop/primer/deprecated_label_variants.rb +5 -5
- data/lib/tasks/docs.rake +12 -7
- data/lib/tasks/test.rake +23 -26
- data/previews/primer/alpha/action_list_preview.rb +29 -0
- data/previews/primer/alpha/auto_complete_preview.rb +10 -0
- data/previews/primer/alpha/button_marketing_preview.rb +9 -0
- data/previews/primer/alpha/dialog_preview.rb +18 -1
- data/previews/primer/alpha/hidden_text_expander_preview.rb +7 -0
- data/previews/primer/alpha/image_crop_preview.rb +31 -0
- data/previews/primer/alpha/layout_preview.rb +15 -0
- data/previews/primer/alpha/nav_list_preview.rb +29 -0
- data/previews/primer/alpha/segmented_control_preview.rb +75 -0
- data/previews/primer/alpha/tab_panels_preview.rb +15 -0
- data/previews/primer/alpha/text_field_preview.rb +58 -0
- data/previews/primer/alpha/toggle_switch_preview.rb +4 -0
- data/previews/primer/alpha/tooltip_preview.rb +13 -3
- data/previews/primer/alpha/underline_nav_preview/playground.html.erb +8 -0
- data/previews/primer/alpha/underline_nav_preview.rb +15 -0
- data/previews/primer/alpha/underline_panels_preview.rb +15 -0
- data/previews/primer/beta/auto_complete_item_preview/playground.html.erb +9 -0
- data/previews/primer/beta/auto_complete_item_preview.rb +14 -0
- data/previews/primer/beta/auto_complete_preview.rb +20 -0
- data/previews/primer/beta/avatar_preview.rb +9 -0
- data/previews/primer/beta/avatar_stack_preview.rb +15 -0
- data/previews/primer/beta/base_button_preview.rb +9 -0
- data/previews/primer/beta/blankslate_preview.rb +12 -0
- data/previews/primer/beta/border_box_preview.rb +14 -0
- data/previews/primer/beta/breadcrumbs_preview.rb +11 -0
- data/previews/primer/beta/button_group_preview.rb +12 -0
- data/previews/primer/beta/close_button_preview.rb +7 -0
- data/previews/primer/beta/counter_preview.rb +11 -0
- data/previews/primer/beta/details_preview.rb +15 -0
- data/previews/primer/beta/flash_preview.rb +12 -0
- data/previews/primer/beta/heading_preview.rb +8 -0
- data/previews/primer/beta/label_preview.rb +26 -0
- data/previews/primer/beta/link_preview.rb +41 -0
- data/previews/primer/beta/text_preview.rb +8 -0
- data/previews/primer/beta/truncate_preview.rb +7 -0
- data/previews/primer/clipboard_copy_preview.rb +8 -0
- data/previews/primer/dropdown_preview.rb +18 -0
- data/previews/primer/hellip_button_preview.rb +8 -0
- data/previews/primer/layout_component_preview.rb +13 -1
- data/previews/primer/local_time_component_preview.rb +13 -0
- data/previews/primer/markdown_preview.rb +277 -266
- data/previews/primer/menu_component_preview/playground.html.erb +17 -0
- data/previews/primer/menu_component_preview.rb +4 -1
- data/previews/primer/octicon_component_preview.rb +8 -0
- data/previews/primer/popover_component_preview.rb +15 -1
- data/previews/primer/progress_bar_component_preview.rb +12 -1
- data/previews/primer/spinner_component_preview.rb +7 -0
- data/previews/primer/state_component_preview.rb +11 -1
- data/previews/primer/subhead_component_preview.rb +17 -0
- data/previews/primer/time_ago_component_preview.rb +8 -0
- data/previews/primer/timeline_item_component_preview.rb +12 -1
- data/static/arguments.json +300 -138
- data/static/audited_at.json +6 -0
- data/static/constants.json +86 -71
- data/static/statuses.json +10 -4
- metadata +27 -9
- data/previews/primer/image_crop_preview.rb +0 -22
- data/previews/primer/label_component_preview.rb +0 -15
- data/previews/primer/link_component_preview.rb +0 -29
@@ -3,6 +3,23 @@
|
|
3
3
|
module Primer
|
4
4
|
# @label SubheadComponent
|
5
5
|
class SubheadComponentPreview < ViewComponent::Preview
|
6
|
+
# @label Playground
|
7
|
+
#
|
8
|
+
# @param spacious [Boolean]
|
9
|
+
# @param hide_border [Boolean]
|
10
|
+
# @param heading_danger [Boolean]
|
11
|
+
# @param heading_tag [Symbol] select [div, h1, h2, h3, h4, h5, h6]
|
12
|
+
def playground(spacious: false, hide_border: false, heading_tag: :div, heading_danger: false)
|
13
|
+
render(Primer::SubheadComponent.new(spacious: spacious, hide_border: hide_border)) do |component|
|
14
|
+
component.with_heading(tag: heading_tag, danger: heading_danger) do
|
15
|
+
"My Heading"
|
16
|
+
end
|
17
|
+
component.with_description do
|
18
|
+
"My Description"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
6
23
|
# @label Default Options
|
7
24
|
#
|
8
25
|
# @param spacious [Boolean]
|
@@ -3,6 +3,14 @@
|
|
3
3
|
module Primer
|
4
4
|
# @label TimeAgoComponent
|
5
5
|
class TimeAgoComponentPreview < ViewComponent::Preview
|
6
|
+
# @label Playground
|
7
|
+
#
|
8
|
+
# @param time datetime-local
|
9
|
+
# @param micro [Boolean] toggle
|
10
|
+
def playground(time: Time.zone.now.to_s, micro: false)
|
11
|
+
render(Primer::TimeAgoComponent.new(time: DateTime.parse(time), micro: micro))
|
12
|
+
end
|
13
|
+
|
6
14
|
# @param time datetime-local
|
7
15
|
# @param micro [Boolean] toggle
|
8
16
|
def default(time: Time.zone.now.to_s, micro: false)
|
@@ -3,7 +3,18 @@
|
|
3
3
|
module Primer
|
4
4
|
# @label TimelineItemComponent
|
5
5
|
class TimelineItemComponentPreview < ViewComponent::Preview
|
6
|
-
# @label
|
6
|
+
# @label Playground
|
7
|
+
#
|
8
|
+
# @param condensed [Boolean]
|
9
|
+
def playground(condensed: false)
|
10
|
+
render(Primer::TimelineItemComponent.new(condensed: condensed)) do |component|
|
11
|
+
component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "octocat")
|
12
|
+
component.with_badge(bg: :success_emphasis, color: :on_emphasis, icon: :check)
|
13
|
+
component.with_body { "Success!" }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# @label Default
|
7
18
|
#
|
8
19
|
# @param condensed [Boolean]
|
9
20
|
def default(condensed: false)
|