ratchet_design 0.1.12 → 0.1.13

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ratchet/base/form.js +9 -3
  3. data/app/assets/javascripts/ratchet/base/sync-input-value.js +9 -18
  4. data/app/assets/javascripts/ratchet/core.js +9 -3
  5. data/app/assets/javascripts/ratchet/enhancement/lightbox.js +6 -6
  6. data/app/assets/javascripts/ratchet/enhancement/mapbox.js +48 -0
  7. data/app/assets/stylesheets/ratchet/_core.scss +4 -2
  8. data/app/assets/stylesheets/ratchet/base/_button.scss +15 -14
  9. data/app/assets/stylesheets/ratchet/base/_document.scss +30 -66
  10. data/app/assets/stylesheets/ratchet/base/_form.scss +162 -529
  11. data/app/assets/stylesheets/ratchet/base/_label-placeholder.scss +97 -0
  12. data/app/assets/stylesheets/ratchet/base/_media.scss +1 -1
  13. data/app/assets/stylesheets/ratchet/base/_multistep-form.scss +65 -11
  14. data/app/assets/stylesheets/ratchet/base/_section.scss +284 -0
  15. data/app/assets/stylesheets/ratchet/base/_table.scss +4 -4
  16. data/app/assets/stylesheets/ratchet/base/_text.scss +50 -45
  17. data/app/assets/stylesheets/ratchet/base/_validation.scss +83 -0
  18. data/app/assets/stylesheets/ratchet/enhancement/_hero.scss +39 -39
  19. data/app/assets/stylesheets/ratchet/utility/_color.scss +135 -0
  20. data/app/assets/stylesheets/ratchet/utility/_global.scss +21 -40
  21. data/app/assets/stylesheets/ratchet/utility/_loader.scss +1 -1
  22. data/app/helpers/ratchet/application_helper.rb +16 -10
  23. data/app/helpers/ratchet/form_helper.rb +302 -18
  24. data/app/views/layouts/ratchet/default.html.slim +2 -2
  25. data/app/views/shared/ratchet/_defs.html.slim +67 -0
  26. data/app/views/shared/ratchet/_footer.html.slim +6 -0
  27. data/app/views/shared/ratchet/_header.html.slim +5 -0
  28. data/app/views/shared/ratchet/_icons.html.slim +53 -6
  29. data/lib/ratchet_design/version.rb +1 -1
  30. data/public/{core-0.1.12.js → core-0.1.13.js} +66 -66
  31. data/public/core-0.1.13.js.gz +0 -0
  32. data/public/core-0.1.13.map.json +1 -0
  33. data/public/{fonts-woff-0.1.12.css → fonts-woff-0.1.13.css} +0 -0
  34. data/public/{fonts-woff-0.1.12.css.gz → fonts-woff-0.1.13.css.gz} +0 -0
  35. data/public/{fonts-woff2-0.1.12.css → fonts-woff2-0.1.13.css} +0 -0
  36. data/public/{fonts-woff2-0.1.12.css.gz → fonts-woff2-0.1.13.css.gz} +0 -0
  37. metadata +36 -32
  38. data/app/assets/javascripts/ratchet/utility/loader.js +0 -84
  39. data/app/assets/stylesheets/ratchet/enhancement/_contrast-section.scss +0 -22
  40. data/public/core-0.1.12.js.gz +0 -0
  41. data/public/core-0.1.12.map.json +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc99e2c25f82c3a23a552194e2bbfdd1a6c74aa2
4
- data.tar.gz: 58144f1e8dfd925c152ae286910df228be26f8b1
3
+ metadata.gz: bf3b0a96221d6598ec994393ab364e5654dce97d
4
+ data.tar.gz: 0209b1415a7f270d57a129df5cbffdaa271c44fc
5
5
  SHA512:
