primer_view_components 0.0.120 → 0.0.122
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -0
- data/app/assets/styles/primer_view_components.css +2 -2
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list.css.json +123 -1
- data/app/components/primer/alpha/auto_complete.css.json +23 -1
- data/app/components/primer/alpha/banner.css.json +24 -1
- data/app/components/primer/alpha/button_marketing.css.json +33 -1
- data/app/components/primer/alpha/check_box.rb +74 -0
- data/app/components/primer/alpha/check_box_group.rb +36 -0
- data/app/components/primer/alpha/dialog.css.json +82 -1
- data/app/components/primer/alpha/dialog.rb +1 -1
- data/app/components/primer/alpha/dropdown.css.json +40 -1
- data/app/components/primer/alpha/form_button.rb +32 -0
- data/app/components/primer/alpha/form_control.html.erb +26 -0
- data/app/components/primer/alpha/form_control.rb +105 -0
- data/app/components/primer/alpha/layout.css.json +80 -1
- data/app/components/primer/alpha/menu.css.json +28 -1
- data/app/components/primer/alpha/multi_input.rb +81 -0
- data/app/components/primer/alpha/radio_button.rb +25 -0
- data/app/components/primer/alpha/radio_button_group.rb +36 -0
- data/app/components/primer/alpha/segmented_control/item.rb +1 -0
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.json +31 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +43 -12
- data/app/components/primer/alpha/segmented_control.rb +30 -0
- data/app/components/primer/alpha/select.rb +37 -0
- data/app/components/primer/alpha/submit_button.rb +32 -0
- data/app/components/primer/alpha/tab_nav.css.json +24 -1
- data/app/components/primer/alpha/tab_panels.rb +7 -0
- data/app/components/primer/alpha/text_area.rb +24 -0
- data/app/components/primer/alpha/text_field.css +2 -2
- data/app/components/primer/alpha/text_field.css.json +134 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +27 -0
- data/app/components/primer/alpha/text_field.rb +16 -20
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.json +40 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.pcss +31 -61
- data/app/components/primer/alpha/underline_nav.css.json +28 -1
- data/app/components/primer/base_component.rb +3 -3
- data/app/components/primer/beta/avatar.css.json +17 -1
- data/app/components/primer/beta/avatar_stack.css.json +28 -1
- data/app/components/primer/beta/blankslate.css.json +22 -1
- data/app/components/primer/beta/border_box.css.json +54 -1
- data/app/components/primer/beta/breadcrumbs.css.json +11 -1
- data/app/components/primer/beta/button.css.json +71 -1
- data/app/components/primer/beta/close_button.rb +1 -1
- data/app/components/primer/beta/counter.css.json +10 -1
- data/app/components/primer/beta/flash.css.json +27 -1
- data/app/components/primer/beta/label.css.json +25 -1
- data/app/components/primer/beta/link.css.json +19 -1
- data/app/components/primer/beta/popover.css.json +39 -1
- data/app/components/primer/beta/progress_bar.css.json +10 -1
- data/app/components/primer/{local_time.d.ts → beta/relative_time.d.ts} +0 -0
- data/app/components/primer/{local_time.js → beta/relative_time.js} +0 -0
- data/app/components/primer/{local_time.ts → beta/relative_time.ts} +0 -0
- data/app/components/primer/beta/state.css.json +13 -1
- data/app/components/primer/beta/subhead.css.json +12 -1
- data/app/components/primer/beta/timeline_item.css.json +16 -1
- data/app/components/primer/beta/truncate.css.json +12 -1
- data/app/components/primer/component.rb +12 -3
- data/app/components/primer/primer.d.ts +1 -2
- data/app/components/primer/primer.js +1 -2
- data/app/components/primer/primer.ts +1 -2
- data/app/components/primer/truncate.css.json +13 -1
- data/app/forms/example_toggle_switch_form.rb +1 -1
- data/app/forms/{select_list_form.rb → select_form.rb} +1 -1
- data/app/lib/primer/css/layout.css.json +316 -1
- data/app/lib/primer/css/utilities.css.json +1659 -1
- data/app/lib/primer/view_helper.rb +0 -1
- data/lib/primer/deprecations.yml +0 -78
- data/lib/primer/form_components.rb +26 -6
- data/lib/primer/forms/acts_as_component.rb +12 -1
- data/lib/primer/forms/builder.rb +1 -17
- data/lib/primer/forms/button.rb +4 -1
- data/lib/primer/forms/check_box_group.html.erb +14 -9
- data/lib/primer/forms/check_box_group.rb +5 -0
- data/lib/primer/forms/dsl/check_box_group_input.rb +3 -4
- data/lib/primer/forms/dsl/input.rb +33 -2
- data/lib/primer/forms/dsl/input_methods.rb +49 -1
- data/lib/primer/forms/dsl/radio_button_group_input.rb +2 -3
- data/lib/primer/forms/dsl/{select_list_input.rb → select_input.rb} +2 -2
- data/lib/primer/forms/dsl/text_field_input.rb +7 -5
- data/lib/primer/forms/form_control.rb +0 -1
- data/lib/primer/forms/group.html.erb +1 -1
- data/lib/primer/forms/multi.html.erb +8 -6
- data/lib/primer/forms/multi.rb +2 -0
- data/lib/primer/forms/radio_button_group.html.erb +14 -9
- data/lib/primer/forms/radio_button_group.rb +5 -0
- data/lib/primer/forms/{select_list.html.erb → select.html.erb} +0 -0
- data/lib/primer/forms/{select_list.rb → select.rb} +2 -2
- data/lib/primer/forms/spacing_wrapper.html.erb +1 -1
- data/lib/primer/forms/text_area.rb +1 -1
- data/lib/primer/forms/text_field.rb +5 -1
- data/lib/primer/forms/toggle_switch_form.rb +10 -3
- data/lib/primer/forms/utils.rb +20 -0
- data/lib/primer/view_components/engine.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/backend.rb +1 -15
- data/lib/primer/yard/component_manifest.rb +44 -27
- data/lib/primer/yard/component_ref.rb +40 -0
- data/lib/primer/yard/docs_helper.rb +16 -2
- data/lib/primer/yard/legacy_gatsby_backend.rb +9 -15
- data/lib/primer/yard/lookbook_docs_helper.rb +32 -0
- data/lib/primer/yard/lookbook_pages_backend.rb +194 -0
- data/lib/primer/yard/registry.rb +6 -21
- data/lib/primer/yard/renders_many_handler.rb +1 -1
- data/lib/primer/yard/renders_one_handler.rb +1 -1
- data/lib/primer/yard.rb +14 -0
- data/lib/tasks/docs.rake +26 -13
- data/lib/tasks/static.rake +22 -0
- data/previews/pages/forms/01_introduction.md.erb +44 -0
- data/previews/pages/forms/02_getting_started.md.erb +125 -0
- data/previews/pages/forms/03_caption_templates.md.erb +30 -0
- data/previews/pages/forms/04_after_content.md.erb +39 -0
- data/previews/pages/forms/05_groups_layouts.md.erb +22 -0
- data/previews/pages/forms/06_miscellaneous_inputs.md.erb +43 -0
- data/previews/pages/forms/07_toggle_switch_forms.md.erb +58 -0
- data/previews/pages/forms/08_validations.md.erb +28 -0
- data/previews/pages/forms/09_compound_forms.md.erb +97 -0
- data/previews/primer/alpha/auto_complete_preview.rb +6 -6
- data/previews/primer/alpha/check_box_group_preview.rb +89 -0
- data/previews/primer/alpha/check_box_preview.rb +62 -0
- data/previews/primer/alpha/form_control_preview/playground.html.erb +9 -0
- data/previews/primer/alpha/form_control_preview.rb +106 -0
- data/previews/primer/alpha/multi_input_preview/playground.html.erb +41 -0
- data/previews/primer/alpha/multi_input_preview.rb +80 -0
- data/previews/primer/alpha/radio_button_group_preview.rb +83 -0
- data/previews/primer/alpha/radio_button_preview.rb +62 -0
- data/previews/primer/alpha/segmented_control_preview/with_label_and_caption.html.erb +9 -0
- data/previews/primer/alpha/segmented_control_preview/with_subhead_actions.html.erb +11 -0
- data/previews/primer/alpha/segmented_control_preview.rb +7 -1
- data/previews/primer/alpha/select_preview.rb +130 -0
- data/previews/primer/alpha/text_area_preview.rb +87 -0
- data/previews/primer/alpha/text_field_preview.rb +24 -1
- data/previews/primer/alpha/toggle_switch_preview.rb +9 -9
- data/previews/primer/beta/auto_complete_preview.rb +17 -17
- data/previews/primer/forms/forms_preview/example_toggle_switch_form.html.erb +2 -2
- data/previews/primer/forms/forms_preview/{select_list_form.html.erb → select_form.html.erb} +1 -1
- data/previews/primer/forms/forms_preview.rb +3 -1
- data/previews/primer/url_helpers.rb +1 -1
- data/static/arguments.json +1348 -1412
- data/static/audited_at.json +12 -21
- data/static/constants.json +20 -51
- data/static/previews.json +1812 -0
- data/static/statuses.json +10 -19
- metadata +47 -32
- data/app/components/primer/dropdown/menu.rb +0 -14
- data/app/components/primer/dropdown.rb +0 -7
- data/app/components/primer/hellip_button.rb +0 -7
- data/app/components/primer/label_component.rb +0 -7
- data/app/components/primer/link_component.rb +0 -7
- data/app/components/primer/local_time.rb +0 -63
- data/app/components/primer/markdown.rb +0 -7
- data/app/components/primer/menu_component.rb +0 -7
- data/app/components/primer/octicon_component.rb +0 -7
- data/app/components/primer/octicon_symbols_component.rb +0 -7
- data/app/components/primer/popover_component.rb +0 -8
- data/app/components/primer/spinner_component.rb +0 -7
- data/app/components/primer/state_component.rb +0 -7
- data/app/components/primer/subhead_component.rb +0 -7
- data/app/components/primer/tab_container_component.rb +0 -7
- data/app/components/primer/time_ago_component.d.ts +0 -1
- data/app/components/primer/time_ago_component.js +0 -1
- data/app/components/primer/time_ago_component.rb +0 -51
- data/app/components/primer/time_ago_component.ts +0 -1
- data/app/components/primer/timeline_item_component.rb +0 -13
- data/previews/primer/local_time_component_preview.rb +0 -57
- data/previews/primer/time_ago_component_preview.rb +0 -27
data/static/statuses.json
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
"Primer::Alpha::AutoComplete::Item": "deprecated",
|
8
8
|
"Primer::Alpha::Banner": "alpha",
|
9
9
|
"Primer::Alpha::ButtonMarketing": "alpha",
|
10
|
+
"Primer::Alpha::CheckBox": "alpha",
|
11
|
+
"Primer::Alpha::CheckBoxGroup": "alpha",
|
10
12
|
"Primer::Alpha::Dialog": "alpha",
|
11
13
|
"Primer::Alpha::Dialog::Body": "alpha",
|
12
14
|
"Primer::Alpha::Dialog::Footer": "alpha",
|
@@ -14,6 +16,8 @@
|
|
14
16
|
"Primer::Alpha::Dropdown": "alpha",
|
15
17
|
"Primer::Alpha::Dropdown::Menu": "alpha",
|
16
18
|
"Primer::Alpha::Dropdown::Menu::Item": "alpha",
|
19
|
+
"Primer::Alpha::FormButton": "alpha",
|
20
|
+
"Primer::Alpha::FormControl": "alpha",
|
17
21
|
"Primer::Alpha::HellipButton": "alpha",
|
18
22
|
"Primer::Alpha::HiddenTextExpander": "alpha",
|
19
23
|
"Primer::Alpha::Image": "alpha",
|
@@ -22,15 +26,21 @@
|
|
22
26
|
"Primer::Alpha::Layout::Main": "alpha",
|
23
27
|
"Primer::Alpha::Layout::Sidebar": "alpha",
|
24
28
|
"Primer::Alpha::Menu": "alpha",
|
29
|
+
"Primer::Alpha::MultiInput": "alpha",
|
25
30
|
"Primer::Alpha::NavList": "alpha",
|
26
31
|
"Primer::Alpha::NavList::Item": "alpha",
|
27
32
|
"Primer::Alpha::NavList::Section": "alpha",
|
28
33
|
"Primer::Alpha::OcticonSymbols": "alpha",
|
34
|
+
"Primer::Alpha::RadioButton": "alpha",
|
35
|
+
"Primer::Alpha::RadioButtonGroup": "alpha",
|
29
36
|
"Primer::Alpha::SegmentedControl": "alpha",
|
30
37
|
"Primer::Alpha::SegmentedControl::Item": "alpha",
|
38
|
+
"Primer::Alpha::Select": "alpha",
|
39
|
+
"Primer::Alpha::SubmitButton": "alpha",
|
31
40
|
"Primer::Alpha::TabContainer": "alpha",
|
32
41
|
"Primer::Alpha::TabNav": "alpha",
|
33
42
|
"Primer::Alpha::TabPanels": "alpha",
|
43
|
+
"Primer::Alpha::TextArea": "alpha",
|
34
44
|
"Primer::Alpha::TextField": "alpha",
|
35
45
|
"Primer::Alpha::ToggleSwitch": "alpha",
|
36
46
|
"Primer::Alpha::Tooltip": "alpha",
|
@@ -76,28 +86,9 @@
|
|
76
86
|
"Primer::ButtonComponent": "deprecated",
|
77
87
|
"Primer::ConditionalWrapper": "alpha",
|
78
88
|
"Primer::Content": "stable",
|
79
|
-
"Primer::Dropdown": "deprecated",
|
80
|
-
"Primer::Dropdown::Menu": "deprecated",
|
81
|
-
"Primer::Dropdown::Menu::Item": "deprecated",
|
82
|
-
"Primer::HellipButton": "deprecated",
|
83
89
|
"Primer::IconButton": "deprecated",
|
84
|
-
"Primer::LabelComponent": "deprecated",
|
85
90
|
"Primer::LayoutComponent": "alpha",
|
86
|
-
"Primer::LinkComponent": "deprecated",
|
87
|
-
"Primer::LocalTime": "deprecated",
|
88
|
-
"Primer::Markdown": "deprecated",
|
89
|
-
"Primer::MenuComponent": "deprecated",
|
90
91
|
"Primer::Navigation::TabComponent": "alpha",
|
91
|
-
"Primer::OcticonComponent": "deprecated",
|
92
|
-
"Primer::OcticonSymbolsComponent": "deprecated",
|
93
|
-
"Primer::PopoverComponent": "deprecated",
|
94
|
-
"Primer::SpinnerComponent": "deprecated",
|
95
|
-
"Primer::StateComponent": "deprecated",
|
96
|
-
"Primer::SubheadComponent": "deprecated",
|
97
|
-
"Primer::TabContainerComponent": "deprecated",
|
98
|
-
"Primer::TimeAgoComponent": "deprecated",
|
99
|
-
"Primer::TimelineItemComponent": "deprecated",
|
100
|
-
"Primer::TimelineItemComponent::BadgeComponent": "deprecated",
|
101
92
|
"Primer::Tooltip": "deprecated",
|
102
93
|
"Primer::Truncate": "beta"
|
103
94
|
}
|
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.122
|
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: 2023-
|
11
|
+
date: 2023-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -423,6 +423,8 @@ files:
|
|
423
423
|
- app/components/primer/alpha/button_marketing.css.map
|
424
424
|
- app/components/primer/alpha/button_marketing.pcss
|
425
425
|
- app/components/primer/alpha/button_marketing.rb
|
426
|
+
- app/components/primer/alpha/check_box.rb
|
427
|
+
- app/components/primer/alpha/check_box_group.rb
|
426
428
|
- app/components/primer/alpha/dialog.css
|
427
429
|
- app/components/primer/alpha/dialog.css.json
|
428
430
|
- app/components/primer/alpha/dialog.css.map
|
@@ -447,6 +449,9 @@ files:
|
|
447
449
|
- app/components/primer/alpha/dropdown/menu.js
|
448
450
|
- app/components/primer/alpha/dropdown/menu.rb
|
449
451
|
- app/components/primer/alpha/dropdown/menu.ts
|
452
|
+
- app/components/primer/alpha/form_button.rb
|
453
|
+
- app/components/primer/alpha/form_control.html.erb
|
454
|
+
- app/components/primer/alpha/form_control.rb
|
450
455
|
- app/components/primer/alpha/hellip_button.rb
|
451
456
|
- app/components/primer/alpha/hidden_text_expander.rb
|
452
457
|
- app/components/primer/alpha/image.rb
|
@@ -470,6 +475,7 @@ files:
|
|
470
475
|
- app/components/primer/alpha/modal_dialog.d.ts
|
471
476
|
- app/components/primer/alpha/modal_dialog.js
|
472
477
|
- app/components/primer/alpha/modal_dialog.ts
|
478
|
+
- app/components/primer/alpha/multi_input.rb
|
473
479
|
- app/components/primer/alpha/nav_list.d.ts
|
474
480
|
- app/components/primer/alpha/nav_list.html.erb
|
475
481
|
- app/components/primer/alpha/nav_list.js
|
@@ -481,6 +487,8 @@ files:
|
|
481
487
|
- app/components/primer/alpha/nav_list/section.rb
|
482
488
|
- app/components/primer/alpha/octicon_symbols.html.erb
|
483
489
|
- app/components/primer/alpha/octicon_symbols.rb
|
490
|
+
- app/components/primer/alpha/radio_button.rb
|
491
|
+
- app/components/primer/alpha/radio_button_group.rb
|
484
492
|
- app/components/primer/alpha/segmented_control.css
|
485
493
|
- app/components/primer/alpha/segmented_control.css.json
|
486
494
|
- app/components/primer/alpha/segmented_control.css.map
|
@@ -492,6 +500,8 @@ files:
|
|
492
500
|
- app/components/primer/alpha/segmented_control.ts
|
493
501
|
- app/components/primer/alpha/segmented_control/item.html.erb
|
494
502
|
- app/components/primer/alpha/segmented_control/item.rb
|
503
|
+
- app/components/primer/alpha/select.rb
|
504
|
+
- app/components/primer/alpha/submit_button.rb
|
495
505
|
- app/components/primer/alpha/tab_container.d.ts
|
496
506
|
- app/components/primer/alpha/tab_container.js
|
497
507
|
- app/components/primer/alpha/tab_container.rb
|
@@ -504,6 +514,7 @@ files:
|
|
504
514
|
- app/components/primer/alpha/tab_nav.rb
|
505
515
|
- app/components/primer/alpha/tab_panels.html.erb
|
506
516
|
- app/components/primer/alpha/tab_panels.rb
|
517
|
+
- app/components/primer/alpha/text_area.rb
|
507
518
|
- app/components/primer/alpha/text_field.css
|
508
519
|
- app/components/primer/alpha/text_field.css.json
|
509
520
|
- app/components/primer/alpha/text_field.css.map
|
@@ -628,7 +639,10 @@ files:
|
|
628
639
|
- app/components/primer/beta/progress_bar.html.erb
|
629
640
|
- app/components/primer/beta/progress_bar.pcss
|
630
641
|
- app/components/primer/beta/progress_bar.rb
|
642
|
+
- app/components/primer/beta/relative_time.d.ts
|
643
|
+
- app/components/primer/beta/relative_time.js
|
631
644
|
- app/components/primer/beta/relative_time.rb
|
645
|
+
- app/components/primer/beta/relative_time.ts
|
632
646
|
- app/components/primer/beta/spinner.html.erb
|
633
647
|
- app/components/primer/beta/spinner.rb
|
634
648
|
- app/components/primer/beta/state.css
|
@@ -663,39 +677,16 @@ files:
|
|
663
677
|
- app/components/primer/component.rb
|
664
678
|
- app/components/primer/conditional_wrapper.rb
|
665
679
|
- app/components/primer/content.rb
|
666
|
-
- app/components/primer/dropdown.rb
|
667
|
-
- app/components/primer/dropdown/menu.rb
|
668
|
-
- app/components/primer/hellip_button.rb
|
669
680
|
- app/components/primer/icon_button.html.erb
|
670
681
|
- app/components/primer/icon_button.rb
|
671
|
-
- app/components/primer/label_component.rb
|
672
682
|
- app/components/primer/layout_component.html.erb
|
673
683
|
- app/components/primer/layout_component.rb
|
674
|
-
- app/components/primer/link_component.rb
|
675
|
-
- app/components/primer/local_time.d.ts
|
676
|
-
- app/components/primer/local_time.js
|
677
|
-
- app/components/primer/local_time.rb
|
678
|
-
- app/components/primer/local_time.ts
|
679
|
-
- app/components/primer/markdown.rb
|
680
|
-
- app/components/primer/menu_component.rb
|
681
684
|
- app/components/primer/navigation/tab_component.html.erb
|
682
685
|
- app/components/primer/navigation/tab_component.rb
|
683
|
-
- app/components/primer/octicon_component.rb
|
684
|
-
- app/components/primer/octicon_symbols_component.rb
|
685
|
-
- app/components/primer/popover_component.rb
|
686
686
|
- app/components/primer/primer.d.ts
|
687
687
|
- app/components/primer/primer.js
|
688
688
|
- app/components/primer/primer.pcss
|
689
689
|
- app/components/primer/primer.ts
|
690
|
-
- app/components/primer/spinner_component.rb
|
691
|
-
- app/components/primer/state_component.rb
|
692
|
-
- app/components/primer/subhead_component.rb
|
693
|
-
- app/components/primer/tab_container_component.rb
|
694
|
-
- app/components/primer/time_ago_component.d.ts
|
695
|
-
- app/components/primer/time_ago_component.js
|
696
|
-
- app/components/primer/time_ago_component.rb
|
697
|
-
- app/components/primer/time_ago_component.ts
|
698
|
-
- app/components/primer/timeline_item_component.rb
|
699
690
|
- app/components/primer/tooltip.rb
|
700
691
|
- app/components/primer/truncate.css
|
701
692
|
- app/components/primer/truncate.css.json
|
@@ -730,7 +721,7 @@ files:
|
|
730
721
|
- app/forms/name_with_question_mark_form/enabled_caption.html.erb
|
731
722
|
- app/forms/radio_button_group_form.rb
|
732
723
|
- app/forms/radio_button_with_nested_form.rb
|
733
|
-
- app/forms/
|
724
|
+
- app/forms/select_form.rb
|
734
725
|
- app/forms/single_text_field_form.rb
|
735
726
|
- app/forms/submit_button_form.rb
|
736
727
|
- app/forms/text_field_and_checkbox_form.rb
|
@@ -791,7 +782,7 @@ files:
|
|
791
782
|
- lib/primer/forms/dsl/multi_input.rb
|
792
783
|
- lib/primer/forms/dsl/radio_button_group_input.rb
|
793
784
|
- lib/primer/forms/dsl/radio_button_input.rb
|
794
|
-
- lib/primer/forms/dsl/
|
785
|
+
- lib/primer/forms/dsl/select_input.rb
|
795
786
|
- lib/primer/forms/dsl/submit_button_input.rb
|
796
787
|
- lib/primer/forms/dsl/text_area_input.rb
|
797
788
|
- lib/primer/forms/dsl/text_field_input.rb
|
@@ -818,8 +809,8 @@ files:
|
|
818
809
|
- lib/primer/forms/radio_button.rb
|
819
810
|
- lib/primer/forms/radio_button_group.html.erb
|
820
811
|
- lib/primer/forms/radio_button_group.rb
|
821
|
-
- lib/primer/forms/
|
822
|
-
- lib/primer/forms/
|
812
|
+
- lib/primer/forms/select.html.erb
|
813
|
+
- lib/primer/forms/select.rb
|
823
814
|
- lib/primer/forms/separator.html.erb
|
824
815
|
- lib/primer/forms/separator.rb
|
825
816
|
- lib/primer/forms/spacing_wrapper.html.erb
|
@@ -873,10 +864,14 @@ files:
|
|
873
864
|
- lib/primer/view_components/linters/two_column_layout_migration_counter.rb
|
874
865
|
- lib/primer/view_components/statuses.rb
|
875
866
|
- lib/primer/view_components/version.rb
|
867
|
+
- lib/primer/yard.rb
|
876
868
|
- lib/primer/yard/backend.rb
|
877
869
|
- lib/primer/yard/component_manifest.rb
|
870
|
+
- lib/primer/yard/component_ref.rb
|
878
871
|
- lib/primer/yard/docs_helper.rb
|
879
872
|
- lib/primer/yard/legacy_gatsby_backend.rb
|
873
|
+
- lib/primer/yard/lookbook_docs_helper.rb
|
874
|
+
- lib/primer/yard/lookbook_pages_backend.rb
|
880
875
|
- lib/primer/yard/registry.rb
|
881
876
|
- lib/primer/yard/renders_many_handler.rb
|
882
877
|
- lib/primer/yard/renders_one_handler.rb
|
@@ -902,6 +897,15 @@ files:
|
|
902
897
|
- lib/tasks/static.rake
|
903
898
|
- lib/tasks/test.rake
|
904
899
|
- lib/tasks/utilities.rake
|
900
|
+
- previews/pages/forms/01_introduction.md.erb
|
901
|
+
- previews/pages/forms/02_getting_started.md.erb
|
902
|
+
- previews/pages/forms/03_caption_templates.md.erb
|
903
|
+
- previews/pages/forms/04_after_content.md.erb
|
904
|
+
- previews/pages/forms/05_groups_layouts.md.erb
|
905
|
+
- previews/pages/forms/06_miscellaneous_inputs.md.erb
|
906
|
+
- previews/pages/forms/07_toggle_switch_forms.md.erb
|
907
|
+
- previews/pages/forms/08_validations.md.erb
|
908
|
+
- previews/pages/forms/09_compound_forms.md.erb
|
905
909
|
- previews/primer/alpha/action_list_preview.rb
|
906
910
|
- previews/primer/alpha/action_list_preview/heading.html.erb
|
907
911
|
- previews/primer/alpha/auto_complete_preview.rb
|
@@ -909,6 +913,8 @@ files:
|
|
909
913
|
- previews/primer/alpha/banner_preview/with_action_button.html.erb
|
910
914
|
- previews/primer/alpha/banner_preview/with_action_content.html.erb
|
911
915
|
- previews/primer/alpha/button_marketing_preview.rb
|
916
|
+
- previews/primer/alpha/check_box_group_preview.rb
|
917
|
+
- previews/primer/alpha/check_box_preview.rb
|
912
918
|
- previews/primer/alpha/dialog_preview.rb
|
913
919
|
- previews/primer/alpha/dialog_preview/body_has_scrollbar_overflow.html.erb
|
914
920
|
- previews/primer/alpha/dialog_preview/custom_header.html.erb
|
@@ -918,6 +924,8 @@ files:
|
|
918
924
|
- previews/primer/alpha/dialog_preview/with_form.html.erb
|
919
925
|
- previews/primer/alpha/dialog_preview/with_text_input.html.erb
|
920
926
|
- previews/primer/alpha/dropdown_preview.rb
|
927
|
+
- previews/primer/alpha/form_control_preview.rb
|
928
|
+
- previews/primer/alpha/form_control_preview/playground.html.erb
|
921
929
|
- previews/primer/alpha/hellip_button_preview.rb
|
922
930
|
- previews/primer/alpha/hidden_text_expander_preview.rb
|
923
931
|
- previews/primer/alpha/image_crop_preview.rb
|
@@ -925,10 +933,18 @@ files:
|
|
925
933
|
- previews/primer/alpha/menu_preview.rb
|
926
934
|
- previews/primer/alpha/menu_preview/default.html.erb
|
927
935
|
- previews/primer/alpha/menu_preview/playground.html.erb
|
936
|
+
- previews/primer/alpha/multi_input_preview.rb
|
937
|
+
- previews/primer/alpha/multi_input_preview/playground.html.erb
|
928
938
|
- previews/primer/alpha/nav_list_preview.rb
|
939
|
+
- previews/primer/alpha/radio_button_group_preview.rb
|
940
|
+
- previews/primer/alpha/radio_button_preview.rb
|
929
941
|
- previews/primer/alpha/segmented_control_preview.rb
|
942
|
+
- previews/primer/alpha/segmented_control_preview/with_label_and_caption.html.erb
|
943
|
+
- previews/primer/alpha/segmented_control_preview/with_subhead_actions.html.erb
|
944
|
+
- previews/primer/alpha/select_preview.rb
|
930
945
|
- previews/primer/alpha/tab_nav_preview.rb
|
931
946
|
- previews/primer/alpha/tab_panels_preview.rb
|
947
|
+
- previews/primer/alpha/text_area_preview.rb
|
932
948
|
- previews/primer/alpha/text_field_preview.rb
|
933
949
|
- previews/primer/alpha/toggle_switch_preview.rb
|
934
950
|
- previews/primer/alpha/tooltip_preview.rb
|
@@ -996,18 +1012,17 @@ files:
|
|
996
1012
|
- previews/primer/forms/forms_preview/name_with_question_mark_form.html.erb
|
997
1013
|
- previews/primer/forms/forms_preview/radio_button_group_form.html.erb
|
998
1014
|
- previews/primer/forms/forms_preview/radio_button_with_nested_form.html.erb
|
999
|
-
- previews/primer/forms/forms_preview/
|
1015
|
+
- previews/primer/forms/forms_preview/select_form.html.erb
|
1000
1016
|
- previews/primer/forms/forms_preview/single_text_field_form.html.erb
|
1001
1017
|
- previews/primer/forms/forms_preview/submit_button_form.html.erb
|
1002
1018
|
- previews/primer/forms/forms_preview/text_field_and_checkbox_form.html.erb
|
1003
1019
|
- previews/primer/layout_component_preview.rb
|
1004
|
-
- previews/primer/local_time_component_preview.rb
|
1005
|
-
- previews/primer/time_ago_component_preview.rb
|
1006
1020
|
- previews/primer/url_helpers.rb
|
1007
1021
|
- static/arguments.json
|
1008
1022
|
- static/assets/view-components.svg
|
1009
1023
|
- static/audited_at.json
|
1010
1024
|
- static/constants.json
|
1025
|
+
- static/previews.json
|
1011
1026
|
- static/statuses.json
|
1012
1027
|
homepage: https://github.com/primer/view_components
|
1013
1028
|
licenses:
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# Use `LocalTime` to format a date and time in the user's preferred locale format. This component requires JavaScript.
|
5
|
-
class LocalTime < Primer::Component
|
6
|
-
status :deprecated
|
7
|
-
|
8
|
-
DEFAULT_DIGIT_TYPE = :numeric
|
9
|
-
DIGIT_TYPE_OPTIONS = [DEFAULT_DIGIT_TYPE, :"2-digit"].freeze
|
10
|
-
|
11
|
-
DEFAULT_TEXT_TYPE = :short
|
12
|
-
TEXT_TYPE_OPTIONS = [DEFAULT_TEXT_TYPE, :long].freeze
|
13
|
-
|
14
|
-
# @example Default
|
15
|
-
# <%= render(Primer::LocalTime.new(datetime: DateTime.parse("2014-06-01T13:05:07Z"))) %>
|
16
|
-
#
|
17
|
-
# @example All the options
|
18
|
-
# <%= render(Primer::LocalTime.new(datetime: DateTime.parse("2014-06-01T13:05:07Z"), weekday: :long, year: :"2-digit", month: :long, day: :"2-digit", hour: :"2-digit", minute: :"2-digit", second: :"2-digit", time_zone_name: :long)) %>
|
19
|
-
#
|
20
|
-
# @example With initial content
|
21
|
-
# <%= render(Primer::LocalTime.new(datetime: DateTime.parse("2014-06-01T13:05:07Z"))) do %>
|
22
|
-
# <!-- This content will be replaced once the component connects -->
|
23
|
-
# 2014/06/01 13:05
|
24
|
-
# <% end %>
|
25
|
-
#
|
26
|
-
# @param datetime [DateTime] The date to parse
|
27
|
-
# @param initial_text [String] Text to render before component is initialized
|
28
|
-
# @param weekday [Symbol] <%= one_of(Primer::LocalTime::TEXT_TYPE_OPTIONS) %>
|
29
|
-
# @param year [Symbol] <%= one_of(Primer::LocalTime::DIGIT_TYPE_OPTIONS) %>
|
30
|
-
# @param month [Symbol] <%= one_of(Primer::LocalTime::TEXT_TYPE_OPTIONS) %>
|
31
|
-
# @param day [Symbol] <%= one_of(Primer::LocalTime::DIGIT_TYPE_OPTIONS) %>
|
32
|
-
# @param hour [Symbol] <%= one_of(Primer::LocalTime::DIGIT_TYPE_OPTIONS) %>
|
33
|
-
# @param minute [Symbol] <%= one_of(Primer::LocalTime::DIGIT_TYPE_OPTIONS) %>
|
34
|
-
# @param second [Symbol] <%= one_of(Primer::LocalTime::DIGIT_TYPE_OPTIONS) %>
|
35
|
-
# @param time_zone_name [Symbol] <%= one_of(Primer::LocalTime::TEXT_TYPE_OPTIONS) %>
|
36
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
37
|
-
def initialize(datetime:, initial_text: nil, weekday: DEFAULT_TEXT_TYPE, year: DEFAULT_DIGIT_TYPE, month: DEFAULT_TEXT_TYPE, day: DEFAULT_DIGIT_TYPE, hour: DEFAULT_DIGIT_TYPE, minute: DEFAULT_DIGIT_TYPE, second: DEFAULT_DIGIT_TYPE, time_zone_name: DEFAULT_TEXT_TYPE, **system_arguments)
|
38
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
39
|
-
|
40
|
-
@datetime = datetime
|
41
|
-
|
42
|
-
@system_arguments[:tag] = "relative-time"
|
43
|
-
@system_arguments[:threshold] = "PT0S"
|
44
|
-
@system_arguments[:prefix] = ""
|
45
|
-
@system_arguments[:datetime] = datetime
|
46
|
-
|
47
|
-
@initial_text = initial_text
|
48
|
-
|
49
|
-
@system_arguments[:weekday] = fetch_or_fallback(TEXT_TYPE_OPTIONS, weekday, DEFAULT_TEXT_TYPE)
|
50
|
-
@system_arguments[:year] = fetch_or_fallback(DIGIT_TYPE_OPTIONS, year, DEFAULT_DIGIT_TYPE)
|
51
|
-
@system_arguments[:month] = fetch_or_fallback(TEXT_TYPE_OPTIONS, month, DEFAULT_TEXT_TYPE)
|
52
|
-
@system_arguments[:day] = fetch_or_fallback(DIGIT_TYPE_OPTIONS, day, DEFAULT_DIGIT_TYPE)
|
53
|
-
@system_arguments[:hour] = fetch_or_fallback(DIGIT_TYPE_OPTIONS, hour, DEFAULT_DIGIT_TYPE)
|
54
|
-
@system_arguments[:minute] = fetch_or_fallback(DIGIT_TYPE_OPTIONS, minute, DEFAULT_DIGIT_TYPE)
|
55
|
-
@system_arguments[:second] = fetch_or_fallback(DIGIT_TYPE_OPTIONS, second, DEFAULT_DIGIT_TYPE)
|
56
|
-
@system_arguments[:"time-zone-name"] = fetch_or_fallback(TEXT_TYPE_OPTIONS, time_zone_name, DEFAULT_TEXT_TYPE)
|
57
|
-
end
|
58
|
-
|
59
|
-
def call
|
60
|
-
render(Primer::BaseComponent.new(**@system_arguments).with_content(@initial_text || @datetime.strftime("%B %-d, %Y %H:%M %Z")))
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
import '@github/relative-time-element';
|
@@ -1 +0,0 @@
|
|
1
|
-
import '@github/relative-time-element';
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# Use `TimeAgo` to display a time relative to how long ago it was. This component requires JavaScript.
|
5
|
-
class TimeAgoComponent < Primer::Component
|
6
|
-
status :deprecated
|
7
|
-
|
8
|
-
# @example Default
|
9
|
-
# <%= render(Primer::TimeAgoComponent.new(time: Time.at(628232400))) %>
|
10
|
-
#
|
11
|
-
# @param time [Time] The time to be formatted
|
12
|
-
# @param micro [Boolean] If true then the text will be formatted in "micro" mode, using as few characters as possible
|
13
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
14
|
-
def initialize(time:, micro: false, **system_arguments)
|
15
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
16
|
-
@system_arguments[:datetime] = time.utc.iso8601
|
17
|
-
@system_arguments[:classes] = class_names("no-wrap", @system_arguments[:classes])
|
18
|
-
@system_arguments[:tag] = "relative-time"
|
19
|
-
@system_arguments[:tense] = "past"
|
20
|
-
@system_arguments[:format] = "micro" if micro
|
21
|
-
@time = time
|
22
|
-
@micro = micro
|
23
|
-
end
|
24
|
-
|
25
|
-
def call
|
26
|
-
render(Primer::BaseComponent.new(**@system_arguments)) { time_in_words }
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def time_in_words
|
32
|
-
return @time.in_time_zone.strftime("%b %-d, %Y") unless @micro
|
33
|
-
|
34
|
-
seconds_ago = Time.current - @time
|
35
|
-
|
36
|
-
if seconds_ago < 1.minute
|
37
|
-
# :nocov:
|
38
|
-
"1m"
|
39
|
-
# :nocov:
|
40
|
-
elsif seconds_ago >= 1.minute && seconds_ago < 1.hour
|
41
|
-
"#{(seconds_ago / 60).floor}m"
|
42
|
-
elsif seconds_ago >= 1.hour && seconds_ago < 1.day
|
43
|
-
"#{(seconds_ago / 60 / 60).floor}h"
|
44
|
-
elsif seconds_ago >= 1.day && seconds_ago < 1.year
|
45
|
-
"#{(seconds_ago / 60 / 60 / 24).floor}d"
|
46
|
-
elsif seconds_ago >= 1.year
|
47
|
-
"#{(seconds_ago / 60 / 60 / 24 / 365).floor}y"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
import '@github/relative-time-element'
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# rubocop:disable Primer/ComponentNameMigration
|
4
|
-
|
5
|
-
module Primer
|
6
|
-
# @label LocalTime
|
7
|
-
class LocalTimeComponentPreview < ViewComponent::Preview
|
8
|
-
# @param datetime datetime-local
|
9
|
-
# @param weekday [Symbol] select [long, short]
|
10
|
-
# @param month [Symbol] select [long, short]
|
11
|
-
# @param year [Symbol] select [numeric, "2-digit"]
|
12
|
-
# @param day [Symbol] select [numeric, "2-digit"]
|
13
|
-
# @param hour [Symbol] select [numeric, "2-digit"]
|
14
|
-
# @param minute [Symbol] select [numeric, "2-digit"]
|
15
|
-
# @param second [Symbol] select [numeric, "2-digit"]
|
16
|
-
# @param time_zone_name [Symbol] select [long, short]
|
17
|
-
def playground(datetime: "2014-04-01T16:30:00-08:00", weekday: :short, month: :short, year: :numeric, day: :numeric, hour: :numeric, minute: :numeric, second: :numeric, time_zone_name: :short)
|
18
|
-
render(Primer::LocalTime.new(datetime: DateTime.parse(datetime), weekday: weekday, month: month, year: year, day: day, hour: hour, minute: minute, second: second, time_zone_name: time_zone_name))
|
19
|
-
end
|
20
|
-
|
21
|
-
# @param datetime datetime-local
|
22
|
-
# @param weekday [Symbol] select [long, short]
|
23
|
-
# @param month [Symbol] select [long, short]
|
24
|
-
# @param year [Symbol] select [numeric, "2-digit"]
|
25
|
-
# @param day [Symbol] select [numeric, "2-digit"]
|
26
|
-
# @param hour [Symbol] select [numeric, "2-digit"]
|
27
|
-
# @param minute [Symbol] select [numeric, "2-digit"]
|
28
|
-
# @param second [Symbol] select [numeric, "2-digit"]
|
29
|
-
# @param time_zone_name [Symbol] select [long, short]
|
30
|
-
def default(datetime: "2014-04-01T16:30:00-08:00", weekday: :short, month: :short, year: :numeric, day: :numeric, hour: :numeric, minute: :numeric, second: :numeric, time_zone_name: :short)
|
31
|
-
render(Primer::LocalTime.new(datetime: DateTime.parse(datetime), weekday: weekday, month: month, year: year, day: day, hour: hour, minute: minute, second: second, time_zone_name: time_zone_name))
|
32
|
-
end
|
33
|
-
|
34
|
-
# @hidden
|
35
|
-
def with_all_the_options
|
36
|
-
render(Primer::LocalTime.new(
|
37
|
-
datetime: DateTime.parse("2016-06-01T13:05:07Z"),
|
38
|
-
weekday: :long,
|
39
|
-
year: :"2-digit",
|
40
|
-
month: :long,
|
41
|
-
day: :"2-digit",
|
42
|
-
hour: :"2-digit",
|
43
|
-
minute: :"2-digit",
|
44
|
-
second: :"2-digit",
|
45
|
-
time_zone_name: :long
|
46
|
-
))
|
47
|
-
end
|
48
|
-
|
49
|
-
# @label With replaceable content
|
50
|
-
#
|
51
|
-
# @param initial_text [String] textarea
|
52
|
-
def with_contents(initial_text: "This will be replaced")
|
53
|
-
render Primer::LocalTime.new(datetime: DateTime.parse("2014-04-01T16:30:00-08:00"), initial_text: initial_text)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
# rubocop:enable Primer/ComponentNameMigration
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# rubocop:disable Primer/ComponentNameMigration
|
4
|
-
|
5
|
-
module Primer
|
6
|
-
# @label TimeAgoComponent
|
7
|
-
class TimeAgoComponentPreview < ViewComponent::Preview
|
8
|
-
# @label Playground
|
9
|
-
#
|
10
|
-
# @param time datetime-local
|
11
|
-
# @param micro [Boolean] toggle
|
12
|
-
def playground(time: Time.zone.now.to_s, micro: false)
|
13
|
-
render(Primer::TimeAgoComponent.new(time: DateTime.parse(time), micro: micro))
|
14
|
-
end
|
15
|
-
|
16
|
-
# @param time datetime-local
|
17
|
-
# @param micro [Boolean] toggle
|
18
|
-
def default(time: Time.zone.now.to_s, micro: false)
|
19
|
-
render(Primer::TimeAgoComponent.new(time: DateTime.parse(time), micro: micro))
|
20
|
-
end
|
21
|
-
|
22
|
-
def micro
|
23
|
-
render(Primer::TimeAgoComponent.new(time: Time.zone.now, micro: true))
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
# rubocop:enable Primer/ComponentNameMigration
|