primer_view_components 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -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 +3 -3
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/form_wrapper.html.erb +10 -0
- data/app/components/primer/alpha/action_list/form_wrapper.rb +61 -0
- data/app/components/primer/alpha/action_list/item.html.erb +41 -36
- data/app/components/primer/alpha/action_list/item.rb +18 -4
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.html.erb +5 -0
- data/app/components/primer/alpha/action_list.pcss +37 -37
- data/app/components/primer/alpha/action_list.rb +18 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +8 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +100 -22
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +119 -20
- data/app/components/primer/alpha/action_menu/list.rb +27 -19
- data/app/components/primer/alpha/action_menu.rb +106 -29
- data/app/components/primer/alpha/auto_complete.css +1 -1
- data/app/components/primer/alpha/auto_complete.css.map +1 -1
- data/app/components/primer/alpha/auto_complete.pcss +2 -2
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/banner.pcss +7 -7
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.json +0 -2
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +33 -36
- data/app/components/primer/alpha/dropdown/menu.rb +1 -1
- data/app/components/primer/alpha/dropdown.css +1 -1
- data/app/components/primer/alpha/dropdown.css.map +1 -1
- data/app/components/primer/alpha/dropdown.pcss +12 -11
- data/app/components/primer/alpha/layout.css +1 -1
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/layout.pcss +4 -4
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/menu.pcss +20 -20
- data/app/components/primer/alpha/modal_dialog.js +12 -0
- data/app/components/primer/alpha/modal_dialog.ts +17 -0
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +1 -1
- data/app/components/primer/alpha/overlay.rb +9 -5
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +27 -38
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.pcss +12 -12
- data/app/components/primer/alpha/text_field.css +3 -3
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +74 -88
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.pcss +9 -9
- data/app/components/primer/alpha/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +1 -1
- data/app/components/primer/alpha/underline_nav.pcss +7 -7
- data/app/components/primer/beta/auto_complete/auto_complete.html.erb +1 -1
- data/app/components/primer/beta/auto_complete/item.html.erb +9 -9
- data/app/components/primer/beta/auto_complete/item.rb +17 -13
- data/app/components/primer/beta/auto_complete.rb +20 -2
- data/app/components/primer/beta/avatar.css +1 -1
- data/app/components/primer/beta/avatar.css.map +1 -1
- data/app/components/primer/beta/avatar.pcss +2 -2
- data/app/components/primer/beta/avatar_stack.css +1 -1
- data/app/components/primer/beta/avatar_stack.css.map +1 -1
- data/app/components/primer/beta/avatar_stack.pcss +5 -5
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.pcss +13 -13
- data/app/components/primer/beta/border_box.css +1 -1
- data/app/components/primer/beta/border_box.css.json +1 -1
- data/app/components/primer/beta/border_box.css.map +1 -1
- data/app/components/primer/beta/border_box.pcss +41 -39
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.json +0 -2
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +27 -29
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/counter.pcss +3 -3
- data/app/components/primer/beta/flash.css +1 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/flash.pcss +10 -11
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/label.pcss +2 -2
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/popover.pcss +4 -4
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/state.pcss +5 -5
- data/app/components/primer/beta/subhead.css +1 -1
- data/app/components/primer/beta/subhead.css.map +1 -1
- data/app/components/primer/beta/subhead.pcss +4 -4
- data/app/components/primer/beta/timeline_item.css +1 -1
- data/app/components/primer/beta/timeline_item.css.map +1 -1
- data/app/components/primer/beta/timeline_item.pcss +13 -13
- data/app/components/primer/beta/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/beta/truncate.pcss +1 -1
- data/lib/postcss_mixins/activeIndicatorLine.pcss +1 -1
- data/lib/primer/view_components/linters/disallow_component_css_counter.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/component_manifest.rb +1 -0
- data/previews/primer/alpha/action_menu_preview/content_labels.html.erb +9 -0
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/single_select_form.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/submitting_forms.html.erb +15 -0
- data/previews/primer/alpha/action_menu_preview.rb +89 -38
- data/previews/primer/beta/auto_complete_preview.rb +36 -23
- data/static/arguments.json +43 -2
- data/static/audited_at.json +1 -0
- data/static/constants.json +37 -9
- data/static/info_arch.json +137 -23
- data/static/previews.json +25 -0
- data/static/statuses.json +1 -0
- metadata +12 -6
@@ -13,6 +13,7 @@ module Primer
|
|
13
13
|
# @param placeholder text
|
14
14
|
# @param size select [small, medium, large]
|
15
15
|
# @param full_width toggle
|
16
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
16
17
|
# @param disabled toggle
|
17
18
|
# @param invalid toggle
|
18
19
|
# @param input_id text
|
@@ -20,8 +21,8 @@ module Primer
|
|
20
21
|
# @param input_name text
|
21
22
|
# @param inset toggle
|
22
23
|
# @param monospace toggle
|
23
|
-
def playground(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
24
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
24
|
+
def playground(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
25
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
25
26
|
component.with_leading_visual_icon(icon: :search)
|
26
27
|
end
|
27
28
|
end
|
@@ -33,6 +34,7 @@ module Primer
|
|
33
34
|
# @param placeholder text
|
34
35
|
# @param size select [small, medium, large]
|
35
36
|
# @param full_width toggle
|
37
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
36
38
|
# @param disabled toggle
|
37
39
|
# @param invalid toggle
|
38
40
|
# @param input_id text
|
@@ -40,8 +42,8 @@ module Primer
|
|
40
42
|
# @param input_name text
|
41
43
|
# @param inset toggle
|
42
44
|
# @param monospace toggle
|
43
|
-
def default(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
44
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
45
|
+
def default(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id", inset: false, monospace: false)
|
46
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name, inset: inset, monospace: monospace)) do |component|
|
45
47
|
component.with_leading_visual_icon(icon: :search)
|
46
48
|
end
|
47
49
|
end
|
@@ -53,12 +55,13 @@ module Primer
|
|
53
55
|
# @param placeholder text
|
54
56
|
# @param size select [small, medium, large]
|
55
57
|
# @param full_width toggle
|
58
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
56
59
|
# @param disabled toggle
|
57
60
|
# @param invalid toggle
|
58
61
|
# @param input_id text
|
59
62
|
# @param list_id text
|
60
63
|
# @param input_name text
|
61
|
-
def with_submit_button(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: true, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
64
|
+
def with_submit_button(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: true, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
62
65
|
render_with_template(locals: {
|
63
66
|
label_text: label_text,
|
64
67
|
show_clear_button: show_clear_button,
|
@@ -66,6 +69,7 @@ module Primer
|
|
66
69
|
placeholder: placeholder,
|
67
70
|
size: size,
|
68
71
|
full_width: full_width,
|
72
|
+
width: width,
|
69
73
|
disabled: disabled,
|
70
74
|
invalid: invalid,
|
71
75
|
input_id: input_id,
|
@@ -81,13 +85,14 @@ module Primer
|
|
81
85
|
# @param placeholder text
|
82
86
|
# @param size select [small, medium, large]
|
83
87
|
# @param full_width toggle
|
88
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
84
89
|
# @param disabled toggle
|
85
90
|
# @param invalid toggle
|
86
91
|
# @param input_id text
|
87
92
|
# @param list_id text
|
88
93
|
# @param input_name text
|
89
|
-
def leading_visual(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
90
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
94
|
+
def leading_visual(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
95
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
91
96
|
component.with_leading_visual_icon(icon: :search)
|
92
97
|
end
|
93
98
|
end
|
@@ -99,13 +104,14 @@ module Primer
|
|
99
104
|
# @param placeholder text
|
100
105
|
# @param size select [small, medium, large]
|
101
106
|
# @param full_width toggle
|
107
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
102
108
|
# @param disabled toggle
|
103
109
|
# @param invalid toggle
|
104
110
|
# @param input_id text
|
105
111
|
# @param list_id text
|
106
112
|
# @param input_name text
|
107
|
-
def trailing_action(label_text: "Select a fruit", show_clear_button: true, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
108
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name))
|
113
|
+
def trailing_action(label_text: "Select a fruit", show_clear_button: true, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
114
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
109
115
|
end
|
110
116
|
|
111
117
|
# @label Full width
|
@@ -115,13 +121,14 @@ module Primer
|
|
115
121
|
# @param placeholder text
|
116
122
|
# @param size select [small, medium, large]
|
117
123
|
# @param full_width toggle
|
124
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
118
125
|
# @param disabled toggle
|
119
126
|
# @param invalid toggle
|
120
127
|
# @param input_id text
|
121
128
|
# @param list_id text
|
122
129
|
# @param input_name text
|
123
|
-
def full_width(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: true, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
124
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
130
|
+
def full_width(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: true, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
131
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
125
132
|
component.with_leading_visual_icon(icon: :search)
|
126
133
|
end
|
127
134
|
end
|
@@ -133,13 +140,14 @@ module Primer
|
|
133
140
|
# @param placeholder text
|
134
141
|
# @param size select [small, medium, large]
|
135
142
|
# @param full_width toggle
|
143
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
136
144
|
# @param disabled toggle
|
137
145
|
# @param invalid toggle
|
138
146
|
# @param input_id text
|
139
147
|
# @param list_id text
|
140
148
|
# @param input_name text
|
141
|
-
def visually_hide_label(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: true, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
142
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
149
|
+
def visually_hide_label(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: true, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
150
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
143
151
|
component.with_leading_visual_icon(icon: :search)
|
144
152
|
end
|
145
153
|
end
|
@@ -152,13 +160,14 @@ module Primer
|
|
152
160
|
# @param placeholder text
|
153
161
|
# @param size select [small, medium, large]
|
154
162
|
# @param full_width toggle
|
163
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
155
164
|
# @param disabled toggle
|
156
165
|
# @param invalid toggle
|
157
166
|
# @param input_id text
|
158
167
|
# @param list_id text
|
159
168
|
# @param input_name text
|
160
|
-
def small(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :small, full_width: false, disabled: false, invalid: false, input_id: "input-id-1", list_id: "list-id-1", input_name: "input-id-1")
|
161
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
169
|
+
def small(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :small, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id-1", list_id: "list-id-1", input_name: "input-id-1")
|
170
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
162
171
|
component.with_leading_visual_icon(icon: :search)
|
163
172
|
end
|
164
173
|
end
|
@@ -169,13 +178,14 @@ module Primer
|
|
169
178
|
# @param placeholder text
|
170
179
|
# @param size select [small, medium, large]
|
171
180
|
# @param full_width toggle
|
181
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
172
182
|
# @param disabled toggle
|
173
183
|
# @param invalid toggle
|
174
184
|
# @param input_id text
|
175
185
|
# @param list_id text
|
176
186
|
# @param input_name text
|
177
|
-
def medium(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id-2", list_id: "list-id-2", input_name: "input-id-2")
|
178
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
187
|
+
def medium(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id-2", list_id: "list-id-2", input_name: "input-id-2")
|
188
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
179
189
|
component.with_leading_visual_icon(icon: :search)
|
180
190
|
end
|
181
191
|
end
|
@@ -186,13 +196,14 @@ module Primer
|
|
186
196
|
# @param placeholder text
|
187
197
|
# @param size select [small, medium, large]
|
188
198
|
# @param full_width toggle
|
199
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
189
200
|
# @param disabled toggle
|
190
201
|
# @param invalid toggle
|
191
202
|
# @param input_id text
|
192
203
|
# @param list_id text
|
193
204
|
# @param input_name text
|
194
|
-
def large(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :large, full_width: false, disabled: false, invalid: false, input_id: "input-id-3", list_id: "list-id-3", input_name: "input-id-3")
|
195
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
205
|
+
def large(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :large, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id-3", list_id: "list-id-3", input_name: "input-id-3")
|
206
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path, show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name)) do |component|
|
196
207
|
component.with_leading_visual_icon(icon: :search)
|
197
208
|
end
|
198
209
|
end
|
@@ -206,13 +217,14 @@ module Primer
|
|
206
217
|
# @param placeholder text
|
207
218
|
# @param size select [small, medium, large]
|
208
219
|
# @param full_width toggle
|
220
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
209
221
|
# @param disabled toggle
|
210
222
|
# @param invalid toggle
|
211
223
|
# @param input_id text
|
212
224
|
# @param list_id text
|
213
225
|
# @param input_name text
|
214
|
-
def leading_visual_in_results(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
215
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path(visual: "leading"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name))
|
226
|
+
def leading_visual_in_results(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
227
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path(visual: "leading"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
216
228
|
end
|
217
229
|
|
218
230
|
# @label Trailing visual in results
|
@@ -222,13 +234,14 @@ module Primer
|
|
222
234
|
# @param placeholder text
|
223
235
|
# @param size select [small, medium, large]
|
224
236
|
# @param full_width toggle
|
237
|
+
# @param width select [auto, small, medium, large, xlarge, xxlarge]
|
225
238
|
# @param disabled toggle
|
226
239
|
# @param invalid toggle
|
227
240
|
# @param input_id text
|
228
241
|
# @param list_id text
|
229
242
|
# @param input_name text
|
230
|
-
def trailing_visual_in_results(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
231
|
-
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path(visual: "trailing"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, disabled: disabled, invalid: invalid, input_name: input_name))
|
243
|
+
def trailing_visual_in_results(label_text: "Select a fruit", show_clear_button: false, visually_hide_label: false, placeholder: "Placeholder text", size: :medium, full_width: false, width: :auto, disabled: false, invalid: false, input_id: "input-id", list_id: "list-id", input_name: "input-id")
|
244
|
+
render(Primer::Beta::AutoComplete.new(label_text: label_text, input_id: input_id, list_id: list_id, src: UrlHelpers.autocomplete_index_path(visual: "trailing"), show_clear_button: show_clear_button, visually_hide_label: visually_hide_label, placeholder: placeholder, size: size, full_width: full_width, width: width, disabled: disabled, invalid: invalid, input_name: input_name))
|
232
245
|
end
|
233
246
|
|
234
247
|
# @hidden
|
data/static/arguments.json
CHANGED
@@ -43,6 +43,12 @@
|
|
43
43
|
"default": "`:none`",
|
44
44
|
"description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
|
45
45
|
},
|
46
|
+
{
|
47
|
+
"name": "form_arguments",
|
48
|
+
"type": "Hash",
|
49
|
+
"default": "`{}`",
|
50
|
+
"description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an [ActionMenu](/components/alpha/actionmenu) instead of using this feature directly."
|
51
|
+
},
|
46
52
|
{
|
47
53
|
"name": "system_arguments",
|
48
54
|
"type": "Hash",
|
@@ -73,6 +79,17 @@
|
|
73
79
|
}
|
74
80
|
]
|
75
81
|
},
|
82
|
+
{
|
83
|
+
"component": "ActionList::FormWrapper",
|
84
|
+
"status": "alpha",
|
85
|
+
"a11y_reviewed": false,
|
86
|
+
"short_name": "ActionListFormWrapper",
|
87
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb",
|
88
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/",
|
89
|
+
"parameters": [
|
90
|
+
|
91
|
+
]
|
92
|
+
},
|
76
93
|
{
|
77
94
|
"component": "ActionList::Heading",
|
78
95
|
"status": "alpha",
|
@@ -169,6 +186,12 @@
|
|
169
186
|
"default": "`{}`",
|
170
187
|
"description": "[System arguments](/system-arguments) used to construct the item's anchor or button tag."
|
171
188
|
},
|
189
|
+
{
|
190
|
+
"name": "form_arguments",
|
191
|
+
"type": "Hash",
|
192
|
+
"default": "`{}`",
|
193
|
+
"description": "Allows the item to submit a form on click. The URL passed in the `href:` option will be used as the form action. Pass the `method:` option to this hash to control what kind of request is made, One of `:delete`, `:get`, `:head`, `:patch`, `:post`, or `:put`. The `name:` option is required and specifies the desired name of the field that will be included in the params sent to the server on form submission. Specify the `value:` option to send a custom value to the server; otherwise the value of `name:` is sent."
|
194
|
+
},
|
172
195
|
{
|
173
196
|
"name": "truncate_label",
|
174
197
|
"type": "Boolean",
|
@@ -263,6 +286,12 @@
|
|
263
286
|
"default": "`:outside_bottom`",
|
264
287
|
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`.."
|
265
288
|
},
|
289
|
+
{
|
290
|
+
"name": "size",
|
291
|
+
"type": "Symbol",
|
292
|
+
"default": "`:auto`",
|
293
|
+
"description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.."
|
294
|
+
},
|
266
295
|
{
|
267
296
|
"name": "src",
|
268
297
|
"type": "String",
|
@@ -291,7 +320,13 @@
|
|
291
320
|
"name": "select_variant",
|
292
321
|
"type": "Symbol",
|
293
322
|
"default": "`:none`",
|
294
|
-
"description": "
|
323
|
+
"description": "One of `:multiple`, `:none`, or `:single`."
|
324
|
+
},
|
325
|
+
{
|
326
|
+
"name": "form_arguments",
|
327
|
+
"type": "Hash",
|
328
|
+
"default": "`{}`",
|
329
|
+
"description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
|
295
330
|
},
|
296
331
|
{
|
297
332
|
"name": "system_arguments",
|
@@ -319,7 +354,7 @@
|
|
319
354
|
"name": "system_arguments",
|
320
355
|
"type": "Hash",
|
321
356
|
"default": "N/A",
|
322
|
-
"description": "
|
357
|
+
"description": "The arguments accepted by [ActionList](/components/alpha/actionlist)"
|
323
358
|
}
|
324
359
|
]
|
325
360
|
},
|
@@ -2738,6 +2773,12 @@
|
|
2738
2773
|
"default": "`false`",
|
2739
2774
|
"description": "Input can be full-width or fit to content"
|
2740
2775
|
},
|
2776
|
+
{
|
2777
|
+
"name": "width",
|
2778
|
+
"type": "String",
|
2779
|
+
"default": "`:auto`",
|
2780
|
+
"description": "Optional parameter to set max width of results list. One of `:auto`, `:large`, `:medium`, `:small`, `:xlarge`, or `:xxlarge`."
|
2781
|
+
},
|
2741
2782
|
{
|
2742
2783
|
"name": "disabled",
|
2743
2784
|
"type": "Boolean",
|
data/static/audited_at.json
CHANGED
data/static/constants.json
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
"DEFAULT_SCHEME": "full",
|
6
6
|
"DEFAULT_SELECT_VARIANT": "none",
|
7
7
|
"Divider": "Primer::Alpha::ActionList::Divider",
|
8
|
+
"FormWrapper": "Primer::Alpha::ActionList::FormWrapper",
|
8
9
|
"Heading": "Primer::Alpha::ActionList::Heading",
|
9
10
|
"Item": "Primer::Alpha::ActionList::Item",
|
10
11
|
"MENU_ROLE": "menu",
|
@@ -39,6 +40,17 @@
|
|
39
40
|
"filled"
|
40
41
|
]
|
41
42
|
},
|
43
|
+
"Primer::Alpha::ActionList::FormWrapper": {
|
44
|
+
"DEFAULT_HTTP_METHOD": "get",
|
45
|
+
"HTTP_METHOD_OPTIONS": [
|
46
|
+
"get",
|
47
|
+
"post",
|
48
|
+
"patch",
|
49
|
+
"put",
|
50
|
+
"delete",
|
51
|
+
"head"
|
52
|
+
]
|
53
|
+
},
|
42
54
|
"Primer::Alpha::ActionList::Heading": {
|
43
55
|
"DEFAULT_SCHEME": "subtle",
|
44
56
|
"HEADING_LEVELS": [
|
@@ -102,18 +114,12 @@
|
|
102
114
|
]
|
103
115
|
},
|
104
116
|
"Primer::Alpha::ActionMenu::List": {
|
105
|
-
"DEFAULT_ITEM_TAG": "
|
106
|
-
"ITEM_ACTION_OPTIONS": [
|
107
|
-
"classes",
|
108
|
-
"onclick",
|
109
|
-
"href",
|
110
|
-
"value"
|
111
|
-
],
|
117
|
+
"DEFAULT_ITEM_TAG": "button",
|
112
118
|
"ITEM_TAG_OPTIONS": [
|
113
119
|
"a",
|
114
120
|
"button",
|
115
121
|
"clipboard-copy",
|
116
|
-
"
|
122
|
+
"button"
|
117
123
|
]
|
118
124
|
},
|
119
125
|
"Primer::Alpha::AutoComplete": {
|
@@ -599,6 +605,7 @@
|
|
599
605
|
},
|
600
606
|
"Primer::Beta::AutoComplete": {
|
601
607
|
"DEFAULT_SIZE": "medium",
|
608
|
+
"DEFAULT_WIDTH": "auto",
|
602
609
|
"Item": "Primer::Beta::AutoComplete::Item",
|
603
610
|
"SIZE_MAPPINGS": {
|
604
611
|
"small": "FormControl-small",
|
@@ -609,10 +616,31 @@
|
|
609
616
|
"small",
|
610
617
|
"medium",
|
611
618
|
"large"
|
619
|
+
],
|
620
|
+
"WIDTH_MAPPINGS": {
|
621
|
+
"auto": "Overlay--width-auto",
|
622
|
+
"small": "Overlay--width-small",
|
623
|
+
"medium": "Overlay--width-medium",
|
624
|
+
"large": "Overlay--width-large",
|
625
|
+
"xlarge": "Overlay--width-xlarge",
|
626
|
+
"xxlarge": "Overlay--width-xxlarge"
|
627
|
+
},
|
628
|
+
"WIDTH_OPTIONS": [
|
629
|
+
"auto",
|
630
|
+
"small",
|
631
|
+
"medium",
|
632
|
+
"large",
|
633
|
+
"xlarge",
|
634
|
+
"xxlarge"
|
612
635
|
]
|
613
636
|
},
|
614
637
|
"Primer::Beta::AutoComplete::Item": {
|
615
|
-
"
|
638
|
+
"DEFAULT_DESCRIPTION_VARIANT": "block",
|
639
|
+
"DESCRIPTION_VARIANT_MAPPINGS": {
|
640
|
+
"inline": "ActionListItem-descriptionWrap--inline",
|
641
|
+
"block": "ActionListItem-descriptionWrap"
|
642
|
+
},
|
643
|
+
"DESCRIPTION_VARIANT_OPTIONS": [
|
616
644
|
"inline",
|
617
645
|
"block"
|
618
646
|
]
|