Module: Polaris

Defined in:
app/components/polaris/text_component.rb,
lib/polaris/view_components.rb,
app/components/polaris/action.rb,
app/components/polaris/tokens.rb,
app/helpers/polaris/url_helper.rb,
app/helpers/polaris/view_helper.rb,
app/components/polaris/component.rb,
app/helpers/polaris/form_builder.rb,
app/helpers/polaris/option_helper.rb,
app/components/polaris/base_button.rb,
lib/polaris/view_components/engine.rb,
app/components/polaris/tokens/color.rb,
lib/polaris/view_components/version.rb,
app/components/polaris/base_checkbox.rb,
app/components/polaris/box_component.rb,
app/components/polaris/tag_component.rb,
app/components/polaris/tokens/border.rb,
app/components/polaris/tokens/shadow.rb,
app/components/polaris/base_component.rb,
app/components/polaris/card_component.rb,
app/components/polaris/icon_component.rb,
app/components/polaris/layout/section.rb,
app/components/polaris/link_component.rb,
app/components/polaris/list_component.rb,
app/components/polaris/page_component.rb,
app/components/polaris/tabs_component.rb,
app/components/polaris/tokens/spacing.rb,
app/helpers/polaris/class_name_helper.rb,
app/components/polaris/badge_component.rb,
app/components/polaris/bleed_component.rb,
app/components/polaris/character_count.rb,
app/components/polaris/frame_component.rb,
app/components/polaris/headless_button.rb,
app/components/polaris/label_component.rb,
app/components/polaris/modal_component.rb,
app/components/polaris/stack_component.rb,
app/helpers/polaris/styles_list_helper.rb,
app/components/polaris/avatar_component.rb,
app/components/polaris/banner_component.rb,
app/components/polaris/button_component.rb,
app/components/polaris/choice_component.rb,
app/components/polaris/inline_component.rb,
app/components/polaris/layout_component.rb,
app/components/polaris/select_component.rb,
app/components/polaris/spacer_component.rb,
app/components/polaris/base_radio_button.rb,
app/components/polaris/caption_component.rb,
app/components/polaris/divider_component.rb,
app/components/polaris/filters_component.rb,
app/components/polaris/heading_component.rb,
app/components/polaris/popover_component.rb,
app/components/polaris/spinner_component.rb,
app/components/polaris/tooltip_component.rb,
app/components/polaris/checkbox_component.rb,
app/components/polaris/dropzone_component.rb,
app/components/polaris/labelled_component.rb,
app/components/polaris/thumbnail_component.rb,
app/components/polaris/data_table_component.rb,
app/components/polaris/navigation_component.rb,
app/components/polaris/pagination_component.rb,
app/components/polaris/scrollable_component.rb,
app/components/polaris/subheading_component.rb,
app/components/polaris/text_field_component.rb,
app/components/polaris/text_style_component.rb,
app/components/polaris/action_list_component.rb,
app/components/polaris/choice_list_component.rb,
app/components/polaris/collapsible_component.rb,
app/components/polaris/empty_state_component.rb,
app/components/polaris/footer_help_component.rb,
app/components/polaris/form_layout_component.rb,
app/components/polaris/index_table_component.rb,
app/components/polaris/inline_code_component.rb,
app/components/polaris/option_list_component.rb,
app/components/polaris/placeholder_component.rb,
app/helpers/polaris/fetch_or_fallback_helper.rb,
app/components/polaris/autocomplete_component.rb,
app/components/polaris/button_group_component.rb,
app/components/polaris/callout_card_component.rb,
app/components/polaris/display_text_component.rb,
app/components/polaris/inline_error_component.rb,
app/components/polaris/keyboard_key_component.rb,
app/components/polaris/page_actions_component.rb,
app/components/polaris/progress_bar_component.rb,
app/components/polaris/radio_button_component.rb,
app/components/polaris/resource_item_component.rb,
app/components/polaris/resource_list_component.rb,
app/components/polaris/skeleton_page_component.rb,
app/components/polaris/exception_list_component.rb,
app/components/polaris/layout/annotated_section.rb,
app/components/polaris/setting_toggle_component.rb,
app/components/polaris/text_container_component.rb,
app/components/polaris/vertical_stack_component.rb,
app/components/polaris/horizontal_grid_component.rb,
app/components/polaris/navigation_list_component.rb,
app/components/polaris/visually_hidden_component.rb,
app/components/polaris/description_list_component.rb,
app/components/polaris/horizontal_stack_component.rb,
app/components/polaris/shopify_navigation_component.rb,
app/components/polaris/skeleton_body_text_component.rb,
app/components/polaris/skeleton_thumbnail_component.rb,
app/components/polaris/autocomplete/action_component.rb,
app/components/polaris/autocomplete/option_component.rb,
lib/polaris/view_components/codemods/v3_slot_setters.rb,
app/components/polaris/autocomplete/section_component.rb,
app/components/polaris/empty_search_results_component.rb,
app/components/polaris/skeleton_display_text_component.rb