6
- metadata.gz: c121fb3c5243341fa74686b74952a4965130a4df607edf3225ebfbdf650f38a72f3db0d997c1173f37f1f1005724d7d2303e417d02e5a82a10bd76a57c67bef5
7
- data.tar.gz: 329b50cbaecafc123722ae1ef965a38ed1d49c2a04e2dddecfc4979b0bc7abeacfc21a999ab62c4ac0d3538d5f1af768ae9fb61cb59e971b52c90d1a76cae794
6
+ metadata.gz: 39dafdfaf803fa32f81fc1dc90f9caa2e263158179d2b97babed02d8e63a0a13a7f9130bcafb89d5119c624e005b32c3dcca2f350e73849887a111f3e4d851e4
7
+ data.tar.gz: fe1a872b9181fd712f5d59291e216968d873fd5bdc641e42772aeb26bf4e0213605b04a0ea407201b11bf91fbe3c326c3fe3cfc33aa95f7b49f926f951601d0c
@@ -59,7 +59,7 @@ var form = function( element, settings ) {
59
59
  // Simply add the `tick-label` classname
60
60
  labelParent.classList.add( 'tick-label' );
61
61
 
62
- // Otherwise
62
+ // Otherwise
63
63
  } else {
64
64
 
65
65
  // Wrap the element properly
@@ -69,7 +69,7 @@ var form = function( element, settings ) {
69
69
  }
70
70
 
71
71
  // And add empty span to label
72
- elem.insertAdjacentHTML( 'afterend', '<span></span>' );
72
+ elem.insertAdjacentHTML( 'afterend', '<span class="tick-label"></span>' );
73
73
 
74
74
  }
75
75
 
