us_web_design_standards_ror 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af1c12e6fd29034b6c2beeff8e958e075fb45625
4
- data.tar.gz: 557d4b2ee42192650299a9f2088f388f78c2e83a
3
+ metadata.gz: 492cd2bc2a1767a32e85577660bc0af57367cb07
4
+ data.tar.gz: 1621a42c630edd6c785f928464fb1e2eaebbd02b
5
5
  SHA512:
6
- metadata.gz: 7aadb87e63aed3ea1400c6ae5ff170ce9406b31ce289b182f75395eaad58f74ceddf3817a5a08619f3960a1d7244314185f3200c8b9bc73944900cb3fd83c008
7
- data.tar.gz: 6eca4c5f9f7967df3dec0993e149d74a559c6244a28f284797d46d4342fe83ad018fadc992247a1235a2fccd3e83d935e7eaf185d7c2565b5ee501a95c56b259
6
+ metadata.gz: 26460ab7ce69913a37af83e20fb1fd28e280396ae7f2effc4260cd5b773a5f7eec01cbe2899277c8334645254e77ac2191322324444d2c3cd16db755da34ae09
7
+ data.tar.gz: 41c55f8f62d8112742fa74e30cbb3b134b71738bb225b67e3e4ee61e4e92a2644a339ca6c9a18831872995785d71789767aa0c6e16f2702636268c88b7815692
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /vendor/assets/stylesheets/uswds.css.scss
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.2.0
4
+ - Included install generator
5
+ - Edited Gemspec
6
+
7
+ ## 0.1.0
8
+ - Initial Build
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in uswds.gemspec
4
3
  gemspec
data/README.md CHANGED
@@ -1,15 +1,13 @@
1
- # Uswds
1
+ # US Web Design Standards
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/uswds`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Hey, internet! I bundled the [US Web Design Standards](https://standards.usa.gov/) into a gem to make Ruby on Rails development easier for federal agencies. It took me a bit of tinkering, and wasn't something I wanted to do again, so I figured I'd share the results of the effort. As of today, I think everything works "the Ruby way," but if you find anything at all, let me know or submit a pull request and I'll make sure to keep this updated.
6
4
 
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
10
8
 
11
9
  ```ruby