Overview

Polaris::FetchOrFallbackHelper A little helper to enable graceful fallbacks

Use this helper to quietly ensure a value is one that you expect:

allowed_values - allowed options for value given_value - input being coerced fallback - returned if given_value is not included in allowed_values deprecated_values - deprecated options for value. Will warn of deprecation if not in production

fetch_or_fallback(, 5, 2) => 2 fetch_or_fallback(, 1, 2) => 1 fetch_or_fallback(, nil, 2) => 2

With deprecations: fetch_or_fallback(, 3, 2, deprecated_values: [3]) => 3 fetch_or_fallback(, nil, 2, deprecated_values: [3]) => 2

Defined Under Namespace

Modules: ClassNameHelper, FetchOrFallbackHelper, Layout, OptionHelper, StylesListHelper, Tokens, UrlHelper, ViewComponents, ViewHelper Classes: Action, ActionListComponent, AutocompleteComponent, AvatarComponent, BadgeComponent, BannerComponent, BaseButton, BaseCheckbox, BaseComponent, BaseRadioButton, BleedComponent, BoxComponent, ButtonComponent, ButtonGroupComponent, CalloutCardComponent, CaptionComponent, CardComponent, CharacterCount, CheckboxComponent, ChoiceComponent, ChoiceListComponent, CollapsibleComponent, Component, DataTableComponent, DescriptionListComponent, DisplayTextComponent, DividerComponent, DropzoneComponent, EmptySearchResultsComponent, EmptyStateComponent, ExceptionListComponent, FiltersComponent, FooterHelpComponent, FormBuilder, FormLayoutComponent, FrameComponent, HeadingComponent, HeadlessButton, HorizontalGridComponent, HorizontalStackComponent, IconComponent, IndexTableComponent, InlineCodeComponent, InlineComponent, InlineErrorComponent, KeyboardKeyComponent, LabelComponent, LabelledComponent, LayoutComponent, LinkComponent, ListComponent, Logo, ModalComponent, NavigationComponent, NavigationListComponent, OptionListComponent, PageActionsComponent, PageComponent, PaginationComponent, PlaceholderComponent, PopoverComponent, ProgressBarComponent, RadioButtonComponent, ResourceItemComponent, ResourceListComponent, ScrollableComponent, SelectComponent, SettingToggleComponent, ShopifyNavigationComponent, SkeletonBodyTextComponent, SkeletonDisplayTextComponent, SkeletonPageComponent, SkeletonThumbnailComponent, SpacerComponent, SpinnerComponent, StackComponent, SubheadingComponent, TabsComponent, TagComponent, TextComponent, TextContainerComponent, TextFieldComponent, TextStyleComponent, ThumbnailComponent, ToastComponent, TooltipComponent, VerticalStackComponent, VisuallyHiddenComponent