nfg_ui 0.9.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Traits
|
|
6
|
+
# Access to pre-designed Alert traits
|
|
7
|
+
module Typeface
|
|
8
|
+
TRAITS = %i[body
|
|
9
|
+
caption
|
|
10
|
+
heading
|
|
11
|
+
subheading
|
|
12
|
+
title
|
|
13
|
+
muted
|
|
14
|
+
truncate].freeze
|
|
15
|
+
|
|
16
|
+
def body_trait
|
|
17
|
+
self.as = body_tag
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# TODO: this was a tricky one and needs specs (as well as other traits need this spec)
|
|
21
|
+
# Write a spec that tests that the typeface is ACTUALLY a caption
|
|
22
|
+
# this was identified earlier as not happening because we'd set the as option
|
|
23
|
+
# but it wasn't spitting out the caption css_class...
|
|
24
|
+
# after some exploring it turned out the component didn't understand that it
|
|
25
|
+
# was actually a caption... it just looked like one.
|
|
26
|
+
def caption_trait
|
|
27
|
+
self.as = caption_tag
|
|
28
|
+
options[:caption] = body
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def heading_trait
|
|
32
|
+
self.as = heading_tag
|
|
33
|
+
options[:heading] = body
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def subheading_trait
|
|
37
|
+
self.as = subheading_tag
|
|
38
|
+
options[:subheading] = body
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def title_trait
|
|
42
|
+
self.as = title_tag
|
|
43
|
+
options[:title] = body
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Add the css class 'text-truncate' to a typeface component
|
|
47
|
+
def truncate_trait
|
|
48
|
+
options[:class] = [options.try(:[], :class), 'text-truncate'].join(' ').squish
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Traits
|
|
6
|
+
# Access to pre-designed theme traits
|
|
7
|
+
module Vertical
|
|
8
|
+
TRAITS = %i[vertical].freeze
|
|
9
|
+
|
|
10
|
+
def vertical_trait
|
|
11
|
+
options[:vertical] = true
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
# Centralizes and autoloads traits for design system components
|
|
6
|
+
# Trait modules must have the same name as the component they represent.
|
|
7
|
+
# This provides autoloading of traits.
|
|
8
|
+
module Traits
|
|
9
|
+
TRAIT_MODULES = %i[Active
|
|
10
|
+
Alert
|
|
11
|
+
Alignment
|
|
12
|
+
Button
|
|
13
|
+
ButtonGroup
|
|
14
|
+
Card
|
|
15
|
+
Collapse
|
|
16
|
+
Disable
|
|
17
|
+
DisableWith
|
|
18
|
+
Dismiss
|
|
19
|
+
DropdownToggle
|
|
20
|
+
Icon
|
|
21
|
+
ListGroup
|
|
22
|
+
Muted
|
|
23
|
+
Nav
|
|
24
|
+
Navbar
|
|
25
|
+
NavItem
|
|
26
|
+
PageHeader
|
|
27
|
+
Pill
|
|
28
|
+
ProgressBar
|
|
29
|
+
Remote
|
|
30
|
+
Size
|
|
31
|
+
Step
|
|
32
|
+
SlatItem
|
|
33
|
+
Theme
|
|
34
|
+
Typeface
|
|
35
|
+
Vertical].freeze
|
|
36
|
+
|
|
37
|
+
extend ActiveSupport::Autoload
|
|
38
|
+
TRAIT_MODULES.each { |trait_module| autoload trait_module }
|
|
39
|
+
|
|
40
|
+
REGISTERED_TRAITS = TRAIT_MODULES.collect { |trait| "NfgUi::Components::Traits::#{trait}::TRAITS".constantize }.reject(&:empty?).flatten
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Add browser detection to the desired component
|
|
7
|
+
module BrowserDetectable
|
|
8
|
+
require 'browser'
|
|
9
|
+
|
|
10
|
+
def browser
|
|
11
|
+
Browser.new(user_agent: view_context.request.env['HTTP_USER_AGENT'])
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Allows components to be setup to accept method: options
|
|
7
|
+
module Confirmable
|
|
8
|
+
def confirm
|
|
9
|
+
options.fetch(:confirm, nil)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def data
|
|
13
|
+
confirm ? super.merge!(confirm: confirm) : super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def non_html_attribute_options
|
|
19
|
+
super.push(:confirm)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module NfgUi
|
|
2
|
+
module Components
|
|
3
|
+
module Utilities
|
|
4
|
+
# Allows components to be setup to accept icons
|
|
5
|
+
module Describable
|
|
6
|
+
def describe
|
|
7
|
+
options.fetch(:describe, nil)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def data
|
|
11
|
+
describe ? super.merge!(describe: describe) : super
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def non_html_attribute_options
|
|
17
|
+
super.push(:describe)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module NfgUi
|
|
2
|
+
module Components
|
|
3
|
+
module Utilities
|
|
4
|
+
# Allows components to be setup to utilize disable_with
|
|
5
|
+
module DisableWithable
|
|
6
|
+
def data
|
|
7
|
+
disable_with ? super.merge!(disable_with: disable_with) : super
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def disable_with
|
|
11
|
+
options.fetch(:disable_with, nil)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def default_disable_with
|
|
17
|
+
@default_disable_with ||= view_context.ui.nfg(:icon, :loader, text: 'Saving...')
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def non_html_attribute_options
|
|
21
|
+
super.push(:disable_with)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module NfgUi
|
|
2
|
+
module Components
|
|
3
|
+
module Utilities
|
|
4
|
+
module Emailable
|
|
5
|
+
def spacer(size)
|
|
6
|
+
# Used in situations where you're utilizing a spacer value based on 12, ex:
|
|
7
|
+
# %spacer{ size: spacer(:double) } is the same as %spacer{ size: "24" }
|
|
8
|
+
case size
|
|
9
|
+
when :quarter then spacer_base / 4
|
|
10
|
+
when :half then spacer_base / 2
|
|
11
|
+
when :base then spacer_base
|
|
12
|
+
when :base_half then spacer_base * 1.5
|
|
13
|
+
when :double then spacer_base * 2
|
|
14
|
+
when :double_half then spacer_base * 2.5
|
|
15
|
+
when :triple then spacer_base * 3
|
|
16
|
+
when :triple_half then spacer_base * 3.5
|
|
17
|
+
when :quadruple then spacer_base * 4
|
|
18
|
+
when :quadruple_half then spacer_base * 4.5
|
|
19
|
+
else
|
|
20
|
+
size # allows for backup scenarios like %spacer{ size: spacer(120) }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def theme_color(theme_color)
|
|
25
|
+
|
|
26
|
+
# Centralizes theme color utilization (like spacer), ex:
|
|
27
|
+
# = render "product_content", theme_color: theme_color(:primary)
|
|
28
|
+
case theme_color
|
|
29
|
+
when :primary then "primary"
|
|
30
|
+
when :success then "success"
|
|
31
|
+
when :warning then "warning"
|
|
32
|
+
when :alert then "alert"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def spacer_base
|
|
39
|
+
12
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Allows components to be setup to accept icons
|
|
7
|
+
module Iconable
|
|
8
|
+
def icon
|
|
9
|
+
options.fetch(:icon, nil)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def non_html_attribute_options
|
|
15
|
+
super.push(:icon, :text)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Allows components to be setup to accept left icons
|
|
7
|
+
# Pass in a text value to identify the correct icon to be placed
|
|
8
|
+
# on the left side of the component.
|
|
9
|
+
module LeftIconable
|
|
10
|
+
def left_icon
|
|
11
|
+
options.fetch(:left_icon, nil)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def non_html_attribute_options
|
|
17
|
+
super.push(:left_icon)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Allows components to be setup to accept method: options
|
|
7
|
+
module Methodable
|
|
8
|
+
def method
|
|
9
|
+
options.fetch(:method, nil)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def data
|
|
13
|
+
send(:method) ? super.merge!(method: send(:method)) : super
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def non_html_attribute_options
|
|
19
|
+
super.push(:method)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module NfgUi
|
|
2
|
+
module Components
|
|
3
|
+
module Utilities
|
|
4
|
+
# Allows us to skip -if statements in our code and directly
|
|
5
|
+
# setup a render_if / render_unless right on the component.
|
|
6
|
+
module Renderable
|
|
7
|
+
def render_if
|
|
8
|
+
options.fetch(:render_if, nil)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def render_unless
|
|
12
|
+
options.fetch(:render_unless, nil)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def non_html_attribute_options
|
|
18
|
+
super.push(:render_if,
|
|
19
|
+
:render_unless)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# The library of dedicated theme resources in Evo & DMS
|
|
7
|
+
module ResourceThemeable
|
|
8
|
+
# attr_reader :view_context
|
|
9
|
+
|
|
10
|
+
def resource_theme_color(object = nil)
|
|
11
|
+
resource_theme_name = resource_theme_name(object)
|
|
12
|
+
case resource_theme_name
|
|
13
|
+
when 'Project'
|
|
14
|
+
'primary'
|
|
15
|
+
when 'Campaign'
|
|
16
|
+
'primary'
|
|
17
|
+
else
|
|
18
|
+
'primary'
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def resource_theme_name(object = nil)
|
|
23
|
+
if object.present?
|
|
24
|
+
if object.is_a?(String)
|
|
25
|
+
object
|
|
26
|
+
elsif object.is_a?(Class)
|
|
27
|
+
object.name
|
|
28
|
+
else
|
|
29
|
+
object.class.name
|
|
30
|
+
end
|
|
31
|
+
else
|
|
32
|
+
controller_name.split('/').last.classify
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def resource_theme_icon(object = nil)
|
|
37
|
+
case resource_theme_name(object)
|
|
38
|
+
when 'Project'
|
|
39
|
+
'bullhorn'
|
|
40
|
+
when 'Campaign'
|
|
41
|
+
'bullhorn'
|
|
42
|
+
else
|
|
43
|
+
'heart-o'
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Allows NFG design system components to utilize the :title option
|
|
7
|
+
module Titleable
|
|
8
|
+
def title
|
|
9
|
+
options.fetch(:title, nil)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def non_html_attribute_options
|
|
15
|
+
super.push(:title)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
module Utilities
|
|
6
|
+
# Manages trait system
|
|
7
|
+
module Traitable
|
|
8
|
+
include NfgUi::Components::Traits
|
|
9
|
+
|
|
10
|
+
def utility_initialize
|
|
11
|
+
super
|
|
12
|
+
initialize_traits
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def traits
|
|
16
|
+
options[:traits] || []
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def initialize_traits
|
|
22
|
+
return unless traits.any?
|
|
23
|
+
|
|
24
|
+
traits.each do |trait|
|
|
25
|
+
next unless NfgUi::Components::Traits::REGISTERED_TRAITS.include?(trait)
|
|
26
|
+
send("#{trait}_trait")
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module NfgUi
|
|
2
|
+
module Components
|
|
3
|
+
module Utilities
|
|
4
|
+
module VerticallyAlignable
|
|
5
|
+
# Can also pass in responsive variations
|
|
6
|
+
# align_items: :sm_center
|
|
7
|
+
def align_items
|
|
8
|
+
options.fetch(:align_items, nil)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def align_self
|
|
12
|
+
options.fetch(:align_self, nil)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def css_classes
|
|
18
|
+
[
|
|
19
|
+
super,
|
|
20
|
+
("d-flex align-items-#{align_items.to_s.dasherize}" if align_items),
|
|
21
|
+
("d-flex align-self-#{align_self.to_s.dasherize}" if align_self)
|
|
22
|
+
].join(' ').squish
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def non_html_attribute_options
|
|
26
|
+
super.push(:align_items)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module Components
|
|
5
|
+
# Autoloads utilities unique for NFG design system components
|
|
6
|
+
module Utilities
|
|
7
|
+
extend ActiveSupport::Autoload
|
|
8
|
+
autoload :BrowserDetectable
|
|
9
|
+
autoload :Confirmable
|
|
10
|
+
autoload :Describable
|
|
11
|
+
autoload :DisableWithable
|
|
12
|
+
autoload :Emailable
|
|
13
|
+
autoload :Iconable
|
|
14
|
+
autoload :Methodable
|
|
15
|
+
autoload :Titleable
|
|
16
|
+
autoload :Traitable
|
|
17
|
+
autoload :Renderable
|
|
18
|
+
autoload :ResourceThemeable
|
|
19
|
+
autoload :VerticallyAlignable
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
class Engine < ::Rails::Engine
|
|
5
|
+
isolate_namespace NfgUi
|
|
6
|
+
|
|
7
|
+
config.autoload_paths << Engine.root.join("lib")
|
|
8
|
+
|
|
9
|
+
# Ensures that the config/nfg_ui_manifest.js file is compiled
|
|
10
|
+
# which, in turn, ensures that all of the non-autoloaded assets
|
|
11
|
+
# are pre-compiled for the host-app's consumption.
|
|
12
|
+
#
|
|
13
|
+
# If you need to add unique assets to be precompiled
|
|
14
|
+
# (new folders -- e.g.: 'font' -- within the assets directory)
|
|
15
|
+
# update / add to the "links" found on the manifest file.
|
|
16
|
+
#
|
|
17
|
+
# Font assets example:
|
|
18
|
+
# on app/assets/config/nfg_ui_manifest.js
|
|
19
|
+
#
|
|
20
|
+
# //= link_tree '../font/nfg_ui'
|
|
21
|
+
#
|
|
22
|
+
# See manifest here: app/assets/config/nfg_ui_manifest.js
|
|
23
|
+
#
|
|
24
|
+
# Learn more about using the sprockets `link`ing mechanisms:
|
|
25
|
+
# https://github.com/rails/sprockets#link
|
|
26
|
+
#
|
|
27
|
+
# Utilize engine initializer method:
|
|
28
|
+
initializer 'nfg_ui.assets.precompile' do |app|
|
|
29
|
+
app.config.assets.precompile << "#{Engine.root.join('app', 'assets', 'config')}/nfg_ui_manifest.js"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
config.to_prepare do
|
|
33
|
+
ActiveSupport.on_load :action_controller do
|
|
34
|
+
helper NfgUi::ApplicationHelper
|
|
35
|
+
helper NfgUi::Components::ResourceThemesHelper
|
|
36
|
+
helper NfgUi::Components::TooltipHelper
|
|
37
|
+
helper NfgUi::Components::EmailHelpers
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
ActiveSupport.on_load :action_mailer do
|
|
41
|
+
helper NfgUi::Components::EmailHelpers
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module UI
|
|
5
|
+
# The base component building class for namespaced
|
|
6
|
+
# components (bootstrap vs network_for_good / nfg)
|
|
7
|
+
class Base
|
|
8
|
+
attr_accessor :view_context
|
|
9
|
+
|
|
10
|
+
def initialize(view_context)
|
|
11
|
+
self.view_context = view_context
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def bootstrap(component_name = nil, *traits, **options, &block)
|
|
15
|
+
NfgUi::UI::Bootstrap.new(view_context, component_name, *traits, **options, &block).render_component
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def nfg(component_name = nil, *traits, **options, &block)
|
|
19
|
+
return unless render_nfg_component?(options)
|
|
20
|
+
NfgUi::UI::NetworkForGood.new(view_context, component_name, *traits, **options, &block).render_component
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def render_nfg_component?(options)
|
|
26
|
+
return true unless options.key?(:render_if) || options.key?(:render_unless)
|
|
27
|
+
if options.key?(:render_if)
|
|
28
|
+
options[:render_if]
|
|
29
|
+
else
|
|
30
|
+
!options[:render_unless]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module UI
|
|
5
|
+
# The class that yields the component for the view
|
|
6
|
+
class Bootstrap
|
|
7
|
+
include NfgUi::UI::Utilities::Initializer
|
|
8
|
+
|
|
9
|
+
attr_accessor :view_context
|
|
10
|
+
# attr_reader :component_name_folder
|
|
11
|
+
|
|
12
|
+
def initialize(view_context, component_name = nil, *traits, **options, &block)
|
|
13
|
+
self.view_context = view_context
|
|
14
|
+
initializer(component_name, *traits, **options, &block)
|
|
15
|
+
# @component_name_folder = component.component_family.to_s.pluralize if component.component_family.present?
|
|
16
|
+
# raise component.send(:component_family).inspect
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def component_name_folder
|
|
22
|
+
# component.component_family.to_s.pluralize if component.component_family.present?
|
|
23
|
+
component.component_family.to_s.pluralize
|
|
24
|
+
# ''
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def group
|
|
28
|
+
'bootstrap'
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def grouping_folder
|
|
32
|
+
'bootstrap'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def ancestry_string
|
|
36
|
+
"NfgUi::Bootstrap::Components::#{class_name}"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def components_within_group(*)
|
|
40
|
+
NfgUi::BOOTSTRAP_COMPONENT_NAMES
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module NfgUi
|
|
4
|
+
module UI
|
|
5
|
+
class NetworkForGood
|
|
6
|
+
include NfgUi::UI::Utilities::Initializer
|
|
7
|
+
|
|
8
|
+
attr_accessor :view_context
|
|
9
|
+
|
|
10
|
+
def initialize(view_context, component_name = nil, *traits, **options, &block)
|
|
11
|
+
self.view_context = view_context
|
|
12
|
+
initializer(component_name, *traits, **options, &block)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def component_name_folder
|
|
18
|
+
component_family.present? ? component_family.to_s.pluralize : component_name.to_s.pluralize
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def group
|
|
22
|
+
NfgUi::GROUPING_NAMES.each do |grouping|
|
|
23
|
+
return grouping.to_s.camelize if components_within_group(grouping: grouping).include?(component_name)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def grouping_folder
|
|
28
|
+
folder_name = ''
|
|
29
|
+
NfgUi::GROUPING_NAMES.each do |grouping|
|
|
30
|
+
next unless components_within_group(grouping: grouping).include?(component_name)
|
|
31
|
+
folder_name = grouping.to_s
|
|
32
|
+
end
|
|
33
|
+
folder_name
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def ancestry_string
|
|
37
|
+
"NfgUi::Components::
|
|
38
|
+
#{nested_class_name_string}::
|
|
39
|
+
#{class_name}".tr(" \t\r\n", '')
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def nested_class_name_string
|
|
43
|
+
NfgUi::GROUPING_NAMES.each do |grouping|
|
|
44
|
+
next unless components_within_group(grouping: grouping).include?(component_name)
|
|
45
|
+
return grouping.to_s.camelize
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def components_within_group(grouping:)
|
|
50
|
+
"NfgUi::#{grouping.to_s.singularize.upcase}_COMPONENT_NAMES".constantize
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|