primer_view_components 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  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/assets/styles/primer_view_components.css +2 -2
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list/item.rb +2 -2
  8. data/app/components/primer/alpha/action_list.rb +1 -1
  9. data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +1 -0
  10. data/app/components/primer/alpha/action_menu/action_menu_element.js +48 -22
  11. data/app/components/primer/alpha/action_menu/action_menu_element.ts +50 -19
  12. data/app/components/primer/alpha/action_menu/list.rb +19 -9
  13. data/app/components/primer/alpha/action_menu.rb +56 -17
  14. data/app/components/primer/alpha/dialog.css +1 -1
  15. data/app/components/primer/alpha/dialog.css.json +0 -2
  16. data/app/components/primer/alpha/dialog.css.map +1 -1
  17. data/app/components/primer/alpha/dialog.pcss +0 -4
  18. data/app/components/primer/alpha/dropdown/menu.rb +1 -1
  19. data/app/components/primer/alpha/modal_dialog.js +12 -0
  20. data/app/components/primer/alpha/modal_dialog.ts +17 -0
  21. data/app/components/primer/alpha/overlay.css +1 -1
  22. data/app/components/primer/alpha/overlay.css.map +1 -1
  23. data/app/components/primer/alpha/overlay.pcss +1 -1
  24. data/app/components/primer/alpha/overlay.rb +9 -5
  25. data/app/components/primer/beta/auto_complete/auto_complete.html.erb +1 -1
  26. data/app/components/primer/beta/auto_complete.rb +19 -1
  27. data/app/components/primer/beta/button.css +1 -1
  28. data/app/components/primer/beta/button.css.json +0 -2
  29. data/app/components/primer/beta/button.css.map +1 -1
  30. data/app/components/primer/beta/button.pcss +2 -4
  31. data/lib/primer/view_components/version.rb +1 -1
  32. data/previews/primer/alpha/action_menu_preview/content_labels.html.erb +9 -0
  33. data/previews/primer/alpha/action_menu_preview.rb +43 -36
  34. data/previews/primer/beta/auto_complete_preview.rb +36 -23
  35. data/static/arguments.json +6 -0
  36. data/static/constants.json +19 -8
  37. data/static/info_arch.json +35 -6
  38. data/static/previews.json +5 -0
  39. metadata +7 -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
@@ -2738,6 +2738,12 @@
2738
2738
  "default": "`false`",
2739
2739
  "description": "Input can be full-width or fit to content"
2740
2740
  },
2741
+ {
2742
+ "name": "width",
2743
+ "type": "String",
2744
+ "default": "`:auto`",
2745
+ "description": "Optional parameter to set max width of results list. One of `:auto`, `:large`, `:medium`, `:small`, `:xlarge`, or `:xxlarge`."
2746
+ },
2741
2747
  {
2742
2748
  "name": "disabled",
2743
2749
  "type": "Boolean",
@@ -102,18 +102,12 @@
102
102
  ]
103
103
  },
104
104
  "Primer::Alpha::ActionMenu::List": {
105
- "DEFAULT_ITEM_TAG": "span",
106
- "ITEM_ACTION_OPTIONS": [
107
- "classes",
108
- "onclick",
109
- "href",
110
- "value"
111
- ],
105
+ "DEFAULT_ITEM_TAG": "button",
112
106
  "ITEM_TAG_OPTIONS": [
113
107
  "a",
114
108
  "button",
115
109
  "clipboard-copy",
116
- "span"
110
+ "button"
117
111
  ]
118
112
  },
119
113
  "Primer::Alpha::AutoComplete": {
@@ -599,6 +593,7 @@
599
593
  },
600
594
  "Primer::Beta::AutoComplete": {
601
595
  "DEFAULT_SIZE": "medium",
596
+ "DEFAULT_WIDTH": "auto",
602
597
  "Item": "Primer::Beta::AutoComplete::Item",
603
598
  "SIZE_MAPPINGS": {
604
599
  "small": "FormControl-small",
@@ -609,6 +604,22 @@
609
604
  "small",
610
605
  "medium",
611
606
  "large"
607
+ ],
608
+ "WIDTH_MAPPINGS": {
609
+ "auto": "Overlay--width-auto",
610
+ "small": "Overlay--width-small",
611
+ "medium": "Overlay--width-medium",
612
+ "large": "Overlay--width-large",
613
+ "xlarge": "Overlay--width-xlarge",
614
+ "xxlarge": "Overlay--width-xxlarge"
615
+ },
616
+ "WIDTH_OPTIONS": [
617
+ "auto",
618
+ "small",
619
+ "medium",
620
+ "large",
621
+ "xlarge",
622
+ "xxlarge"
612
623
  ]
613
624
  },
614
625
  "Primer::Beta::AutoComplete::Item": {
@@ -647,13 +647,13 @@
647
647
  },
