polaris_view_components 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +20 -0
- data/README.md +51 -0
- data/app/assets/icons/polaris/AbandonedCartMajor.svg +1 -0
- data/app/assets/icons/polaris/AccessibilityMajor.svg +1 -0
- data/app/assets/icons/polaris/ActivitiesMajor.svg +1 -0
- data/app/assets/icons/polaris/AddCodeMajor.svg +1 -0
- data/app/assets/icons/polaris/AddImageMajor.svg +1 -0
- data/app/assets/icons/polaris/AddMajor.svg +1 -0
- data/app/assets/icons/polaris/AddNoteMajor.svg +1 -0
- data/app/assets/icons/polaris/AddProductMajor.svg +1 -0
- data/app/assets/icons/polaris/AffiliateMajor.svg +1 -0
- data/app/assets/icons/polaris/AlertMinor.svg +1 -0
- data/app/assets/icons/polaris/AnalyticsMajor.svg +1 -0
- data/app/assets/icons/polaris/AppExtensionMinor.svg +1 -0
- data/app/assets/icons/polaris/AppsMajor.svg +1 -0
- data/app/assets/icons/polaris/ArchiveMajor.svg +1 -0
- data/app/assets/icons/polaris/ArchiveMinor.svg +1 -0
- data/app/assets/icons/polaris/ArrowDownMinor.svg +1 -0
- data/app/assets/icons/polaris/ArrowLeftMinor.svg +1 -0
- data/app/assets/icons/polaris/ArrowRightMinor.svg +1 -0
- data/app/assets/icons/polaris/ArrowUpMinor.svg +1 -0
- data/app/assets/icons/polaris/AttachmentMajor.svg +1 -0
- data/app/assets/icons/polaris/AutomationMajor.svg +1 -0
- data/app/assets/icons/polaris/BackspaceMajor.svg +1 -0
- data/app/assets/icons/polaris/BalanceMajor.svg +1 -0
- data/app/assets/icons/polaris/BankMajor.svg +1 -0
- data/app/assets/icons/polaris/BarcodeMajor.svg +1 -0
- data/app/assets/icons/polaris/BehaviorMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementDollarMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementEuroMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementPoundMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementRupeeMajor.svg +1 -0
- data/app/assets/icons/polaris/BillingStatementYenMajor.svg +1 -0
- data/app/assets/icons/polaris/BlockquoteMajor.svg +1 -0
- data/app/assets/icons/polaris/BlogMajor.svg +1 -0
- data/app/assets/icons/polaris/BugMajor.svg +1 -0
- data/app/assets/icons/polaris/ButtonCornerPillMajor.svg +1 -0
- data/app/assets/icons/polaris/ButtonCornerRoundedMajor.svg +1 -0
- data/app/assets/icons/polaris/ButtonCornerSquareMajor.svg +1 -0
- data/app/assets/icons/polaris/BuyButtonButtonLayoutMajor.svg +1 -0
- data/app/assets/icons/polaris/BuyButtonHorizontalLayoutMajor.svg +1 -0
- data/app/assets/icons/polaris/BuyButtonMajor.svg +1 -0
- data/app/assets/icons/polaris/BuyButtonVerticalLayoutMajor.svg +1 -0
- data/app/assets/icons/polaris/CalendarMajor.svg +1 -0
- data/app/assets/icons/polaris/CalendarMinor.svg +1 -0
- data/app/assets/icons/polaris/CalendarTickMajor.svg +1 -0
- data/app/assets/icons/polaris/CameraMajor.svg +1 -0
- data/app/assets/icons/polaris/CancelSmallMinor.svg +1 -0
- data/app/assets/icons/polaris/CapitalMajor.svg +1 -0
- data/app/assets/icons/polaris/CapturePaymentMinor.svg +1 -0
- data/app/assets/icons/polaris/CardReaderChipMajor.svg +1 -0
- data/app/assets/icons/polaris/CardReaderMajor.svg +1 -0
- data/app/assets/icons/polaris/CardReaderTapMajor.svg +1 -0
- data/app/assets/icons/polaris/CaretDownMinor.svg +1 -0
- data/app/assets/icons/polaris/CaretUpMinor.svg +1 -0
- data/app/assets/icons/polaris/CartDownMajor.svg +1 -0
- data/app/assets/icons/polaris/CartMajor.svg +1 -0
- data/app/assets/icons/polaris/CartUpMajor.svg +1 -0
- data/app/assets/icons/polaris/CashDollarMajor.svg +1 -0
- data/app/assets/icons/polaris/CashEuroMajor.svg +1 -0
- data/app/assets/icons/polaris/CashPoundMajor.svg +1 -0
- data/app/assets/icons/polaris/CashRupeeMajor.svg +1 -0
- data/app/assets/icons/polaris/CashYenMajor.svg +1 -0
- data/app/assets/icons/polaris/CategoriesMajor.svg +1 -0
- data/app/assets/icons/polaris/ChannelsMajor.svg +1 -0
- data/app/assets/icons/polaris/ChatMajor.svg +1 -0
- data/app/assets/icons/polaris/ChecklistAlternateMajor.svg +1 -0
- data/app/assets/icons/polaris/ChecklistMajor.svg +1 -0
- data/app/assets/icons/polaris/CheckoutMajor.svg +1 -0
- data/app/assets/icons/polaris/ChevronDownMinor.svg +1 -0
- data/app/assets/icons/polaris/ChevronLeftMinor.svg +1 -0
- data/app/assets/icons/polaris/ChevronRightMinor.svg +1 -0
- data/app/assets/icons/polaris/ChevronUpMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleAlertMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleCancelMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleCancelMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleChevronDownMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleChevronLeftMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleChevronRightMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleChevronUpMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleDisableMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleDisabledMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleDotsMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleDownMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleInformationMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleLeftMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleMinusMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleMinusMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleMinusOutlineMinor.svg +1 -0
- data/app/assets/icons/polaris/CirclePlusMajor.svg +1 -0
- data/app/assets/icons/polaris/CirclePlusMinor.svg +1 -0
- data/app/assets/icons/polaris/CirclePlusOutlineMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleRightMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleTickMajor.svg +1 -0
- data/app/assets/icons/polaris/CircleTickOutlineMinor.svg +1 -0
- data/app/assets/icons/polaris/CircleUpMajor.svg +1 -0
- data/app/assets/icons/polaris/ClipboardMinor.svg +1 -0
- data/app/assets/icons/polaris/ClockMajor.svg +1 -0
- data/app/assets/icons/polaris/ClockMinor.svg +1 -0
- data/app/assets/icons/polaris/CodeMajor.svg +1 -0
- data/app/assets/icons/polaris/CollectionsMajor.svg +1 -0
- data/app/assets/icons/polaris/ColorNoneMinor.svg +1 -0
- data/app/assets/icons/polaris/ColorsMajor.svg +1 -0
- data/app/assets/icons/polaris/Column1Major.svg +1 -0
- data/app/assets/icons/polaris/ColumnWithTextMajor.svg +1 -0
- data/app/assets/icons/polaris/Columns2Major.svg +1 -0
- data/app/assets/icons/polaris/Columns3Major.svg +1 -0
- data/app/assets/icons/polaris/ComposeMajor.svg +1 -0
- data/app/assets/icons/polaris/ConfettiMajor.svg +1 -0
- data/app/assets/icons/polaris/ConnectMinor.svg +1 -0
- data/app/assets/icons/polaris/ConversationMinor.svg +1 -0
- data/app/assets/icons/polaris/CreditCardMajor.svg +1 -0
- data/app/assets/icons/polaris/CreditCardPercentMajor.svg +1 -0
- data/app/assets/icons/polaris/CreditCardSecureMajor.svg +1 -0
- data/app/assets/icons/polaris/CurrencyConvertMinor.svg +1 -0
- data/app/assets/icons/polaris/CustomerMinusMajor.svg +1 -0
- data/app/assets/icons/polaris/CustomerPlusMajor.svg +1 -0
- data/app/assets/icons/polaris/CustomersMajor.svg +1 -0
- data/app/assets/icons/polaris/CustomersMinor.svg +1 -0
- data/app/assets/icons/polaris/DataVisualizationMajor.svg +1 -0
- data/app/assets/icons/polaris/DeleteMajor.svg +1 -0
- data/app/assets/icons/polaris/DeleteMinor.svg +1 -0
- data/app/assets/icons/polaris/DesktopMajor.svg +1 -0
- data/app/assets/icons/polaris/DetailedPopUpMajor.svg +1 -0
- data/app/assets/icons/polaris/DiamondAlertMajor.svg +1 -0
- data/app/assets/icons/polaris/DigitalMediaReceiverMajor.svg +1 -0
- data/app/assets/icons/polaris/DiscountAutomaticMajor.svg +1 -0
- data/app/assets/icons/polaris/DiscountCodeMajor.svg +1 -0
- data/app/assets/icons/polaris/DiscountsMajor.svg +1 -0
- data/app/assets/icons/polaris/DisputeMinor.svg +1 -0
- data/app/assets/icons/polaris/DnsSettingsMajor.svg +1 -0
- data/app/assets/icons/polaris/DomainNewMajor.svg +1 -0
- data/app/assets/icons/polaris/DomainsMajor.svg +1 -0
- data/app/assets/icons/polaris/DraftOrdersMajor.svg +1 -0
- data/app/assets/icons/polaris/DragDropMajor.svg +1 -0
- data/app/assets/icons/polaris/DragHandleMinor.svg +1 -0
- data/app/assets/icons/polaris/DropdownMinor.svg +1 -0
- data/app/assets/icons/polaris/DuplicateMinor.svg +1 -0
- data/app/assets/icons/polaris/EditMajor.svg +1 -0
- data/app/assets/icons/polaris/EditMinor.svg +1 -0
- data/app/assets/icons/polaris/EmailMajor.svg +1 -0
- data/app/assets/icons/polaris/EmailNewsletterMajor.svg +1 -0
- data/app/assets/icons/polaris/EmbedMinor.svg +1 -0
- data/app/assets/icons/polaris/EnableSelectionMinor.svg +1 -0
- data/app/assets/icons/polaris/EnvelopeMajor.svg +1 -0
- data/app/assets/icons/polaris/ExchangeMajor.svg +1 -0
- data/app/assets/icons/polaris/ExistingInventoryMajor.svg +1 -0
- data/app/assets/icons/polaris/ExitMajor.svg +1 -0
- data/app/assets/icons/polaris/ExportMinor.svg +1 -0
- data/app/assets/icons/polaris/ExternalMinor.svg +1 -0
- data/app/assets/icons/polaris/ExternalSmallMinor.svg +1 -0
- data/app/assets/icons/polaris/FaviconMajor.svg +1 -0
- data/app/assets/icons/polaris/FavoriteMajor.svg +1 -0
- data/app/assets/icons/polaris/FeaturedCollectionMajor.svg +1 -0
- data/app/assets/icons/polaris/FeaturedContentMajor.svg +1 -0
- data/app/assets/icons/polaris/FilterMajor.svg +1 -0
- data/app/assets/icons/polaris/FirstOrderMajor.svg +1 -0
- data/app/assets/icons/polaris/FirstVisitMajor.svg +1 -0
- data/app/assets/icons/polaris/FlagMajor.svg +1 -0
- data/app/assets/icons/polaris/FlipCameraMajor.svg +1 -0
- data/app/assets/icons/polaris/FolderDownMajor.svg +1 -0
- data/app/assets/icons/polaris/FolderMajor.svg +1 -0
- data/app/assets/icons/polaris/FolderMinusMajor.svg +1 -0
- data/app/assets/icons/polaris/FolderPlusMajor.svg +1 -0
- data/app/assets/icons/polaris/FolderUpMajor.svg +1 -0
- data/app/assets/icons/polaris/FollowUpEmailMajor.svg +1 -0
- data/app/assets/icons/polaris/FoodMajor.svg +1 -0
- data/app/assets/icons/polaris/FooterMajor.svg +1 -0
- data/app/assets/icons/polaris/FormsMajor.svg +1 -0
- data/app/assets/icons/polaris/FraudProtectMajor.svg +1 -0
- data/app/assets/icons/polaris/FraudProtectMinor.svg +1 -0
- data/app/assets/icons/polaris/FraudProtectPendingMajor.svg +1 -0
- data/app/assets/icons/polaris/FraudProtectPendingMinor.svg +1 -0
- data/app/assets/icons/polaris/FraudProtectUnprotectedMajor.svg +1 -0
- data/app/assets/icons/polaris/FraudProtectUnprotectedMinor.svg +1 -0
- data/app/assets/icons/polaris/GamesConsoleMajor.svg +1 -0
- data/app/assets/icons/polaris/GiftCardMajor.svg +1 -0
- data/app/assets/icons/polaris/GiftCardMinor.svg +1 -0
- data/app/assets/icons/polaris/GlobeMajor.svg +1 -0
- data/app/assets/icons/polaris/GlobeMinor.svg +1 -0
- data/app/assets/icons/polaris/GrammarMajor.svg +1 -0
- data/app/assets/icons/polaris/HashtagMajor.svg +1 -0
- data/app/assets/icons/polaris/HeaderMajor.svg +1 -0
- data/app/assets/icons/polaris/HeartMajor.svg +1 -0
- data/app/assets/icons/polaris/HideKeyboardMajor.svg +1 -0
- data/app/assets/icons/polaris/HideMinor.svg +1 -0
- data/app/assets/icons/polaris/HintMajor.svg +1 -0
- data/app/assets/icons/polaris/HomeMajor.svg +1 -0
- data/app/assets/icons/polaris/HorizontalDotsMinor.svg +1 -0
- data/app/assets/icons/polaris/IconsMajor.svg +1 -0
- data/app/assets/icons/polaris/IllustrationMajor.svg +1 -0
- data/app/assets/icons/polaris/ImageAltMajor.svg +1 -0
- data/app/assets/icons/polaris/ImageAltMinor.svg +1 -0
- data/app/assets/icons/polaris/ImageMajor.svg +1 -0
- data/app/assets/icons/polaris/ImageWithTextMajor.svg +1 -0
- data/app/assets/icons/polaris/ImageWithTextOverlayMajor.svg +1 -0
- data/app/assets/icons/polaris/ImagesMajor.svg +1 -0
- data/app/assets/icons/polaris/ImportMinor.svg +1 -0
- data/app/assets/icons/polaris/ImportStoreMajor.svg +1 -0
- data/app/assets/icons/polaris/IncomingMajor.svg +1 -0
- data/app/assets/icons/polaris/InfoMinor.svg +1 -0
- data/app/assets/icons/polaris/InstallMinor.svg +1 -0
- data/app/assets/icons/polaris/InventoryMajor.svg +1 -0
- data/app/assets/icons/polaris/InviteMinor.svg +1 -0
- data/app/assets/icons/polaris/IqMajor.svg +1 -0
- data/app/assets/icons/polaris/JobsMajor.svg +1 -0
- data/app/assets/icons/polaris/KeyMajor.svg +1 -0
- data/app/assets/icons/polaris/LabelPrinterMajor.svg +1 -0
- data/app/assets/icons/polaris/LandingPageMajor.svg +1 -0
- data/app/assets/icons/polaris/LanguageMinor.svg +1 -0
- data/app/assets/icons/polaris/LegalMajor.svg +1 -0
- data/app/assets/icons/polaris/LinkMinor.svg +1 -0
- data/app/assets/icons/polaris/ListMajor.svg +1 -0
- data/app/assets/icons/polaris/LiveViewMajor.svg +1 -0
- data/app/assets/icons/polaris/LocationMajor.svg +1 -0
- data/app/assets/icons/polaris/LocationsMinor.svg +1 -0
- data/app/assets/icons/polaris/LockMajor.svg +1 -0
- data/app/assets/icons/polaris/LockMinor.svg +1 -0
- data/app/assets/icons/polaris/LogOutMinor.svg +1 -0
- data/app/assets/icons/polaris/LogoBlockMajor.svg +1 -0
- data/app/assets/icons/polaris/ManagedStoreMajor.svg +1 -0
- data/app/assets/icons/polaris/MarkFulfilledMinor.svg +1 -0
- data/app/assets/icons/polaris/MarkPaidMinor.svg +1 -0
- data/app/assets/icons/polaris/MarketingMajor.svg +1 -0
- data/app/assets/icons/polaris/MaximizeMajor.svg +1 -0
- data/app/assets/icons/polaris/MaximizeMinor.svg +1 -0
- data/app/assets/icons/polaris/MentionMajor.svg +1 -0
- data/app/assets/icons/polaris/MicrophoneMajor.svg +1 -0
- data/app/assets/icons/polaris/MinimizeMajor.svg +1 -0
- data/app/assets/icons/polaris/MinimizeMinor.svg +1 -0
- data/app/assets/icons/polaris/MinusMinor.svg +1 -0
- data/app/assets/icons/polaris/MobileAcceptMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileBackArrowMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileCancelMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileChevronMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileHamburgerMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileHorizontalDotsMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileMajor.svg +1 -0
- data/app/assets/icons/polaris/MobilePlusMajor.svg +1 -0
- data/app/assets/icons/polaris/MobileVerticalDotsMajor.svg +1 -0
- data/app/assets/icons/polaris/MonerisMajor.svg +1 -0
- data/app/assets/icons/polaris/NatureMajor.svg +1 -0
- data/app/assets/icons/polaris/NavigationMajor.svg +1 -0
- data/app/assets/icons/polaris/NoteMajor.svg +1 -0
- data/app/assets/icons/polaris/NoteMinor.svg +1 -0
- data/app/assets/icons/polaris/NotificationMajor.svg +1 -0
- data/app/assets/icons/polaris/OnlineStoreMajor.svg +1 -0
- data/app/assets/icons/polaris/OrderStatusMinor.svg +1 -0
- data/app/assets/icons/polaris/OrdersMajor.svg +1 -0
- data/app/assets/icons/polaris/OutgoingMajor.svg +1 -0
- data/app/assets/icons/polaris/PackageMajor.svg +1 -0
- data/app/assets/icons/polaris/PageDownMajor.svg +1 -0
- data/app/assets/icons/polaris/PageMajor.svg +1 -0
- data/app/assets/icons/polaris/PageMinusMajor.svg +1 -0
- data/app/assets/icons/polaris/PagePlusMajor.svg +1 -0
- data/app/assets/icons/polaris/PageUpMajor.svg +1 -0
- data/app/assets/icons/polaris/PaginationEndMinor.svg +1 -0
- data/app/assets/icons/polaris/PaginationStartMinor.svg +1 -0
- data/app/assets/icons/polaris/PaintBrushMajor.svg +1 -0
- data/app/assets/icons/polaris/PauseCircleMajor.svg +1 -0
- data/app/assets/icons/polaris/PauseMajor.svg +1 -0
- data/app/assets/icons/polaris/PauseMinor.svg +1 -0
- data/app/assets/icons/polaris/PaymentsMajor.svg +1 -0
- data/app/assets/icons/polaris/PhoneInMajor.svg +1 -0
- data/app/assets/icons/polaris/PhoneMajor.svg +1 -0
- data/app/assets/icons/polaris/PhoneOutMajor.svg +1 -0
- data/app/assets/icons/polaris/PinMajor.svg +1 -0
- data/app/assets/icons/polaris/PinMinor.svg +1 -0
- data/app/assets/icons/polaris/PlayCircleMajor.svg +1 -0
- data/app/assets/icons/polaris/PlayMajor.svg +1 -0
- data/app/assets/icons/polaris/PlayMinor.svg +1 -0
- data/app/assets/icons/polaris/PlusMinor.svg +1 -0
- data/app/assets/icons/polaris/PointOfSaleMajor.svg +1 -0
- data/app/assets/icons/polaris/PopularMajor.svg +1 -0
- data/app/assets/icons/polaris/PriceLookupMinor.svg +1 -0
- data/app/assets/icons/polaris/PrintMajor.svg +1 -0
- data/app/assets/icons/polaris/PrintMinor.svg +1 -0
- data/app/assets/icons/polaris/ProductReturnsMinor.svg +1 -0
- data/app/assets/icons/polaris/ProductsMajor.svg +1 -0
- data/app/assets/icons/polaris/ProfileMajor.svg +1 -0
- data/app/assets/icons/polaris/ProfileMinor.svg +1 -0
- data/app/assets/icons/polaris/PromoteMinor.svg +1 -0
- data/app/assets/icons/polaris/QuestionMarkMajor.svg +1 -0
- data/app/assets/icons/polaris/QuestionMarkMinor.svg +1 -0
- data/app/assets/icons/polaris/QuickSaleMajor.svg +1 -0
- data/app/assets/icons/polaris/ReadTimeMinor.svg +1 -0
- data/app/assets/icons/polaris/ReceiptMajor.svg +1 -0
- data/app/assets/icons/polaris/RecentSearchesMajor.svg +1 -0
- data/app/assets/icons/polaris/RedoMajor.svg +1 -0
- data/app/assets/icons/polaris/ReferralCodeMajor.svg +1 -0
- data/app/assets/icons/polaris/ReferralMajor.svg +1 -0
- data/app/assets/icons/polaris/RefreshMajor.svg +1 -0
- data/app/assets/icons/polaris/RefreshMinor.svg +1 -0
- data/app/assets/icons/polaris/RefundMajor.svg +1 -0
- data/app/assets/icons/polaris/RefundMinor.svg +1 -0
- data/app/assets/icons/polaris/RemoveProductMajor.svg +1 -0
- data/app/assets/icons/polaris/RepeatOrderMajor.svg +1 -0
- data/app/assets/icons/polaris/ReplaceMajor.svg +1 -0
- data/app/assets/icons/polaris/ReplayMinor.svg +1 -0
- data/app/assets/icons/polaris/ReportMinor.svg +1 -0
- data/app/assets/icons/polaris/ReportsMajor.svg +1 -0
- data/app/assets/icons/polaris/ResetMinor.svg +1 -0
- data/app/assets/icons/polaris/ResourcesMajor.svg +1 -0
- data/app/assets/icons/polaris/ReturnMinor.svg +1 -0
- data/app/assets/icons/polaris/RiskMajor.svg +1 -0
- data/app/assets/icons/polaris/RiskMinor.svg +1 -0
- data/app/assets/icons/polaris/SandboxMajor.svg +1 -0
- data/app/assets/icons/polaris/SaveMinor.svg +1 -0
- data/app/assets/icons/polaris/SearchMajor.svg +1 -0
- data/app/assets/icons/polaris/SearchMinor.svg +1 -0
- data/app/assets/icons/polaris/SectionMajor.svg +1 -0
- data/app/assets/icons/polaris/SecureMajor.svg +1 -0
- data/app/assets/icons/polaris/SelectMinor.svg +1 -0
- data/app/assets/icons/polaris/SendMajor.svg +1 -0
- data/app/assets/icons/polaris/SettingsMajor.svg +1 -0
- data/app/assets/icons/polaris/SettingsMinor.svg +1 -0
- data/app/assets/icons/polaris/ShareIosMinor.svg +1 -0
- data/app/assets/icons/polaris/ShareMinor.svg +1 -0
- data/app/assets/icons/polaris/ShipmentMajor.svg +1 -0
- data/app/assets/icons/polaris/ShopcodesMajor.svg +1 -0
- data/app/assets/icons/polaris/SidebarLeftMajor.svg +1 -0
- data/app/assets/icons/polaris/SidebarRightMajor.svg +1 -0
- data/app/assets/icons/polaris/SlideshowMajor.svg +1 -0
- data/app/assets/icons/polaris/SmileyHappyMajor.svg +1 -0
- data/app/assets/icons/polaris/SmileyJoyMajor.svg +1 -0
- data/app/assets/icons/polaris/SmileyNeutralMajor.svg +1 -0
- data/app/assets/icons/polaris/SmileySadMajor.svg +1 -0
- data/app/assets/icons/polaris/SocialAdMajor.svg +1 -0
- data/app/assets/icons/polaris/SocialPostMajor.svg +1 -0
- data/app/assets/icons/polaris/SoftPackMajor.svg +1 -0
- data/app/assets/icons/polaris/SortAscendingMajor.svg +1 -0
- data/app/assets/icons/polaris/SortDescendingMajor.svg +1 -0
- data/app/assets/icons/polaris/SortMinor.svg +1 -0
- data/app/assets/icons/polaris/SoundMajor.svg +1 -0
- data/app/assets/icons/polaris/StarFilledMinor.svg +1 -0
- data/app/assets/icons/polaris/StarOutlineMinor.svg +1 -0
- data/app/assets/icons/polaris/StoreMajor.svg +1 -0
- data/app/assets/icons/polaris/StoreMinor.svg +1 -0
- data/app/assets/icons/polaris/StoreStatusMajor.svg +1 -0
- data/app/assets/icons/polaris/TabletMajor.svg +1 -0
- data/app/assets/icons/polaris/TapChipMajor.svg +1 -0
- data/app/assets/icons/polaris/TaxMajor.svg +1 -0
- data/app/assets/icons/polaris/TeamMajor.svg +1 -0
- data/app/assets/icons/polaris/TemplateMajor.svg +1 -0
- data/app/assets/icons/polaris/TextAlignmentCenterMajor.svg +1 -0
- data/app/assets/icons/polaris/TextAlignmentLeftMajor.svg +1 -0
- data/app/assets/icons/polaris/TextAlignmentRightMajor.svg +1 -0
- data/app/assets/icons/polaris/TextBlockMajor.svg +1 -0
- data/app/assets/icons/polaris/TextMajor.svg +1 -0
- data/app/assets/icons/polaris/ThemeEditMajor.svg +1 -0
- data/app/assets/icons/polaris/ThemeStoreMajor.svg +1 -0
- data/app/assets/icons/polaris/ThemesMajor.svg +1 -0
- data/app/assets/icons/polaris/ThumbsDownMajor.svg +1 -0
- data/app/assets/icons/polaris/ThumbsDownMinor.svg +1 -0
- data/app/assets/icons/polaris/ThumbsUpMajor.svg +1 -0
- data/app/assets/icons/polaris/ThumbsUpMinor.svg +1 -0
- data/app/assets/icons/polaris/TickMinor.svg +1 -0
- data/app/assets/icons/polaris/TickSmallMinor.svg +1 -0
- data/app/assets/icons/polaris/TimelineAttachmentMajor.svg +1 -0
- data/app/assets/icons/polaris/TipsMajor.svg +1 -0
- data/app/assets/icons/polaris/ToolsMajor.svg +1 -0
- data/app/assets/icons/polaris/TransactionFeeDollarMajor.svg +1 -0
- data/app/assets/icons/polaris/TransactionFeeEuroMajor.svg +1 -0
- data/app/assets/icons/polaris/TransactionFeePoundMajor.svg +1 -0
- data/app/assets/icons/polaris/TransactionFeeRupeeMajor.svg +1 -0
- data/app/assets/icons/polaris/TransactionFeeYenMajor.svg +1 -0
- data/app/assets/icons/polaris/TransactionMajor.svg +1 -0
- data/app/assets/icons/polaris/TransferInMajor.svg +1 -0
- data/app/assets/icons/polaris/TransferMajor.svg +1 -0
- data/app/assets/icons/polaris/TransferOutMajor.svg +1 -0
- data/app/assets/icons/polaris/TransferWithinShopifyMajor.svg +1 -0
- data/app/assets/icons/polaris/TransportMajor.svg +1 -0
- data/app/assets/icons/polaris/TroubleshootMajor.svg +1 -0
- data/app/assets/icons/polaris/TypeMajor.svg +1 -0
- data/app/assets/icons/polaris/UndoMajor.svg +1 -0
- data/app/assets/icons/polaris/UnfulfilledMajor.svg +1 -0
- data/app/assets/icons/polaris/UnknownDeviceMajor.svg +1 -0
- data/app/assets/icons/polaris/UpdateInventoryMajor.svg +1 -0
- data/app/assets/icons/polaris/UploadMajor.svg +1 -0
- data/app/assets/icons/polaris/VariantMajor.svg +1 -0
- data/app/assets/icons/polaris/ViewMajor.svg +1 -0
- data/app/assets/icons/polaris/ViewMinor.svg +1 -0
- data/app/assets/icons/polaris/ViewportNarrowMajor.svg +1 -0
- data/app/assets/icons/polaris/ViewportWideMajor.svg +1 -0
- data/app/assets/icons/polaris/VocabularyMajor.svg +1 -0
- data/app/assets/icons/polaris/WandMajor.svg +1 -0
- data/app/assets/icons/polaris/WearableMajor.svg +1 -0
- data/app/assets/icons/polaris/WholesaleMajor.svg +1 -0
- data/app/assets/icons/polaris/WifiMajor.svg +1 -0
- data/app/assets/javascripts/polaris.js +113 -0
- data/app/assets/stylesheets/polaris_view_components.css +136 -0
- data/app/components/polaris/action.rb +32 -0
- data/app/components/polaris/application_component.rb +35 -0
- data/app/components/polaris/avatar_component.html.erb +19 -0
- data/app/components/polaris/avatar_component.rb +39 -0
- data/app/components/polaris/badge_component.html.erb +9 -0
- data/app/components/polaris/badge_component.rb +51 -0
- data/app/components/polaris/banner_component.html.erb +42 -0
- data/app/components/polaris/banner_component.rb +89 -0
- data/app/components/polaris/base_button.rb +31 -0
- data/app/components/polaris/base_component.rb +23 -0
- data/app/components/polaris/button_component.html.erb +24 -0
- data/app/components/polaris/button_component.rb +90 -0
- data/app/components/polaris/button_group_component.html.erb +5 -0
- data/app/components/polaris/button_group_component.rb +109 -0
- data/app/components/polaris/callout_card_component.html.erb +46 -0
- data/app/components/polaris/callout_card_component.rb +45 -0
- data/app/components/polaris/caption_component.rb +18 -0
- data/app/components/polaris/card/header_component.html.erb +25 -0
- data/app/components/polaris/card/header_component.rb +23 -0
- data/app/components/polaris/card/section_component.html.erb +31 -0
- data/app/components/polaris/card/section_component.rb +40 -0
- data/app/components/polaris/card_component.html.erb +51 -0
- data/app/components/polaris/card_component.rb +52 -0
- data/app/components/polaris/character_count.rb +50 -0
- data/app/components/polaris/checkbox_component.html.erb +15 -0
- data/app/components/polaris/checkbox_component.rb +78 -0
- data/app/components/polaris/choice_component.html.erb +35 -0
- data/app/components/polaris/choice_component.rb +29 -0
- data/app/components/polaris/choice_list/component.html.erb +34 -0
- data/app/components/polaris/choice_list/component.rb +65 -0
- data/app/components/polaris/choice_list_component.html.erb +19 -0
- data/app/components/polaris/choice_list_component.rb +68 -0
- data/app/components/polaris/component.rb +5 -0
- data/app/components/polaris/description_list_component.html.erb +5 -0
- data/app/components/polaris/description_list_component.rb +41 -0
- data/app/components/polaris/display_text_component.rb +35 -0
- data/app/components/polaris/dropzone/component.html.erb +72 -0
- data/app/components/polaris/dropzone/component.rb +130 -0
- data/app/components/polaris/dropzone/controller.js +226 -0
- data/app/components/polaris/dropzone/utils.js +57 -0
- data/app/components/polaris/empty_state_component.html.erb +47 -0
- data/app/components/polaris/empty_state_component.rb +38 -0
- data/app/components/polaris/exception_list/item_component.html.erb +19 -0
- data/app/components/polaris/exception_list/item_component.rb +27 -0
- data/app/components/polaris/exception_list_component.html.erb +5 -0
- data/app/components/polaris/exception_list_component.rb +20 -0
- data/app/components/polaris/footer_help_component.html.erb +11 -0
- data/app/components/polaris/footer_help_component.rb +13 -0
- data/app/components/polaris/form_layout/group_component.html.erb +7 -0
- data/app/components/polaris/form_layout/group_component.rb +39 -0
- data/app/components/polaris/form_layout/item_component.rb +18 -0
- data/app/components/polaris/form_layout_component.html.erb +5 -0
- data/app/components/polaris/form_layout_component.rb +37 -0
- data/app/components/polaris/heading_component.rb +24 -0
- data/app/components/polaris/icon_component.html.erb +7 -0
- data/app/components/polaris/icon_component.rb +36 -0
- data/app/components/polaris/inline_error_component.html.erb +6 -0
- data/app/components/polaris/inline_error_component.rb +12 -0
- data/app/components/polaris/label_component.html.erb +21 -0
- data/app/components/polaris/label_component.rb +36 -0
- data/app/components/polaris/labelled_component.html.erb +25 -0
- data/app/components/polaris/labelled_component.rb +49 -0
- data/app/components/polaris/layout/annotated_section.html.erb +19 -0
- data/app/components/polaris/layout/annotated_section.rb +21 -0
- data/app/components/polaris/layout/section.rb +35 -0
- data/app/components/polaris/layout_component.html.erb +5 -0
- data/app/components/polaris/layout_component.rb +48 -0
- data/app/components/polaris/link_component.rb +48 -0
- data/app/components/polaris/list_component.html.erb +5 -0
- data/app/components/polaris/list_component.rb +46 -0
- data/app/components/polaris/new_component.rb +10 -0
- data/app/components/polaris/page_actions_component.html.erb +21 -0
- data/app/components/polaris/page_actions_component.rb +24 -0
- data/app/components/polaris/page_component.html.erb +63 -0
- data/app/components/polaris/page_component.rb +56 -0
- data/app/components/polaris/pagination_component.html.erb +19 -0
- data/app/components/polaris/pagination_component.rb +26 -0
- data/app/components/polaris/progress_bar_component.html.erb +14 -0
- data/app/components/polaris/progress_bar_component.rb +41 -0
- data/app/components/polaris/radio_button_component.html.erb +11 -0
- data/app/components/polaris/radio_button_component.rb +55 -0
- data/app/components/polaris/select_component.html.erb +36 -0
- data/app/components/polaris/select_component.rb +75 -0
- data/app/components/polaris/shopify_navigation_component.html.erb +9 -0
- data/app/components/polaris/shopify_navigation_component.rb +43 -0
- data/app/components/polaris/spinner_component.html.erb +11 -0
- data/app/components/polaris/spinner_component.rb +25 -0
- data/app/components/polaris/stack_component.html.erb +7 -0
- data/app/components/polaris/stack_component.rb +79 -0
- data/app/components/polaris/subheading_component.rb +24 -0
- data/app/components/polaris/text_container_component.rb +30 -0
- data/app/components/polaris/text_field_component.html.erb +103 -0
- data/app/components/polaris/text_field_component.rb +181 -0
- data/app/components/polaris/text_style_component.rb +32 -0
- data/app/components/polaris/thumbnail_component.html.erb +7 -0
- data/app/components/polaris/thumbnail_component.rb +37 -0
- data/app/components/polaris/visually_hidden_component.rb +12 -0
- data/app/helpers/polaris/action_helper.rb +14 -0
- data/app/helpers/polaris/class_name_helper.rb +24 -0
- data/app/helpers/polaris/conditional_helper.rb +11 -0
- data/app/helpers/polaris/fetch_or_fallback_helper.rb +53 -0
- data/app/helpers/polaris/form_builder.rb +16 -0
- data/app/helpers/polaris/option_helper.rb +13 -0
- data/app/helpers/polaris/view_helper.rb +66 -0
- data/app/javascript/polaris/index.js +9 -0
- data/app/javascript/polaris/select_controller.js +12 -0
- data/app/javascript/polaris/text_field_controller.js +112 -0
- data/app/validators/type_validator.rb +15 -0
- data/lib/polaris/view_components.rb +7 -0
- data/lib/polaris/view_components/engine.rb +29 -0
- data/lib/polaris/view_components/version.rb +5 -0
- data/lib/polaris_view_components.rb +1 -0
- metadata +588 -0
@@ -0,0 +1,181 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class TextFieldComponent < Polaris::NewComponent
|
5
|
+
TYPE_DEFAULT = :text
|
6
|
+
TYPE_OPTIONS = %i[
|
7
|
+
text number email password search tel url date
|
8
|
+
datetime_local month time week currency
|
9
|
+
]
|
10
|
+
|
11
|
+
ALIGN_DEFAULT = :default
|
12
|
+
ALIGN_MAPPINGS = {
|
13
|
+
ALIGN_DEFAULT => "",
|
14
|
+
:left => "Polaris-TextField__Input--alignLeft",
|
15
|
+
:center => "Polaris-TextField__Input--alignCenter",
|
16
|
+
:right => "Polaris-TextField__Input--alignRight",
|
17
|
+
}
|
18
|
+
ALIGN_OPTIONS = ALIGN_MAPPINGS.keys
|
19
|
+
|
20
|
+
attr_reader :value
|
21
|
+
|
22
|
+
renders_one :connected_left
|
23
|
+
renders_one :connected_right
|
24
|
+
|
25
|
+
def initialize(
|
26
|
+
form: nil,
|
27
|
+
attribute: nil,
|
28
|
+
name: nil,
|
29
|
+
value: nil,
|
30
|
+
type: TYPE_DEFAULT,
|
31
|
+
placeholder: nil,
|
32
|
+
maxlength: nil,
|
33
|
+
minlength: nil,
|
34
|
+
step: 1,
|
35
|
+
min: 0,
|
36
|
+
max: 1_000_000,
|
37
|
+
rows: 2,
|
38
|
+
prefix: nil,
|
39
|
+
suffix: nil,
|
40
|
+
multiline: false,
|
41
|
+
show_character_count: false,
|
42
|
+
clear_button: false,
|
43
|
+
monospaced: false,
|
44
|
+
align: ALIGN_DEFAULT,
|
45
|
+
label: nil,
|
46
|
+
label_hidden: false,
|
47
|
+
label_action: nil,
|
48
|
+
disabled: false,
|
49
|
+
required: false,
|
50
|
+
help_text: nil,
|
51
|
+
error: false,
|
52
|
+
wrapper_arguments: {},
|
53
|
+
input_options: {},
|
54
|
+
**system_arguments
|
55
|
+
)
|
56
|
+
@form = form
|
57
|
+
@attribute = attribute
|
58
|
+
@name = name
|
59
|
+
@value = value
|
60
|
+
@type = fetch_or_fallback(TYPE_OPTIONS, type, TYPE_DEFAULT)
|
61
|
+
@placeholder = placeholder
|
62
|
+
@maxlength = maxlength
|
63
|
+
@minlength = minlength
|
64
|
+
@step = step
|
65
|
+
@min = min
|
66
|
+
@max = max
|
67
|
+
@rows = rows
|
68
|
+
@prefix = prefix
|
69
|
+
@suffix = suffix
|
70
|
+
@multiline = multiline
|
71
|
+
@show_character_count = show_character_count
|
72
|
+
@clear_button = clear_button
|
73
|
+
@monospaced = monospaced
|
74
|
+
@align_class = ALIGN_MAPPINGS[fetch_or_fallback(ALIGN_OPTIONS, align, ALIGN_DEFAULT)]
|
75
|
+
@label = label
|
76
|
+
@label_hidden = label_hidden
|
77
|
+
@label_action = label_action
|
78
|
+
@disabled = disabled
|
79
|
+
@required = required
|
80
|
+
@help_text = help_text
|
81
|
+
@error = error
|
82
|
+
@wrapper_arguments = wrapper_arguments
|
83
|
+
@input_options = input_options
|
84
|
+
@system_arguments = system_arguments
|
85
|
+
end
|
86
|
+
|
87
|
+
def wrapper_arguments
|
88
|
+
{
|
89
|
+
form: @form,
|
90
|
+
attribute: @attribute,
|
91
|
+
name: @name,
|
92
|
+
label: @label,
|
93
|
+
label_hidden: @label_hidden,
|
94
|
+
label_action: @label_action,
|
95
|
+
required: @required,
|
96
|
+
help_text: @help_text,
|
97
|
+
error: @error,
|
98
|
+
}.deep_merge(@wrapper_arguments)
|
99
|
+
end
|
100
|
+
|
101
|
+
def system_arguments
|
102
|
+
{
|
103
|
+
tag: "div",
|
104
|
+
data: {
|
105
|
+
polaris_text_field_has_value_class: "Polaris-TextField--hasValue",
|
106
|
+
polaris_text_field_clear_button_hidden_class: "Polaris-TextField__ClearButton--hidden",
|
107
|
+
},
|
108
|
+
}.deep_merge(@system_arguments).tap do |opts|
|
109
|
+
opts[:classes] = class_names(
|
110
|
+
opts[:classes],
|
111
|
+
"Polaris-TextField",
|
112
|
+
"Polaris-TextField--disabled": @disabled,
|
113
|
+
"Polaris-TextField--error": @error,
|
114
|
+
"Polaris-TextField--hasValue": @value.present?,
|
115
|
+
"Polaris-TextField--multiline": @multiline,
|
116
|
+
)
|
117
|
+
prepend_option(opts[:data], :controller, "polaris-text-field")
|
118
|
+
if @show_character_count
|
119
|
+
opts[:data][:polaris_text_field_label_template_value] = character_count.label_template
|
120
|
+
opts[:data][:polaris_text_field_text_template_value] = character_count.text_template
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def input_options
|
126
|
+
default_options = {
|
127
|
+
value: @value,
|
128
|
+
disabled: @disabled,
|
129
|
+
required: @required,
|
130
|
+
placeholder: @placeholder,
|
131
|
+
maxlength: @maxlength,
|
132
|
+
minlength: @minlength,
|
133
|
+
data: { polaris_text_field_target: "input" },
|
134
|
+
}
|
135
|
+
if @type == :number
|
136
|
+
default_options.merge!({
|
137
|
+
step: @step,
|
138
|
+
min: @min,
|
139
|
+
max: @max,
|
140
|
+
})
|
141
|
+
end
|
142
|
+
if @multiline
|
143
|
+
default_options[:rows] = @rows
|
144
|
+
end
|
145
|
+
|
146
|
+
default_options.deep_merge(@input_options).tap do |opts|
|
147
|
+
opts[:class] = class_names(
|
148
|
+
opts[:class],
|
149
|
+
"Polaris-TextField__Input",
|
150
|
+
@align_class,
|
151
|
+
"Polaris-TextField--monospaced": @monospaced,
|
152
|
+
"Polaris-TextField__Input--suffixed": @suffix.present?,
|
153
|
+
)
|
154
|
+
prepend_option(opts[:data], :action, "polaris-text-field#syncValue")
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def input
|
159
|
+
case @type
|
160
|
+
when :text
|
161
|
+
@multiline ? "text_area" : "text_field"
|
162
|
+
when :tel then "telephone_field"
|
163
|
+
when :currency then "text_field"
|
164
|
+
else
|
165
|
+
"#{@type}_field"
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
def input_tag
|
170
|
+
"#{input}_tag"
|
171
|
+
end
|
172
|
+
|
173
|
+
def character_count
|
174
|
+
@character_count ||= CharacterCount.new(text_field: self, max_length: @maxlength)
|
175
|
+
end
|
176
|
+
|
177
|
+
def render_number_buttons?
|
178
|
+
@type == :number && !@disabled
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class TextStyleComponent < Polaris::NewComponent
|
5
|
+
VARIATION_DEFAULT = :default
|
6
|
+
VARIATION_MAPPINGS = {
|
7
|
+
VARIATION_DEFAULT => "",
|
8
|
+
:positive => "Polaris-TextStyle--variationPositive",
|
9
|
+
:negative => "Polaris-TextStyle--variationNegative",
|
10
|
+
:strong => "Polaris-TextStyle--variationStrong",
|
11
|
+
:subdued => "Polaris-TextStyle--variationSubdued",
|
12
|
+
:code => "Polaris-TextStyle--variationCode",
|
13
|
+
}
|
14
|
+
VARIATION_OPTIONS = VARIATION_MAPPINGS.keys
|
15
|
+
|
16
|
+
def initialize(
|
17
|
+
variation: VARIATION_DEFAULT,
|
18
|
+
**system_arguments
|
19
|
+
)
|
20
|
+
@system_arguments = system_arguments
|
21
|
+
@system_arguments[:tag] = 'span'
|
22
|
+
@system_arguments[:classes] = class_names(
|
23
|
+
@system_arguments[:classes],
|
24
|
+
VARIATION_MAPPINGS[fetch_or_fallback(VARIATION_OPTIONS, variation, VARIATION_DEFAULT)],
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def call
|
29
|
+
render(Polaris::BaseComponent.new(**@system_arguments)) { content }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class ThumbnailComponent < Polaris::NewComponent
|
5
|
+
SIZE_DEFAULT = :medium
|
6
|
+
SIZE_MAPPINGS = {
|
7
|
+
small: "Polaris-Thumbnail--sizeSmall",
|
8
|
+
medium: "Polaris-Thumbnail--sizeMedium",
|
9
|
+
large: "Polaris-Thumbnail--sizeLarge",
|
10
|
+
}
|
11
|
+
SIZE_OPTIONS = SIZE_MAPPINGS.keys
|
12
|
+
|
13
|
+
renders_one :icon, Polaris::IconComponent
|
14
|
+
|
15
|
+
def initialize(
|
16
|
+
source: nil,
|
17
|
+
size: SIZE_DEFAULT,
|
18
|
+
alt: nil,
|
19
|
+
**system_arguments
|
20
|
+
)
|
21
|
+
@source = source
|
22
|
+
@alt = alt
|
23
|
+
|
24
|
+
@system_arguments = system_arguments
|
25
|
+
@system_arguments[:tag] = "span"
|
26
|
+
@system_arguments[:classes] = class_names(
|
27
|
+
@system_arguments[:classes],
|
28
|
+
"Polaris-Thumbnail",
|
29
|
+
SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)],
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def renders?
|
34
|
+
source.present? || icon.present?
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Polaris
|
2
|
+
module ActionHelper
|
3
|
+
def render_plain_action(action)
|
4
|
+
case action
|
5
|
+
when Hash
|
6
|
+
action = action(**action)
|
7
|
+
end
|
8
|
+
|
9
|
+
render Polaris::ButtonComponent.new(**action.to_h.except(:content), plain: true) do
|
10
|
+
action.content
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
module ClassNameHelper
|
5
|
+
def class_names(*args)
|
6
|
+
classes = []
|
7
|
+
|
8
|
+
args.each do |class_name|
|
9
|
+
case class_name
|
10
|
+
when String
|
11
|
+
classes << class_name if class_name.present?
|
12
|
+
when Hash
|
13
|
+
class_name.each do |key, val|
|
14
|
+
classes << key if val
|
15
|
+
end
|
16
|
+
when Array
|
17
|
+
classes << class_names(*class_name).presence
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
classes.compact.uniq.join(" ")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Polaris::FetchOrFallbackHelper
|
4
|
+
# A little helper to enable graceful fallbacks
|
5
|
+
#
|
6
|
+
# Use this helper to quietly ensure a value is
|
7
|
+
# one that you expect:
|
8
|
+
#
|
9
|
+
# allowed_values - allowed options for *value*
|
10
|
+
# given_value - input being coerced
|
11
|
+
# fallback - returned if *given_value* is not included in *allowed_values*
|
12
|
+
# deprecated_values - deprecated options for *value*. Will warn of deprecation if not in production
|
13
|
+
#
|
14
|
+
# fetch_or_fallback([1,2,3], 5, 2) => 2
|
15
|
+
# fetch_or_fallback([1,2,3], 1, 2) => 1
|
16
|
+
# fetch_or_fallback([1,2,3], nil, 2) => 2
|
17
|
+
#
|
18
|
+
# With deprecations:
|
19
|
+
# fetch_or_fallback([1,2], 3, 2, deprecated_values: [3]) => 3
|
20
|
+
# fetch_or_fallback([1,2], nil, 2, deprecated_values: [3]) => 2
|
21
|
+
module Polaris
|
22
|
+
# :nodoc:
|
23
|
+
module FetchOrFallbackHelper
|
24
|
+
mattr_accessor :fallback_raises, default: true
|
25
|
+
|
26
|
+
InvalidValueError = Class.new(StandardError)
|
27
|
+
|
28
|
+
def fetch_or_fallback(allowed_values, given_value, fallback = nil, deprecated_values: nil)
|
29
|
+
if allowed_values.include?(given_value)
|
30
|
+
given_value
|
31
|
+
else
|
32
|
+
if fallback_raises && ENV["RAILS_ENV"] != "production" && ENV["STORYBOOK"] != "true"
|
33
|
+
raise InvalidValueError, <<~MSG
|
34
|
+
fetch_or_fallback was called with an invalid value.
|
35
|
+
Expected one of: #{allowed_values.inspect}
|
36
|
+
Got: #{given_value.inspect}
|
37
|
+
This will not raise in production, but will instead fallback to: #{fallback.inspect}
|
38
|
+
MSG
|
39
|
+
end
|
40
|
+
|
41
|
+
fallback
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def fetch_or_fallback_boolean(given_value, fallback = false)
|
46
|
+
if [true, false].include?(given_value)
|
47
|
+
given_value
|
48
|
+
else
|
49
|
+
fallback
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Polaris
|
2
|
+
class FormBuilder < ActionView::Helpers::FormBuilder
|
3
|
+
def polaris_text_field(method, **options, &block)
|
4
|
+
options[:error] ||= errors_for(method)
|
5
|
+
@template.render(
|
6
|
+
Polaris::TextFieldComponent.new(form: self, attribute: method, **options, &block)
|
7
|
+
)
|
8
|
+
end
|
9
|
+
|
10
|
+
def errors_for(method)
|
11
|
+
return if object.blank?
|
12
|
+
return unless object.errors.key?(method)
|
13
|
+
object.errors[method].join(', ').html_safe
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
module OptionHelper
|
5
|
+
def prepend_option(options, key, value)
|
6
|
+
options[key] = [value, options[key]].compact.join(" ")
|
7
|
+
end
|
8
|
+
|
9
|
+
def append_option(options, key, value)
|
10
|
+
options[key] = [options[key], value].compact.join(" ")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Polaris
|
2
|
+
# Module to allow shorthand calls for Polaris components
|
3
|
+
module ViewHelper
|
4
|
+
HELPERS = {
|
5
|
+
avatar: "Polaris::AvatarComponent",
|
6
|
+
badge: "Polaris::BadgeComponent",
|
7
|
+
banner: "Polaris::BannerComponent",
|
8
|
+
button: "Polaris::ButtonComponent",
|
9
|
+
button_group: "Polaris::ButtonGroupComponent",
|
10
|
+
callout_card: "Polaris::CalloutCardComponent",
|
11
|
+
caption: "Polaris::CaptionComponent",
|
12
|
+
card: "Polaris::CardComponent",
|
13
|
+
checkbox: "Polaris::CheckboxComponent",
|
14
|
+
choice_list: "Polaris::ChoiceListComponent",
|
15
|
+
description_list: "Polaris::DescriptionListComponent",
|
16
|
+
display_text: "Polaris::DisplayTextComponent",
|
17
|
+
dropzone: "Polaris::Dropzone::Component",
|
18
|
+
empty_state: "Polaris::EmptyStateComponent",
|
19
|
+
exception_list: "Polaris::ExceptionListComponent",
|
20
|
+
footer_help: "Polaris::FooterHelpComponent",
|
21
|
+
form_layout: "Polaris::FormLayoutComponent",
|
22
|
+
heading: "Polaris::HeadingComponent",
|
23
|
+
icon: "Polaris::IconComponent",
|
24
|
+
inline_error: "Polaris::InlineErrorComponent",
|
25
|
+
layout: "Polaris::LayoutComponent",
|
26
|
+
link: "Polaris::LinkComponent",
|
27
|
+
list: "Polaris::ListComponent",
|
28
|
+
page: "Polaris::PageComponent",
|
29
|
+
page_actions: "Polaris::PageActionsComponent",
|
30
|
+
pagination: "Polaris::PaginationComponent",
|
31
|
+
progress_bar: "Polaris::ProgressBarComponent",
|
32
|
+
radio_button: "Polaris::RadioButtonComponent",
|
33
|
+
select: "Polaris::SelectComponent",
|
34
|
+
shopify_navigation: "Polaris::ShopifyNavigationComponent",
|
35
|
+
stack: "Polaris::StackComponent",
|
36
|
+
subheading: "Polaris::SubheadingComponent",
|
37
|
+
spinner: "Polaris::SpinnerComponent",
|
38
|
+
text_container: "Polaris::TextContainerComponent",
|
39
|
+
text_field: "Polaris::TextFieldComponent",
|
40
|
+
text_style: "Polaris::TextStyleComponent",
|
41
|
+
thumbnail: "Polaris::ThumbnailComponent",
|
42
|
+
visually_hidden: "Polaris::VisuallyHiddenComponent",
|
43
|
+
}.freeze
|
44
|
+
|
45
|
+
HELPERS.each do |name, component|
|
46
|
+
define_method "polaris_#{name}" do |*args, **kwargs, &block|
|
47
|
+
render component.constantize.new(*args, **kwargs), &block
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def polaris_icon_source(name)
|
52
|
+
path = ViewComponents::Engine.root.join("app", "assets", "icons", "polaris", "#{name}.svg")
|
53
|
+
file = File.read(path)
|
54
|
+
doc = Nokogiri::HTML::DocumentFragment.parse(file)
|
55
|
+
svg = doc.at_css 'svg'
|
56
|
+
svg[:class] = "Polaris-Icon__Svg"
|
57
|
+
svg[:focusable] = false
|
58
|
+
svg[:"aria-hidden"] = true
|
59
|
+
doc.to_html.html_safe
|
60
|
+
end
|
61
|
+
|
62
|
+
def polaris_body_styles
|
63
|
+
%Q(background-color: rgb(246, 246, 247); color: rgb(32, 34, 35); --p-background:rgba(246, 246, 247, 1); --p-background-hovered:rgba(241, 242, 243, 1); --p-background-pressed:rgba(237, 238, 239, 1); --p-background-selected:rgba(237, 238, 239, 1); --p-surface:rgba(255, 255, 255, 1); --p-surface-neutral:rgba(228, 229, 231, 1); --p-surface-neutral-hovered:rgba(219, 221, 223, 1); --p-surface-neutral-pressed:rgba(201, 204, 208, 1); --p-surface-neutral-disabled:rgba(241, 242, 243, 1); --p-surface-neutral-subdued:rgba(246, 246, 247, 1); --p-surface-subdued:rgba(250, 251, 251, 1); --p-surface-disabled:rgba(250, 251, 251, 1); --p-surface-hovered:rgba(246, 246, 247, 1); --p-surface-pressed:rgba(241, 242, 243, 1); --p-surface-depressed:rgba(237, 238, 239, 1); --p-backdrop:rgba(0, 0, 0, 0.5); --p-overlay:rgba(255, 255, 255, 0.5); --p-shadow-from-dim-light:rgba(0, 0, 0, 0.2); --p-shadow-from-ambient-light:rgba(23, 24, 24, 0.05); --p-shadow-from-direct-light:rgba(0, 0, 0, 0.15); --p-hint-from-direct-light:rgba(0, 0, 0, 0.15); --p-on-surface-background:rgba(241, 242, 243, 1); --p-border:rgba(140, 145, 150, 1); --p-border-neutral-subdued:rgba(186, 191, 195, 1); --p-border-hovered:rgba(153, 158, 164, 1); --p-border-disabled:rgba(210, 213, 216, 1); --p-border-subdued:rgba(201, 204, 207, 1); --p-border-depressed:rgba(87, 89, 89, 1); --p-border-shadow:rgba(174, 180, 185, 1); --p-border-shadow-subdued:rgba(186, 191, 196, 1); --p-divider:rgba(225, 227, 229, 1); --p-icon:rgba(92, 95, 98, 1); --p-icon-hovered:rgba(26, 28, 29, 1); --p-icon-pressed:rgba(68, 71, 74, 1); --p-icon-disabled:rgba(186, 190, 195, 1); --p-icon-subdued:rgba(140, 145, 150, 1); --p-text:rgba(32, 34, 35, 1); --p-text-disabled:rgba(140, 145, 150, 1); --p-text-subdued:rgba(109, 113, 117, 1); --p-interactive:rgba(44, 110, 203, 1); --p-interactive-disabled:rgba(189, 193, 204, 1); --p-interactive-hovered:rgba(31, 81, 153, 1); --p-interactive-pressed:rgba(16, 50, 98, 1); --p-focused:rgba(69, 143, 255, 1); --p-surface-selected:rgba(242, 247, 254, 1); --p-surface-selected-hovered:rgba(237, 244, 254, 1); --p-surface-selected-pressed:rgba(229, 239, 253, 1); --p-icon-on-interactive:rgba(255, 255, 255, 1); --p-text-on-interactive:rgba(255, 255, 255, 1); --p-action-secondary:rgba(255, 255, 255, 1); --p-action-secondary-disabled:rgba(255, 255, 255, 1); --p-action-secondary-hovered:rgba(246, 246, 247, 1); --p-action-secondary-pressed:rgba(241, 242, 243, 1); --p-action-secondary-depressed:rgba(109, 113, 117, 1); --p-action-primary:rgba(0, 128, 96, 1); --p-action-primary-disabled:rgba(241, 241, 241, 1); --p-action-primary-hovered:rgba(0, 110, 82, 1); --p-action-primary-pressed:rgba(0, 94, 70, 1); --p-action-primary-depressed:rgba(0, 61, 44, 1); --p-icon-on-primary:rgba(255, 255, 255, 1); --p-text-on-primary:rgba(255, 255, 255, 1); --p-text-primary:rgba(0, 123, 92, 1); --p-text-primary-hovered:rgba(0, 108, 80, 1); --p-text-primary-pressed:rgba(0, 92, 68, 1); --p-surface-primary-selected:rgba(241, 248, 245, 1); --p-surface-primary-selected-hovered:rgba(179, 208, 195, 1); --p-surface-primary-selected-pressed:rgba(162, 188, 176, 1); --p-border-critical:rgba(253, 87, 73, 1); --p-border-critical-subdued:rgba(224, 179, 178, 1); --p-border-critical-disabled:rgba(255, 167, 163, 1); --p-icon-critical:rgba(215, 44, 13, 1); --p-surface-critical:rgba(254, 211, 209, 1); --p-surface-critical-subdued:rgba(255, 244, 244, 1); --p-surface-critical-subdued-hovered:rgba(255, 240, 240, 1); --p-surface-critical-subdued-pressed:rgba(255, 233, 232, 1); --p-surface-critical-subdued-depressed:rgba(254, 188, 185, 1); --p-text-critical:rgba(215, 44, 13, 1); --p-action-critical:rgba(216, 44, 13, 1); --p-action-critical-disabled:rgba(241, 241, 241, 1); --p-action-critical-hovered:rgba(188, 34, 0, 1); --p-action-critical-pressed:rgba(162, 27, 0, 1); --p-action-critical-depressed:rgba(108, 15, 0, 1); --p-icon-on-critical:rgba(255, 255, 255, 1); --p-text-on-critical:rgba(255, 255, 255, 1); --p-interactive-critical:rgba(216, 44, 13, 1); --p-interactive-critical-disabled:rgba(253, 147, 141, 1); --p-interactive-critical-hovered:rgba(205, 41, 12, 1); --p-interactive-critical-pressed:rgba(103, 15, 3, 1); --p-border-warning:rgba(185, 137, 0, 1); --p-border-warning-subdued:rgba(225, 184, 120, 1); --p-icon-warning:rgba(185, 137, 0, 1); --p-surface-warning:rgba(255, 215, 157, 1); --p-surface-warning-subdued:rgba(255, 245, 234, 1); --p-surface-warning-subdued-hovered:rgba(255, 242, 226, 1); --p-surface-warning-subdued-pressed:rgba(255, 235, 211, 1); --p-text-warning:rgba(145, 106, 0, 1); --p-border-highlight:rgba(68, 157, 167, 1); --p-border-highlight-subdued:rgba(152, 198, 205, 1); --p-icon-highlight:rgba(0, 160, 172, 1); --p-surface-highlight:rgba(164, 232, 242, 1); --p-surface-highlight-subdued:rgba(235, 249, 252, 1); --p-surface-highlight-subdued-hovered:rgba(228, 247, 250, 1); --p-surface-highlight-subdued-pressed:rgba(213, 243, 248, 1); --p-text-highlight:rgba(52, 124, 132, 1); --p-border-success:rgba(0, 164, 124, 1); --p-border-success-subdued:rgba(149, 201, 180, 1); --p-icon-success:rgba(0, 127, 95, 1); --p-surface-success:rgba(174, 233, 209, 1); --p-surface-success-subdued:rgba(241, 248, 245, 1); --p-surface-success-subdued-hovered:rgba(236, 246, 241, 1); --p-surface-success-subdued-pressed:rgba(226, 241, 234, 1); --p-text-success:rgba(0, 128, 96, 1); --p-decorative-one-icon:rgba(126, 87, 0, 1); --p-decorative-one-surface:rgba(255, 201, 107, 1); --p-decorative-one-text:rgba(61, 40, 0, 1); --p-decorative-two-icon:rgba(175, 41, 78, 1); --p-decorative-two-surface:rgba(255, 196, 176, 1); --p-decorative-two-text:rgba(73, 11, 28, 1); --p-decorative-three-icon:rgba(0, 109, 65, 1); --p-decorative-three-surface:rgba(146, 230, 181, 1); --p-decorative-three-text:rgba(0, 47, 25, 1); --p-decorative-four-icon:rgba(0, 106, 104, 1); --p-decorative-four-surface:rgba(145, 224, 214, 1); --p-decorative-four-text:rgba(0, 45, 45, 1); --p-decorative-five-icon:rgba(174, 43, 76, 1); --p-decorative-five-surface:rgba(253, 201, 208, 1); --p-decorative-five-text:rgba(79, 14, 31, 1); --p-border-radius-base:0.4rem; --p-border-radius-wide:0.8rem; --p-border-radius-full:50%; --p-card-shadow:0px 0px 5px var(--p-shadow-from-ambient-light), 0px 1px 2px var(--p-shadow-from-direct-light); --p-popover-shadow:-1px 0px 20px var(--p-shadow-from-ambient-light), 0px 1px 5px var(--p-shadow-from-direct-light); --p-modal-shadow:0px 26px 80px var(--p-shadow-from-dim-light), 0px 0px 1px var(--p-shadow-from-dim-light); --p-top-bar-shadow:0 2px 2px -1px var(--p-shadow-from-direct-light); --p-button-drop-shadow:0 1px 0 rgba(0, 0, 0, 0.05); --p-button-inner-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.2); --p-button-pressed-inner-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.15); --p-override-none:none; --p-override-transparent:transparent; --p-override-one:1; --p-override-visible:visible; --p-override-zero:0; --p-override-loading-z-index:514; --p-button-font-weight:500; --p-non-null-content:''; --p-choice-size:2rem; --p-icon-size:1rem; --p-choice-margin:0.1rem; --p-control-border-width:0.2rem; --p-banner-border-default:inset 0 0.1rem 0 0 var(--p-border-neutral-subdued), inset 0 0 0 0.1rem var(--p-border-neutral-subdued); --p-banner-border-success:inset 0 0.1rem 0 0 var(--p-border-success-subdued), inset 0 0 0 0.1rem var(--p-border-success-subdued); --p-banner-border-highlight:inset 0 0.1rem 0 0 var(--p-border-highlight-subdued), inset 0 0 0 0.1rem var(--p-border-highlight-subdued); --p-banner-border-warning:inset 0 0.1rem 0 0 var(--p-border-warning-subdued), inset 0 0 0 0.1rem var(--p-border-warning-subdued); --p-banner-border-critical:inset 0 0.1rem 0 0 var(--p-border-critical-subdued), inset 0 0 0 0.1rem var(--p-border-critical-subdued); --p-badge-mix-blend-mode:luminosity; --p-thin-border-subdued:0.1rem solid var(--p-border-subdued); --p-text-field-spinner-offset:0.2rem; --p-text-field-focus-ring-offset:-0.4rem; --p-text-field-focus-ring-border-radius:0.7rem; --p-button-group-item-spacing:-0.1rem; --p-duration-1-0-0:100ms; --p-duration-1-5-0:150ms; --p-ease-in:cubic-bezier(0.5, 0.1, 1, 1); --p-ease:cubic-bezier(0.4, 0.22, 0.28, 1); --p-range-slider-thumb-size-base:1.6rem; --p-range-slider-thumb-size-active:2.4rem; --p-range-slider-thumb-scale:1.5; --p-badge-font-weight:400; --p-frame-offset:0px;)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|