nfg_ui 0.9.8.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (384) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +431 -0
  4. data/Rakefile +23 -0
  5. data/app/assets/config/nfg_ui_manifest.js +3 -0
  6. data/app/assets/images/nfg_ui/app_icon/android-chrome-192x192.png +0 -0
  7. data/app/assets/images/nfg_ui/app_icon/android-chrome-384x384.png +0 -0
  8. data/app/assets/images/nfg_ui/app_icon/apple-touch-icon.png +0 -0
  9. data/app/assets/images/nfg_ui/app_icon/browserconfig.xml.erb +9 -0
  10. data/app/assets/images/nfg_ui/app_icon/favicon-16x16.png +0 -0
  11. data/app/assets/images/nfg_ui/app_icon/favicon-32x32.png +0 -0
  12. data/app/assets/images/nfg_ui/app_icon/favicon.ico +0 -0
  13. data/app/assets/images/nfg_ui/app_icon/mstile-150x150.png +0 -0
  14. data/app/assets/images/nfg_ui/app_icon/safari-pinned-tab.svg +38 -0
  15. data/app/assets/images/nfg_ui/app_icon/site.webmanifest.erb +19 -0
  16. data/app/assets/images/nfg_ui/email/icons/fa-caret-right.png +0 -0
  17. data/app/assets/images/nfg_ui/email/icons/fa-facebook.png +0 -0
  18. data/app/assets/images/nfg_ui/email/icons/fa-linkedin.png +0 -0
  19. data/app/assets/images/nfg_ui/email/icons/fa-twitter.png +0 -0
  20. data/app/assets/images/nfg_ui/email/icons/fa-youtube.png +0 -0
  21. data/app/assets/images/nfg_ui/email/nfg-logo.png +0 -0
  22. data/app/assets/javascripts/nfg_ui/application.coffee +16 -0
  23. data/app/assets/javascripts/nfg_ui/collapsible_toggle.coffee +47 -0
  24. data/app/assets/javascripts/nfg_ui/prevent_clickable_disabled_element.coffee +47 -0
  25. data/app/assets/javascripts/nfg_ui/vendor/select2.coffee +26 -0
  26. data/app/assets/javascripts/nfg_ui/vendor/tooltips.coffee +18 -0
  27. data/app/assets/stylesheets/nfg_ui/bootstrap/application.scss +2 -0
  28. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/_variables.scss +1123 -0
  29. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/application.scss +23 -0
  30. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_alert.scss +2 -0
  31. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_backgrounds.scss +9 -0
  32. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_button-group.scss +8 -0
  33. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_buttons.scss +17 -0
  34. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_card.scss +20 -0
  35. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_custom.scss +20 -0
  36. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_custom_forms.scss +156 -0
  37. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_dropdown.scss +24 -0
  38. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_forms.scss +85 -0
  39. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_media.scss +2 -0
  40. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_nav.scss +22 -0
  41. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_navbar.scss +132 -0
  42. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_progress.scss +3 -0
  43. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_reboot.scss +31 -0
  44. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_tables.scss +7 -0
  45. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_tooltip.scss +5 -0
  46. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/_type.scss +82 -0
  47. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_campaign_card.scss +6 -0
  48. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_campaign_preview.scss +25 -0
  49. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_content_section_buttons.scss +11 -0
  50. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_custom_questions_questionnaire.scss +84 -0
  51. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_custom_receipt_language.scss +15 -0
  52. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_email_preview.scss +24 -0
  53. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_interaction.scss +2 -0
  54. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_mobile.scss +4 -0
  55. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_nav_step.scss +95 -0
  56. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_overlay_blocker.scss +49 -0
  57. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_page_header.scss +9 -0
  58. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_product_icons.scss +45 -0
  59. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_redactor.scss +25 -0
  60. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_share_dropdown.scss +53 -0
  61. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_slat.scss +113 -0
  62. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_social_share.scss +44 -0
  63. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_status_indicator.scss +9 -0
  64. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_ticket.scss +12 -0
  65. data/app/assets/stylesheets/nfg_ui/network_for_good/admin/nfg_theme/custom/_tile.scss +71 -0
  66. data/app/assets/stylesheets/nfg_ui/network_for_good/email/application.scss +38 -0
  67. data/app/assets/stylesheets/nfg_ui/network_for_good/email/foundation_emails/_alignment.scss +93 -0
  68. data/app/assets/stylesheets/nfg_ui/network_for_good/email/foundation_emails/_button.scss +345 -0
  69. data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_backgrounds.scss +15 -0
  70. data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_layout.scss +33 -0
  71. data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_rainbow_bar.scss +47 -0
  72. data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_spacers.scss +60 -0
  73. data/app/assets/stylesheets/nfg_ui/network_for_good/email/nfg_theme/_typography.scss +6 -0
  74. data/app/assets/stylesheets/nfg_ui/network_for_good/email/settings/_settings.scss +148 -0
  75. data/app/assets/stylesheets/nfg_ui/network_for_good/public/_variables.scss +1124 -0
  76. data/app/assets/stylesheets/nfg_ui/network_for_good/public/application.scss +23 -0
  77. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/application.scss +19 -0
  78. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_badge.scss +6 -0
  79. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_buttons.scss +43 -0
  80. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_custom.scss +3 -0
  81. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_custom_forms.scss +50 -0
  82. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_forms.scss +12 -0
  83. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_functions.scss +29 -0
  84. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_navbar.scss +18 -0
  85. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_reboot.scss +6 -0
  86. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_type.scss +16 -0
  87. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/_utilities.scss +8 -0
  88. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/custom/_everyday_default.scss +6 -0
  89. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/nfg_theme/custom/_nav_step.scss +20 -0
  90. data/app/assets/stylesheets/nfg_ui/network_for_good/public/entity_branding/plugins/_select2.scss +16 -0
  91. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/_variables.scss +13 -0
  92. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/application.scss +35 -0
  93. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_breadcrumb.scss +4 -0
  94. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_button-group.scss +10 -0
  95. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_card.scss +45 -0
  96. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_carousel.scss +18 -0
  97. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_custom-forms.scss +12 -0
  98. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_custom.scss +4 -0
  99. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_forms.scss +68 -0
  100. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_grid.scss +4 -0
  101. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_input-group.scss +25 -0
  102. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_list-group.scss +9 -0
  103. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_media.scss +5 -0
  104. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_mixins.scss +6 -0
  105. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_modal.scss +28 -0
  106. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_nav.scss +21 -0
  107. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_navbar.scss +54 -0
  108. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_pagination.scss +1 -0
  109. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_progress.scss +6 -0
  110. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/_utilities.scss +2 -0
  111. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/custom/_everyday_giving.scss +8 -0
  112. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/custom/_nav_step.scss +13 -0
  113. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/custom/_slat.scss +66 -0
  114. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/mixins/_breakpoints.scss +123 -0
  115. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/mixins/_grid-framework.scss +30 -0
  116. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/mixins/_grid.scss +10 -0
  117. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/utilities/_display.scss +9 -0
  118. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/nfg_theme/utilities/_flex.scss +49 -0
  119. data/app/assets/stylesheets/nfg_ui/network_for_good/public/legacy_browser_support/plugins/_sticky_div.scss +9 -0
  120. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_alert.scss +2 -0
  121. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_buttons.scss +17 -0
  122. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_card.scss +6 -0
  123. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_carousel.scss +9 -0
  124. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_custom.scss +12 -0
  125. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_custom_forms.scss +156 -0
  126. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_dropdown.scss +1 -0
  127. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_event.scss +19 -0
  128. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_forms.scss +83 -0
  129. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_list-group.scss +12 -0
  130. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_progress.scss +9 -0
  131. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_reboot.scss +31 -0
  132. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_tooltip.scss +5 -0
  133. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/_type.scss +81 -0
  134. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_admin_bar.scss +20 -0
  135. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_background_variations.scss +12 -0
  136. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_everyday_default.scss +43 -0
  137. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_everyday_story.scss +21 -0
  138. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_footer_links.scss +8 -0
  139. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_nav_step.scss +95 -0
  140. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_slat.scss +110 -0
  141. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_social_share.scss +44 -0
  142. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_ticket.scss +12 -0
  143. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_tile.scss +63 -0
  144. data/app/assets/stylesheets/nfg_ui/network_for_good/public/nfg_theme/custom/_user_navbar.scss +33 -0
  145. data/app/assets/stylesheets/nfg_ui/network_for_good/public/plugins/_datepicker.scss +2 -0
  146. data/app/assets/stylesheets/nfg_ui/network_for_good/public/plugins/_select2.scss +216 -0
  147. data/app/assets/stylesheets/nfg_ui/network_for_good/public/plugins/_sticky_div.scss +11 -0
  148. data/app/controllers/nfg_ui/application_controller.rb +5 -0
  149. data/app/helpers/nfg_ui/application_helper.rb +27 -0
  150. data/app/helpers/nfg_ui/components/email_helpers.rb +8 -0
  151. data/app/helpers/nfg_ui/components/resource_themes_helper.rb +8 -0
  152. data/app/helpers/nfg_ui/components/tooltip_helper.rb +24 -0
  153. data/app/models/nfg_ui/application_record.rb +5 -0
  154. data/app/views/nfg_ui/app_icons/_icons.html.haml +10 -0
  155. data/app/views/nfg_ui/email/README.md +12 -0
  156. data/app/views/nfg_ui/email/_button.html.haml +12 -0
  157. data/app/views/nfg_ui/email/_email_signature.html.haml +4 -0
  158. data/app/views/nfg_ui/email/_footer.html.haml +16 -0
  159. data/app/views/nfg_ui/email/_header.html.haml +6 -0
  160. data/app/views/nfg_ui/email/_logo.html.haml +6 -0
  161. data/app/views/nfg_ui/email/_product_content_image.html.haml +7 -0
  162. data/app/views/nfg_ui/email/_rainbow_bar.html.haml +10 -0
  163. data/app/views/nfg_ui/email/_section_header.html.haml +8 -0
  164. data/app/views/nfg_ui/email/_social_network_link.html.haml +12 -0
  165. data/app/views/nfg_ui/email/_sub_footer.html.haml +9 -0
  166. data/app/views/nfg_ui/email/_table_row.html.haml +13 -0
  167. data/config/initializers/web_app_manifest.rb +3 -0
  168. data/config/locales/email.yml +34 -0
  169. data/config/locales/en.yml +63 -0
  170. data/config/routes.rb +2 -0
  171. data/config/spring.rb +1 -0
  172. data/lib/nfg_ui/bootstrap/components/alert.rb +52 -0
  173. data/lib/nfg_ui/bootstrap/components/badge.rb +39 -0
  174. data/lib/nfg_ui/bootstrap/components/base.rb +151 -0
  175. data/lib/nfg_ui/bootstrap/components/breadcrumb.rb +23 -0
  176. data/lib/nfg_ui/bootstrap/components/breadcrumb_item.rb +28 -0
  177. data/lib/nfg_ui/bootstrap/components/button.rb +74 -0
  178. data/lib/nfg_ui/bootstrap/components/button_group.rb +36 -0
  179. data/lib/nfg_ui/bootstrap/components/button_toolbar.rb +21 -0
  180. data/lib/nfg_ui/bootstrap/components/card.rb +81 -0
  181. data/lib/nfg_ui/bootstrap/components/card_body.rb +15 -0
  182. data/lib/nfg_ui/bootstrap/components/card_footer.rb +15 -0
  183. data/lib/nfg_ui/bootstrap/components/card_header.rb +35 -0
  184. data/lib/nfg_ui/bootstrap/components/card_image.rb +33 -0
  185. data/lib/nfg_ui/bootstrap/components/card_image_overlay.rb +46 -0
  186. data/lib/nfg_ui/bootstrap/components/carousel.rb +57 -0
  187. data/lib/nfg_ui/bootstrap/components/carousel_caption.rb +34 -0
  188. data/lib/nfg_ui/bootstrap/components/carousel_control.rb +73 -0
  189. data/lib/nfg_ui/bootstrap/components/carousel_indicators.rb +54 -0
  190. data/lib/nfg_ui/bootstrap/components/carousel_item.rb +49 -0
  191. data/lib/nfg_ui/bootstrap/components/collapse.rb +32 -0
  192. data/lib/nfg_ui/bootstrap/components/dropdown.rb +51 -0
  193. data/lib/nfg_ui/bootstrap/components/dropdown_divider.rb +19 -0
  194. data/lib/nfg_ui/bootstrap/components/dropdown_header.rb +23 -0
  195. data/lib/nfg_ui/bootstrap/components/dropdown_item.rb +41 -0
  196. data/lib/nfg_ui/bootstrap/components/dropdown_menu.rb +32 -0
  197. data/lib/nfg_ui/bootstrap/components/dropdown_toggle.rb +82 -0
  198. data/lib/nfg_ui/bootstrap/components/embed.rb +80 -0
  199. data/lib/nfg_ui/bootstrap/components/form.rb +13 -0
  200. data/lib/nfg_ui/bootstrap/components/input_group.rb +13 -0
  201. data/lib/nfg_ui/bootstrap/components/jumbotron.rb +13 -0
  202. data/lib/nfg_ui/bootstrap/components/list_group.rb +39 -0
  203. data/lib/nfg_ui/bootstrap/components/list_group_item.rb +69 -0
  204. data/lib/nfg_ui/bootstrap/components/media.rb +15 -0
  205. data/lib/nfg_ui/bootstrap/components/media_body.rb +15 -0
  206. data/lib/nfg_ui/bootstrap/components/media_object.rb +23 -0
  207. data/lib/nfg_ui/bootstrap/components/modal.rb +66 -0
  208. data/lib/nfg_ui/bootstrap/components/modal_body.rb +16 -0
  209. data/lib/nfg_ui/bootstrap/components/modal_footer.rb +16 -0
  210. data/lib/nfg_ui/bootstrap/components/modal_header.rb +37 -0
  211. data/lib/nfg_ui/bootstrap/components/nav.rb +71 -0
  212. data/lib/nfg_ui/bootstrap/components/nav_item.rb +103 -0
  213. data/lib/nfg_ui/bootstrap/components/nav_link.rb +62 -0
  214. data/lib/nfg_ui/bootstrap/components/navbar.rb +97 -0
  215. data/lib/nfg_ui/bootstrap/components/navbar_brand.rb +25 -0
  216. data/lib/nfg_ui/bootstrap/components/navbar_nav.rb +48 -0
  217. data/lib/nfg_ui/bootstrap/components/navbar_text.rb +21 -0
  218. data/lib/nfg_ui/bootstrap/components/navbar_toggler.rb +38 -0
  219. data/lib/nfg_ui/bootstrap/components/page_item.rb +66 -0
  220. data/lib/nfg_ui/bootstrap/components/pagination.rb +30 -0
  221. data/lib/nfg_ui/bootstrap/components/popover.rb +12 -0
  222. data/lib/nfg_ui/bootstrap/components/progress.rb +44 -0
  223. data/lib/nfg_ui/bootstrap/components/progress_bar.rb +51 -0
  224. data/lib/nfg_ui/bootstrap/components/tab_content.rb +15 -0
  225. data/lib/nfg_ui/bootstrap/components/tab_pane.rb +49 -0
  226. data/lib/nfg_ui/bootstrap/components/table.rb +17 -0
  227. data/lib/nfg_ui/bootstrap/readme.md +1 -0
  228. data/lib/nfg_ui/bootstrap/utilities/activatable.rb +32 -0
  229. data/lib/nfg_ui/bootstrap/utilities/alignable.rb +33 -0
  230. data/lib/nfg_ui/bootstrap/utilities/collapse_toggleable.rb +35 -0
  231. data/lib/nfg_ui/bootstrap/utilities/collapsible.rb +42 -0
  232. data/lib/nfg_ui/bootstrap/utilities/disableable.rb +49 -0
  233. data/lib/nfg_ui/bootstrap/utilities/dismissible.rb +24 -0
  234. data/lib/nfg_ui/bootstrap/utilities/dropdown_directionable.rb +40 -0
  235. data/lib/nfg_ui/bootstrap/utilities/headable.rb +20 -0
  236. data/lib/nfg_ui/bootstrap/utilities/modalable.rb +104 -0
  237. data/lib/nfg_ui/bootstrap/utilities/progressable.rb +42 -0
  238. data/lib/nfg_ui/bootstrap/utilities/remotable.rb +24 -0
  239. data/lib/nfg_ui/bootstrap/utilities/sizable.rb +40 -0
  240. data/lib/nfg_ui/bootstrap/utilities/themeable.rb +51 -0
  241. data/lib/nfg_ui/bootstrap/utilities/tooltipable.rb +95 -0
  242. data/lib/nfg_ui/bootstrap/utilities/wrappable.rb +48 -0
  243. data/lib/nfg_ui/components/base.rb +14 -0
  244. data/lib/nfg_ui/components/elements/activity.rb +10 -0
  245. data/lib/nfg_ui/components/elements/alert.rb +63 -0
  246. data/lib/nfg_ui/components/elements/badge.rb +32 -0
  247. data/lib/nfg_ui/components/elements/breadcrumb.rb +16 -0
  248. data/lib/nfg_ui/components/elements/breadcrumb_item.rb +16 -0
  249. data/lib/nfg_ui/components/elements/button.rb +97 -0
  250. data/lib/nfg_ui/components/elements/card_body.rb +15 -0
  251. data/lib/nfg_ui/components/elements/card_footer.rb +14 -0
  252. data/lib/nfg_ui/components/elements/card_header.rb +14 -0
  253. data/lib/nfg_ui/components/elements/card_image.rb +14 -0
  254. data/lib/nfg_ui/components/elements/card_image_overlay.rb +14 -0
  255. data/lib/nfg_ui/components/elements/carousel_caption.rb +14 -0
  256. data/lib/nfg_ui/components/elements/carousel_control.rb +14 -0
  257. data/lib/nfg_ui/components/elements/carousel_indicators.rb +23 -0
  258. data/lib/nfg_ui/components/elements/carousel_item.rb +16 -0
  259. data/lib/nfg_ui/components/elements/chart.rb +11 -0
  260. data/lib/nfg_ui/components/elements/dropdown_divider.rb +14 -0
  261. data/lib/nfg_ui/components/elements/dropdown_header.rb +14 -0
  262. data/lib/nfg_ui/components/elements/dropdown_item.rb +78 -0
  263. data/lib/nfg_ui/components/elements/dropdown_toggle.rb +37 -0
  264. data/lib/nfg_ui/components/elements/embed.rb +15 -0
  265. data/lib/nfg_ui/components/elements/form_control.rb +18 -0
  266. data/lib/nfg_ui/components/elements/input_group.rb +14 -0
  267. data/lib/nfg_ui/components/elements/key.rb +11 -0
  268. data/lib/nfg_ui/components/elements/list_group_item.rb +14 -0
  269. data/lib/nfg_ui/components/elements/loader.rb +11 -0
  270. data/lib/nfg_ui/components/elements/media_body.rb +14 -0
  271. data/lib/nfg_ui/components/elements/media_object.rb +12 -0
  272. data/lib/nfg_ui/components/elements/modal_body.rb +14 -0
  273. data/lib/nfg_ui/components/elements/modal_footer.rb +14 -0
  274. data/lib/nfg_ui/components/elements/modal_header.rb +14 -0
  275. data/lib/nfg_ui/components/elements/nav.rb +19 -0
  276. data/lib/nfg_ui/components/elements/nav_item.rb +39 -0
  277. data/lib/nfg_ui/components/elements/nav_link.rb +33 -0
  278. data/lib/nfg_ui/components/elements/navbar_brand.rb +15 -0
  279. data/lib/nfg_ui/components/elements/navbar_text.rb +14 -0
  280. data/lib/nfg_ui/components/elements/navbar_toggler.rb +14 -0
  281. data/lib/nfg_ui/components/elements/page_item.rb +14 -0
  282. data/lib/nfg_ui/components/elements/popover.rb +14 -0
  283. data/lib/nfg_ui/components/elements/progress_bar.rb +62 -0
  284. data/lib/nfg_ui/components/elements/slat_action.rb +14 -0
  285. data/lib/nfg_ui/components/elements/slat_body.rb +14 -0
  286. data/lib/nfg_ui/components/elements/slat_item.rb +62 -0
  287. data/lib/nfg_ui/components/elements/stat.rb +11 -0
  288. data/lib/nfg_ui/components/elements/step.rb +55 -0
  289. data/lib/nfg_ui/components/elements/step_indicator.rb +41 -0
  290. data/lib/nfg_ui/components/elements/tab_pane.rb +15 -0
  291. data/lib/nfg_ui/components/elements/table.rb +14 -0
  292. data/lib/nfg_ui/components/elements/task.rb +11 -0
  293. data/lib/nfg_ui/components/elements.rb +58 -0
  294. data/lib/nfg_ui/components/foundations/color.rb +11 -0
  295. data/lib/nfg_ui/components/foundations/grid.rb +11 -0
  296. data/lib/nfg_ui/components/foundations/icon.rb +82 -0
  297. data/lib/nfg_ui/components/foundations/image.rb +14 -0
  298. data/lib/nfg_ui/components/foundations/input.rb +11 -0
  299. data/lib/nfg_ui/components/foundations/typeface.rb +122 -0
  300. data/lib/nfg_ui/components/patterns/activity_feed.rb +11 -0
  301. data/lib/nfg_ui/components/patterns/button_group.rb +23 -0
  302. data/lib/nfg_ui/components/patterns/button_toolbar.rb +20 -0
  303. data/lib/nfg_ui/components/patterns/card.rb +39 -0
  304. data/lib/nfg_ui/components/patterns/carousel.rb +31 -0
  305. data/lib/nfg_ui/components/patterns/collapse.rb +31 -0
  306. data/lib/nfg_ui/components/patterns/dropdown.rb +27 -0
  307. data/lib/nfg_ui/components/patterns/dropdown_menu.rb +16 -0
  308. data/lib/nfg_ui/components/patterns/empty_state.rb +11 -0
  309. data/lib/nfg_ui/components/patterns/filter_bar.rb +11 -0
  310. data/lib/nfg_ui/components/patterns/form_group.rb +11 -0
  311. data/lib/nfg_ui/components/patterns/graph.rb +11 -0
  312. data/lib/nfg_ui/components/patterns/jumbotron.rb +14 -0
  313. data/lib/nfg_ui/components/patterns/list_group.rb +16 -0
  314. data/lib/nfg_ui/components/patterns/media.rb +14 -0
  315. data/lib/nfg_ui/components/patterns/modal.rb +15 -0
  316. data/lib/nfg_ui/components/patterns/navbar.rb +17 -0
  317. data/lib/nfg_ui/components/patterns/navbar_nav.rb +17 -0
  318. data/lib/nfg_ui/components/patterns/page_header.rb +85 -0
  319. data/lib/nfg_ui/components/patterns/pagination.rb +14 -0
  320. data/lib/nfg_ui/components/patterns/progress.rb +24 -0
  321. data/lib/nfg_ui/components/patterns/slat.rb +14 -0
  322. data/lib/nfg_ui/components/patterns/slat_actions.rb +115 -0
  323. data/lib/nfg_ui/components/patterns/slat_header.rb +23 -0
  324. data/lib/nfg_ui/components/patterns/slat_list.rb +18 -0
  325. data/lib/nfg_ui/components/patterns/slats.rb +14 -0
  326. data/lib/nfg_ui/components/patterns/steps.rb +27 -0
  327. data/lib/nfg_ui/components/patterns/tab_content.rb +14 -0
  328. data/lib/nfg_ui/components/patterns/task_list.rb +11 -0
  329. data/lib/nfg_ui/components/patterns/tile.rb +58 -0
  330. data/lib/nfg_ui/components/patterns/tile_body.rb +29 -0
  331. data/lib/nfg_ui/components/patterns/tile_header.rb +40 -0
  332. data/lib/nfg_ui/components/patterns/tile_section.rb +29 -0
  333. data/lib/nfg_ui/components/traits/active.rb +14 -0
  334. data/lib/nfg_ui/components/traits/alert.rb +36 -0
  335. data/lib/nfg_ui/components/traits/alignment.rb +26 -0
  336. data/lib/nfg_ui/components/traits/button.rb +47 -0
  337. data/lib/nfg_ui/components/traits/button_group.rb +22 -0
  338. data/lib/nfg_ui/components/traits/card.rb +14 -0
  339. data/lib/nfg_ui/components/traits/collapse.rb +29 -0
  340. data/lib/nfg_ui/components/traits/disable.rb +19 -0
  341. data/lib/nfg_ui/components/traits/disable_with.rb +14 -0
  342. data/lib/nfg_ui/components/traits/dismiss.rb +16 -0
  343. data/lib/nfg_ui/components/traits/dropdown_toggle.rb +14 -0
  344. data/lib/nfg_ui/components/traits/icon.rb +16 -0
  345. data/lib/nfg_ui/components/traits/list_group.rb +16 -0
  346. data/lib/nfg_ui/components/traits/muted.rb +16 -0
  347. data/lib/nfg_ui/components/traits/nav.rb +26 -0
  348. data/lib/nfg_ui/components/traits/nav_item.rb +16 -0
  349. data/lib/nfg_ui/components/traits/navbar.rb +18 -0
  350. data/lib/nfg_ui/components/traits/page_header.rb +16 -0
  351. data/lib/nfg_ui/components/traits/pill.rb +14 -0
  352. data/lib/nfg_ui/components/traits/progress_bar.rb +24 -0
  353. data/lib/nfg_ui/components/traits/remote.rb +14 -0
  354. data/lib/nfg_ui/components/traits/size.rb +18 -0
  355. data/lib/nfg_ui/components/traits/slat_item.rb +28 -0
  356. data/lib/nfg_ui/components/traits/step.rb +14 -0
  357. data/lib/nfg_ui/components/traits/theme.rb +57 -0
  358. data/lib/nfg_ui/components/traits/typeface.rb +53 -0
  359. data/lib/nfg_ui/components/traits/vertical.rb +16 -0
  360. data/lib/nfg_ui/components/traits.rb +43 -0
  361. data/lib/nfg_ui/components/utilities/browser_detectable.rb +16 -0
  362. data/lib/nfg_ui/components/utilities/confirmable.rb +24 -0
  363. data/lib/nfg_ui/components/utilities/describable.rb +22 -0
  364. data/lib/nfg_ui/components/utilities/disable_withable.rb +26 -0
  365. data/lib/nfg_ui/components/utilities/emailable.rb +44 -0
  366. data/lib/nfg_ui/components/utilities/iconable.rb +20 -0
  367. data/lib/nfg_ui/components/utilities/left_iconable.rb +22 -0
  368. data/lib/nfg_ui/components/utilities/methodable.rb +24 -0
  369. data/lib/nfg_ui/components/utilities/renderable.rb +24 -0
  370. data/lib/nfg_ui/components/utilities/resource_themeable.rb +49 -0
  371. data/lib/nfg_ui/components/utilities/titleable.rb +20 -0
  372. data/lib/nfg_ui/components/utilities/traitable.rb +32 -0
  373. data/lib/nfg_ui/components/utilities/vertically_alignable.rb +31 -0
  374. data/lib/nfg_ui/components/utilities.rb +22 -0
  375. data/lib/nfg_ui/engine.rb +45 -0
  376. data/lib/nfg_ui/ui/base.rb +35 -0
  377. data/lib/nfg_ui/ui/bootstrap.rb +44 -0
  378. data/lib/nfg_ui/ui/network_for_good.rb +54 -0
  379. data/lib/nfg_ui/ui/utilities/initializer.rb +88 -0
  380. data/lib/nfg_ui/ui/utilities.rb +10 -0
  381. data/lib/nfg_ui/version.rb +5 -0
  382. data/lib/nfg_ui.rb +174 -0
  383. data/lib/tasks/nfg_ui_tasks.rake +53 -0
  384. metadata +741 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c9313b155aed1b8d262480e684191a8e33715b9f3831c48a1f6f9c4c0073cc17
