nfg_ui 0.9.8.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +431 -0
- data/Rakefile +23 -0
- data/app/assets/config/nfg_ui_manifest.js +3 -0
- data/app/assets/images/nfg_ui/app_icon/android-chrome-192x192.png +0 -0
- data/app/assets/images/nfg_ui/app_icon/android-chrome-384x384.png +0 -0
- data/app/assets/images/nfg_ui/app_icon/apple-touch-icon.png +0 -0
- data/app/assets/images/nfg_ui/app_icon/browserconfig.xml.erb +9 -0
- data/app/assets/images/nfg_ui/app_icon/favicon-16x16.png +0 -0
- data/app/assets/images/nfg_ui/app_icon/favicon-32x32.png +0 -0
- data/app/assets/images/nfg_ui/app_icon/favicon.ico +0 -0
- data/app/assets/images/nfg_ui/app_icon/mstile-150x150.png +0 -0
- data/app/assets/images/nfg_ui/app_icon/safari-pinned-tab.svg +38 -0
- data/app/assets/images/nfg_ui/app_icon/site.webmanifest.erb +19 -0
- data/app/assets/images/nfg_ui/email/icons/fa-caret-right.png +0 -0
- data/app/assets/images/nfg_ui/email/icons/fa-facebook.png +0 -0
- data/app/assets/images/nfg_ui/email/icons/fa-linkedin.png +0 -0
- data/app/assets/images/nfg_ui/email/icons/fa-twitter.png +0 -0
- data/app/assets/images/nfg_ui/email/icons/fa-youtube.png +0 -0
- data/app/assets/images/nfg_ui/email/nfg-logo.png +0 -0
- data/app/assets/javascripts/nfg_ui/application.coffee +16 -0
- data/app/assets/javascripts/nfg_ui/collapsible_toggle.coffee +47 -0
- data/app/assets/javascripts/nfg_ui/prevent_clickable_disabled_element.coffee +47 -0
- data/app/assets/javascripts/nfg_ui/vendor/select2.coffee +26 -0
- data/app/assets/javascripts/nfg_ui/vendor/tooltips.coffee +18 -0
- data/app/assets/stylesheets/nfg_ui/bootstrap/application.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/_variables.scss +1123 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/application.scss +23 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_alert.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_backgrounds.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_button-group.scss +8 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_buttons.scss +17 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_card.scss +20 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_custom.scss +20 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_custom_forms.scss +156 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_dropdown.scss +24 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_forms.scss +85 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_media.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_nav.scss +22 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_navbar.scss +132 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_progress.scss +3 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_reboot.scss +31 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_tables.scss +7 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_tooltip.scss +5 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_type.scss +82 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_campaign_card.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_campaign_preview.scss +25 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_content_section_buttons.scss +11 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_custom_questions_questionnaire.scss +84 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_custom_receipt_language.scss +15 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_email_preview.scss +24 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_interaction.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_mobile.scss +4 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_nav_step.scss +95 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_overlay_blocker.scss +49 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_page_header.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_product_icons.scss +45 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_redactor.scss +25 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_share_dropdown.scss +53 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_slat.scss +113 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_social_share.scss +44 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_status_indicator.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_ticket.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_tile.scss +71 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/application.scss +38 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/foundation_emails/_alignment.scss +93 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/foundation_emails/_button.scss +345 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_backgrounds.scss +15 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_layout.scss +33 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_rainbow_bar.scss +47 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_spacers.scss +60 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_typography.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/email/settings/_settings.scss +148 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/_variables.scss +1124 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/application.scss +23 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/application.scss +19 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_badge.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_buttons.scss +43 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_custom.scss +3 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_custom_forms.scss +50 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_forms.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_functions.scss +29 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_navbar.scss +18 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_reboot.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_type.scss +16 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_utilities.scss +8 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/custom/_everyday_default.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/custom/_nav_step.scss +20 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/plugins/_select2.scss +16 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/_variables.scss +13 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/application.scss +35 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_breadcrumb.scss +4 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_button-group.scss +10 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_card.scss +45 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_carousel.scss +18 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_custom-forms.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_custom.scss +4 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_forms.scss +68 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_grid.scss +4 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_input-group.scss +25 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_list-group.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_media.scss +5 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_mixins.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_modal.scss +28 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_nav.scss +21 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_navbar.scss +54 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_pagination.scss +1 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_progress.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_utilities.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/custom/_everyday_giving.scss +8 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/custom/_nav_step.scss +13 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/custom/_slat.scss +66 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/mixins/_breakpoints.scss +123 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/mixins/_grid-framework.scss +30 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/mixins/_grid.scss +10 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/utilities/_display.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/utilities/_flex.scss +49 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/plugins/_sticky_div.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_alert.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_buttons.scss +17 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_card.scss +6 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_carousel.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_custom.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_custom_forms.scss +156 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_dropdown.scss +1 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_event.scss +19 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_forms.scss +83 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_list-group.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_progress.scss +9 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_reboot.scss +31 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_tooltip.scss +5 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_type.scss +81 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_admin_bar.scss +20 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_background_variations.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_everyday_default.scss +43 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_everyday_story.scss +21 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_footer_links.scss +8 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_nav_step.scss +95 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_slat.scss +110 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_social_share.scss +44 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_ticket.scss +12 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_tile.scss +63 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_user_navbar.scss +33 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/plugins/_datepicker.scss +2 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/plugins/_select2.scss +216 -0
- data/app/assets/stylesheets/nfg_ui/network_for_good/public/plugins/_sticky_div.scss +11 -0
- data/app/controllers/nfg_ui/application_controller.rb +5 -0
- data/app/helpers/nfg_ui/application_helper.rb +27 -0
- data/app/helpers/nfg_ui/components/email_helpers.rb +8 -0
- data/app/helpers/nfg_ui/components/resource_themes_helper.rb +8 -0
- data/app/helpers/nfg_ui/components/tooltip_helper.rb +24 -0
- data/app/models/nfg_ui/application_record.rb +5 -0
- data/app/views/nfg_ui/app_icons/_icons.html.haml +10 -0
- data/app/views/nfg_ui/email/README.md +12 -0
- data/app/views/nfg_ui/email/_button.html.haml +12 -0
- data/app/views/nfg_ui/email/_email_signature.html.haml +4 -0
- data/app/views/nfg_ui/email/_footer.html.haml +16 -0
- data/app/views/nfg_ui/email/_header.html.haml +6 -0
- data/app/views/nfg_ui/email/_logo.html.haml +6 -0
- data/app/views/nfg_ui/email/_product_content_image.html.haml +7 -0
- data/app/views/nfg_ui/email/_rainbow_bar.html.haml +10 -0
- data/app/views/nfg_ui/email/_section_header.html.haml +8 -0
- data/app/views/nfg_ui/email/_social_network_link.html.haml +12 -0
- data/app/views/nfg_ui/email/_sub_footer.html.haml +9 -0
- data/app/views/nfg_ui/email/_table_row.html.haml +13 -0
- data/config/initializers/web_app_manifest.rb +3 -0
- data/config/locales/email.yml +34 -0
- data/config/locales/en.yml +63 -0
- data/config/routes.rb +2 -0
- data/config/spring.rb +1 -0
- data/lib/nfg_ui/bootstrap/components/alert.rb +52 -0
- data/lib/nfg_ui/bootstrap/components/badge.rb +39 -0
- data/lib/nfg_ui/bootstrap/components/base.rb +151 -0
- data/lib/nfg_ui/bootstrap/components/breadcrumb.rb +23 -0
- data/lib/nfg_ui/bootstrap/components/breadcrumb_item.rb +28 -0
- data/lib/nfg_ui/bootstrap/components/button.rb +74 -0
- data/lib/nfg_ui/bootstrap/components/button_group.rb +36 -0
- data/lib/nfg_ui/bootstrap/components/button_toolbar.rb +21 -0
- data/lib/nfg_ui/bootstrap/components/card.rb +81 -0
- data/lib/nfg_ui/bootstrap/components/card_body.rb +15 -0
- data/lib/nfg_ui/bootstrap/components/card_footer.rb +15 -0
- data/lib/nfg_ui/bootstrap/components/card_header.rb +35 -0
- data/lib/nfg_ui/bootstrap/components/card_image.rb +33 -0
- data/lib/nfg_ui/bootstrap/components/card_image_overlay.rb +46 -0
- data/lib/nfg_ui/bootstrap/components/carousel.rb +57 -0
- data/lib/nfg_ui/bootstrap/components/carousel_caption.rb +34 -0
- data/lib/nfg_ui/bootstrap/components/carousel_control.rb +73 -0
- data/lib/nfg_ui/bootstrap/components/carousel_indicators.rb +54 -0
- data/lib/nfg_ui/bootstrap/components/carousel_item.rb +49 -0
- data/lib/nfg_ui/bootstrap/components/collapse.rb +32 -0
- data/lib/nfg_ui/bootstrap/components/dropdown.rb +51 -0
- data/lib/nfg_ui/bootstrap/components/dropdown_divider.rb +19 -0
- data/lib/nfg_ui/bootstrap/components/dropdown_header.rb +23 -0
- data/lib/nfg_ui/bootstrap/components/dropdown_item.rb +41 -0
- data/lib/nfg_ui/bootstrap/components/dropdown_menu.rb +32 -0
- data/lib/nfg_ui/bootstrap/components/dropdown_toggle.rb +82 -0
- data/lib/nfg_ui/bootstrap/components/embed.rb +80 -0
- data/lib/nfg_ui/bootstrap/components/form.rb +13 -0
- data/lib/nfg_ui/bootstrap/components/input_group.rb +13 -0
- data/lib/nfg_ui/bootstrap/components/jumbotron.rb +13 -0
- data/lib/nfg_ui/bootstrap/components/list_group.rb +39 -0
- data/lib/nfg_ui/bootstrap/components/list_group_item.rb +69 -0
- data/lib/nfg_ui/bootstrap/components/media.rb +15 -0
- data/lib/nfg_ui/bootstrap/components/media_body.rb +15 -0
- data/lib/nfg_ui/bootstrap/components/media_object.rb +23 -0
- data/lib/nfg_ui/bootstrap/components/modal.rb +66 -0
- data/lib/nfg_ui/bootstrap/components/modal_body.rb +16 -0
- data/lib/nfg_ui/bootstrap/components/modal_footer.rb +16 -0
- data/lib/nfg_ui/bootstrap/components/modal_header.rb +37 -0
- data/lib/nfg_ui/bootstrap/components/nav.rb +71 -0
- data/lib/nfg_ui/bootstrap/components/nav_item.rb +103 -0
- data/lib/nfg_ui/bootstrap/components/nav_link.rb +62 -0
- data/lib/nfg_ui/bootstrap/components/navbar.rb +97 -0
- data/lib/nfg_ui/bootstrap/components/navbar_brand.rb +25 -0
- data/lib/nfg_ui/bootstrap/components/navbar_nav.rb +48 -0
- data/lib/nfg_ui/bootstrap/components/navbar_text.rb +21 -0
- data/lib/nfg_ui/bootstrap/components/navbar_toggler.rb +38 -0
- data/lib/nfg_ui/bootstrap/components/page_item.rb +66 -0
- data/lib/nfg_ui/bootstrap/components/pagination.rb +30 -0
- data/lib/nfg_ui/bootstrap/components/popover.rb +12 -0
- data/lib/nfg_ui/bootstrap/components/progress.rb +44 -0
- data/lib/nfg_ui/bootstrap/components/progress_bar.rb +51 -0
- data/lib/nfg_ui/bootstrap/components/tab_content.rb +15 -0
- data/lib/nfg_ui/bootstrap/components/tab_pane.rb +49 -0
- data/lib/nfg_ui/bootstrap/components/table.rb +17 -0
- data/lib/nfg_ui/bootstrap/readme.md +1 -0
- data/lib/nfg_ui/bootstrap/utilities/activatable.rb +32 -0
- data/lib/nfg_ui/bootstrap/utilities/alignable.rb +33 -0
- data/lib/nfg_ui/bootstrap/utilities/collapse_toggleable.rb +35 -0
- data/lib/nfg_ui/bootstrap/utilities/collapsible.rb +42 -0
- data/lib/nfg_ui/bootstrap/utilities/disableable.rb +49 -0
- data/lib/nfg_ui/bootstrap/utilities/dismissible.rb +24 -0
- data/lib/nfg_ui/bootstrap/utilities/dropdown_directionable.rb +40 -0
- data/lib/nfg_ui/bootstrap/utilities/headable.rb +20 -0
- data/lib/nfg_ui/bootstrap/utilities/modalable.rb +104 -0
- data/lib/nfg_ui/bootstrap/utilities/progressable.rb +42 -0
- data/lib/nfg_ui/bootstrap/utilities/remotable.rb +24 -0
- data/lib/nfg_ui/bootstrap/utilities/sizable.rb +40 -0
- data/lib/nfg_ui/bootstrap/utilities/themeable.rb +51 -0
- data/lib/nfg_ui/bootstrap/utilities/tooltipable.rb +95 -0
- data/lib/nfg_ui/bootstrap/utilities/wrappable.rb +48 -0
- data/lib/nfg_ui/components/base.rb +14 -0
- data/lib/nfg_ui/components/elements/activity.rb +10 -0
- data/lib/nfg_ui/components/elements/alert.rb +63 -0
- data/lib/nfg_ui/components/elements/badge.rb +32 -0
- data/lib/nfg_ui/components/elements/breadcrumb.rb +16 -0
- data/lib/nfg_ui/components/elements/breadcrumb_item.rb +16 -0
- data/lib/nfg_ui/components/elements/button.rb +97 -0
- data/lib/nfg_ui/components/elements/card_body.rb +15 -0
- data/lib/nfg_ui/components/elements/card_footer.rb +14 -0
- data/lib/nfg_ui/components/elements/card_header.rb +14 -0
- data/lib/nfg_ui/components/elements/card_image.rb +14 -0
- data/lib/nfg_ui/components/elements/card_image_overlay.rb +14 -0
- data/lib/nfg_ui/components/elements/carousel_caption.rb +14 -0
- data/lib/nfg_ui/components/elements/carousel_control.rb +14 -0
- data/lib/nfg_ui/components/elements/carousel_indicators.rb +23 -0
- data/lib/nfg_ui/components/elements/carousel_item.rb +16 -0
- data/lib/nfg_ui/components/elements/chart.rb +11 -0
- data/lib/nfg_ui/components/elements/dropdown_divider.rb +14 -0
- data/lib/nfg_ui/components/elements/dropdown_header.rb +14 -0
- data/lib/nfg_ui/components/elements/dropdown_item.rb +78 -0
- data/lib/nfg_ui/components/elements/dropdown_toggle.rb +37 -0
- data/lib/nfg_ui/components/elements/embed.rb +15 -0
- data/lib/nfg_ui/components/elements/form_control.rb +18 -0
- data/lib/nfg_ui/components/elements/input_group.rb +14 -0
- data/lib/nfg_ui/components/elements/key.rb +11 -0
- data/lib/nfg_ui/components/elements/list_group_item.rb +14 -0
- data/lib/nfg_ui/components/elements/loader.rb +11 -0
- data/lib/nfg_ui/components/elements/media_body.rb +14 -0
- data/lib/nfg_ui/components/elements/media_object.rb +12 -0
- data/lib/nfg_ui/components/elements/modal_body.rb +14 -0
- data/lib/nfg_ui/components/elements/modal_footer.rb +14 -0
- data/lib/nfg_ui/components/elements/modal_header.rb +14 -0
- data/lib/nfg_ui/components/elements/nav.rb +19 -0
- data/lib/nfg_ui/components/elements/nav_item.rb +39 -0
- data/lib/nfg_ui/components/elements/nav_link.rb +33 -0
- data/lib/nfg_ui/components/elements/navbar_brand.rb +15 -0
- data/lib/nfg_ui/components/elements/navbar_text.rb +14 -0
- data/lib/nfg_ui/components/elements/navbar_toggler.rb +14 -0
- data/lib/nfg_ui/components/elements/page_item.rb +14 -0
- data/lib/nfg_ui/components/elements/popover.rb +14 -0
- data/lib/nfg_ui/components/elements/progress_bar.rb +62 -0
- data/lib/nfg_ui/components/elements/slat_action.rb +14 -0
- data/lib/nfg_ui/components/elements/slat_body.rb +14 -0
- data/lib/nfg_ui/components/elements/slat_item.rb +62 -0
- data/lib/nfg_ui/components/elements/stat.rb +11 -0
- data/lib/nfg_ui/components/elements/step.rb +55 -0
- data/lib/nfg_ui/components/elements/step_indicator.rb +41 -0
- data/lib/nfg_ui/components/elements/tab_pane.rb +15 -0
- data/lib/nfg_ui/components/elements/table.rb +14 -0
- data/lib/nfg_ui/components/elements/task.rb +11 -0
- data/lib/nfg_ui/components/elements.rb +58 -0
- data/lib/nfg_ui/components/foundations/color.rb +11 -0
- data/lib/nfg_ui/components/foundations/grid.rb +11 -0
- data/lib/nfg_ui/components/foundations/icon.rb +82 -0
- data/lib/nfg_ui/components/foundations/image.rb +14 -0
- data/lib/nfg_ui/components/foundations/input.rb +11 -0
- data/lib/nfg_ui/components/foundations/typeface.rb +122 -0
- data/lib/nfg_ui/components/patterns/activity_feed.rb +11 -0
- data/lib/nfg_ui/components/patterns/button_group.rb +23 -0
- data/lib/nfg_ui/components/patterns/button_toolbar.rb +20 -0
- data/lib/nfg_ui/components/patterns/card.rb +39 -0
- data/lib/nfg_ui/components/patterns/carousel.rb +31 -0
- data/lib/nfg_ui/components/patterns/collapse.rb +31 -0
- data/lib/nfg_ui/components/patterns/dropdown.rb +27 -0
- data/lib/nfg_ui/components/patterns/dropdown_menu.rb +16 -0
- data/lib/nfg_ui/components/patterns/empty_state.rb +11 -0
- data/lib/nfg_ui/components/patterns/filter_bar.rb +11 -0
- data/lib/nfg_ui/components/patterns/form_group.rb +11 -0
- data/lib/nfg_ui/components/patterns/graph.rb +11 -0
- data/lib/nfg_ui/components/patterns/jumbotron.rb +14 -0
- data/lib/nfg_ui/components/patterns/list_group.rb +16 -0
- data/lib/nfg_ui/components/patterns/media.rb +14 -0
- data/lib/nfg_ui/components/patterns/modal.rb +15 -0
- data/lib/nfg_ui/components/patterns/navbar.rb +17 -0
- data/lib/nfg_ui/components/patterns/navbar_nav.rb +17 -0
- data/lib/nfg_ui/components/patterns/page_header.rb +85 -0
- data/lib/nfg_ui/components/patterns/pagination.rb +14 -0
- data/lib/nfg_ui/components/patterns/progress.rb +24 -0
- data/lib/nfg_ui/components/patterns/slat.rb +14 -0
- data/lib/nfg_ui/components/patterns/slat_actions.rb +115 -0
- data/lib/nfg_ui/components/patterns/slat_header.rb +23 -0
- data/lib/nfg_ui/components/patterns/slat_list.rb +18 -0
- data/lib/nfg_ui/components/patterns/slats.rb +14 -0
- data/lib/nfg_ui/components/patterns/steps.rb +27 -0
- data/lib/nfg_ui/components/patterns/tab_content.rb +14 -0
- data/lib/nfg_ui/components/patterns/task_list.rb +11 -0
- data/lib/nfg_ui/components/patterns/tile.rb +58 -0
- data/lib/nfg_ui/components/patterns/tile_body.rb +29 -0
- data/lib/nfg_ui/components/patterns/tile_header.rb +40 -0
- data/lib/nfg_ui/components/patterns/tile_section.rb +29 -0
- data/lib/nfg_ui/components/traits/active.rb +14 -0
- data/lib/nfg_ui/components/traits/alert.rb +36 -0
- data/lib/nfg_ui/components/traits/alignment.rb +26 -0
- data/lib/nfg_ui/components/traits/button.rb +47 -0
- data/lib/nfg_ui/components/traits/button_group.rb +22 -0
- data/lib/nfg_ui/components/traits/card.rb +14 -0
- data/lib/nfg_ui/components/traits/collapse.rb +29 -0
- data/lib/nfg_ui/components/traits/disable.rb +19 -0
- data/lib/nfg_ui/components/traits/disable_with.rb +14 -0
- data/lib/nfg_ui/components/traits/dismiss.rb +16 -0
- data/lib/nfg_ui/components/traits/dropdown_toggle.rb +14 -0
- data/lib/nfg_ui/components/traits/icon.rb +16 -0
- data/lib/nfg_ui/components/traits/list_group.rb +16 -0
- data/lib/nfg_ui/components/traits/muted.rb +16 -0
- data/lib/nfg_ui/components/traits/nav.rb +26 -0
- data/lib/nfg_ui/components/traits/nav_item.rb +16 -0
- data/lib/nfg_ui/components/traits/navbar.rb +18 -0
- data/lib/nfg_ui/components/traits/page_header.rb +16 -0
- data/lib/nfg_ui/components/traits/pill.rb +14 -0
- data/lib/nfg_ui/components/traits/progress_bar.rb +24 -0
- data/lib/nfg_ui/components/traits/remote.rb +14 -0
- data/lib/nfg_ui/components/traits/size.rb +18 -0
- data/lib/nfg_ui/components/traits/slat_item.rb +28 -0
- data/lib/nfg_ui/components/traits/step.rb +14 -0
- data/lib/nfg_ui/components/traits/theme.rb +57 -0
- data/lib/nfg_ui/components/traits/typeface.rb +53 -0
- data/lib/nfg_ui/components/traits/vertical.rb +16 -0
- data/lib/nfg_ui/components/traits.rb +43 -0
- data/lib/nfg_ui/components/utilities/browser_detectable.rb +16 -0
- data/lib/nfg_ui/components/utilities/confirmable.rb +24 -0
- data/lib/nfg_ui/components/utilities/describable.rb +22 -0
- data/lib/nfg_ui/components/utilities/disable_withable.rb +26 -0
- data/lib/nfg_ui/components/utilities/emailable.rb +44 -0
- data/lib/nfg_ui/components/utilities/iconable.rb +20 -0
- data/lib/nfg_ui/components/utilities/left_iconable.rb +22 -0
- data/lib/nfg_ui/components/utilities/methodable.rb +24 -0
- data/lib/nfg_ui/components/utilities/renderable.rb +24 -0
- data/lib/nfg_ui/components/utilities/resource_themeable.rb +49 -0
- data/lib/nfg_ui/components/utilities/titleable.rb +20 -0
- data/lib/nfg_ui/components/utilities/traitable.rb +32 -0
- data/lib/nfg_ui/components/utilities/vertically_alignable.rb +31 -0
- data/lib/nfg_ui/components/utilities.rb +22 -0
- data/lib/nfg_ui/engine.rb +45 -0
- data/lib/nfg_ui/ui/base.rb +35 -0
- data/lib/nfg_ui/ui/bootstrap.rb +44 -0
- data/lib/nfg_ui/ui/network_for_good.rb +54 -0
- data/lib/nfg_ui/ui/utilities/initializer.rb +88 -0
- data/lib/nfg_ui/ui/utilities.rb +10 -0
- data/lib/nfg_ui/version.rb +5 -0
- data/lib/nfg_ui.rb +174 -0
- data/lib/tasks/nfg_ui_tasks.rake +53 -0
- metadata +741 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Carousel Control Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/carousel/#with-controls
|
8
|
+
class CarouselControl < NfgUi::Bootstrap::Components::Base
|
9
|
+
# CarouselControl does not get adjustable body content
|
10
|
+
def body
|
11
|
+
nil
|
12
|
+
end
|
13
|
+
|
14
|
+
def component_family
|
15
|
+
:carousel
|
16
|
+
end
|
17
|
+
|
18
|
+
def carousel
|
19
|
+
options.fetch(:carousel, nil)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Options for control are :prev and :next
|
23
|
+
# control's value sets up the rest of the carousel control attributes in HTML
|
24
|
+
def control
|
25
|
+
options.fetch(:control, nil)
|
26
|
+
end
|
27
|
+
|
28
|
+
def data
|
29
|
+
control ? super.merge!(slide: control) : super
|
30
|
+
end
|
31
|
+
|
32
|
+
def href
|
33
|
+
carousel ? carousel : '#'
|
34
|
+
end
|
35
|
+
|
36
|
+
def icon_html_options
|
37
|
+
return {} unless control
|
38
|
+
{ class: "carousel-control-#{control}-icon", aria: { hidden: true } }
|
39
|
+
end
|
40
|
+
|
41
|
+
def render
|
42
|
+
super do
|
43
|
+
capture do
|
44
|
+
if control
|
45
|
+
concat(content_tag(:span, nil, icon_html_options))
|
46
|
+
concat(content_tag(:span, control.to_s, class: 'sr-only'))
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def base_element
|
55
|
+
:a
|
56
|
+
end
|
57
|
+
|
58
|
+
def assistive_html_attributes
|
59
|
+
super.merge!(role: 'button')
|
60
|
+
end
|
61
|
+
|
62
|
+
# next is a reserved word, for here, we'll refer to options[:next]
|
63
|
+
def component_css_class
|
64
|
+
control ? "#{super}-#{control}" : super
|
65
|
+
end
|
66
|
+
|
67
|
+
def non_html_attribute_options
|
68
|
+
super.push(:control, :carousel)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Carousel Indicators Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/carousel/#with-indicators
|
8
|
+
class CarouselIndicators < NfgUi::Bootstrap::Components::Base
|
9
|
+
def active
|
10
|
+
options.fetch(:active, 1) # allow nil so that no indicator is active if desired
|
11
|
+
end
|
12
|
+
|
13
|
+
# Carousel Indicators do not accept a body
|
14
|
+
def body
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def component_family
|
19
|
+
:carousel
|
20
|
+
end
|
21
|
+
|
22
|
+
def count
|
23
|
+
options[:count] || 0 # return 0 when nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def carousel
|
27
|
+
options.fetch(:carousel, nil)
|
28
|
+
end
|
29
|
+
|
30
|
+
def render
|
31
|
+
super do
|
32
|
+
capture do
|
33
|
+
count.times do |i|
|
34
|
+
concat(content_tag(:li, nil, class: ('active' if active == i + 1), data: { target: carousel, slide_to: i }))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def base_element
|
43
|
+
:ol
|
44
|
+
end
|
45
|
+
|
46
|
+
def non_html_attribute_options
|
47
|
+
super.push(:active,
|
48
|
+
:count,
|
49
|
+
:carousel)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Carousel Slide / Carousel Item Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/carousel/#slides-only
|
8
|
+
class CarouselItem < NfgUi::Bootstrap::Components::Base
|
9
|
+
include Bootstrap::Utilities::Activatable
|
10
|
+
|
11
|
+
def caption
|
12
|
+
options.fetch(:caption, nil)
|
13
|
+
end
|
14
|
+
|
15
|
+
def component_family
|
16
|
+
:carousel
|
17
|
+
end
|
18
|
+
|
19
|
+
def image
|
20
|
+
options.fetch(:image, nil)
|
21
|
+
end
|
22
|
+
|
23
|
+
def label
|
24
|
+
options.fetch(:label, nil)
|
25
|
+
end
|
26
|
+
|
27
|
+
def render
|
28
|
+
super do
|
29
|
+
capture do
|
30
|
+
concat(image_tag(image, class: 'd-block w-100')) if image
|
31
|
+
if caption || label
|
32
|
+
concat(NfgUi::Bootstrap::Components::CarouselCaption.new({ body: caption, label: label }, view_context).render)
|
33
|
+
end
|
34
|
+
concat(block_given? ? yield : body)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def non_html_attribute_options
|
42
|
+
super.push(:image,
|
43
|
+
:caption,
|
44
|
+
:label)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module NfgUi
|
2
|
+
module Bootstrap
|
3
|
+
module Components
|
4
|
+
# Bootstrap Collapse Component
|
5
|
+
# https://getbootstrap.com/docs/4.1/components/collapse/
|
6
|
+
class Collapse < NfgUi::Bootstrap::Components::Base
|
7
|
+
include Bootstrap::Utilities::Collapsible
|
8
|
+
# def collapsed
|
9
|
+
# options.fetch(:collapsed, false)
|
10
|
+
# end
|
11
|
+
|
12
|
+
def navbar
|
13
|
+
options.fetch(:navbar, false)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def css_classes
|
19
|
+
[
|
20
|
+
super,
|
21
|
+
('show' unless collapsed || navbar),
|
22
|
+
('navbar-collapse' if navbar)
|
23
|
+
].join(' ').squish
|
24
|
+
end
|
25
|
+
|
26
|
+
def non_html_attribute_options
|
27
|
+
super.push(:collapsed, :navbar)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Dropdown Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/dropdowns/
|
8
|
+
class Dropdown < NfgUi::Bootstrap::Components::Base
|
9
|
+
include Bootstrap::Utilities::DropdownDirectionable
|
10
|
+
|
11
|
+
def button
|
12
|
+
options.fetch(:button, '')
|
13
|
+
end
|
14
|
+
|
15
|
+
def component_family
|
16
|
+
:dropdown
|
17
|
+
end
|
18
|
+
|
19
|
+
def offset
|
20
|
+
options.fetch(:offset, '')
|
21
|
+
end
|
22
|
+
|
23
|
+
def theme
|
24
|
+
options.fetch(:theme, NfgUi::DEFAULT_BOOTSTRAP_THEME)
|
25
|
+
end
|
26
|
+
|
27
|
+
def render
|
28
|
+
super do
|
29
|
+
capture do
|
30
|
+
if button.present?
|
31
|
+
concat(NfgUi::Bootstrap::Components::DropdownToggle.new({ body: button, theme: theme, as: :button, offset: offset }, view_context).render)
|
32
|
+
end
|
33
|
+
concat(block_given? ? yield : body)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def non_html_attribute_options
|
41
|
+
super.push(:theme,
|
42
|
+
:button,
|
43
|
+
:offset,
|
44
|
+
:dropleft,
|
45
|
+
:dropright,
|
46
|
+
:dropup)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Dropdown Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/dropdowns/
|
8
|
+
class DropdownDivider < NfgUi::Bootstrap::Components::Base
|
9
|
+
def component_family
|
10
|
+
:dropdown
|
11
|
+
end
|
12
|
+
|
13
|
+
def render
|
14
|
+
content_tag(:div, nil, html_options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Dropdown Header Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/dropdowns/#headers
|
8
|
+
class DropdownHeader < NfgUi::Bootstrap::Components::Base
|
9
|
+
def heading
|
10
|
+
options.fetch(:heading, '')
|
11
|
+
end
|
12
|
+
|
13
|
+
def component_family
|
14
|
+
:dropdown
|
15
|
+
end
|
16
|
+
|
17
|
+
def render
|
18
|
+
content_tag(:h6, heading, html_options)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Dropdown Items Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/dropdowns/#menu-items
|
8
|
+
class DropdownItem < NfgUi::Bootstrap::Components::Base
|
9
|
+
include Bootstrap::Utilities::Wrappable
|
10
|
+
include Bootstrap::Utilities::Activatable
|
11
|
+
include Bootstrap::Utilities::Disableable
|
12
|
+
include Bootstrap::Utilities::Tooltipable
|
13
|
+
include Bootstrap::Utilities::Remotable
|
14
|
+
|
15
|
+
def component_family
|
16
|
+
:dropdown
|
17
|
+
end
|
18
|
+
|
19
|
+
def render
|
20
|
+
if tooltip && disabled
|
21
|
+
content_tag(:span, disabled_component_tooltip_wrapper_html_options) do
|
22
|
+
content_tag(as, html_options.except(:href)) do
|
23
|
+
(block_given? ? yield : body)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
else
|
27
|
+
content_tag(as, html_options) do
|
28
|
+
(block_given? ? yield : body)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def default_html_wrapper_element
|
36
|
+
:a
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Dropdown Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/dropdowns/
|
8
|
+
class DropdownMenu < NfgUi::Bootstrap::Components::Base
|
9
|
+
def component_family
|
10
|
+
:dropdown
|
11
|
+
end
|
12
|
+
|
13
|
+
def right
|
14
|
+
options.fetch(:right, false)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def css_classes
|
20
|
+
[
|
21
|
+
super,
|
22
|
+
('dropdown-menu-right' if right)
|
23
|
+
].join(' ').squish
|
24
|
+
end
|
25
|
+
|
26
|
+
def non_html_attribute_options
|
27
|
+
super.push(:right)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Dropdown Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/dropdowns/
|
8
|
+
class DropdownToggle < NfgUi::Bootstrap::Components::Base
|
9
|
+
include Bootstrap::Utilities::Wrappable
|
10
|
+
include Bootstrap::Utilities::Sizable
|
11
|
+
|
12
|
+
def component_family
|
13
|
+
:dropdown
|
14
|
+
end
|
15
|
+
|
16
|
+
def data
|
17
|
+
data_toggle = (options[:data] || {}).merge!(toggle: 'dropdown')
|
18
|
+
offset.present? ? { **data_toggle, offset: offset } : data_toggle
|
19
|
+
end
|
20
|
+
|
21
|
+
def href
|
22
|
+
as == :a ? '#' : super
|
23
|
+
end
|
24
|
+
|
25
|
+
def nav_link
|
26
|
+
options.fetch(:nav_link, false)
|
27
|
+
end
|
28
|
+
|
29
|
+
def offset
|
30
|
+
options.fetch(:offset, '')
|
31
|
+
end
|
32
|
+
|
33
|
+
def split
|
34
|
+
options.fetch(:split, false)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Bypass & Skip Bootstrap::Utilities::Themeable module
|
38
|
+
# this method just passes the options[:theme] to the button component
|
39
|
+
# Otherwise, if utilizing :button AND Themeable,
|
40
|
+
# we end up with duplicate theme css classes being sent to the button...
|
41
|
+
# ex: <button class='btn-danger btn-danger'...>
|
42
|
+
def theme
|
43
|
+
options.fetch(:theme, NfgUi::DEFAULT_BOOTSTRAP_THEME)
|
44
|
+
end
|
45
|
+
|
46
|
+
def render
|
47
|
+
NfgUi::Bootstrap::Components::Button.new({ as: as, theme: theme, **html_options, remove_component_css_classes: nav_link }, view_context).render do
|
48
|
+
(block_given? ? yield : body)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def css_classes
|
55
|
+
[
|
56
|
+
super,
|
57
|
+
("#{component_css_class}-split" if split)
|
58
|
+
].join(' ').squish
|
59
|
+
end
|
60
|
+
|
61
|
+
def assistive_html_attributes
|
62
|
+
{ aria: { haspopup: 'true', expanded: 'false' } }
|
63
|
+
end
|
64
|
+
|
65
|
+
def default_html_wrapper_element
|
66
|
+
:button
|
67
|
+
end
|
68
|
+
|
69
|
+
def non_html_attribute_options
|
70
|
+
super.push(:offset, :nav_link)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Toggle, in html, is a customized button, so sizing a toggle requires using the
|
74
|
+
# button prefix -- otherwise it'll end up as
|
75
|
+
# 'dropdown-toggle-lg' or 'dropdown-toggle-sm', etc
|
76
|
+
def size_css_class_prefix
|
77
|
+
'btn'
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Responsive Embed Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/utilities/embed/
|
8
|
+
class Embed < NfgUi::Bootstrap::Components::Base
|
9
|
+
def aspect_ratio
|
10
|
+
options.fetch(:aspect_ratio, default_aspect_ratio) || default_aspect_ratio
|
11
|
+
end
|
12
|
+
|
13
|
+
def iframe
|
14
|
+
return unless iframe?
|
15
|
+
view_context.content_tag :iframe, nil, src: src, class: 'embed-responsive-item', allowfullscreen: true
|
16
|
+
end
|
17
|
+
|
18
|
+
def iframe?
|
19
|
+
options[:iframe].present?
|
20
|
+
end
|
21
|
+
|
22
|
+
def autoplay
|
23
|
+
options.fetch(:autoplay, default_autoplay)
|
24
|
+
end
|
25
|
+
|
26
|
+
def render
|
27
|
+
super do
|
28
|
+
if iframe?
|
29
|
+
iframe
|
30
|
+
else
|
31
|
+
(block_given? ? yield : body)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def component_css_class
|
39
|
+
'embed-responsive'
|
40
|
+
end
|
41
|
+
|
42
|
+
def src
|
43
|
+
return unless iframe?
|
44
|
+
options[:iframe] + (autoplay ? '?autoplay=1' : '')
|
45
|
+
end
|
46
|
+
|
47
|
+
def css_classes
|
48
|
+
return super unless allowed_aspect_ratios.include?(aspect_ratio)
|
49
|
+
super + " embed-responsive-#{aspect_ratio.gsub("\:", 'by')}"
|
50
|
+
end
|
51
|
+
|
52
|
+
def allowed_aspect_ratios
|
53
|
+
%w[21:9 16:9 4:3 1:1]
|
54
|
+
end
|
55
|
+
|
56
|
+
def default_aspect_ratio
|
57
|
+
'16:9'
|
58
|
+
end
|
59
|
+
|
60
|
+
# def default_iframe
|
61
|
+
# ''
|
62
|
+
# end
|
63
|
+
|
64
|
+
def non_html_attribute_options
|
65
|
+
super.push(:iframe, :aspect_ratio, :autoplay)
|
66
|
+
end
|
67
|
+
|
68
|
+
# def defaults
|
69
|
+
# super.merge!(iframe: default_iframe,
|
70
|
+
# aspect_ratio: default_aspect_ratio,
|
71
|
+
# autoplay: default_autoplay)
|
72
|
+
# end
|
73
|
+
|
74
|
+
def default_autoplay
|
75
|
+
false
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Input Group Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/input-group/
|
8
|
+
class InputGroup < NfgUi::Bootstrap::Components::Base
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap Jumbotron Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/jumbotron/
|
8
|
+
class Jumbotron < NfgUi::Bootstrap::Components::Base
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap List Group Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/list-group/
|
8
|
+
class ListGroup < NfgUi::Bootstrap::Components::Base
|
9
|
+
include Bootstrap::Utilities::Wrappable
|
10
|
+
|
11
|
+
def component_family
|
12
|
+
:list_group
|
13
|
+
end
|
14
|
+
|
15
|
+
def flush
|
16
|
+
options.fetch(:flush, false)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def base_element
|
22
|
+
as
|
23
|
+
end
|
24
|
+
|
25
|
+
def css_classes
|
26
|
+
flush ? super + " #{component_css_class}-flush" : super
|
27
|
+
end
|
28
|
+
|
29
|
+
def default_html_wrapper_element
|
30
|
+
:ul
|
31
|
+
end
|
32
|
+
|
33
|
+
def non_html_attribute_options
|
34
|
+
super.push(:flush)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NfgUi
|
4
|
+
module Bootstrap
|
5
|
+
module Components
|
6
|
+
# Bootstrap List Group Item Component
|
7
|
+
# https://getbootstrap.com/docs/4.1/components/list-group/
|
8
|
+
class ListGroupItem < NfgUi::Bootstrap::Components::Base
|
9
|
+
include Bootstrap::Utilities::Wrappable
|
10
|
+
include Bootstrap::Utilities::Activatable
|
11
|
+
include Bootstrap::Utilities::Disableable
|
12
|
+
include Bootstrap::Utilities::Themeable
|
13
|
+
|
14
|
+
def component_family
|
15
|
+
:list_group
|
16
|
+
end
|
17
|
+
|
18
|
+
def action
|
19
|
+
options.fetch(:action, false)
|
20
|
+
end
|
21
|
+
|
22
|
+
def badge
|
23
|
+
options.fetch(:badge, nil)
|
24
|
+
end
|
25
|
+
|
26
|
+
def render
|
27
|
+
super do
|
28
|
+
capture do
|
29
|
+
concat(block_given? ? yield : body)
|
30
|
+
if badge
|
31
|
+
concat(NfgUi::Bootstrap::Components::Badge.new({ pill: true, theme: (theme || NfgUi::DEFAULT_BOOTSTRAP_THEME), body: badge }, view_context).render)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def base_element
|
40
|
+
as
|
41
|
+
end
|
42
|
+
|
43
|
+
def default_theme
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
|
47
|
+
def default_html_wrapper_element
|
48
|
+
:li
|
49
|
+
end
|
50
|
+
|
51
|
+
def css_classes
|
52
|
+
[
|
53
|
+
super,
|
54
|
+
("#{component_css_class}-action" if action),
|
55
|
+
('d-flex justify-content-between align-items-center' if badge)
|
56
|
+
].join(' ').squish
|
57
|
+
end
|
58
|
+
|
59
|
+
def non_html_attribute_options
|
60
|
+
super.push(:action, :badge)
|
61
|
+
end
|
62
|
+
|
63
|
+
def outlineable?
|
64
|
+
false
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|