12
- gem 'uswds'
10
+ gem 'us_web_design_standards_ror'
13
11
  ```
14
12
 
15
13
  And then execute:
@@ -18,11 +16,11 @@ And then execute:
18
16
 
19
17
  Or install it yourself as:
20
18
 
21
- $ gem install uswds
19
+ $ gem install us_web_design_standards_ror
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ The US Web Design Standards documentation can be found [here](https://standards.usa.gov/). It behaves similarly to Bootstrap, but has some peculiarities.
26
24
 
27
25
  ## Development
28
26
 
@@ -32,10 +30,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
30
 
33
31
  ## Contributing
34
32
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/uswds. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
33
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Quinncuatro/USWebDesignStandardsRoRGem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
34
 
37
35
 
38
36
  ## License
39
37
 
40
38
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -0,0 +1,32 @@
1
+ require 'rails/generators'
2
+ require 'rails'
3
+
4
+ module Uswds
5
+ module Generators
6
+ class InstallGenerator < Rails::Generators::Base
7
+
8
+ desc "This generator installs USWDS framework to Asset Pipeline"
9
+ def add_assets
10
+ js_inject = " //= require uswds"
11
+ app_js = File.join(Rails.root, 'app', 'assets', 'javascripts', 'application.js')
12
+ css_inject = " *= require uswds"
13
+ app_scss = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'application.scss')
14
+ app_css = File.join(Rails.root, 'app', 'assets', 'stylesheets', 'application.css')
15
+
16
+ if File.exist?(app_js)
17
+ insert_into_file app_js, js_inject, :after => "require jjquery\n"
18
+ else
19
+ say_status('','Nor application.js could not be found!')
20
+ end
21
+
22
+ if File.exist?(app_scss)
23
+ insert_into_file app_scss, css_inject, :after => "require_self\n"
24
+ elsif File.exist?(app_css)
25
+ insert_into_file app_css, css_inject, :after => "require_self\n"
26
+ else
27
+ say_status('','Nor application.css/application.scss could not be found!')
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
data/lib/uswds.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "uswds/version"
2
+ require "uswds/engine"
2
3
 
3
4
  module Uswds
4
- class Engine < ::Rails::Engine; end
5
+ require 'uswds/engine'
5
6
  end
@@ -0,0 +1,10 @@
1
+ require 'rails'
2
+
3
+ module Uswds
4
+ class Engine < Rails::Engine
5
+ initializer 'Uswds.setup',
6
+ :group => :all do |app|
7
+ app.paths['config'] << File.join(config.root, 'vendor')
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ require 'rails'
2
+
3
+ module UswdsRails
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ initializer 'uswds-rails.setup',
7
+ :group => :all do |app|
8
+ app.paths['config'] << File.join(config.root, 'vendor')
9
+ end
10
+ end
11
+ end
12
+ end
data/lib/uswds/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Uswds
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/uswds.gemspec CHANGED
@@ -8,26 +8,14 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Uswds::VERSION
9
9
  spec.authors = ["Henry Quinn"]
10
10
  spec.email = ["henryquinniv@gmail.com"]
11
-
12
- spec.summary = "This is a RoR ready port of the US Web Design Standards."
13
- spec.description = "I wanted to use the US Web Design Standards in a project for work and found that I had to edit quite a bit to get it ready for Rails development; figured I could share the result to save people the hassle later."
14
11
  spec.homepage = "https://rubygems.org"
12
+ spec.summary = "This is a RoR ready port of the US Web Design Standards."
13
+ spec.description = "I wanted to use the US Web Design Standards in a project and found that I had to edit quite a bit to get it ready for Rails development; figured I could share the result to save others the hassle."
15
14
  spec.license = "MIT"
16
15
 
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
- else
22
- raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
24
- end
25
-
26
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
28
- end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
16
+ spec.files = `git ls-files`.split("\n")
17
+ spec.test_files = `git ls-files --{test,spec,features}/*`.split("/n")
18
+ spec.executables = `git ls-filex -- bin/*`.split("/n").map{ |f| File.basename(f) }
31
19
  spec.require_paths = ["lib"]
32
20
 
33
21
  spec.add_development_dependency "bundler", "~> 1.13"
@@ -1 +1 @@
1
- !function t(e,n,i){function o(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return o(n?n:t)},l,l.exports,t,e,n,i)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(t,e,n){(function(t){function n(t,e,n){function o(e){var n=v,i=m;return v=m=void 0,j=e,b=t.apply(i,n)}function r(t){return j=t,g=setTimeout(l,e),k?o(t):b}function u(t){var n=t-A,i=t-j,o=e-n;return L?x(o,y-i):o}function c(t){var n=t-A,i=t-j;return void 0===A||n>=e||n<0||L&&i>=y}function l(){var t=E();return c(t)?d(t):void(g=setTimeout(l,u(t)))}function d(t){return g=void 0,T&&v?o(t):(v=m=void 0,b)}function f(){void 0!==g&&clearTimeout(g),j=0,v=A=m=g=void 0}function p(){return void 0===g?b:d(E())}function h(){var t=E(),n=c(t);if(v=arguments,m=this,A=t,n){if(void 0===g)return r(A);if(L)return g=setTimeout(l,e),o(A)}return void 0===g&&(g=setTimeout(l,e)),b}var v,m,y,b,g,A,j=0,k=!1,L=!1,T=!0;if("function"!=typeof t)throw new TypeError(a);return e=s(e)||0,i(n)&&(k=!!n.leading,L="maxWait"in n,y=L?w(s(n.maxWait)||0,e):y,T="trailing"in n?!!n.trailing:T),h.cancel=f,h.flush=p,h}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function o(t){return!!t&&"object"==typeof t}function r(t){return"symbol"==typeof t||o(t)&&g.call(t)==c}function s(t){if("number"==typeof t)return t;if(r(t))return u;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(l,"");var n=f.test(t);return n||p.test(t)?h(t.slice(2),n?2:8):d.test(t)?u:+t}var a="Expected a function",u=NaN,c="[object Symbol]",l=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,p=/^0o[0-7]+$/i,h=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,y=v||m||Function("return this")(),b=Object.prototype,g=b.toString,w=Math.max,x=Math.min,E=function(){return y.Date.now()};e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){!function(t){"use strict";var e=function(t){if(!t)throw new Error("Politespace requires an element argument.");t.getAttribute&&(this.element=t,this.type=this.element.getAttribute("type"),this.delimiter=this.element.getAttribute("data-delimiter")||" ",this.reverse=null!==this.element.getAttribute("data-reverse"),this.groupLength=this.element.getAttribute("data-grouplength")||3)};e.prototype._divideIntoArray=function(t){for(var e,n,i,o=(""+this.groupLength).split(","),r=1===o.length,s=[],a=0;o.length&&a<t.length;)e=r?o[0]:o.shift()||t.length-a,i=Math.min(parseInt(e,10),t.length-a),n=this.reverse?-1*(i+a):a,s.push(t.substr(n,i)),a+=i;return this.reverse&&s.reverse(),s},e.prototype.format=function(t){var e=this.unformat(t);return this._divideIntoArray(e).join(this.delimiter)},e.prototype.trimMaxlength=function(t){var e=this.element.getAttribute("maxlength");return e&&(t=t.substr(0,e)),t},e.prototype.getValue=function(){return this.trimMaxlength(this.element.value)},e.prototype.update=function(){this.element.value=this.useProxy()?this.getValue():this.format(this.getValue())},e.prototype.unformat=function(t){return t.replace(new RegExp(this.delimiter,"g"),"")},e.prototype.reset=function(){this.element.value=this.unformat(this.element.value)},e.prototype.useProxy=function(){return"number"===this.type},e.prototype.updateProxy=function(){var t;this.useProxy()&&(t=this.element.parentNode.firstChild,t.innerHTML=this.format(this.getValue()),t.style.width=this.element.offsetWidth+"px")},e.prototype.createProxy=function(){function t(t,e){return window.getComputedStyle(t,null).getPropertyValue(e)}function e(e,n){for(var i=0,o=0,r=n.length;o<r;o++)i+=parseFloat(t(e,n[o]));return i}if(this.useProxy()){var n=this.element.parentNode,i=document.createElement("div"),o=document.createElement("div");o.style.font=t(this.element,"font"),o.style.paddingLeft=e(this.element,["padding-left","border-left-width"])+"px",o.style.paddingRight=e(this.element,["padding-right","border-right-width"])+"px",o.style.top=e(this.element,["padding-top","border-top-width","margin-top"])+"px",i.appendChild(o),i.className="politespace-proxy active";var r=n.replaceChild(i,this.element);i.appendChild(r),this.updateProxy()}},t.Politespace=e}(this)},{}],3:[function(t,e,n){function i(t,e){var n="true"===t.getAttribute("aria-expanded");return this.hideAll(),n||this.show(t),!1}function o(t){var e=this;this.root=t;var n=r("button",this.root);n.forEach(function(t){t.attachEvent?t.attachEvent("onclick",i.bind(e,t)):t.addEventListener("click",i.bind(e,t))});var o=this.$("button[aria-expanded=true]")[0];this.hideAll(),void 0!==o&&this.show(o)}var r=t("../utils/select");o.prototype.$=function(t){return r(t,this.root)},o.prototype.hide=function(t){var e=t.getAttribute("aria-controls"),n=this.$("#"+e)[0];return t.setAttribute("aria-expanded",!1),n.setAttribute("aria-hidden",!0),this},o.prototype.show=function(t){var e=t.getAttribute("aria-controls"),n=this.$("#"+e)[0];return t.setAttribute("aria-expanded",!0),n.setAttribute("aria-hidden",!1),this},o.prototype.hideAll=function(){var t=this,e=this.$("ul > li > button, .usa-accordion-button");return e.forEach(function(e){t.hide(e)}),this},e.exports=o},{"../utils/select":23}],4:[function(t,e,n){function i(t){t.preventDefault?t.preventDefault():t.returnValue=!1;var e="true"===t.target.getAttribute("aria-expanded"),n=e?s:a;n(this,"usa-banner-header-expanded")}function o(){var t=r(".usa-banner-header");t.forEach(function(t){var e=i.bind(t);r("[aria-controls]").forEach(function(t){u(t,"click",e)})})}var r=t("../utils/select"),s=t("../utils/add-class"),a=t("../utils/remove-class"),u=t("../utils/dispatch");e.exports=o},{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],5:[function(t,e,n){function i(t){for(var e=t.parentNode.firstChild,n=[];e;)1==e.nodeType&&e!=t&&n.push(e),e=e.nextSibling;return n}var o=t("../utils/select"),r=t("../utils/add-class"),s=t("../utils/remove-class"),a=t("../utils/dispatch"),u=function(){var t=this.parentNode,e=i(t);s(t,"hidden"),e.forEach(function(t){r(t,"hidden")})},c=[];e.exports=function(){var t=o(".usa-footer-big nav ul"),e=o(".usa-footer-big nav .usa-footer-primary-link");c.length&&(c.forEach(function(t){t.off()}),c=[]),window.innerWidth<600?(t.forEach(function(t){r(t,"hidden")}),e.forEach(function(t){c.push(a(t,"click",u))})):t.forEach(function(t){s(t,"hidden")})}},{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],6:[function(t,e,n){function i(t,e){t.classList&&t.classList.toggle(e)}function o(t){var e=s(".usa-overlay, .usa-nav"),n=s(".usa-nav-close")[0];return e.forEach(function(t){i(t,"is-visible")}),i(document.body,"usa-mobile_nav-active"),n.focus(),shouldTrigger=!1,!1}function r(){var t=s(".usa-menu-btn, .usa-overlay, .usa-nav-close");t.forEach(function(t){a(t,u,o)})}var s=t("../../utils/select"),a=(t("../../utils/add-class"),t("../../utils/remove-class"),t("../../utils/dispatch")),u="ontouchstart"in document.documentElement?"touchstart":"click";e.exports=r},{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],7:[function(t,e,n){function i(t){return a(l)?s():(r(),p=y(document.body,"click touchstart",o)),!1}function o(t){var e=t.target;u(e)||(s(),p.off())}function r(){v(l,"is-visible"),v(d,"is-hidden")}function s(){m(l,"is-visible"),m(d,"is-hidden")}function a(t){var e=new RegExp("(^| )is-visible( |$)","gi");return e.test(t.className)}function u(t){return l&&l.contains(t)||f&&f.contains(t)}function c(){l=h(".js-search-form")[0],d=h(".js-search-button")[0],f=h(".js-search-button-container")[0],d&&l&&y(d,"click touchstart",i)}var l,d,f,p,h=t("../../utils/select"),v=t("../../utils/add-class"),m=t("../../utils/remove-class"),y=t("../../utils/dispatch");e.exports=c},{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],8:[function(t,e,n){e.exports=function(t,e){t.forEach(function(t){t.setAttribute("autocapitalize","off"),t.setAttribute("autocorrect","off"),t.setAttribute("type",e?"password":"text")})}},{}],9:[function(t,e,n){function i(t){var e=t.split(" ");return e.map(function(t){return"#"+t}).join(", ")}function o(t){for(;t&&"FORM"!==t.tagName;)t=t.parentNode;return t}var r=t("./toggle-field-mask"),s=t("../utils/select"),a=function(t,e,n){var a=t.getAttribute("aria-controls");if(!a||0===a.trim().length)throw new Error("Did you forget to define selectors in the aria-controls attribute? Check element "+t.outerHTML);var u=i(a),c=o(t);if(!c)throw new Error("toggleFormInput() needs the supplied element to be inside a <form>. Check element "+t.outerHTML);var l=s(u,c),d=!1,f=function(i){i.preventDefault(),r(l,d),t.textContent=d?e:n,d=!d};t.attachEvent?t.attachEvent("onclick",f):t.addEventListener("click",f)};e.exports=a},{"../utils/select":23,"./toggle-field-mask":8}],10:[function(t,e,n){function i(t){if(t.hasAttributes()){for(var e={},n=t.attributes,i=n.length-1;i>=0;i--){var o=n[i].name.match(/data-(.*)/i);if(o&&o[1]){var r=o[1].replace(/-/,"");e[r]=n[i].value}}return e}}var o=t("../utils/select"),r=t("../utils/add-class"),s=t("../utils/remove-class"),a=t("../utils/dispatch");e.exports=function(t){function e(){for(n in d)n.startsWith("validate")&&(u=n.split("validate")[1],c=new RegExp(d[n]),validatorSelector="[data-validator="+u+"]",l=o(validatorSelector,f)[0],c.test(t.value)?r(l,"usa-checklist-checked"):s(l,"usa-checklist-checked"))}var n,u,c,l,d=i(t),f=o(d.validationelement)[0];a(t,"keyup",e)}},{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],11:[function(t,e,n){var i=t("../utils/select"),o=t("../utils/when-dom-ready"),r=t("../components/accordion");o(function(){var t=i(".usa-accordion, .usa-accordion-bordered");t.forEach(function(t){new r(t)})})},{"../components/accordion":3,"../utils/select":23,"../utils/when-dom-ready":25}],12:[function(t,e,n){var i=t("../utils/when-dom-ready"),o=t("../components/banner");i(function(){o()})},{"../components/banner":4,"../utils/when-dom-ready":25}],13:[function(t,e,n){var i=t("lodash.debounce"),o=t("../utils/when-dom-ready"),r=t("../utils/dispatch"),s=t("../components/footer");o(function(){s(),r(window,"resize",i(s,180))})},{"../components/footer":5,"../utils/dispatch":21,"../utils/when-dom-ready":25,"lodash.debounce":1}],14:[function(t,e,n){var i=t("../utils/when-dom-ready"),o=t("../utils/select"),r=t("../components/validator"),s=t("../components/toggle-form-input");i(function(){var t=o(".usa-show_password")[0],e=o(".usa-show_multipassword")[0],n=o(".js-validate_password")[0];t&&s(t,"Show Password","Hide Password"),e&&s(e,"Show my typing","Hide my typing"),n&&r(n)})},{"../components/toggle-form-input":9,"../components/validator":10,"../utils/select":23,"../utils/when-dom-ready":25}],15:[function(t,e,n){var i=t("../utils/when-dom-ready"),o=t("../components/header/search"),r=t("../components/header/mobile");i(function(){o(),r()})},{"../components/header/mobile":6,"../components/header/search":7,"../utils/when-dom-ready":25}],16:[function(t,e,n){var i=t("../utils/verify-jquery");if(i(window)){var o=window.jQuery,r=t("../../../node_modules/politespace/src/politespace").Politespace,s="politespace";o.fn[s]=function(){return this.each(function(){var t=new r(this);"number"===t.type&&t.createProxy(),o(this).bind("input keydown",function(){t.updateProxy()}).bind("blur",function(){o(this).closest(".politespace-proxy").addClass("active"),t.update(),t.updateProxy()}).bind("focus",function(){o(this).closest(".politespace-proxy").removeClass("active"),t.reset()}).data(s,t),t.update()})},o(function(){o("[data-"+s+"]").politespace()})}},{"../../../node_modules/politespace/src/politespace":2,"../utils/verify-jquery":24}],17:[function(t,e,n){Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var n,i;if(null===this)throw new TypeError(" this is null or not defined");var o=Object(this),r=o.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(n=e),i=0;i<r;){var s;i in o&&(s=o[i],t.call(n,s,i,o)),i++}}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,i=function(){},o=function(){return n.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),o.prototype=new i,o})},{}],18:[function(t,e,n){var i=t("../utils/dispatch"),o=t("../utils/select"),r=t("../utils/when-dom-ready");r(function(){var t=o(".skipnav")[0],e=o("#main-content")[0];t&&i(t,"click",function(){e.setAttribute("tabindex","0")}),e&&i(e,"blur",function(){e.setAttribute("tabindex","-1")})})},{"../utils/dispatch":21,"../utils/select":23,"../utils/when-dom-ready":25}],19:[function(t,e,n){"use strict";t("./initializers/polyfills"),t("./initializers/header"),t("./initializers/accordions"),t("./initializers/footer"),t("./initializers/skip-nav"),t("./initializers/forms"),t("./initializers/politespace"),t("./initializers/banner")},{"./initializers/accordions":11,"./initializers/banner":12,"./initializers/footer":13,"./initializers/forms":14,"./initializers/header":15,"./initializers/politespace":16,"./initializers/polyfills":17,"./initializers/skip-nav":18}],20:[function(t,e,n){e.exports=function(t,e){t.classList?t.classList.add(e):t.className+=" "+e}},{}],21:[function(t,e,n){e.exports=function(t,e,n,i){var o=e.split(/\s+/),r=function(t,e,n){t.attachEvent&&t.attachEvent("on"+e,n,i),t.addEventListener&&t.addEventListener(e,n,i)},s=function(t,e){var n;"createEvent"in document?(n=document.createEvent("HTMLEvents"),n.initEvent(e,!1,!0),t.dispatchEvent(n)):(n=document.createEventObject(),n.eventType=e,t.fireEvent("on"+t.eventType,n))},a=function(t,e,n){t.detachEvent&&t.detachEvent("on"+e,n,i),t.removeEventListener&&t.removeEventListener(e,n,i)};return o.forEach(function(e){r.call(null,t,e,n)}),{trigger:function(){s.call(null,t,o[0])},off:function(){o.forEach(function(e){a.call(null,t,e,n)})}}}},{}],22:[function(t,e,n){e.exports=function(t,e){var n=t.classList;if(void 0!==n)n.remove(e);else{n=t.className.split(/\s+/);var i=[];n.forEach(function(t){t!==e&&i.push(t)}),t.className=i.join(" ")}}},{}],23:[function(t,e,n){function i(t){return!!t&&"object"==typeof t&&1===t.nodeType}e.exports=function(t,e){if("string"!=typeof t)return[];void 0!==e&&i(e)||(e=window.document);var n=e.querySelectorAll(t);return Array.prototype.slice.call(n)}},{}],24:[function(t,e,n){e.exports=function(t){return t=t||window,!!(t.jQuery&&t.jQuery.fn&&t.jQuery.fn.jquery)}},{}],25:[function(t,e,n){function i(t){return"function"==typeof t}e.exports=function(t){"loading"!==document.readyState?i(t)&&t():document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&i(t)&&t()})}},{}]},{},[19]);
1
+ !function t(e,n,i){function o(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return o(n?n:t)},l,l.exports,t,e,n,i)}return n[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(t,e,n){(function(t){function n(t,e,n){function o(e){var n=v,i=m;return v=m=void 0,j=e,b=t.apply(i,n)}function r(t){return j=t,g=setTimeout(l,e),k?o(t):b}function u(t){var n=t-A,i=t-j,o=e-n;return L?x(o,y-i):o}function c(t){var n=t-A,i=t-j;return void 0===A||n>=e||n<0||L&&i>=y}function l(){var t=E();return c(t)?d(t):void(g=setTimeout(l,u(t)))}function d(t){return g=void 0,T&&v?o(t):(v=m=void 0,b)}function f(){void 0!==g&&clearTimeout(g),j=0,v=A=m=g=void 0}function p(){return void 0===g?b:d(E())}function h(){var t=E(),n=c(t);if(v=arguments,m=this,A=t,n){if(void 0===g)return r(A);if(L)return g=setTimeout(l,e),o(A)}return void 0===g&&(g=setTimeout(l,e)),b}var v,m,y,b,g,A,j=0,k=!1,L=!1,T=!0;if("function"!=typeof t)throw new TypeError(a);return e=s(e)||0,i(n)&&(k=!!n.leading,L="maxWait"in n,y=L?w(s(n.maxWait)||0,e):y,T="trailing"in n?!!n.trailing:T),h.cancel=f,h.flush=p,h}function i(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function o(t){return!!t&&"object"==typeof t}function r(t){return"symbol"==typeof t||o(t)&&g.call(t)==c}function s(t){if("number"==typeof t)return t;if(r(t))return u;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(l,"");var n=f.test(t);return n||p.test(t)?h(t.slice(2),n?2:8):d.test(t)?u:+t}var a="Expected a function",u=NaN,c="[object Symbol]",l=/^\s+|\s+$/g,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,p=/^0o[0-7]+$/i,h=parseInt,v="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,y=v||m||Function("return this")(),b=Object.prototype,g=b.toString,w=Math.max,x=Math.min,E=function(){return y.Date.now()};e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){!function(t){"use strict";var e=function(t){if(!t)throw new Error("Politespace requires an element argument.");t.getAttribute&&(this.element=t,this.type=this.element.getAttribute("type"),this.delimiter=this.element.getAttribute("data-delimiter")||" ",this.reverse=null!==this.element.getAttribute("data-reverse"),this.groupLength=this.element.getAttribute("data-grouplength")||3)};e.prototype._divideIntoArray=function(t){for(var e,n,i,o=(""+this.groupLength).split(","),r=1===o.length,s=[],a=0;o.length&&a<t.length;)e=r?o[0]:o.shift()||t.length-a,i=Math.min(parseInt(e,10),t.length-a),n=this.reverse?-1*(i+a):a,s.push(t.substr(n,i)),a+=i;return this.reverse&&s.reverse(),s},e.prototype.format=function(t){var e=this.unformat(t);return this._divideIntoArray(e).join(this.delimiter)},e.prototype.trimMaxlength=function(t){var e=this.element.getAttribute("maxlength");return e&&(t=t.substr(0,e)),t},e.prototype.getValue=function(){return this.trimMaxlength(this.element.value)},e.prototype.update=function(){this.element.value=this.useProxy()?this.getValue():this.format(this.getValue())},e.prototype.unformat=function(t){return t.replace(new RegExp(this.delimiter,"g"),"")},e.prototype.reset=function(){this.element.value=this.unformat(this.element.value)},e.prototype.useProxy=function(){return"number"===this.type},e.prototype.updateProxy=function(){var t;this.useProxy()&&(t=this.element.parentNode.firstChild,t.innerHTML=this.format(this.getValue()),t.style.width=this.element.offsetWidth+"px")},e.prototype.createProxy=function(){function t(t,e){return window.getComputedStyle(t,null).getPropertyValue(e)}function e(e,n){for(var i=0,o=0,r=n.length;o<r;o++)i+=parseFloat(t(e,n[o]));return i}if(this.useProxy()){var n=this.element.parentNode,i=document.createElement("div"),o=document.createElement("div");o.style.font=t(this.element,"font"),o.style.paddingLeft=e(this.element,["padding-left","border-left-width"])+"px",o.style.paddingRight=e(this.element,["padding-right","border-right-width"])+"px",o.style.top=e(this.element,["padding-top","border-top-width","margin-top"])+"px",i.appendChild(o),i.className="politespace-proxy active";var r=n.replaceChild(i,this.element);i.appendChild(r),this.updateProxy()}},t.Politespace=e}(this)},{}],3:[function(t,e,n){function i(t,e){var n="true"===t.getAttribute("aria-expanded");return this.hideAll(),n||this.show(t),!1}function o(t){var e=this;this.root=t;var n=r("button",this.root);n.forEach(function(t){t.attachEvent?t.attachEvent("onclick",i.bind(e,t)):t.addEventListener("click",i.bind(e,t))});var o=this.$("button[aria-expanded=true]")[0];this.hideAll(),void 0!==o&&this.show(o)}var r=t("../utils/select");o.prototype.$=function(t){return r(t,this.root)},o.prototype.hide=function(t){var e=t.getAttribute("aria-controls"),n=this.$("#"+e)[0];return t.setAttribute("aria-expanded",!1),n.setAttribute("aria-hidden",!0),this},o.prototype.show=function(t){var e=t.getAttribute("aria-controls"),n=this.$("#"+e)[0];return t.setAttribute("aria-expanded",!0),n.setAttribute("aria-hidden",!1),this},o.prototype.hideAll=function(){var t=this,e=this.$("ul > li > button, .usa-accordion-button");return e.forEach(function(e){t.hide(e)}),this},e.exports=o},{"../utils/select":23}],4:[function(t,e,n){function i(t){t.preventDefault?t.preventDefault():t.returnValue=!1;var e="true"===t.target.getAttribute("aria-expanded"),n=e?s:a;n(this,"usa-banner-header-expanded")}function o(){var t=r(".usa-banner-header");t.forEach(function(t){var e=i.bind(t);r("[aria-controls]").forEach(function(t){u(t,"click",e)})})}var r=t("../utils/select"),s=t("../utils/add-class"),a=t("../utils/remove-class"),u=t("../utils/dispatch");e.exports=o},{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],5:[function(t,e,n){function i(t){for(var e=t.parentNode.firstChild,n=[];e;)1==e.nodeType&&e!=t&&n.push(e),e=e.nextSibling;return n}var o=t("../utils/select"),r=t("../utils/add-class"),s=t("../utils/remove-class"),a=t("../utils/dispatch"),u=function(){var t=this.parentNode,e=i(t);s(t,"hidden"),e.forEach(function(t){r(t,"hidden")})},c=[];e.exports=function(){var t=o(".usa-footer-big nav ul"),e=o(".usa-footer-big nav .usa-footer-primary-link");c.length&&(c.forEach(function(t){t.off()}),c=[]),window.innerWidth<600?(t.forEach(function(t){r(t,"hidden")}),e.forEach(function(t){c.push(a(t,"click",u))})):t.forEach(function(t){s(t,"hidden")})}},{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],6:[function(t,e,n){function i(t,e){t.classList&&t.classList.toggle(e)}function o(t){var e=s(".usa-overlay, .usa-nav"),n=s(".usa-nav-close")[0];return e.forEach(function(t){i(t,"is-visible")}),i(document.body,"usa-mobile_nav-active"),n.focus(),shouldTrigger=!1,!1}function r(){var t=s(".usa-menu-btn, .usa-overlay, .usa-nav-close");t.forEach(function(t){a(t,u,o)})}var s=t("../../utils/select"),a=(t("../../utils/add-class"),t("../../utils/remove-class"),t("../../utils/dispatch")),u="ontouchstart"in document.documentElement?"touchstart":"click";e.exports=r},{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],7:[function(t,e,n){function i(t){return a(l)?s():(r(),p=y(document.body,"click touchstart",o)),!1}function o(t){var e=t.target;u(e)||(s(),p.off())}function r(){v(l,"is-visible"),v(d,"is-hidden")}function s(){m(l,"is-visible"),m(d,"is-hidden")}function a(t){var e=new RegExp("(^| )is-visible( |$)","gi");return e.test(t.className)}function u(t){return l&&l.contains(t)||f&&f.contains(t)}function c(){l=h(".js-search-form")[0],d=h(".js-search-button")[0],f=h(".js-search-button-container")[0],d&&l&&y(d,"click touchstart",i)}var l,d,f,p,h=t("../../utils/select"),v=t("../../utils/add-class"),m=t("../../utils/remove-class"),y=t("../../utils/dispatch");e.exports=c},{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],8:[function(t,e,n){e.exports=function(t,e){t.forEach(function(t){t.setAttribute("autocapitalize","off"),t.setAttribute("autocorrect","off"),t.setAttribute("type",e?"password":"text")})}},{}],9:[function(t,e,n){function i(t){var e=t.split(" ");return e.map(function(t){return"#"+t}).join(", ")}function o(t){for(;t&&"FORM"!==t.tagName;)t=t.parentNode;return t}var r=t("./toggle-field-mask"),s=t("../utils/select"),a=function(t,e,n){var a=t.getAttribute("aria-controls");if(!a||0===a.trim().length)throw new Error("Did you forget to define selectors in the aria-controls attribute? Check element "+t.outerHTML);var u=i(a),c=o(t);if(!c)throw new Error("toggleFormInput() needs the supplied element to be inside a <form>. Check element "+t.outerHTML);var l=s(u,c),d=!1,f=function(i){i.preventDefault(),r(l,d),t.textContent=d?e:n,d=!d};t.attachEvent?t.attachEvent("onclick",f):t.addEventListener("click",f)};e.exports=a},{"../utils/select":23,"./toggle-field-mask":8}],10:[function(t,e,n){function i(t){if(t.hasAttributes()){for(var e={},n=t.attributes,i=n.length-1;i>=0;i--){var o=n[i].name.match(/data-(.*)/i);if(o&&o[1]){var r=o[1].replace(/-/,"");e[r]=n[i].value}}return e}}var o=t("../utils/select"),r=t("../utils/add-class"),s=t("../utils/remove-class"),a=t("../utils/dispatch");e.exports=function(t){function e(){for(n in d)n.startsWith("validate")&&(u=n.split("validate")[1],c=new RegExp(d[n]),validatorSelector="[data-validator="+u+"]",l=o(validatorSelector,f)[0],c.test(t.value)?r(l,"usa-checklist-checked"):s(l,"usa-checklist-checked"))}var n,u,c,l,d=i(t),f=o(d.validationelement)[0];a(t,"keyup",e)}},{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],11:[function(t,e,n){var i=t("../utils/select"),o=t("../utils/when-dom-ready"),r=t("../components/accordion");o(function(){var t=i(".usa-accordion, .usa-accordion-bordered");t.forEach(function(t){new r(t)})})},{"../components/accordion":3,"../utils/select":23,"../utils/when-dom-ready":25}],12:[function(t,e,n){var i=t("../utils/when-dom-ready"),o=t("../components/banner");i(function(){o()})},{"../components/banner":4,"../utils/when-dom-ready":25}],13:[function(t,e,n){var i=t("lodash.debounce"),o=t("../utils/when-dom-ready"),r=t("../utils/dispatch"),s=t("../components/footer");o(function(){s(),r(window,"resize",i(s,180))})},{"../components/footer":5,"../utils/dispatch":21,"../utils/when-dom-ready":25,"lodash.debounce":1}],14:[function(t,e,n){var i=t("../utils/when-dom-ready"),o=t("../utils/select"),r=t("../components/validator"),s=t("../components/toggle-form-input");i(function(){var t=o(".usa-show_password")[0],e=o(".usa-show_multipassword")[0],n=o(".js-validate_password")[0];t&&s(t,"Show Password","Hide Password"),e&&s(e,"Show my typing","Hide my typing"),n&&r(n)})},{"../components/toggle-form-input":9,"../components/validator":10,"../utils/select":23,"../utils/when-dom-ready":25}],15:[function(t,e,n){var i=t("../utils/when-dom-ready"),o=t("../components/header/search"),r=t("../components/header/mobile");i(function(){o(),r()})},{"../components/header/mobile":6,"../components/header/search":7,"../utils/when-dom-ready":25}],16:[function(t,e,n){var i=t("../utils/verify-jquery");if(i(window)){var o=window.jQuery,r=t("../../../node_modules/politespace/src/politespace").Politespace,s="politespace";o.fn[s]=function(){return this.each(function(){var t=new r(this);"number"===t.type&&t.createProxy(),o(this).bind("input keydown",function(){t.updateProxy()}).bind("blur",function(){o(this).closest(".politespace-proxy").addClass("active"),t.update(),t.updateProxy()}).bind("focus",function(){o(this).closest(".politespace-proxy").removeClass("active"),t.reset()}).data(s,t),t.update()})},o(function(){o("[data-"+s+"]").politespace()})}},{"../../../node_modules/politespace/src/politespace":2,"../utils/verify-jquery":24}],17:[function(t,e,n){Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var n,i;if(null===this)throw new TypeError(" this is null or not defined");var o=Object(this),r=o.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(n=e),i=0;i<r;){var s;i in o&&(s=o[i],t.call(n,s,i,o)),i++}}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,i=function(){},o=function(){return n.apply(this instanceof i?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),o.prototype=new i,o})},{}],18:[function(t,e,n){var i=t("../utils/dispatch"),o=t("../utils/select"),r=t("../utils/when-dom-ready");r(function(){var t=o(".skipnav")[0],e=o("#main-content")[0];t&&i(t,"click",function(){e.setAttribute("tabindex","0")}),e&&i(e,"blur",function(){e.setAttribute("tabindex","-1")})})},{"../utils/dispatch":21,"../utils/select":23,"../utils/when-dom-ready":25}],19:[function(t,e,n){"use strict";t("./initializers/polyfills"),t("./initializers/header"),t("./initializers/accordions"),t("./initializers/footer"),t("./initializers/skip-nav"),t("./initializers/forms"),t("./initializers/politespace"),t("./initializers/banner")},{"./initializers/accordions":11,"./initializers/banner":12,"./initializers/footer":13,"./initializers/forms":14,"./initializers/header":15,"./initializers/politespace":16,"./initializers/polyfills":17,"./initializers/skip-nav":18}],20:[function(t,e,n){e.exports=function(t,e){t.classList?t.classList.add(e):t.className+=" "+e}},{}],21:[function(t,e,n){e.exports=function(t,e,n,i){var o=e.split(/\s+/),r=function(t,e,n){t.attachEvent&&t.attachEvent("on"+e,n,i),t.addEventListener&&t.addEventListener(e,n,i)},s=function(t,e){var n;"createEvent"in document?(n=document.createEvent("HTMLEvents"),n.initEvent(e,!1,!0),t.dispatchEvent(n)):(n=document.createEventObject(),n.eventType=e,t.fireEvent("on"+t.eventType,n))},a=function(t,e,n){t.detachEvent&&t.detachEvent("on"+e,n,i),t.removeEventListener&&t.removeEventListener(e,n,i)};return o.forEach(function(e){r.call(null,t,e,n)}),{trigger:function(){s.call(null,t,o[0])},off:function(){o.forEach(function(e){a.call(null,t,e,n)})}}}},{}],22:[function(t,e,n){e.exports=function(t,e){var n=t.classList;if(void 0!==n)n.remove(e);else{n=t.className.split(/\s+/);var i=[];n.forEach(function(t){t!==e&&i.push(t)}),t.className=i.join(" ")}}},{}],23:[function(t,e,n){function i(t){return!!t&&"object"==typeof t&&1===t.nodeType}e.exports=function(t,e){if("string"!=typeof t)return[];void 0!==e&&i(e)||(e=window.document);var n=e.querySelectorAll(t);return Array.prototype.slice.call(n)}},{}],24:[function(t,e,n){e.exports=function(t){return t=t||window,!!(t.jQuery&&t.jQuery.fn&&t.jQuery.fn.jquery)}},{}],25:[function(t,e,n){function i(t){return"function"==typeof t}e.exports=function(t){"loading"!==document.readyState?i(t)&&t():document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&i(t)&&t()})}},{}]},{},[19]);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: us_web_design_standards_ror
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Quinn
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-09 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,9 +38,9 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
- description: I wanted to use the US Web Design Standards in a project for work and
42
- found that I had to edit quite a bit to get it ready for Rails development; figured
43
- I could share the result to save people the hassle later.
41
+ description: I wanted to use the US Web Design Standards in a project and found that
42
+ I had to edit quite a bit to get it ready for Rails development; figured I could
43
+ share the result to save others the hassle.
44
44
  email:
45
45
  - henryquinniv@gmail.com
46
46
  executables: []
@@ -48,14 +48,16 @@ extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
+ - CHANGELOG.md
51
52
  - CODE_OF_CONDUCT.md
52
53
  - Gemfile
53
54
  - LICENSE.txt
54
55
  - README.md
55
56
  - Rakefile
56
- - bin/console
57
- - bin/setup
57
+ - lib/generators/uswds/install/install_generator.rb
58
58
  - lib/uswds.rb
59
+ - lib/uswds/engine.rb
60
+ - lib/uswds/rails/engine.rb
59
61
  - lib/uswds/version.rb
60
62
  - uswds.gemspec
61
63
  - vendor/assets/fonts/merriweather-bold-webfont.eot
@@ -164,15 +166,12 @@ files:
164
166
  - vendor/assets/images/social-icons/svg/twitter16.svg
165
167
  - vendor/assets/images/social-icons/svg/youtube15.svg
166
168
  - vendor/assets/images/us_flag_small.png
167
- - vendor/assets/javascripts/.keep
168
169
  - vendor/assets/javascripts/uswds.js
169
- - vendor/assets/stylesheets/.keep
170
- - vendor/assets/stylesheets/uswds.css.scss
170
+ - vendor/assets/stylesheets/uswds.css
171
171
  homepage: https://rubygems.org
172
172
  licenses:
173
173
  - MIT
174
- metadata:
175
- allowed_push_host: https://rubygems.org
174
+ metadata: {}
176
175
  post_install_message:
177
176
  rdoc_options: []
178
177
  require_paths:
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "uswds"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
File without changes
File without changes