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,35 @@
|
|
1
|
+
<div>
|
2
|
+
<%= render Polaris::BaseComponent.new(**@system_arguments) do %>
|
3
|
+
<span class="Polaris-Choice__Control">
|
4
|
+
<%= content %>
|
5
|
+
</span>
|
6
|
+
|
7
|
+
<% if @label %>
|
8
|
+
<span class="Polaris-Choice__Label">
|
9
|
+
<%= @label %>
|
10
|
+
</span>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<% if @children_content.present? %>
|
15
|
+
<div class="Polaris-ChoiceList__ChoiceChildren">
|
16
|
+
<%= @children_content %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% if @help_text.present? || @error.present? %>
|
21
|
+
<div class="Polaris-Choice__Descriptions">
|
22
|
+
<% if @help_text.present? %>
|
23
|
+
<div class="Polaris-Choice__HelpText">
|
24
|
+
<%= @help_text %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<% if @error.present? %>
|
29
|
+
<div class="Polaris-Choice__Error">
|
30
|
+
<%= polaris_inline_error { @error } %>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class ChoiceComponent < Polaris::NewComponent
|
5
|
+
def initialize(
|
6
|
+
label:,
|
7
|
+
label_hidden:,
|
8
|
+
help_text:,
|
9
|
+
disabled:,
|
10
|
+
error: nil,
|
11
|
+
children_content: nil,
|
12
|
+
**system_arguments
|
13
|
+
)
|
14
|
+
@label = label
|
15
|
+
@help_text = help_text
|
16
|
+
@error = error
|
17
|
+
@children_content = children_content
|
18
|
+
|
19
|
+
@system_arguments = system_arguments
|
20
|
+
@system_arguments[:tag] = "label"
|
21
|
+
@system_arguments[:classes] = class_names(
|
22
|
+
@system_arguments[:classes],
|
23
|
+
"Polaris-Choice",
|
24
|
+
"Polaris-Choice--labelHidden": label_hidden,
|
25
|
+
"Polaris-Choice--disabled": disabled,
|
26
|
+
)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= field_set_tag(nil, content_tag_options) do %>
|
2
|
+
<% if @title.present? %>
|
3
|
+
<%= content_tag("legend", class: "Polaris-ChoiceList__Title") do %>
|
4
|
+
<%= @title %>
|
5
|
+
<% end %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<ul class="Polaris-ChoiceList__Choices">
|
9
|
+
<% choice_component = @allow_multiple ? Polaris::CheckboxComponent : Polaris::RadioButtonComponent %>
|
10
|
+
|
11
|
+
<% @choices.each do |choice| %>
|
12
|
+
<li>
|
13
|
+
<%= render choice_component.new(
|
14
|
+
form: @form,
|
15
|
+
attribute: @attribute,
|
16
|
+
name: final_name,
|
17
|
+
value: choice[:value],
|
18
|
+
label: choice[:label],
|
19
|
+
disabled: choice[:disabled] || @disabled,
|
20
|
+
checked: choice_is_selected?(choice),
|
21
|
+
help_text: choice[:help_text],
|
22
|
+
children_content: choice[:children_content],
|
23
|
+
input_attrs: @input_attrs,
|
24
|
+
) %>
|
25
|
+
</li>
|
26
|
+
<% end %>
|
27
|
+
</ul>
|
28
|
+
|
29
|
+
<% if @error.present? %>
|
30
|
+
<div class="Polaris-ChoiceList__ChoiceError">
|
31
|
+
<%= polaris_inline_error { @error } %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
module ChoiceList
|
5
|
+
class Component < Polaris::Component
|
6
|
+
def initialize(
|
7
|
+
choices:,
|
8
|
+
form: nil,
|
9
|
+
attribute: nil,
|
10
|
+
name: nil,
|
11
|
+
title: '',
|
12
|
+
title_hidden: false,
|
13
|
+
selected: [],
|
14
|
+
allow_multiple: false,
|
15
|
+
error: '',
|
16
|
+
disabled: false,
|
17
|
+
input_attrs: {},
|
18
|
+
**args
|
19
|
+
)
|
20
|
+
super
|
21
|
+
|
22
|
+
@choices = choices
|
23
|
+
@form = form
|
24
|
+
@attribute = attribute
|
25
|
+
|
26
|
+
@name = name
|
27
|
+
@title = title
|
28
|
+
@title_hidden = title_hidden
|
29
|
+
@selected = selected
|
30
|
+
@allow_multiple = allow_multiple
|
31
|
+
@error = error
|
32
|
+
@disabled = disabled
|
33
|
+
@input_attrs = input_attrs
|
34
|
+
end
|
35
|
+
|
36
|
+
def final_name
|
37
|
+
return nil if @name.nil?
|
38
|
+
|
39
|
+
@allow_multiple ? "#{@name}[]" : @name
|
40
|
+
end
|
41
|
+
|
42
|
+
def choice_is_selected?(choice)
|
43
|
+
@selected.include? choice[:value]
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def classes
|
49
|
+
classes = ['Polaris-ChoiceList']
|
50
|
+
|
51
|
+
classes << 'Polaris-ChoiceList--titleHidden' if @title_hidden
|
52
|
+
|
53
|
+
classes
|
54
|
+
end
|
55
|
+
|
56
|
+
def additional_aria
|
57
|
+
super
|
58
|
+
|
59
|
+
{
|
60
|
+
invalid: @error.present?
|
61
|
+
}
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= render Polaris::BaseComponent.new(**@system_arguments) do %>
|
2
|
+
<legend class="Polaris-ChoiceList__Title">
|
3
|
+
<%= @title %>
|
4
|
+
</legend>
|
5
|
+
|
6
|
+
<ul class="Polaris-ChoiceList__Choices">
|
7
|
+
<% items.each do |item| %>
|
8
|
+
<li>
|
9
|
+
<%= item %>
|
10
|
+
</li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
|
14
|
+
<% if @error.present? %>
|
15
|
+
<div class="Polaris-ChoiceList__ChoiceError">
|
16
|
+
<%= polaris_inline_error { @error } %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class ChoiceListComponent < Polaris::NewComponent
|
5
|
+
renders_many :checkboxes, -> (value:, disabled: false, **system_arguments) do
|
6
|
+
Polaris::CheckboxComponent.new(
|
7
|
+
form: @form,
|
8
|
+
attribute: @attribute,
|
9
|
+
name: @name && "#{@name}[]",
|
10
|
+
value: value,
|
11
|
+
checked: @selected.include?(value),
|
12
|
+
disabled: disabled || @disabled,
|
13
|
+
**system_arguments
|
14
|
+
)
|
15
|
+
end
|
16
|
+
renders_many :radio_buttons, -> (value:, disabled: false, **system_arguments) do
|
17
|
+
Polaris::RadioButtonComponent.new(
|
18
|
+
form: @form,
|
19
|
+
attribute: @attribute,
|
20
|
+
name: @name,
|
21
|
+
value: value,
|
22
|
+
checked: @selected.include?(value),
|
23
|
+
disabled: disabled || @disabled,
|
24
|
+
**system_arguments,
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(
|
29
|
+
title:,
|
30
|
+
title_hidden: false,
|
31
|
+
form: nil,
|
32
|
+
attribute: nil,
|
33
|
+
name: nil,
|
34
|
+
selected: [],
|
35
|
+
disabled: false,
|
36
|
+
error: nil,
|
37
|
+
**system_arguments
|
38
|
+
)
|
39
|
+
@title = title
|
40
|
+
@error = error
|
41
|
+
@form = form
|
42
|
+
@attribute = attribute
|
43
|
+
@name = name
|
44
|
+
@selected = selected
|
45
|
+
@disabled = disabled
|
46
|
+
|
47
|
+
@system_arguments = system_arguments
|
48
|
+
@system_arguments[:tag] = "fieldset"
|
49
|
+
@system_arguments[:classes] = class_names(
|
50
|
+
@system_arguments[:classes],
|
51
|
+
"Polaris-ChoiceList",
|
52
|
+
"Polaris-ChoiceList--titleHidden": title_hidden,
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
def items
|
57
|
+
checkboxes.presence || radio_buttons
|
58
|
+
end
|
59
|
+
|
60
|
+
def renders?
|
61
|
+
items.any?
|
62
|
+
end
|
63
|
+
|
64
|
+
def multiple_choice_allowed?
|
65
|
+
checkboxes.any?
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class DescriptionListComponent < Polaris::NewComponent
|
5
|
+
SPACING_DEFAULT = :loose
|
6
|
+
SPACING_MAPPINGS = {
|
7
|
+
SPACING_DEFAULT => "",
|
8
|
+
:tight => "Polaris-DescriptionList--spacingTight",
|
9
|
+
}
|
10
|
+
SPACING_OPTIONS = SPACING_MAPPINGS.keys
|
11
|
+
|
12
|
+
renders_many :items, "DescriptionListItemComponent"
|
13
|
+
|
14
|
+
def initialize(spacing: SPACING_DEFAULT, **system_arguments)
|
15
|
+
@system_arguments = system_arguments
|
16
|
+
@system_arguments[:tag] = "dl"
|
17
|
+
@system_arguments[:classes] = class_names(
|
18
|
+
@system_arguments[:classes],
|
19
|
+
"Polaris-DescriptionList",
|
20
|
+
SPACING_MAPPINGS[fetch_or_fallback(SPACING_OPTIONS, spacing, SPACING_DEFAULT)],
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def renders?
|
25
|
+
items.any?
|
26
|
+
end
|
27
|
+
|
28
|
+
class DescriptionListItemComponent < Polaris::NewComponent
|
29
|
+
def initialize(term:)
|
30
|
+
@term = term
|
31
|
+
end
|
32
|
+
|
33
|
+
def call
|
34
|
+
safe_join [
|
35
|
+
tag.dt(class: "Polaris-DescriptionList__Term") { @term },
|
36
|
+
tag.dd(class: "Polaris-DescriptionList__Description") { content },
|
37
|
+
]
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
class DisplayTextComponent < Polaris::NewComponent
|
5
|
+
ELEMENT_DEFAULT = :p
|
6
|
+
ELEMENT_OPTIONS = %i[p h1 h2 h3 h4 h5 h6]
|
7
|
+
|
8
|
+
SIZE_DEFAULT = :medium
|
9
|
+
SIZE_MAPPINGS = {
|
10
|
+
small: "Polaris-DisplayText--sizeSmall",
|
11
|
+
medium: "Polaris-DisplayText--sizeMedium",
|
12
|
+
large: "Polaris-DisplayText--sizeLarge",
|
13
|
+
extra_large: "Polaris-DisplayText--sizeExtraLarge",
|
14
|
+
}
|
15
|
+
SIZE_OPTIONS = SIZE_MAPPINGS.keys
|
16
|
+
|
17
|
+
def initialize(
|
18
|
+
element: ELEMENT_DEFAULT,
|
19
|
+
size: SIZE_DEFAULT,
|
20
|
+
**system_arguments
|
21
|
+
)
|
22
|
+
@system_arguments = system_arguments
|
23
|
+
@system_arguments[:tag] = element
|
24
|
+
@system_arguments[:classes] = class_names(
|
25
|
+
@system_arguments[:classes],
|
26
|
+
"Polaris-DisplayText",
|
27
|
+
SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, size, SIZE_DEFAULT)],
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def call
|
32
|
+
render(Polaris::BaseComponent.new(**@system_arguments)) { content }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<%= render Polaris::Labelled::Component.new(**labelled_attrs) do %>
|
2
|
+
<%= content_tag('div', content_tag_options) do %>
|
3
|
+
<div
|
4
|
+
class="Polaris-DropZone__Overlay Polaris-VisuallyHidden"
|
5
|
+
data-polaris--dropzone-target="overlay"
|
6
|
+
>
|
7
|
+
<%= polaris_stack(vertical: true, spacing: :tight) do |stack| %>
|
8
|
+
<% stack.item do %>
|
9
|
+
<%= polaris_icon(color: :primary) do %>
|
10
|
+
<svg viewBox="0 0 20 20" class="Polaris-Icon__Svg" focusable="false" aria-hidden="true">
|
11
|
+
<path d="M2 2h1V0H1.5A1.5 1.5 0 000 1.5V3h2V2zM5 2h3V0H5v2zM13 2h-3V0h3v2zM0 5v3h2V5H0zM0 10v3h2v-3H0zM18 5h-2v3h2V5zM5 18h3v-2H5v2zM0 17a1 1 0 001 1h2v-2H2v-1H0v2zM16 3V2h-1V0h1.5A1.5 1.5 0 0118 1.5V3h-2z" />
|
12
|
+
|
13
|
+
<path d="M10.814 14H5.5A1.5 1.5 0 014 12.5v-7A1.5 1.5 0 015.5 4h7A1.5 1.5 0 0114 5.5v5.314l5.512 2.506a.832.832 0 01.028 1.501l-2.898 1.45a.832.832 0 00-.372.371l-1.449 2.898a.832.832 0 01-1.501-.028L10.814 14zm-.909-2l-.828-1.821c-.318-.7.402-1.42 1.102-1.102L12 9.905V6H6v6h3.905z" />
|
14
|
+
</svg>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<% stack.item do %>
|
19
|
+
<%= polaris_display_text(size: :small) do %>
|
20
|
+
<%= @overlay_text %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div class="Polaris-DropZone__Container" data-polaris--dropzone-target="container">
|
27
|
+
<div class="Polaris-DropZone-FileUpload" data-polaris--dropzone-target="fileUpload">
|
28
|
+
<%= polaris_stack(vertical: true) do |stack| %>
|
29
|
+
<% stack.item do %>
|
30
|
+
<img width="40" src="data:image/svg+xml,%3csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M20 10a10 10 0 11-20 0 10 10 0 0120 0zM5.3 8.3l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L11 7.4V15a1 1 0 11-2 0V7.4L6.7 9.7a1 1 0 01-1.4-1.4z' fill='%235C5F62'/%3e%3c/svg%3e" alt="">
|
31
|
+
<% end %>
|
32
|
+
|
33
|
+
<% stack.item do %>
|
34
|
+
<div class="Polaris-DropZone-FileUpload__Button">Add file</div>
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
<% stack.item do %>
|
38
|
+
<%= polaris_text_style(variation: :subdued) do %>
|
39
|
+
or drop files to upload
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<%= polaris_visually_hidden do %>
|
47
|
+
<%= @form.file_field(@attribute, input_attrs) %>
|
48
|
+
<% end %>
|
49
|
+
|
50
|
+
<template data-polaris--dropzone-target="itemsTemplate">
|
51
|
+
<%= polaris_stack(vertical: true, data: { rendered: '' }) do %>
|
52
|
+
<span class="target"></span>
|
53
|
+
<% end %>
|
54
|
+
</template>
|
55
|
+
|
56
|
+
<template data-polaris--dropzone-target="itemTemplate">
|
57
|
+
<div class="Polaris-Stack__Item">
|
58
|
+
<%= polaris_stack(alignment: :center) do |stack| %>
|
59
|
+
<% stack.item do %>
|
60
|
+
<%# polaris_thumnail(source: "TODO", size: :small) %>
|
61
|
+
<% end %>
|
62
|
+
|
63
|
+
<% stack.item do %>
|
64
|
+
<div class="content">
|
65
|
+
<%= polaris_caption_component { "TODO" } %>
|
66
|
+
</div>
|
67
|
+
<% end %>
|
68
|
+
<% end %>
|
69
|
+
</div>
|
70
|
+
</template>
|
71
|
+
<% end %>
|
72
|
+
<% end %>
|
@@ -0,0 +1,130 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Polaris
|
4
|
+
module Dropzone
|
5
|
+
class Component < Polaris::Component
|
6
|
+
include Polaris::ActionHelper
|
7
|
+
|
8
|
+
ALLOWED_TYPES = %w[file image]
|
9
|
+
|
10
|
+
validates :type, inclusion: { in: ALLOWED_TYPES, message: "%{value} is not a valid type" }
|
11
|
+
validates :label_action, type: Action, allow_nil: true
|
12
|
+
|
13
|
+
# TODO
|
14
|
+
# Options missing:
|
15
|
+
# - open_file_dialog
|
16
|
+
# - overlay
|
17
|
+
# - overlay_text
|
18
|
+
# - Size CSS Class
|
19
|
+
# - Doesn't take into account an initial load with files
|
20
|
+
|
21
|
+
attr_reader :label_action, :type
|
22
|
+
|
23
|
+
def initialize(
|
24
|
+
form:,
|
25
|
+
attribute:,
|
26
|
+
accept: "",
|
27
|
+
active: false,
|
28
|
+
allow_multiple: true,
|
29
|
+
disabled: false,
|
30
|
+
drop_on_page: false,
|
31
|
+
error: false,
|
32
|
+
error_overlay_text: "",
|
33
|
+
id: "",
|
34
|
+
label: "",
|
35
|
+
label_action: nil,
|
36
|
+
label_hidden: false,
|
37
|
+
overlay_text: "Drop file to upload",
|
38
|
+
outline: true,
|
39
|
+
type: "file",
|
40
|
+
**args
|
41
|
+
)
|
42
|
+
super
|
43
|
+
|
44
|
+
@form = form
|
45
|
+
@attribute = attribute
|
46
|
+
@accept = accept
|
47
|
+
@active = active
|
48
|
+
@allow_multiple = allow_multiple
|
49
|
+
@disabled = disabled
|
50
|
+
@drop_on_page = drop_on_page
|
51
|
+
@error = error
|
52
|
+
@error_overlay_text = error_overlay_text
|
53
|
+
@id = id
|
54
|
+
@label = label
|
55
|
+
@label_action = label_action
|
56
|
+
@label_hidden = label_hidden
|
57
|
+
@overlay_text = overlay_text
|
58
|
+
@outline = outline
|
59
|
+
@type = type
|
60
|
+
end
|
61
|
+
|
62
|
+
def labelled_attrs
|
63
|
+
{
|
64
|
+
form: @form,
|
65
|
+
attribute: @attribute,
|
66
|
+
error: @error,
|
67
|
+
label: @label,
|
68
|
+
label_hidden: @label_hidden,
|
69
|
+
index: @index,
|
70
|
+
action: @label_action
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
def input_attrs
|
75
|
+
{
|
76
|
+
accept: @accept,
|
77
|
+
disabled: @disabled,
|
78
|
+
type: "file",
|
79
|
+
multiple: @allow_multiple,
|
80
|
+
data: {
|
81
|
+
action: "focus->polaris--dropzone#onFocus blur->polaris--dropzone#onBlur change->polaris--dropzone#onChange",
|
82
|
+
'polaris--dropzone-target': 'input',
|
83
|
+
}
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def additional_aria
|
90
|
+
{
|
91
|
+
disabled: @disabled.to_s,
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
def additional_data
|
96
|
+
{
|
97
|
+
controller: "polaris--dropzone",
|
98
|
+
action: "click->polaris--dropzone#onClick #{drop_actions}",
|
99
|
+
'polaris--dropzone-accept-value': @accept,
|
100
|
+
'polaris--dropzone-allowMultiple-value': @allow_multiple.to_s,
|
101
|
+
'polaris--dropzone-disabled-value': @disabled.to_s,
|
102
|
+
'polaris--dropzone-focused-value': 'false',
|
103
|
+
'polaris--dropzone-drop-on-page-value': 'false',
|
104
|
+
}
|
105
|
+
end
|
106
|
+
|
107
|
+
def drop_actions
|
108
|
+
event_scope = @drop_on_page ? "@document" : ""
|
109
|
+
|
110
|
+
[
|
111
|
+
"drop#{event_scope}->polaris--dropzone#onDrop",
|
112
|
+
"dragover#{event_scope}->polaris--dropzone#onDragOver",
|
113
|
+
"dragenter#{event_scope}->polaris--dropzone#onDragEnter",
|
114
|
+
"dragleave#{event_scope}->polaris--dropzone#onDragLeave"
|
115
|
+
].join(" ")
|
116
|
+
end
|
117
|
+
|
118
|
+
def classes
|
119
|
+
classes = %w[Polaris-DropZone Polaris-DropZone--sizeExtraLarge]
|
120
|
+
|
121
|
+
classes << "Polaris-DropZone--isDisabled" if @disabled
|
122
|
+
classes << "Polaris-DropZone--isDisabled" if @disabled
|
123
|
+
classes << "Polaris-DropZone--hasError" if @error.present?
|
124
|
+
classes << "Polaris-DropZone--hasOutline" if @outline
|
125
|
+
|
126
|
+
classes
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|