4
+ data.tar.gz: 65af621df7962edb12da0c148f27c7321f5404c313118bf17d4ca2226a464e0f
5
+ SHA512:
6
+ metadata.gz: 18a15c79036fcc7c8c281e03c53416c35fa620bbb883c7778299ffba2427e8a4a2a6cff2fab195d6c10c5dfb70807538d4039287bc4893de8f346360a5c8d7b3
7
+ data.tar.gz: 3a0965c073127d4dba6c623c67758179ea4af5875c706b37d9eaa20d8c669a6457e4adfc4c00b869dfb65c629b498675f5461fda2081b9e66950af7d72c67d65
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2018 jonathanroehm
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,431 @@
1
+ # Network for Good's Design System for Ruby on Rails
2
+ The authoritative resource for the Network for Good front-end UI, empowered by the NFG Design System.
3
+
4
+ Note: the readme documentation is a little out of date and will be updated with accurate info soon (note added on Jan. 19, 2019)
5
+
6
+ [Jump to development / setting up the gem locally](https://github.com/network-for-good/nfg_ui/blob/master/README.md#local-development--accessing-documentation)
7
+
8
+ ```ruby
9
+ gem 'nfg_ui', git: 'https://github.com/network-for-good/nfg_ui'
10
+ ```
11
+
12
+ NFG UX & UI team_ (J&K) are excited to bring you... the *Network For Good design system* gem or: `nfg_ui` gem. This bad boy is an all encompassing one-stop shop for everything front-end for Network for Good products.
13
+
14
+ This gem is an organic, evolving and ongoing work that is the loving result of 4+ years of study, practice, implementation, planning, drafting and good ol' sweat. After a dozen code drafts, a fully realized Sketch design system suite, and the canvas to work on... we're building a robust design system framework.
15
+
16
+ With this gem, you can stand up a brand new rails app and it will seamlessly, from day 1, look, feel and be a Network for Good product. *Huzzah*
17
+
18
+ ## Accessing Component Code Examples & Documentation:
19
+ To review the documentation for the components, get code samples and browse the library, follow the instructions at the bottom for getting the gem setup locally. It has its own `test_app` so the documentation is hosted there and the gem doesn't need to be added to a seperate parent app (unless you want to). We intend to get this online in its own dedicated space... until then, that's your best bet for browsing docs.
20
+
21
+ ## Configuration
22
+
23
+ ### Include the gem in your Gemfile
24
+ ```ruby
25
+ gem 'nfg_ui', git: 'https://github.com/network-for-good/nfg_ui'
26
+ ```
27
+
28
+ ### Import & Require the gem's assets
29
+ _NOTE:_ This gem has not taken over ownership of JS from Evo yet. Some styles have been brought over for documentation visual check purposes (the core styling is in place), but it's not fully brought over yet. This includes javascript plugins, etc. To use `nfg_ui` images, note the special requirements:
30
+
31
+ In `application.scss` add your pertinent stylesheet suite based on whatever context you're building an interface. These are currently two categories: `admin` and `public` (and `email`)
32
+
33
+ #### SCSS Application stylesheets
34
+ *Admin* stylesheets should be `@imported` in your pertinent application.scss file:
35
+ ```scss
36
+ @import 'nfg_ui/network_for_good/admin/application';
37
+ ```
38
+
39
+ *Public* stylesheets should be `@imported` in your pertinent application.scss file:
40
+ ```scss
41
+ @import 'nfg_ui/network_for_good/public/application';
42
+ ```
43
+
44
+ *Email* stylesheeets should be `@imported` as above:
45
+ ```scss
46
+ @import 'nfg_ui/network_for_good/email/application';
47
+ ```
48
+
49
+ #### Javascript
50
+ Currently, there is only one javascript library. This will likely change, but the current setup is as follows:
51
+
52
+ Javascript should be `//= required` in your pertinent application.js file:
53
+ ```js
54
+ //= require nfg_ui/application
55
+ ```
56
+
57
+ # Usage
58
+
59
+ ## Network for Good design system components
60
+
61
+ This gem allows you to add any NFG design component to your haml view at command. You can build one line, all inclusive components and build out high level pre-designed and pre-configured context-specific components.
62
+
63
+ Components also come with traits. Traits are stackable and overwriteable. Traits are meaningful symbols added as the first array of arguments on your component. Read more about traits below. The key value of traits: it provides pre-set and pre-designed components out of the box so that you don't need to go through the monotonous task of adding theme colors, sizes, headlines, etc every time you need to use that component. *Handy*
64
+
65
+ All components accept the same attributes when appropriate. This list will expand but here is a sample:
66
+
67
+ * All html attributes (`id`, `data`, `aria`, `required`, if it's an attribute, it's available)
68
+ * `body: 'Inserted content into the obvious content space for the component'`
69
+ * `title: 'For modals and tiles'`
70
+ * `headline: 'For components with headlines like media objects'`
71
+ * `:collapsible` and `:collapsed`
72
+ * more to come...
73
+ * `tooltip: 'My tooltip text'` is available on many components (that would make sense to have tooltips) and will automatically apply a tooltip to the component
74
+
75
+
76
+ Examples:
77
+ ```haml
78
+ // Produce a styled, pre-designed submit button for your form on the fly
79
+ = ui.nfg :button, :submit
80
+
81
+ // Is the traited / predesigned equivalent of...
82
+ = ui.nfg :button, as: :button, type: 'submit', icon: 'chevron-right', body: 'Save & Exit', theme: :primary, disable_with: "<i class='fa fa-spinner fa-spin mr-1'></i> Saving..."
83
+
84
+ // Build your own button
85
+ = ui.nfg :button, :danger, data: { describe: 'delete-button' } do
86
+ = ui.nfg :icon, 'trash', class: 'mr-1', text: 'Delete Row'
87
+ ```
88
+
89
+ #### Trait details
90
+ Traits are designed to allow you to speedily build components, or pre-design complex components using meaningful symbols.
91
+
92
+ Traits are pre-designed / pre-created in the gem (the process / system for this is getting an update after some very cool conversations recently, but the implementation on the front end likely won't be changing)
93
+
94
+ We use two general "kinds" of traits (this is being examined in more detail, but the usage is the same).
95
+
96
+ The first "kind" of trait is "speedy" versions of options. The second "kind" of trait are more like a combination of options.
97
+
98
+ We do this, for example, with an error alert, which then pre-supplies a set of options...
99
+
100
+ ```haml
101
+ = ui.nfg :alert, :error
102
+
103
+ // is the pre-designed error alert that looks like this:
104
+ = ui.nfg :alert, :dismissible, theme: :danger, heading: 'Oops!', body: 'There appears to be someting wrong with your submission! Please take a look...'
105
+ ```
106
+
107
+ The second kind of trait is the speedy version (described above).
108
+
109
+ Here are some implementation examples of speedy traits:
110
+ * For components that are "themeable" (alerts, buttons, etc) and are designated as such, automatically get a theme trait:
111
+ * `ui.nfg :button, :primary` is a speedy way to write `ui.nfg :button, theme: :primary`
112
+ * `:primary`
113
+ * `:secondary`
114
+ * `:success`
115
+ * `:danger`
116
+ * `:warning`
117
+ * `:info`
118
+ * `:light`
119
+ * `:dark`
120
+ * For components that are resizable (buttons, modals, etc)
121
+ * `ui.nfg :button, :large` is the same as `ui.nfg :button, size: :large`
122
+ * `:lg`
123
+ * `:large`
124
+ * `:sm`
125
+ * `:small`
126
+ * For components that are collapsible (Tiles for example)
127
+ * `ui.nfg :tile, :collapsible` is the same as `ui.nfg :tile, collapsed: false`
128
+ * `ui.nfg :tile, :collapsed` is the same as `ui.nfg :tile, collapsed: true`
129
+ * `:collapsible`
130
+ * `:collapsed`
131
+ * And more... to be documented
132
+
133
+ More soon...
134
+
135
+ ### NFG Components
136
+ Syntax: `= ui.nfg :component_name, optional_traits, options`
137
+
138
+ Components are organized into 4 major groupings. Currently 3 of the groupings are available through this gem.
139
+
140
+ #### Foundations
141
+ The basic essentials that form elements
142
+ * `:color`
143
+ * `:icon`
144
+ * `:image`
145
+ * `:input`
146
+ * `:grid`
147
+ * `:typeface`
148
+
149
+ #### Elements
150
+ The main component blocks, made up of foundation components.
151
+
152
+ * `:activity`
153
+ * `:alert`
154
+ * `:badge`
155
+ * `:breadcrumb`
156
+ * `:breadcrumb_item`
157
+ * `:button`
158
+ * `:chart`
159
+ * `:dropdown`
160
+ * `:form_control`
161
+ * `:input_group`
162
+ * `:key`
163
+ * `:list_group_item`
164
+ * `:loader`
165
+ * `:media_object`
166
+ * `:nav`
167
+ * `:popover`
168
+ * `:progress_bar`
169
+ * `:slat`
170
+ * `:stat`
171
+ * `:table`
172
+ * `:task`
173
+ * `:tooltip`
174
+
175
+ #### Patterns
176
+ Groupings of elements to create rich interfaces. For example, an `:activity_feed` (one of the patterns) is made up many `:activity`
177
+
178
+ * `:activity_feed`
179
+ * `:button_group`
180
+ * `:card`
181
+ * `:carousel`
182
+ * `:empty_state`
183
+ * `:filter_bar`
184
+ * `:form_group`
185
+ * `:graph`
186
+ * `:jumbotron`
187
+ * `:list_group`
188
+ * `:media`
189
+ * `:modal`
190
+ * `:navbar`
191
+ * `:slat_list`
192
+ * `:task_list`
193
+ * *Tiles*
194
+ * `:tile`
195
+ * `:tile_body`
196
+ * `:tile_header`
197
+ * `:tile_section`
198
+
199
+ ### Component traits for design system components
200
+ *Coming soon*
201
+
202
+ ## Bootstrap design system components
203
+
204
+ Utilize all bootstrap4 components, coded to strict bootstrap standards via a similar method: `= ui.bootstrap :my_component, options...`
205
+
206
+ *Note: while the names of bootstrap components and network for good components may be similar or identical (ex.: the design system has an `:alert` as does bootstrap), do not use bootstrap components on the front-end. _Only use `ui.nfg` components for front-end code._ Great care has been taken to ensure that any component you'd expect to have from bootstrap4 is made available by an appropriately coded and designed design system component*
207
+
208
+ The bootstrap side of this will eventually be isolated into its own gem. Until then, it lives within the `nfg_ui` gem.
209
+
210
+ ```haml
211
+ // An example alert
212
+ = ui.nfg :alert, theme: :danger, dismissible: false, headline: 'Oh snap!', body: 'The alert body content'
213
+
214
+ // Build your own button
215
+ = ui.bootstrap :button, theme: :danger, data: { describe: 'delete-button' } do
216
+ = fa_icon 'trash', class: 'mr-1', text: 'Delete Row'
217
+ ```
218
+
219
+ #### Bootstrap components
220
+ Syntax: `= ui.bootstrap :component_name, options`
221
+
222
+ * `:alert`
223
+ * `:badge`
224
+ * `:breadcrumb`
225
+ * `:breadcrumb_item`
226
+ * `:button`
227
+ * `:button_group`
228
+ * `:card`
229
+ * `:carousel`
230
+ * `:dropdown`
231
+ * `:form`
232
+ * `:input_group`
233
+ * `:jumbotron`
234
+ * `:list_group`
235
+ * `:list_group_item`
236
+ * `:media_object`
237
+ * `:modal`
238
+ * `:nav`
239
+ * `:navbar`
240
+ * `:pagination`
241
+ * `:popover`
242
+ * `:progress`
243
+ * `:table`
244
+ * `:tooltip`
245
+
246
+ ## Local development & accessing documentation
247
+
248
+ 1. Clone repo:
249
+
250
+ ```
251
+ $ git clone https://github.com/network-for-good/nfg_ui.git
252
+ ```
253
+
254
+ 2. Bundle gems
255
+
256
+ ```
257
+ $ bundle exec bundle install
258
+ ```
259
+
260
+ ### To test the gem locally on your host app
261
+ See this gist: https://gist.github.com/jonathanroehm/70749fb6f29c61d0af7c7ed9cc233f79
262
+
263
+ All done!
264
+
265
+ ## To browse the components:
266
+ Browse the components at: *http://localhost:3000/*
267
+
268
+ _From the gem's root directory (not spec/test_app/):_,
269
+ Begin rails server the normal way.
270
+
271
+ ```
272
+ $ rails s
273
+ ```
274
+
275
+ If you're running other rails apps on port 3000 or 3001 you can run this on another port, for example:
276
+
277
+ ```
278
+ $ rails s -p 3003
279
+ ```
280
+
281
+ Documentation .haml files can be found here:
282
+ ```
283
+ /spec/test_app/app/views
284
+ ```
285
+ Within that folder are all of the component code examples found when you click through the navigation. Divided up as `Bootstrap`, then the grouping names: `patterns`, `elements`, `foundations`.
286
+
287
+ ## Specs
288
+ _From the gem's root directory (not spec/test_app/):_
289
+ This gem comes with spring, you can use spring when executing rspec
290
+
291
+ ```
292
+ $ spring rspec
293
+ ```
294
+
295
+ ## To do's:
296
+ 1. Create a generator for adding a new bootstrap component and a new nfg component. perhaps run through a script (or skip) to set it up to have utilities in place... do you want it to be...
297
+ ```
298
+ $ Collapsible? (Y/n):
299
+ ```
300
+
301
+ 2. Write out a step by step process for manually creating a component of different nesting levels
302
+
303
+ 3. Trait documentation
304
+
305
+ 4. RDoc
306
+
307
+ 5. Userful error library, particularly on any quirky things (also note quirky things as code-smell stuff to fix.).
308
+
309
+ 6. Look into setting up an installer for allowing configuration options (specifically, initially on whether or not to include simple_form)
310
+
311
+ 7. Host test_app on heroku for online documentation
312
+
313
+ 8. Migrate test_app content into the design system CMS app.
314
+
315
+ 9. Design token integration
316
+
317
+ 10. API feed for design token for third party sites like wordpress?
318
+
319
+ 11. Add I18n lookup.
320
+
321
+ 12. Update browser gem in all NFG apps to 2.5+
322
+
323
+ 13. Review what's involved in having simple_form "subscribe" to our design system inputs and form controls, particularly the advanced ones (like radio buttons with images) so that the design system is actually hosting the html and not obnoxiously complicated simple_form classes doing that job.
324
+
325
+ 14. Design tokens
326
+
327
+ 15. need a better way to define and create / map traits. I am not enjoying the bloat in attr_readers...
328
+
329
+ 16. Generator for customizable components with commented out class methods (like devise's generated controllers) for easy customization (reference that kicked this off was the modal title ... allowing an icon on the bs version might be what you want to do if you're a gem consumer...)
330
+
331
+ 17. Consider implementing a universal catch all "content" attribute when there's only one region so that users don't need to guess if a something like the dropdown header uses `heading` or `body` or `content` for passing in the content.
332
+
333
+ 18. Create a registered list ... for things like tooltippable nfg components (all? some?) -- that way can mass add modules for nfg side as needed.
334
+
335
+ 19. Look into collapsible toggle / collapse toggle, There are lots of buttons that have their classes removed so they can behave as a "link"
336
+
337
+ 20. Trait specs
338
+
339
+ 21. Consider moving component_css_class out of private so it can be manipulated in the component (instead of needing stuff like remove_component_css_classes methods)
340
+
341
+ 22. Author useful error notifications for missing traits (instead of 'something_trait' method error)
342
+
343
+ 23. need an overlay_blocker
344
+
345
+ 24. should form-row be a (nfg?) component? see: Givecorps-site/app/views/bootstrap4/addresses/_address_form.html.haml
346
+
347
+ 25. card sub title and card title components?
348
+
349
+ 26. consider typeface for link_to so we can supply our luxuries to link_to.
350
+
351
+ 27. Add a trait for dropdown items where we pass in a "not_deletable" type of attribute that shows when a can't delete condition is present -- or make it more generic and have it be embedded dropdown text that we conditionalize on the component.
352
+
353
+ 28. Examine how theme css prefix class is being worked out... looks like we'd be better off having some kind of value that's shared / accessible... somethign like "type of theme" ... :text (text-success). right now, we're doing it by setting the prefix to 'text-'
354
+
355
+ 29. Slat list sm ...
356
+
357
+ 30. Render_if doesn't see nil as falsy. Fix that.
358
+
359
+ 31. _Add a generator to supply the bootstrap shared examples for spec writing your own components._
360
+
361
+ Component tooltip/icon auto list for backup
362
+ FOUNDATION_COMPONENT_NAMES = %i[color
363
+ icon
364
+ image
365
+ input
366
+ grid
367
+ typeface].freeze
368
+
369
+ ELEMENT_COMPONENT_NAMES = %i[activity
370
+ alert [icon, tooltip]
371
+ badge [icon, tooltip]
372
+ breadcrumb
373
+ breadcrumb_item [icon, tooltip]
374
+ button [icon, tooltip]
375
+ chart
376
+ dropdown_divider
377
+ dropdown_header [icon, tooltip]
378
+ dropdown_item [icon, tooltip]
379
+ dropdown_toggle [icon, tooltip]
380
+ embed
381
+ form_control [icon, tooltip]
382
+ input_group [icon, tooltip]
383
+ key
384
+ list_group_item [icon, tooltip]
385
+ loader [icon]
386
+ media_body [icon, tooltip]
387
+ media_object [icon, tooltip]
388
+ modal_body [icon, tooltip]
389
+ modal_footer
390
+ modal_header [icon]
391
+ nav
392
+ nav_item [icon, tooltip]
393
+ nav_link
394
+ navbar_brand [icon]
395
+ navbar_text
396
+ navbar_toggler [icon]
397
+ popover [icon]
398
+ progress_bar [tooltip]
399
+ slat [icon, tooltip]
400
+ stat [icon, tooltip]
401
+ tab_pane
402
+ table [icon, tooltip]
403
+ task [icon, tooltip]
404
+
405
+ PATTERN_COMPONENT_NAMES = %i[activity_feed [icon, tooltip]
406
+ button_group [tooltip]
407
+ button_toolbar [tooltip]
408
+ card [icon, tooltip]
409
+ carousel [icon, tooltip]
410
+ collapse [icon, tooltip]
411
+ dropdown [icon, tooltip]
412
+ dropdown_menu
413
+ empty_state [icon, tooltip]
414
+ filter_bar [tooltip]
415
+ form_group [tooltip]
416
+ graph
417
+ jumbotron
418
+ list_group
419
+ media [tooltip]
420
+ modal [icon]
421
+ navbar
422
+ navbar_nav
423
+ page_header
424
+ slat_list [tooltip]
425
+ tab_content
426
+ task_list
427
+ tile [icon, tooltip]
428
+ tile_body [icon, tooltip]
429
+ tile_header [icon, tooltip]
430
+ tile_section [icon]
431
+
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'NfgUi'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+ require 'bundler/gem_tasks'
@@ -0,0 +1,3 @@
1
+ //= link_directory ../javascripts/nfg_ui .js
2
+ //= link_directory ../stylesheets/nfg_ui .css
3
+ //= link_tree ../images/nfg_ui
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <browserconfig>
3
+ <msapplication>
4
+ <tile>
5
+ <square150x150logo src="<%= image_path('nfg_ui/app_icon/mstile-150x150.png') %>"/>
6
+ <TileColor>#25aceb</TileColor>
7
+ </tile>
8
+ </msapplication>
9
+ </browserconfig>
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
3
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
4
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg"
5
+ width="400.000000pt" height="400.000000pt" viewBox="0 0 400.000000 400.000000"
6
+ preserveAspectRatio="xMidYMid meet">
7
+ <metadata>
8
+ Created by potrace 1.11, written by Peter Selinger 2001-2013
9
+ </metadata>
10
+ <g transform="translate(0.000000,400.000000) scale(0.100000,-0.100000)"
11
+ fill="#000000" stroke="none">
12
+ <path d="M2010 3987 c-19 -8 -48 -20 -64 -26 -16 -7 -62 -45 -102 -85 -87 -89
13
+ -119 -152 -194 -381 -62 -190 -96 -260 -153 -318 -35 -37 -54 -47 -112 -62
14
+ -93 -24 -162 -57 -227 -107 -151 -118 -283 -232 -368 -318 -94 -93 -112 -120
15
+ -279 -400 -45 -76 -141 -278 -161 -340 -43 -135 -36 -236 20 -265 26 -14 33
16
+ -13 70 1 52 21 159 135 274 295 195 270 264 357 335 426 41 40 77 70 79 68 2
17
+ -2 -4 -48 -13 -102 -9 -54 -19 -111 -22 -128 -2 -16 -13 -67 -23 -112 -11 -46
18
+ -21 -93 -24 -105 -6 -37 -118 -418 -133 -458 -3 -8 -7 -19 -8 -25 -11 -49 -72
19
+ -194 -132 -317 -40 -82 -107 -237 -149 -346 -42 -108 -82 -210 -89 -227 -66
20
+ -152 -130 -347 -140 -423 -11 -90 43 -177 117 -186 71 -9 104 30 318 369 109
21
+ 173 320 486 390 580 82 109 109 163 195 379 36 91 74 180 84 197 l19 31 27
22
+ -45 c92 -158 194 -499 209 -702 23 -305 135 -648 253 -776 72 -78 176 -105
23
+ 220 -56 42 45 44 104 14 342 -11 88 -23 245 -26 349 -3 103 -7 191 -9 195 -2
24
+ 3 -7 42 -11 86 -14 165 -35 274 -79 409 -64 194 -89 319 -90 446 -1 117 0 126
25
+ 45 296 l32 121 66 -67 c41 -41 89 -78 126 -96 53 -26 70 -29 150 -28 187 2
26
+ 525 90 673 174 54 31 92 79 92 115 0 36 -37 82 -85 105 -39 19 -67 24 -154 26
27
+ -58 1 -126 -1 -151 -6 -25 -4 -61 -11 -81 -14 -20 -3 -47 -9 -60 -14 -37 -13
28
+ -122 -15 -167 -2 -53 14 -114 75 -193 193 -101 150 -215 277 -300 334 -41 27
29
+ -82 100 -75 135 13 71 44 104 181 196 105 70 156 118 200 187 114 178 65 377
30
+ -114 469 -45 24 -156 30 -201 13z"/>
31
+ <path d="M3273 3252 c-197 -70 -324 -331 -327 -677 l-1 -60 36 -2 c34 -3 37
32
+ -1 53 39 26 69 79 133 128 156 44 20 159 48 241 57 114 13 134 17 157 32 67
33
+ 43 114 134 113 219 -2 101 -52 176 -153 228 -59 30 -172 34 -247 8z"/>
34
+ <path d="M2445 3216 c-84 -38 -130 -168 -91 -261 18 -43 75 -79 151 -95 155
35
+ -32 261 -133 299 -283 10 -40 18 -53 34 -55 18 -3 21 3 24 40 3 42 -6 181 -17
36
+ 246 -32 203 -115 356 -219 403 -48 22 -137 24 -181 5z"/>
37
+ </g>
38
+ </svg>
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "Network for Good",
3
+ "short_name": "Network for Good",
4
+ "icons": [
5
+ {
6
+ "src": "<%= image_path("nfg_ui/app_icon/android-chrome-192x192.png") %>",
7
+ "sizes": "192x192",
8
+ "type": "image/png"
9
+ },
10
+ {
11
+ "src": "<%= image_path("nfg_ui/app_icon/android-chrome-384x384.png") %>",
12
+ "sizes": "384x384",
13
+ "type": "image/png"
14
+ }
15
+ ],
16
+ "theme_color": "#ffffff",
17
+ "background_color": "#ffffff",
18
+ "display": "standalone"
19
+ }
@@ -0,0 +1,16 @@
1
+ #= require jquery3
2
+ #= require popper
3
+ #= require select2
4
+ #= require bootstrap
5
+
6
+ #= require_self
7
+ #= require nfg_ui/collapsible_toggle
8
+ #= require nfg_ui/vendor/select2
9
+ #= require nfg_ui/vendor/tooltips
10
+
11
+ window.NfgUi = {}
12
+
13
+ if $("head [data-turbolinks-track='reload']").length
14
+ window.NfgUi.readyOrTurbolinksLoad = "turbolinks:load"
15
+ else
16
+ window.NfgUi.readyOrTurbolinksLoad = "ready"
@@ -0,0 +1,47 @@
1
+ class NfgUi.CollapsibleToggle
2
+ constructor: (@el) ->
3
+ @target = @collapseTarget()
4
+ @iconBase = 'fa'
5
+ @collapseIconClass = "fa-#{@el.data 'collapsed-icon'}"
6
+ @collapsedIconClass = "fa-#{@el.data 'collapse-icon'}"
7
+
8
+ @initialize()
9
+
10
+ @el.click (e) =>
11
+ @swapIcon()
12
+
13
+ initialize: ->
14
+ if @target.hasClass 'show'
15
+ @el
16
+ .find ".#{@collapseIconClass}"
17
+ .removeClass @collapseIconClass
18
+ .addClass @collapsedIconClass
19
+ else
20
+ @el
21
+ .find ".#{@collapsedIconClass}"
22
+ .removeClass @collapsedIconClass
23
+ .addClass @collapseIconClass
24
+
25
+ collapseTarget: ->
26
+ if @el.is('a') then return $(@el.attr 'href')
27
+ if @el.is('button') then return $(@el.data 'target')
28
+
29
+ swapIcon: ->
30
+ @target.on 'show.bs.collapse', (e) =>
31
+ @el
32
+ .find ".#{@collapseIconClass}"
33
+ .removeClass @collapseIconClass
34
+ .addClass @collapsedIconClass
35
+
36
+ @target.on 'hide.bs.collapse', (e) =>
37
+ @el
38
+ .find ".#{@collapsedIconClass}"
39
+ .removeClass @collapsedIconClass
40
+ .addClass @collapseIconClass
41
+
42
+ $ ->
43
+ el = $("[data-toggle='collapse'][data-collapse-icon][data-collapsed-icon]")
44
+
45
+ return unless el.length
46
+ el.each ->
47
+ inst = new NfgUi.CollapsibleToggle $(@)