@@ -312,6 +312,12 @@ def with_avatar_item(**system_arguments)
312
312
:none ,
313
313
] . freeze
314
314
315
+ DEFAULT_BANNER_SCHEME = :danger
316
+ BANNER_SCHEME_OPTIONS = [
317
+ DEFAULT_BANNER_SCHEME ,
318
+ :warning
319
+ ] . freeze
320
+
315
321
# The URL to fetch search results from.
316
322
#
317
323
# @return [String]
@@ -332,6 +338,11 @@ def with_avatar_item(**system_arguments)
332
338
# @return [Symbol]
333
339
attr_reader :select_variant
334
340
341
+ # <%= one_of(Primer::Alpha::SelectPanel::BANNER_SCHEME_OPTIONS) %>
342
+ #
343
+ # @return [Symbol]
344
+ attr_reader :banner_scheme
345
+
335
346
# <%= one_of(Primer::Alpha::SelectPanel::FETCH_STRATEGIES) %>
336
347
#
337
348
# @return [Symbol]
@@ -369,6 +380,7 @@ def with_avatar_item(**system_arguments)
369
380
# @param open_on_load [Boolean] Open the panel when the page loads.
370
381
# @param anchor_align [Symbol] The anchor alignment of the Overlay. <%= one_of(Primer::Alpha::Overlay::ANCHOR_ALIGN_OPTIONS) %>
371
382
# @param anchor_side [Symbol] The side to anchor the Overlay to. <%= one_of(Primer::Alpha::Overlay::ANCHOR_SIDE_OPTIONS) %>
383
+ # @param banner_scheme [Symbol] The scheme for the error banner <%= one_of(Primer::Alpha::SelectPanel::BANNER_SCHEME_OPTIONS) %>
372
384
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
373
385
def initialize (
374
386
src : nil ,
@@ -389,6 +401,7 @@ def initialize(
389
401
open_on_load : false ,
390
402
anchor_align : Primer ::Alpha ::Overlay ::DEFAULT_ANCHOR_ALIGN ,
391
403
anchor_side : Primer ::Alpha ::Overlay ::DEFAULT_ANCHOR_SIDE ,
404
+ banner_scheme : DEFAULT_BANNER_SCHEME ,
392
405
**system_arguments
393
406
)
394
407
raise_if_role_given! ( **system_arguments )
@@ -410,6 +423,7 @@ def initialize(
410
423
@dynamic_label = dynamic_label
411
424
@dynamic_label_prefix = dynamic_label_prefix
412
425
@dynamic_aria_label_prefix = dynamic_aria_label_prefix
426
+ @banner_scheme = fetch_or_fallback ( BANNER_SCHEME_OPTIONS , banner_scheme , DEFAULT_BANNER_SCHEME )
413
427
414
428
@system_arguments = deny_tag_argument ( **system_arguments )
415
429
@system_arguments [ :id ] = @panel_id
0 commit comments