648
648
  {
649
649
  "name": "with_show_button",
650
- "description": "Button to activate the menu. This may be a {{#link_to_component}}Primer::ButtonComponent{{/link_to_component}} or {{#link_to_component}}Primer::IconButton{{/link_to_component}}.",
650
+ "description": "Button to activate the menu.",
651
651
  "parameters": [
652
652
  {
653
- "name": "icon",
654
- "type": "Symbol",
653
+ "name": "system_arguments",
654
+ "type": "Hash",
655
655
  "default": "N/A",
656
- "description": "Set this to an [Octicon name](https://primer.style/octicons/) when you want to render an `IconButton`. Otherwise, this renders as a {{#link_to_component}}Primer::ButtonComponent{{/link_to_component}}."
656
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Alpha::Overlay{{/link_to_component}}'s `show_button` slot."
657
657
  }
658
658
  ]
659
659
  },
@@ -695,6 +695,11 @@
695
695
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/playground",
696
696
  "name": "playground"
697
697
  },
698
+ {
699
+ "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/content_labels",
700
+ "preview_path": "/lookbook/preview/primer/alpha/action_menu/content_labels",
701
+ "name": "content_labels"
702
+ },
698
703
  {
699
704
  "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/default",
700
705
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/default",
@@ -3347,10 +3352,22 @@
3347
3352
  "description": "Optional button to open the Overlay.",
3348
3353
  "parameters": [
3349
3354
  {
3350
- "name": "system_arguments",
3355
+ "name": "icon",
3356
+ "type": "String",
3357
+ "default": "N/A",
3358
+ "description": "Name of {{link_to_octicons}} to use instead of text. If provided, a {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}} will be rendered. Otherwise a {{#link_to_component}}Primer::Beta::Button{{/link_to_component}} will be rendered."
3359
+ },
3360
+ {
3361
+ "name": "controls",
3362
+ "type": "String",
3363
+ "default": "N/A",
3364
+ "description": "The ID of the menu this button controls. Used internally."
3365
+ },
3366
+ {
3367
+ "name": "button_arguments",
3351
3368
  "type": "Hash",
3352
3369
  "default": "N/A",
3353
- "description": "The same arguments as {{#link_to_component}}Primer::ButtonComponent{{/link_to_component}}."
3370
+ "description": "The arguments accepted by {{#link_to_component}}Primer::Beta::Button{{/link_to_component}} or {{#link_to_component}}Primer::Beta::IconButton{{/link_to_component}} depending on the presence of the `icon:` argument."
3354
3371
  }
3355
3372
  ]
3356
3373
  },
@@ -3364,6 +3381,12 @@
3364
3381
  "default": "N/A",
3365
3382
  "description": "Show a divider between the header and body."
3366
3383
  },
3384
+ {
3385
+ "name": "size",
3386
+ "type": "Symbol",
3387
+ "default": "N/A",
3388
+ "description": "One of One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.."
3389
+ },
3367
3390
  {
3368
3391
  "name": "visually_hide_title",
3369
3392
  "type": "Boolean",
@@ -5286,6 +5309,12 @@
5286
5309
  "default": "`false`",
5287
5310
  "description": "Input can be full-width or fit to content"
5288
5311
  },
5312
+ {
5313
+ "name": "width",
5314
+ "type": "String",
5315
+ "default": "`:auto`",
5316
+ "description": "Optional parameter to set max width of results list. One of `:auto`, `:large`, `:medium`, `:small`, `:xlarge`, or `:xxlarge`."
5317
+ },
5289
5318
  {
5290
5319
  "name": "disabled",
5291
5320
  "type": "Boolean",
data/static/previews.json CHANGED
@@ -123,6 +123,11 @@
123
123
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/playground",
124
124
  "name": "playground"
125
125
  },
126
+ {
127
+ "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/content_labels",
128
+ "preview_path": "/lookbook/preview/primer/alpha/action_menu/content_labels",
129
+ "name": "content_labels"
130
+ },
126
131
  {
127
132
  "inspect_path": "/lookbook/inspect/primer/alpha/action_menu/default",
128
133
  "preview_path": "/lookbook/preview/primer/alpha/action_menu/default",
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.1.5
4
+ version: 0.1.6
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-04-06 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -146,16 +146,16 @@ dependencies:
146
146
  name: erb_lint
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
- - - ">="
149
+ - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '0'
151
+ version: 0.4.0
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - ">="
156
+ - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '0'
158
+ version: 0.4.0
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: erblint-github
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -940,6 +940,7 @@ files:
940
940
  - previews/primer/alpha/action_list_preview.rb
941
941
  - previews/primer/alpha/action_menu_preview.rb
942
942
  - previews/primer/alpha/action_menu_preview/align_end.html.erb
943
+ - previews/primer/alpha/action_menu_preview/content_labels.html.erb
943
944
  - previews/primer/alpha/action_menu_preview/opens_dialog.html.erb
944
945
  - previews/primer/alpha/auto_complete_preview.rb
945
946
  - previews/primer/alpha/banner_preview.rb