@@ -89,6 +89,12 @@ var form = function( element, settings ) {
89
89
  // Range input hander function
90
90
  function rangeHandler( event ) {
91
91
 
92
+ // Define local variable(s)
93
+ var currValue = rangeEls.value,
94
+ maxValue = rangeEls.max,
95
+ minValue = rangeEls.min,
96
+ percValue = currValue / maxValue * 100;
97
+
92
98
  // Define target element
93
99
  var element = ( event.target ) ? event.target : event;
94
100
 
@@ -101,7 +107,7 @@ var form = function( element, settings ) {
101
107
  var percValue = ( element.max ) ? element.value / element.max * 100 : element.value / 100 * 100;
102
108
 
103
109
  // Style bar accordingly
104
- element.style.backgroundImage = 'linear-gradient(90deg, #009DDC ' + percValue + '%, #D1D1D1 ' + percValue + '%)';
110
+ element.style.backgroundImage = 'linear-gradient(90deg, #c3d4e4 ' + percValue + '%, #ffffff ' + percValue + '%)';
105
111
 
106
112
  }
107
113
 
@@ -1,30 +1,21 @@
1
1
  var toolbox = require( 'compose-toolbox' )
2
2
  var Event = toolbox.event
3
- var textSelectors = 'textarea, input[type=url], input[type=tel], input[type=text], input[type=email], input[type=number], input[type=password]'
4
-
5
- Event.bubbleFormEvents()
6
-
7
- function textInputs() {
8
- return document.querySelectorAll( textSelectors )
9
- }
3
+ var textSelectors = 'textarea, input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=hidden]):not([type=submit]):not([type=image]):not([type=reset])'
10
4
 
11
5
  function syncValue( input ) {
12
6
 
13
7
  // Allow calling from event handler
14
- if ( input.target ) { input = input.target }
15
-
16
- // If element only contains whitespace, strip value
17
- if ( !input.value.replace( /\s/g, '' ).length ) { input.value = ''; }
18
-
19
- input.setAttribute( 'value', input.value )
8
+ input = ( input.target || input )
20
9
 
10
+ // If element is empty (or contains only whitespace)
11
+ // Add empty class
12
+ input.classList.toggle( 'empty', !input.value.trim().length )
21
13
  }
22
14
 
15
+ // Initialize input state
23
16
  Event.change( function() {
24
-
25
- // Ensure that all inputs have a value
26
- toolbox.each( textInputs(), syncValue )
27
-
17
+ toolbox.each( document.querySelectorAll( textSelectors ), syncValue )
28
18
  })
29
19
 
30
- Event.on( document, 'blur', 'input', syncValue )
20
+ // Set input state on keyup (debounced)
21
+ Event.on( document, 'keyup', textSelectors, Event.debounce( syncValue, 100 ) )
@@ -1,6 +1,7 @@
1
1
  // Utility modules
2
- var loadFont = require( './utility/load_font' )
3
- var loadScript = require( './utility/load_script' )
2
+ var loadFont = require( './utility/load_font' );
3
+ var loadScript = require( './utility/load_script' );
4
+ var toggler = require('compose-toggler')
4
5
 
5
6
  // Base modules
6
7
  var mobileMenu = require( './base/mobilemenu' )
@@ -45,7 +46,10 @@ require( 'codemirror/addon/edit/matchbrackets' )
45
46
  rangeTouch.set("thumbWidth", 20); // Annoying hack to make input ranges work smoothly on touch devices
46
47
 
47
48
  event.scroll.disablePointer() // disable pointer events on scroll for performance (to avoid extra repaints)
48
- event.resize.disableAnimation() // disable animation on resize for performance (to avoid extra repaints)
49
+
50
+ // This seems to trigger animations whenever it is turned on again
51
+ // So I've disabled it for now
52
+ //event.resize.disableAnimation() // disable animation on resize for performance (to avoid extra repaints)
49
53
 
50
54
  // Trigger these events each time the page loads
51
55
  event.change( function() {
@@ -65,11 +69,13 @@ var ratchet = toolbox.merge( {
65
69
  loader : loader,
66
70
  mobileMenu : mobileMenu,
67
71
  form : form,
72
+ toggler : toggler,
68
73
  validation : formUp.validate,
69
74
  waypoints : waypoints,
70
75
  notice : notice,
71
76
  sticky : sticky,
72
77
  lightbox : lightbox,
78
+ //mapbox : mapbox,
73
79
  esvg : esvg
74
80
  }, toolbox )
75
81
 
@@ -9,7 +9,7 @@
9
9
  var toolbox = require( 'compose-toolbox' ),
10
10
  Event = toolbox.event,
11
11
  delay = toolbox.delay,
12
- loader = require( '../utility/loader' );
12
+ loader = require( 'compose-loader' )
13
13
 
14
14
  // Public API function
15
15
  var lightbox = function( element, settings ) {
@@ -26,8 +26,8 @@ var lightbox = function( element, settings ) {
26
26
  options = toolbox.merge( defaults, settings ),
27
27
  selector = document.querySelector( element ),
28
28
  widthQuery = window.matchMedia( '(max-width: ' + options.initWidth + ')' ),
29
- spinner = loader({ loadingMessage: 'Loading image', failureMessage : 'No image found' }),
30
29
  docBody = document.body,
30
+ spinner = loader.new({ loading: 'Loading image', failure : 'No image found' }),
31
31
  tempImg;
32
32
 
33
33
  // Only run when selectors exist
@@ -57,7 +57,7 @@ var lightbox = function( element, settings ) {
57
57
  if ( event && event.target.tagName === 'IMG' ) return false;
58
58
 
59
59
  // Hide the spinner
60
- spinner.hide();
60
+ spinner.remove();
61
61
 
62
62
  // Remove active lightbox class from body
63
63
  docBody.classList.remove( 'lightbox-active' );
@@ -74,7 +74,7 @@ var lightbox = function( element, settings ) {
74
74
  function loadPending( target ) {
75
75
 
76
76
  // Show loading icon
77
- spinner.show( 'pending' );
77
+ spinner.loading();
78
78
 
79
79
  // Set temp image source appropriately
80
80
  tempImg.src = target.parentNode.href;
@@ -88,7 +88,7 @@ var lightbox = function( element, settings ) {
88
88
  function loadSuccess() {
89
89
 
90
90
  // Hide the spinner
91
- spinner.hide();
91
+ spinner.remove();
92
92
 
93
93
  // Bada bing, bada boom
94
94
  tempImg.classList.add( 'loaded' );
@@ -102,7 +102,7 @@ var lightbox = function( element, settings ) {
102
102
  delay( function() {
103
103
 
104
104
  // Show spinner failure state
105
- spinner.show( 'failure' );
105
+ spinner.failure();
106
106
 
107
107
  }, 1000 );
108
108
 
@@ -0,0 +1,48 @@
1
+ /**
2
+ * LoadScript 0.0.1
3
+ * Load external JavaScript function
4
+ * @author Matt Gillespie (@SaveTheTweets)
5
+ **/
6
+
7
+ // Tooltips for deployment locations
8
+ // var myLayer = L.mapbox.featureLayer().addTo(map);
9
+
10
+ // var geojson = {
11
+ // type: 'FeatureCollection',
12
+ // features: [{
13
+ // type: 'Feature',
14
+ // properties: {
15
+ // title: 'Washington, D.C.',
16
+ // 'marker-color': '#f86767',
17
+ // 'marker-size': 'large',
18
+ // 'marker-symbol': 'star',
19
+ // url: 'http://en.wikipedia.org/wiki/Washington,_D.C.'
20
+ // },
21
+ // geometry: {
22
+ // type: 'Point',
23
+ // coordinates: [-77.03201, 38.90065]
24
+ // }
25
+ // },
26
+ // {
27
+ // type: 'Feature',
28
+ // properties: {
29
+ // title: 'Baltimore, MD',
30
+ // 'marker-color': '#7ec9b1',
31
+ // 'marker-size': 'large',
32
+ // 'marker-symbol': 'star',
33
+ // url: 'http://en.wikipedia.org/wiki/Baltimore'
34
+ // },
35
+ // geometry: {
36
+ // type: 'Point',
37
+ // coordinates: [-76.60767, 39.28755]
38
+ // }
39
+ // }]
40
+ // };
41
+
42
+ // myLayer.setGeoJSON(geojson);
43
+ // myLayer.on('mouseover', function(e) {
44
+ // e.layer.openPopup();
45
+ // });
46
+ // myLayer.on('mouseout', function(e) {
47
+ // e.layer.closePopup();
48
+ // });
@@ -10,14 +10,16 @@
10
10
  @import 'base/media';
11
11
  @import 'base/form';
12
12
  @import 'base/multistep-form';
13
+ @import 'base/validation';
14
+ @import 'base/label-placeholder';
13
15
  @import 'base/table';
14
16
  @import 'base/document';
17
+ @import 'base/section';
15
18
 
16
19
  // Enhancement modules
17
20
  @import 'enhancement/feature';
18
21
  @import 'enhancement/sticky-sidebar';
19
22
  @import 'enhancement/notice';
20
23
  @import 'enhancement/hero';
21
- @import 'enhancement/contrast-section';
22
24
  @import 'enhancement/tooltip';
23
- @import 'enhancement/lightbox';
25
+ @import 'enhancement/lightbox';
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  // Resizable / colorable buttons
29
- @mixin button($color: $cerulean, $size: normal, $fill: on, $bevel: off) {
29
+ @mixin button($color: $azure, $size: normal, $fill: on, $bevel: off) {
30
30
 
31
31
  // Define default variables
32
32
  $font-size: 16px;
@@ -38,19 +38,19 @@
38
38
 
39
39
  // Define color-based variables
40
40
  @if $color == primary {
41
- $color: $cerulean;
41
+ $color: $azure;
42
42
  } @else if $color == secondary {
43
- $color: $flush;
43
+ $color: $mulberry;
44
44
  } @else if $color == success {
45
- $color: $apple;
45
+ $color: $caribbean;
46
46
  } @else if $color == failure {
47
- $color: $punch;
47
+ $color: $rusty;
48
48
  }
49
49
 
50
50
  // Define size-based variables
51
51
  @if $size == small {
52
- $font-size: 13px;
53
- $padding: 3px 14px 0;
52
+ $font-size: 14px;
53
+ $padding: 3px 14px;
54
54
  $margin-top: 15px;
55
55
  $margin-bottom: 20px;
56
56
  } @else if $size == large {
@@ -76,7 +76,7 @@
76
76
  margin-top: $margin-top;
77
77
  margin-bottom: $margin-bottom;
78
78
  transition: $duration;
79
- border-radius: $border-radius;
79
+ // border-radius: $border-radius;
80
80
 
81
81
  // Default
82
82
  &,
@@ -84,7 +84,8 @@
84
84
  @if $fill == on {
85
85
  color: $white;
86
86
  background: $color;
87
- border: 1px solid darken($color, 3);
87
+ border: none;
88
+ // border: 1px solid darken($color, 3);
88
89
  } @else {
89
90
  color: $color;
90
91
  background: transparent;
@@ -99,9 +100,9 @@
99
100
  @if $fill == on {
100
101
  color: $white;
101
102
  background: darken($color, 3);
102
- border: 1px solid darken($color, 3);
103
+ border: none;
103
104
  } @else if $fill == off and $color == $white {
104
- color: $cerulean;
105
+ color: $azure;
105
106
  background: $color;
106
107
  } @else {
107
108
  color: $white;
@@ -111,9 +112,9 @@
111
112
 
112
113
  // Disabled
113
114
  &[disabled] {
114
- color: $nobel;
115
- background: $iron;
116
- border-color: $alto;
115
+ // color: $smoke;
116
+ background: lighten($color, 33);
117
+ // border-color: $alabaster;
117
118
  text-shadow: none;
118
119
  pointer-events: none;
119
120
  }
@@ -7,7 +7,11 @@
7
7
  * ------------------------------------- */
8
8
 
9
9
  // Point at which mobile menu is visible
10
+ $breakpoint-xlg: 1500px;
11
+ $breakpoint-lg: 1100px;
10
12
  $breakpoint: 800px;
13
+ $breakpoint-sm: 550px;
14
+ $breakpoint-xsm: 400px;
11
15
 
12
16
  // Transparent headers (for use with hero banners)
13
17
  @mixin transparent-header {
@@ -26,16 +30,15 @@ $breakpoint: 800px;
26
30
 
27
31
  // Transparent header extendable placeholder
28
32
  %transparent-header {
29
- @include transparent-header;
30
- }
33
+ @include transparent-header; }
31
34
 
32
35
  // Header link styles
33
36
  %header-link {
34
37
  cursor: pointer;
35
38
  flex-shrink: 0;
36
- font-size: 13px;
37
- font-weight: 700;
38
- text-transform: uppercase;
39
+ font-size: 14px;
40
+ font-weight: 400;
41
+ // text-transform: uppercase;
39
42
  }
40
43
 
41
44
  // Logo home link styles
@@ -53,6 +56,7 @@ $breakpoint: 800px;
53
56
  // Header button styles
54
57
  %header-button {
55
58
  @include button($size: small, $color: $white, $fill: off, $bevel: on);
59
+ font-weight: 400;
56
60
  margin-top: 0;
57
61
  margin-bottom: 0;
58
62
  }
@@ -130,10 +134,18 @@ body {
130
134
  display: flex;
131
135
  min-height: 100vh;
132
136
  flex-direction: column;
133
- color: $capecod;
134
- font-weight: 300;
137
+ color: $space;
138
+ font-weight: 400;
135
139
  font-size: $base-size;
136
140
  line-height: $base-height;
141
+ overflow-x: hidden;
142
+
143
+ a,
144
+ input,
145
+ a:hover,
146
+ input:hover {
147
+ transition: all $duration ease;
148
+ }
137
149
  }
138
150
 
139
151
  /* ===================================== *
@@ -148,7 +160,7 @@ header[role=banner] {
148
160
  z-index: 12;
149
161
  color: $white;
150
162
  @include padded-module; // 1100px width & 30px padding
151
- @include cover-background($cerulean linear-gradient(to bottom right, $cerulean, mix($orchid, $cerulean, 75%)) no-repeat fixed);
163
+ @include cover-background($azure linear-gradient(to bottom right, $azure, mix($mulberry, $azure, 75%)) no-repeat fixed);
152
164
 
153
165
  a {
154
166
  @extend %header-link;
@@ -234,7 +246,7 @@ header[role=banner] > nav[role=navigation] {
234
246
  header[role=banner] > nav[role=navigation] {
235
247
  opacity: 1;
236
248
  transform: translateX(0);
237
- background: rgba($shark, .95);
249
+ background: rgba($space, .95);
238
250
  transition:
239
251
  .5s opacity,
240
252
  .5s background;
@@ -254,66 +266,18 @@ main {
254
266
  }
255
267
 
256
268
  /* ===================================== *
257
- * vii. Footer
269
+ * vii. Ratchet Footer
258
270
  * ------------------------------------- */
259
271
 
260
272
  // Main site footer
261
273
  footer[role=contentinfo] {
262
- color: $nobel;
274
+ color: $pewter;
275
+ font-size: vr(1);
263
276
  @include padded-module; // 1100px width & 30px padding
264
- @include cover-background($capecod);
265
- }
277
+ @include cover-background($shark);
266
278
 
267
- // footer[role="contentinfo"] {
268
- // width: 100%;
269
- // color: $aluminum;
270
- // font-size: .778em;
271
-
272
- // .footer-nav {
273
- // // @extend %column-container;
274
- // }
275
-
276
- // dl {
277
- // // @include one-of-four(false);
278
-
279
- // @media (max-width: 720px) {
280
- // // @include one-of-two(false);
281
- // }
282
- // }
283
-
284
- // dt {
285
- // @extend %caps;
286
- // color: $white;
287
- // margin-bottom: .5rem;
288
- // }
289
-
290
- // dd > a {
291
- // display: inline;
292
- // font-weight: 700;
293
- // @include underlined-link(inherit, $white);
294
-
295
- // &:after {
296
- // content: '\A';
297
- // white-space: pre;
298
- // }
299
- // }
300
-
301
- // // Social icons
302
- // .social-nav {
303
- // margin-top: 1.5rem;
304
- // @extend %social-icons;
305
-
306
- // a {
307
- // margin-bottom: 5px;
308
- // @include rounded-btn($aluminum, $cerulean, $white, 30px);
309
- // }
310
- // }
311
-
312
- // // Copyright
313
- // p {
314
- // font-size: .857em;
315
- // text-align: center;
316
- // margin-top: 40px;
317
- // margin-bottom: 40px;
318
- // }
319
- // }
279
+ > * {
280
+ @include grid;
281
+ padding: vr(3) 0;
282
+ }
283
+ }