primer_view_components 0.27.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -9
- data/app/assets/javascripts/app/components/primer/alpha/select_panel_element.d.ts +64 -0
- data/app/assets/javascripts/app/components/primer/aria_live.d.ts +8 -0
- data/app/assets/javascripts/app/components/primer/primer.d.ts +4 -0
- data/app/assets/javascripts/app/components/primer/shared_events.d.ts +9 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.pcss +1 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -9
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +0 -11
- data/app/components/primer/alpha/action_menu.rb +13 -6
- data/app/components/primer/alpha/select_panel.html.erb +100 -0
- data/app/components/primer/alpha/select_panel.rb +486 -0
- data/app/components/primer/alpha/select_panel_element.d.ts +64 -0
- data/app/components/primer/alpha/select_panel_element.js +927 -0
- data/app/components/primer/alpha/select_panel_element.ts +1049 -0
- data/app/components/primer/aria_live.d.ts +8 -0
- data/app/components/primer/aria_live.js +38 -0
- data/app/components/primer/aria_live.ts +41 -0
- data/app/components/primer/base_component.rb +1 -1
- data/app/components/primer/primer.d.ts +4 -0
- data/app/components/primer/primer.js +4 -0
- data/app/components/primer/primer.ts +4 -0
- data/app/components/primer/shared_events.d.ts +9 -0
- data/app/components/primer/shared_events.js +1 -0
- data/app/components/primer/shared_events.ts +10 -0
- data/app/forms/example_toggle_switch_form/example_field_caption.html.erb +1 -1
- data/lib/primer/forms/toggle_switch.html.erb +1 -2
- data/lib/primer/static/generate_info_arch.rb +3 -2
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/component_manifest.rb +2 -0
- data/previews/primer/alpha/action_menu_preview.rb +1 -1
- data/previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb +25 -0
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch_initial_failure.html.erb +12 -0
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch_no_results.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/footer_buttons.html.erb +23 -0
- data/previews/primer/alpha/select_panel_preview/local_fetch.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview/local_fetch_no_results.html.erb +15 -0
- data/previews/primer/alpha/select_panel_preview/multiselect.html.erb +17 -0
- data/previews/primer/alpha/select_panel_preview/multiselect_form.html.erb +31 -0
- data/previews/primer/alpha/select_panel_preview/playground.html.erb +23 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_filter_failure.html.erb +13 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_initial_failure.html.erb +12 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_no_results.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/single_select.html.erb +20 -0
- data/previews/primer/alpha/select_panel_preview/single_select_form.html.erb +33 -0
- data/previews/primer/alpha/select_panel_preview/with_avatar_items.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview/with_dynamic_label.html.erb +23 -0
- data/previews/primer/alpha/select_panel_preview/with_dynamic_label_and_aria_prefix.html.erb +24 -0
- data/previews/primer/alpha/select_panel_preview/with_leading_icons.html.erb +31 -0
- data/previews/primer/alpha/select_panel_preview/with_subtitle.html.erb +25 -0
- data/previews/primer/alpha/select_panel_preview/with_trailing_icons.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview.rb +239 -0
- data/static/arguments.json +140 -0
- data/static/audited_at.json +2 -0
- data/static/constants.json +18 -0
- data/static/info_arch.json +950 -106
- data/static/previews.json +294 -0
- data/static/statuses.json +2 -0
- metadata +39 -2
@@ -0,0 +1,24 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
4
|
+
data: { interaction_subject: subject_id },
|
5
|
+
id: "with_avatar_items",
|
6
|
+
title: "Select users",
|
7
|
+
select_variant: :single,
|
8
|
+
fetch_strategy: :local,
|
9
|
+
dynamic_label: true,
|
10
|
+
dynamic_label_prefix: "Item",
|
11
|
+
dynamic_aria_label_prefix: "Your item",
|
12
|
+
open_on_load: open_on_load
|
13
|
+
)) do |panel| %>
|
14
|
+
<% panel.with_show_button { "Choose item" } %>
|
15
|
+
|
16
|
+
<% panel.with_item(label: "Item 1") %>
|
17
|
+
<% panel.with_item(label: "Item 2") %>
|
18
|
+
<% panel.with_item(label: "Item 3") %>
|
19
|
+
<% panel.with_item(label: "Item 4") %>
|
20
|
+
<% panel.with_item(label: "Item 5") %>
|
21
|
+
<% panel.with_item(label: "Item 6") %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
4
|
+
data: { interaction_subject: subject_id },
|
5
|
+
select_variant: :single,
|
6
|
+
fetch_strategy: :local,
|
7
|
+
dynamic_label: true,
|
8
|
+
dynamic_label_prefix: "Item",
|
9
|
+
dynamic_aria_label_prefix: "Selected item",
|
10
|
+
open_on_load: open_on_load
|
11
|
+
)) do |panel| %>
|
12
|
+
<% panel.with_show_button { "Choose item" } %>
|
13
|
+
|
14
|
+
<% panel.with_item(label: "Leading SVG visual") do |item| %>
|
15
|
+
<% item.with_leading_visual_svg do %>
|
16
|
+
<path d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z"></path><path fill-rule="evenodd" d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z"></path>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% panel.with_item(label: "Custom content") do |item| %>
|
21
|
+
<% item.with_leading_visual_content do %>
|
22
|
+
<span style="width: 16px; height: 16px; display: block; text-align: center; line-height: 16px">A</span>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<% panel.with_item(label: "Visual icons") do |item| %>
|
27
|
+
<% item.with_leading_visual_icon(icon: :star) %>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
4
|
+
data: { interaction_subject: subject_id },
|
5
|
+
select_variant: :single,
|
6
|
+
fetch_strategy: :local,
|
7
|
+
dynamic_label: true,
|
8
|
+
dynamic_label_prefix: "Item",
|
9
|
+
dynamic_aria_label_prefix: "Selected item",
|
10
|
+
open_on_load: open_on_load
|
11
|
+
)) do |panel| %>
|
12
|
+
<% panel.with_show_button { "Choose item" } %>
|
13
|
+
<% panel.with_subtitle do %>
|
14
|
+
Choose the item you want to select
|
15
|
+
<% end %>
|
16
|
+
<% panel.with_item(label: "Item 1") %>
|
17
|
+
<% panel.with_item(label: "Item 2") %>
|
18
|
+
<% panel.with_item(label: "Item 3") %>
|
19
|
+
<% panel.with_item(label: "Item 4") %>
|
20
|
+
<% panel.with_footer(show_divider: true) do %>
|
21
|
+
I'm a footer!
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
4
|
+
data: { interaction_subject: subject_id },
|
5
|
+
select_variant: :single,
|
6
|
+
fetch_strategy: :local,
|
7
|
+
dynamic_label: true,
|
8
|
+
dynamic_label_prefix: "Item",
|
9
|
+
dynamic_aria_label_prefix: "Selected item",
|
10
|
+
open_on_load: open_on_load
|
11
|
+
)) do |panel| %>
|
12
|
+
<% panel.with_show_button { "Choose item" } %>
|
13
|
+
|
14
|
+
<% panel.with_item(label: "Visual icons") do |item| %>
|
15
|
+
<% item.with_trailing_visual_icon(icon: :star) %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -0,0 +1,239 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Alpha
|
5
|
+
# @label SelectPanel
|
6
|
+
class SelectPanelPreview < ViewComponent::Preview
|
7
|
+
# @label Playground
|
8
|
+
#
|
9
|
+
# @param title text
|
10
|
+
# @param size [Symbol] select [auto, small, medium, medium_portrait, large, xlarge]
|
11
|
+
# @param simulate_failure toggle
|
12
|
+
# @param simulate_no_results toggle
|
13
|
+
# @param no_results_label text
|
14
|
+
# @param dynamic_label toggle
|
15
|
+
# @param dynamic_label_prefix text
|
16
|
+
# @param dynamic_aria_label_prefix text
|
17
|
+
# @param show_filter toggle
|
18
|
+
# @param open_on_load toggle
|
19
|
+
# @param anchor_align [Symbol] select [start, center, end]
|
20
|
+
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
21
|
+
def playground(
|
22
|
+
title: "Sci-fi equipment",
|
23
|
+
subtitle: "Various tools from your favorite shows",
|
24
|
+
size: :auto,
|
25
|
+
simulate_failure: false,
|
26
|
+
simulate_no_results: false,
|
27
|
+
no_results_label: "No results found",
|
28
|
+
dynamic_label: false,
|
29
|
+
dynamic_label_prefix: nil,
|
30
|
+
dynamic_aria_label_prefix: nil,
|
31
|
+
show_filter: true,
|
32
|
+
open_on_load: false,
|
33
|
+
anchor_align: :start,
|
34
|
+
anchor_side: :outside_bottom
|
35
|
+
)
|
36
|
+
render_with_template(locals: {
|
37
|
+
subtitle: subtitle,
|
38
|
+
system_arguments: {
|
39
|
+
title: title,
|
40
|
+
size: size,
|
41
|
+
simulate_failure: simulate_failure,
|
42
|
+
simulate_no_results: simulate_no_results,
|
43
|
+
no_results_label: no_results_label,
|
44
|
+
dynamic_label: dynamic_label,
|
45
|
+
dynamic_label_prefix: dynamic_label_prefix,
|
46
|
+
dynamic_aria_label_prefix: dynamic_aria_label_prefix,
|
47
|
+
show_filter: show_filter,
|
48
|
+
open_on_load: open_on_load,
|
49
|
+
anchor_align: anchor_align,
|
50
|
+
anchor_side: anchor_side
|
51
|
+
}
|
52
|
+
})
|
53
|
+
end
|
54
|
+
|
55
|
+
# @label Default
|
56
|
+
#
|
57
|
+
# @snapshot interactive
|
58
|
+
# @param open_on_load toggle
|
59
|
+
def default(open_on_load: false)
|
60
|
+
render_with_template(template: "primer/alpha/select_panel_preview/local_fetch", locals: {
|
61
|
+
open_on_load: open_on_load
|
62
|
+
})
|
63
|
+
end
|
64
|
+
|
65
|
+
# @!group Fetch strategies
|
66
|
+
|
67
|
+
# @label Local fetch
|
68
|
+
#
|
69
|
+
# @snapshot interactive
|
70
|
+
# @param open_on_load toggle
|
71
|
+
def local_fetch(open_on_load: false)
|
72
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
73
|
+
end
|
74
|
+
|
75
|
+
# @label Eventually local fetch
|
76
|
+
#
|
77
|
+
# @snapshot interactive
|
78
|
+
# @param open_on_load toggle
|
79
|
+
def eventually_local_fetch(open_on_load: false)
|
80
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
81
|
+
end
|
82
|
+
|
83
|
+
# @label Remote fetch
|
84
|
+
#
|
85
|
+
# @snapshot interactive
|
86
|
+
# @param open_on_load toggle
|
87
|
+
def remote_fetch(open_on_load: false)
|
88
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
89
|
+
end
|
90
|
+
|
91
|
+
# @label Local fetch (no results)
|
92
|
+
#
|
93
|
+
# @snapshot interactive
|
94
|
+
# @param open_on_load toggle
|
95
|
+
def local_fetch_no_results(open_on_load: false)
|
96
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
97
|
+
end
|
98
|
+
|
99
|
+
# @label Eventually local fetch (no results)
|
100
|
+
#
|
101
|
+
# @snapshot interactive
|
102
|
+
# @param open_on_load toggle
|
103
|
+
def eventually_local_fetch_no_results(open_on_load: false)
|
104
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
105
|
+
end
|
106
|
+
|
107
|
+
# @label Remote fetch (no results)
|
108
|
+
#
|
109
|
+
# @snapshot interactive
|
110
|
+
# @param open_on_load toggle
|
111
|
+
def remote_fetch_no_results(open_on_load: false)
|
112
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
113
|
+
end
|
114
|
+
|
115
|
+
# @!endgroup
|
116
|
+
|
117
|
+
# @label Single select
|
118
|
+
#
|
119
|
+
# @snapshot interactive
|
120
|
+
# @param dynamic_label toggle
|
121
|
+
# @param open_on_load toggle
|
122
|
+
def single_select(dynamic_label: false, open_on_load: false)
|
123
|
+
render_with_template(locals: { dynamic_label: dynamic_label, open_on_load: open_on_load })
|
124
|
+
end
|
125
|
+
|
126
|
+
# @label Multiselect
|
127
|
+
#
|
128
|
+
# @snapshot interactive
|
129
|
+
# @param open_on_load toggle
|
130
|
+
def multiselect(open_on_load: false)
|
131
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
132
|
+
end
|
133
|
+
|
134
|
+
# @!group Dynamic label
|
135
|
+
|
136
|
+
# @label With dynamic label
|
137
|
+
#
|
138
|
+
# @snapshot interactive
|
139
|
+
# @param open_on_load toggle
|
140
|
+
def with_dynamic_label(open_on_load: false)
|
141
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
142
|
+
end
|
143
|
+
|
144
|
+
# @label With dynamic label and aria prefix
|
145
|
+
#
|
146
|
+
# @snapshot interactive
|
147
|
+
# @param open_on_load toggle
|
148
|
+
def with_dynamic_label_and_aria_prefix(open_on_load: false)
|
149
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
150
|
+
end
|
151
|
+
|
152
|
+
# @!endgroup
|
153
|
+
|
154
|
+
# @label Footer buttons
|
155
|
+
#
|
156
|
+
# @snapshot interactive
|
157
|
+
# @param open_on_load toggle
|
158
|
+
def footer_buttons(open_on_load: false)
|
159
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
160
|
+
end
|
161
|
+
|
162
|
+
# @label With avatar items
|
163
|
+
#
|
164
|
+
# @snapshot interactive
|
165
|
+
# @param open_on_load toggle
|
166
|
+
def with_avatar_items(open_on_load: false)
|
167
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
168
|
+
end
|
169
|
+
|
170
|
+
# @!group With icons
|
171
|
+
|
172
|
+
# @label With leading icons
|
173
|
+
#
|
174
|
+
# @snapshot interactive
|
175
|
+
# @param open_on_load toggle
|
176
|
+
def with_leading_icons(open_on_load: false)
|
177
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
178
|
+
end
|
179
|
+
|
180
|
+
# @label With trailing icons
|
181
|
+
#
|
182
|
+
# @snapshot interactive
|
183
|
+
# @param open_on_load toggle
|
184
|
+
def with_trailing_icons(open_on_load: false)
|
185
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
186
|
+
end
|
187
|
+
|
188
|
+
# @!endgroup
|
189
|
+
|
190
|
+
# @label With subtitle
|
191
|
+
#
|
192
|
+
# @snapshot interactive
|
193
|
+
# @param open_on_load toggle
|
194
|
+
def with_subtitle(open_on_load: false)
|
195
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
196
|
+
end
|
197
|
+
|
198
|
+
# @label Remote fetch initial failure
|
199
|
+
#
|
200
|
+
# @snapshot interactive
|
201
|
+
# @param open_on_load toggle
|
202
|
+
def remote_fetch_initial_failure(open_on_load: false)
|
203
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
204
|
+
end
|
205
|
+
|
206
|
+
# @label Remote fetch filter failure
|
207
|
+
#
|
208
|
+
# @snapshot interactive
|
209
|
+
# @param open_on_load toggle
|
210
|
+
def remote_fetch_filter_failure(open_on_load: false)
|
211
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
212
|
+
end
|
213
|
+
|
214
|
+
# @label Eventually local fetch initial failure
|
215
|
+
#
|
216
|
+
# @snapshot interactive
|
217
|
+
# @param open_on_load toggle
|
218
|
+
def eventually_local_fetch_initial_failure(open_on_load: false)
|
219
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
220
|
+
end
|
221
|
+
|
222
|
+
# @label Single-select form
|
223
|
+
#
|
224
|
+
# @snapshot interactive
|
225
|
+
# @param open_on_load toggle
|
226
|
+
def single_select_form(open_on_load: false, route_format: :html)
|
227
|
+
render_with_template(locals: { open_on_load: open_on_load, route_format: route_format })
|
228
|
+
end
|
229
|
+
|
230
|
+
# @label Multi-select form
|
231
|
+
#
|
232
|
+
# @snapshot interactive
|
233
|
+
# @param open_on_load toggle
|
234
|
+
def multiselect_form(open_on_load: false, route_format: :html)
|
235
|
+
render_with_template(locals: { open_on_load: open_on_load, route_format: route_format })
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
data/static/arguments.json
CHANGED
@@ -2352,6 +2352,146 @@
|
|
2352
2352
|
}
|
2353
2353
|
]
|
2354
2354
|
},
|
2355
|
+
{
|
2356
|
+
"component": "SelectPanel",
|
2357
|
+
"status": "alpha",
|
2358
|
+
"a11y_reviewed": false,
|
2359
|
+
"short_name": "SelectPanel",
|
2360
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/select_panel.rb",
|
2361
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/select_panel/default/",
|
2362
|
+
"parameters": [
|
2363
|
+
{
|
2364
|
+
"name": "src",
|
2365
|
+
"type": "String",
|
2366
|
+
"default": "`nil`",
|
2367
|
+
"description": "The URL to fetch search results from."
|
2368
|
+
},
|
2369
|
+
{
|
2370
|
+
"name": "title",
|
2371
|
+
"type": "String",
|
2372
|
+
"default": "`\"Menu\"`",
|
2373
|
+
"description": "The title that appears at the top of the panel."
|
2374
|
+
},
|
2375
|
+
{
|
2376
|
+
"name": "id",
|
2377
|
+
"type": "String",
|
2378
|
+
"default": "`self.class.generate_id`",
|
2379
|
+
"description": "The unique ID of the panel."
|
2380
|
+
},
|
2381
|
+
{
|
2382
|
+
"name": "size",
|
2383
|
+
"type": "Symbol",
|
2384
|
+
"default": "`:small`",
|
2385
|
+
"description": "The size of the panel. One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`."
|
2386
|
+
},
|
2387
|
+
{
|
2388
|
+
"name": "select_variant",
|
2389
|
+
"type": "Symbol",
|
2390
|
+
"default": "`:single`",
|
2391
|
+
"description": "One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
|
2392
|
+
},
|
2393
|
+
{
|
2394
|
+
"name": "fetch_strategy",
|
2395
|
+
"type": "Symbol",
|
2396
|
+
"default": "`:remote`",
|
2397
|
+
"description": "One of `:eventually_local`, `:local`, or `:remote`."
|
2398
|
+
},
|
2399
|
+
{
|
2400
|
+
"name": "no_results_label",
|
2401
|
+
"type": "String",
|
2402
|
+
"default": "`\"No results found\"`",
|
2403
|
+
"description": "The label to display when no results are found."
|
2404
|
+
},
|
2405
|
+
{
|
2406
|
+
"name": "preload",
|
2407
|
+
"type": "Boolean",
|
2408
|
+
"default": "`false`",
|
2409
|
+
"description": "Whether to preload search results when the page loads. If this option is false, results are loaded when the panel is opened."
|
2410
|
+
},
|
2411
|
+
{
|
2412
|
+
"name": "dynamic_label",
|
2413
|
+
"type": "Boolean",
|
2414
|
+
"default": "`false`",
|
2415
|
+
"description": "Whether or not to display the text of the currently selected item in the show button."
|
2416
|
+
},
|
2417
|
+
{
|
2418
|
+
"name": "dynamic_label_prefix",
|
2419
|
+
"type": "String",
|
2420
|
+
"default": "`nil`",
|
2421
|
+
"description": "If provided, the prefix is prepended to the dynamic label and displayed in the show button."
|
2422
|
+
},
|
2423
|
+
{
|
2424
|
+
"name": "dynamic_aria_label_prefix",
|
2425
|
+
"type": "String",
|
2426
|
+
"default": "`nil`",
|
2427
|
+
"description": "If provided, the prefix is prepended to the dynamic label and set as the value of the `aria-label` attribute on the show button."
|
2428
|
+
},
|
2429
|
+
{
|
2430
|
+
"name": "body_id",
|
2431
|
+
"type": "String",
|
2432
|
+
"default": "`nil`",
|
2433
|
+
"description": "The unique ID of the panel body. If not provided, the body ID will be set to the panel ID with a \"-body\" suffix."
|
2434
|
+
},
|
2435
|
+
{
|
2436
|
+
"name": "list_arguments",
|
2437
|
+
"type": "Hash",
|
2438
|
+
"default": "`{}`",
|
2439
|
+
"description": "Arguments to pass to the underlying [ActionList](/components/alpha/actionlist) component. Only has an effect for the local fetch strategy."
|
2440
|
+
},
|
2441
|
+
{
|
2442
|
+
"name": "form_arguments",
|
2443
|
+
"type": "Hash",
|
2444
|
+
"default": "`{}`",
|
2445
|
+
"description": "Form arguments to pass to the underlying [ActionList](/components/alpha/actionlist) component. Only has an effect for the local fetch strategy."
|
2446
|
+
},
|
2447
|
+
{
|
2448
|
+
"name": "show_filter",
|
2449
|
+
"type": "Boolean",
|
2450
|
+
"default": "`true`",
|
2451
|
+
"description": "Whether or not to show the filter input."
|
2452
|
+
},
|
2453
|
+
{
|
2454
|
+
"name": "open_on_load",
|
2455
|
+
"type": "Boolean",
|
2456
|
+
"default": "`false`",
|
2457
|
+
"description": "Open the panel when the page loads."
|
2458
|
+
},
|
2459
|
+
{
|
2460
|
+
"name": "anchor_align",
|
2461
|
+
"type": "Symbol",
|
2462
|
+
"default": "`:start`",
|
2463
|
+
"description": "The anchor alignment of the Overlay. One of `:center`, `:end`, or `:start`."
|
2464
|
+
},
|
2465
|
+
{
|
2466
|
+
"name": "anchor_side",
|
2467
|
+
"type": "Symbol",
|
2468
|
+
"default": "`:outside_bottom`",
|
2469
|
+
"description": "The side to anchor the Overlay to. One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
|
2470
|
+
},
|
2471
|
+
{
|
2472
|
+
"name": "system_arguments",
|
2473
|
+
"type": "Hash",
|
2474
|
+
"default": "N/A",
|
2475
|
+
"description": "[System arguments](/system-arguments)"
|
2476
|
+
}
|
2477
|
+
]
|
2478
|
+
},
|
2479
|
+
{
|
2480
|
+
"component": "SelectPanel::ItemList",
|
2481
|
+
"status": "alpha",
|
2482
|
+
"a11y_reviewed": true,
|
2483
|
+
"short_name": "SelectPanelItemList",
|
2484
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/select_panel/item_list.rb",
|
2485
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/select_panel/item_list/default/",
|
2486
|
+
"parameters": [
|
2487
|
+
{
|
2488
|
+
"name": "system_arguments",
|
2489
|
+
"type": "Hash",
|
2490
|
+
"default": "N/A",
|
2491
|
+
"description": "The arguments accepted by [ActionList](/components/alpha/actionlist)."
|
2492
|
+
}
|
2493
|
+
]
|
2494
|
+
},
|
2355
2495
|
{
|
2356
2496
|
"component": "SubmitButton",
|
2357
2497
|
"status": "alpha",
|
data/static/audited_at.json
CHANGED
@@ -52,6 +52,8 @@
|
|
52
52
|
"Primer::Alpha::SegmentedControl": "2023-02-01",
|
53
53
|
"Primer::Alpha::SegmentedControl::Item": "2023-02-01",
|
54
54
|
"Primer::Alpha::Select": "",
|
55
|
+
"Primer::Alpha::SelectPanel": "",
|
56
|
+
"Primer::Alpha::SelectPanel::ItemList": "2023-07-10",
|
55
57
|
"Primer::Alpha::SubmitButton": "",
|
56
58
|
"Primer::Alpha::TabContainer": "",
|
57
59
|
"Primer::Alpha::TabNav": "",
|
data/static/constants.json
CHANGED
@@ -597,6 +597,24 @@
|
|
597
597
|
},
|
598
598
|
"Primer::Alpha::Select": {
|
599
599
|
},
|
600
|
+
"Primer::Alpha::SelectPanel": {
|
601
|
+
"DEFAULT_FETCH_STRATEGY": "remote",
|
602
|
+
"DEFAULT_PRELOAD": false,
|
603
|
+
"DEFAULT_SELECT_VARIANT": "single",
|
604
|
+
"FETCH_STRATEGIES": [
|
605
|
+
"remote",
|
606
|
+
"eventually_local",
|
607
|
+
"local"
|
608
|
+
],
|
609
|
+
"ItemList": "Primer::Alpha::SelectPanel::ItemList",
|
610
|
+
"SELECT_VARIANT_OPTIONS": [
|
611
|
+
"single",
|
612
|
+
"multiple",
|
613
|
+
"none"
|
614
|
+
]
|
615
|
+
},
|
616
|
+
"Primer::Alpha::SelectPanel::ItemList": {
|
617
|
+
},
|
600
618
|
"Primer::Alpha::SubmitButton": {
|
601
619
|
},
|
602
620
|
"Primer::Alpha::TabContainer": {
|