foundation-rails 6.2.3.0 → 6.2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/bower.json +1 -1
  3. data/lib/foundation/rails/version.rb +1 -1
  4. data/lib/generators/foundation/templates/_settings.scss +7 -0
  5. data/vendor/assets/js/foundation.accordion.js.es6 +13 -24
  6. data/vendor/assets/js/foundation.accordionMenu.js.es6 +9 -10
  7. data/vendor/assets/js/foundation.core.js.es6 +1 -1
  8. data/vendor/assets/js/foundation.drilldown.js.es6 +21 -9
  9. data/vendor/assets/js/foundation.dropdown.js.es6 +11 -8
  10. data/vendor/assets/js/foundation.dropdownMenu.js.es6 +46 -21
  11. data/vendor/assets/js/foundation.equalizer.js.es6 +3 -1
  12. data/vendor/assets/js/foundation.interchange.js.es6 +1 -1
  13. data/vendor/assets/js/foundation.magellan.js.es6 +3 -1
  14. data/vendor/assets/js/foundation.offcanvas.js.es6 +41 -27
  15. data/vendor/assets/js/foundation.orbit.js.es6 +23 -15
  16. data/vendor/assets/js/foundation.reveal.js.es6 +10 -3
  17. data/vendor/assets/js/foundation.slider.js.es6 +1 -1
  18. data/vendor/assets/js/foundation.sticky.js.es6 +18 -7
  19. data/vendor/assets/js/foundation.tooltip.js.es6 +2 -1
  20. data/vendor/assets/js/foundation.util.box.js.es6 +2 -2
  21. data/vendor/assets/js/foundation.util.mediaQuery.js.es6 +1 -1
  22. data/vendor/assets/js/foundation.util.nest.js.es6 +1 -1
  23. data/vendor/assets/js/foundation.util.timerAndImageLoader.js.es6 +1 -1
  24. data/vendor/assets/js/foundation.util.triggers.js.es6 +1 -1
  25. data/vendor/assets/scss/components/_button.scss +24 -6
  26. data/vendor/assets/scss/components/_drilldown.scss +1 -1
  27. data/vendor/assets/scss/components/_off-canvas.scss +1 -0
  28. data/vendor/assets/scss/components/_orbit.scss +1 -0
  29. data/vendor/assets/scss/components/_pagination.scss +13 -2
  30. data/vendor/assets/scss/components/_reveal.scss +3 -3
  31. data/vendor/assets/scss/components/_switch.scss +4 -0
  32. data/vendor/assets/scss/components/_table.scss +39 -4
  33. data/vendor/assets/scss/components/_title-bar.scss +0 -4
  34. data/vendor/assets/scss/components/_top-bar.scss +4 -2
  35. data/vendor/assets/scss/forms/_input-group.scss +4 -3
  36. data/vendor/assets/scss/forms/_meter.scss +3 -1
  37. data/vendor/assets/scss/forms/_progress.scss +9 -0
  38. data/vendor/assets/scss/forms/_text.scss +6 -2
  39. data/vendor/assets/scss/foundation.scss +1 -1
  40. data/vendor/assets/scss/grid/_classes.scss +14 -10
  41. data/vendor/assets/scss/grid/_flex-grid.scss +19 -9
  42. data/vendor/assets/scss/grid/_layout.scss +27 -2
  43. data/vendor/assets/scss/grid/_position.scss +4 -1
  44. data/vendor/assets/scss/grid/_row.scss +1 -2
  45. data/vendor/assets/scss/settings/_settings.scss +7 -0
  46. data/vendor/assets/scss/util/_breakpoint.scss +12 -15
  47. data/vendor/assets/scss/util/_color.scss +13 -0
  48. data/vendor/assets/scss/util/_mixins.scss +6 -2
  49. data/vendor/assets/scss/util/_unit.scss +5 -0
  50. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f32f3823c38823acc3571855ddeeabbdd1dd590e
4
- data.tar.gz: d709d42eeede630436458e26a802af0b1f55e946
3
+ metadata.gz: d579a2cb3b53c295b40796b5c4443cee3694fe1f
4
+ data.tar.gz: 5f5e1db125a0f953aa860f3566a047e1cbe33de2
5
5
  SHA512:
6
- metadata.gz: c0113fcb9e16914f67ab0e7565e221fe485cdee87d03dc6644663cf876021533cb57f6efdb4df65bb3fc10d5118dbc22edf51273c281dd1f43b3f4f74e384353
7
- data.tar.gz: 120e60d9f7bbc4a2e6a6f89bef65ec893ba6ac962c8aa2136db96e1d49b312e92bc2f800f5d238aef8992aa4064dc2759417159e3152b286524946fa44a7c834
6
+ metadata.gz: 938991fd768b70aecef5a793f00b35617d622e1caf0bda0a8445068d3f841620f2384ca88069ab81a226dd5a50cc36b1a16a8468567b5f3edc16c778fe34283d
7
+ data.tar.gz: ae2728878fbe3a32a3ed7459307df6b631ffde107ac8ffdfcd48132533749adc51cd317d7141dabd5024381a120b979c9901a5a116459249a8e4177df6581b59
data/bower.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "foundation-rails",
3
3
  "version": "6.2.1.0",
4
4
  "dependencies": {
5
- "foundation-sites": "6.2.3",
5
+ "foundation-sites": "6.2.4",
6
6
  "motion-ui": "1.2.2"
7
7
  }
8
8
  }
@@ -1,5 +1,5 @@
1
1
  module Foundation
2
2
  module Rails
3
- VERSION = "6.2.3.0"
3
+ VERSION = "6.2.4.0"
4
4
  end
5
5
  end
@@ -248,6 +248,8 @@ $button-sizes: (
248
248
  large: 1.25rem,
249
249
  );
250
250
  $button-opacity-disabled: 0.25;
251
+ $button-background-hover-lightness: -20%;
252
+ $button-hollow-hover-lightness: -50%;
251
253
 
252
254
  // 12. Button Group
253
255
  // ----------------
@@ -356,6 +358,7 @@ $input-cursor-disabled: not-allowed;
356
358
  $input-transition: box-shadow 0.5s, border-color 0.25s ease-in-out;
357
359
  $input-number-spinners: true;
358
360
  $input-radius: $global-radius;
361
+ $button-radius: $global-radius;
359
362
 
360
363
  // 20. Label
361
364
  // ---------
@@ -436,6 +439,7 @@ $pagination-item-color-current: foreground($pagination-item-background-current);
436
439
  $pagination-item-color-disabled: $medium-gray;
437
440
  $pagination-ellipsis-color: $black;
438
441
  $pagination-mobile-items: false;
442
+ $pagination-mobile-current-item: false;
439
443
  $pagination-arrows: true;
440
444
 
441
445
  // 27. Progress Bar
@@ -502,8 +506,11 @@ $table-row-stripe-hover: darken($table-background, $table-color-scale + $table-h
502
506
  $table-striped-background: smart-scale($table-background, $table-color-scale);
503
507
  $table-stripe: even;
504
508
  $table-head-background: smart-scale($table-background, $table-color-scale / 2);
509
+ $table-head-row-hover: darken($table-head-background, $table-hover-scale);
505
510
  $table-foot-background: smart-scale($table-background, $table-color-scale);
511
+ $table-foot-row-hover: darken($table-foot-background, $table-hover-scale);
506
512
  $table-head-font-color: $body-font-color;
513
+ $table-foot-font-color: $body-font-color;
507
514
  $show-header-for-stacked: false;
508
515
 
509
516
  // 32. Tabs
@@ -76,16 +76,8 @@ class Accordion {
76
76
  if ($tabContent.length) {
77
77
  $elem.children('a').off('click.zf.accordion keydown.zf.accordion')
78
78
  .on('click.zf.accordion', function(e) {
79
- // $(this).children('a').on('click.zf.accordion', function(e) {
80
79
  e.preventDefault();
81
- if ($elem.hasClass('is-active')) {
82
- if(_this.options.allowAllClosed || $elem.siblings().hasClass('is-active')){
83
- _this.up($tabContent);
84
- }
85
- }
86
- else {
87
- _this.down($tabContent);
88
- }
80
+ _this.toggle($tabContent);
89
81
  }).on('keydown.zf.accordion', function(e){
90
82
  Foundation.Keyboard.handleKey(e, 'Accordion', {
91
83
  toggle: function() {
@@ -115,14 +107,12 @@ class Accordion {
115
107
 
116
108
  /**
117
109
  * Toggles the selected content pane's open/close state.
118
- * @param {jQuery} $target - jQuery object of the pane to toggle.
110
+ * @param {jQuery} $target - jQuery object of the pane to toggle (`.accordion-content`).
119
111
  * @function
120
112
  */
121
113
  toggle($target) {
122
114
  if($target.parent().hasClass('is-active')) {
123
- if(this.options.allowAllClosed || $target.parent().siblings().hasClass('is-active')){
124
- this.up($target);
125
- } else { return; }
115
+ this.up($target);
126
116
  } else {
127
117
  this.down($target);
128
118
  }
@@ -130,25 +120,25 @@ class Accordion {
130
120
 
131
121
  /**
132
122
  * Opens the accordion tab defined by `$target`.
133
- * @param {jQuery} $target - Accordion pane to open.
123
+ * @param {jQuery} $target - Accordion pane to open (`.accordion-content`).
134
124
  * @param {Boolean} firstTime - flag to determine if reflow should happen.
135
125
  * @fires Accordion#down
136
126
  * @function
137
127
  */
138
128
  down($target, firstTime) {
139
- if (!this.options.multiExpand && !firstTime) {
140
- var $currentActive = this.$element.children('.is-active').children('[data-tab-content]');
141
- if($currentActive.length){
142
- this.up($currentActive);
143
- }
144
- }
145
-
146
129
  $target
147
130
  .attr('aria-hidden', false)
148
131
  .parent('[data-tab-content]')
149
132
  .addBack()
150
133
  .parent().addClass('is-active');
151
134
 
135
+ if (!this.options.multiExpand && !firstTime) {
136
+ var $currentActive = this.$element.children('.is-active').children('[data-tab-content]');
137
+ if ($currentActive.length) {
138
+ this.up($currentActive.not($target));
139
+ }
140
+ }
141
+
152
142
  $target.slideDown(this.options.slideSpeed, () => {
153
143
  /**
154
144
  * Fires when the tab is done opening.
@@ -165,16 +155,15 @@ class Accordion {
165
155
 
166
156
  /**
167
157
  * Closes the tab defined by `$target`.
168
- * @param {jQuery} $target - Accordion tab to close.
158
+ * @param {jQuery} $target - Accordion tab to close (`.accordion-content`).
169
159
  * @fires Accordion#up
170
160
  * @function
171
161
  */
172
162
  up($target) {
173
163
  var $aunts = $target.parent().siblings(),
174
164
  _this = this;
175
- var canClose = this.options.multiExpand ? $aunts.hasClass('is-active') : $target.parent().hasClass('is-active');
176
165
 
177
- if(!this.options.allowAllClosed && !canClose) {
166
+ if((!this.options.allowAllClosed && !$aunts.hasClass('is-active')) || !$target.parent().hasClass('is-active')) {
178
167
  return;
179
168
  }
180
169
 
@@ -34,9 +34,7 @@ class AccordionMenu {
34
34
  'ARROW_UP': 'up',
35
35
  'ARROW_DOWN': 'down',
36
36
  'ARROW_LEFT': 'close',
37
- 'ESCAPE': 'closeAll',
38
- 'TAB': 'down',
39
- 'SHIFT_TAB': 'up'
37
+ 'ESCAPE': 'closeAll'
40
38
  });
41
39
  }
42
40
 
@@ -49,7 +47,7 @@ class AccordionMenu {
49
47
  _init() {
50
48
  this.$element.find('[data-submenu]').not('.is-active').slideUp(0);//.find('a').css('padding-left', '1rem');
51
49
  this.$element.attr({
52
- 'role': 'tablist',
50
+ 'role': 'menu',
53
51
  'aria-multiselectable': this.options.multiOpen
54
52
  });
55
53
 
@@ -63,13 +61,13 @@ class AccordionMenu {
63
61
  $elem.attr({
64
62
  'aria-controls': subId,
65
63
  'aria-expanded': isActive,
66
- 'role': 'tab',
64
+ 'role': 'menuitem',
67
65
  'id': linkId
68
66
  });
69
67
  $sub.attr({
70
68
  'aria-labelledby': linkId,
71
69
  'aria-hidden': !isActive,
72
- 'role': 'tabpanel',
70
+ 'role': 'menu',
73
71
  'id': subId
74
72
  });
75
73
  });
@@ -117,8 +115,8 @@ class AccordionMenu {
117
115
  }
118
116
  if ($(this).is(':first-child')) { // is first element of sub menu
119
117
  $prevElement = $element.parents('li').first().find('a').first();
120
- } else if ($prevElement.children('[data-submenu]:visible').length) { // if previous element has open sub menu
121
- $prevElement = $prevElement.find('li:last-child').find('a').first();
118
+ } else if ($prevElement.parents('li').first().children('[data-submenu]:visible').length) { // if previous element has open sub menu
119
+ $prevElement = $prevElement.parents('li').find('li:last-child').find('a').first();
122
120
  }
123
121
  if ($(this).is(':last-child')) { // is last element of sub menu
124
122
  $nextElement = $element.parents('li').first().next('li').find('a').first();
@@ -127,6 +125,7 @@ class AccordionMenu {
127
125
  return;
128
126
  }
129
127
  });
128
+
130
129
  Foundation.Keyboard.handleKey(e, 'AccordionMenu', {
131
130
  open: function() {
132
131
  if ($target.is(':hidden')) {
@@ -143,11 +142,11 @@ class AccordionMenu {
143
142
  }
144
143
  },
145
144
  up: function() {
146
- $prevElement.attr('tabindex', -1).focus();
145
+ $prevElement.focus();
147
146
  return true;
148
147
  },
149
148
  down: function() {
150
- $nextElement.attr('tabindex', -1).focus();
149
+ $nextElement.focus();
151
150
  return true;
152
151
  },
153
152
  toggle: function() {
@@ -2,7 +2,7 @@
2
2
 
3
3
  "use strict";
4
4
 
5
- var FOUNDATION_VERSION = '6.2.2';
5
+ var FOUNDATION_VERSION = '6.2.4';
6
6
 
7
7
  // Global Foundation object
8
8
  // This is attached to the window, or used as a module for AMD/Browserify
@@ -71,7 +71,7 @@ class Drilldown {
71
71
  if(_this.options.parentLink){
72
72
  $link.clone().prependTo($sub.children('[data-submenu]')).wrap('<li class="is-submenu-parent-item is-submenu-item is-drilldown-submenu-item" role="menu-item"></li>');
73
73
  }
74
- $link.data('savedHref', $link.attr('href')).removeAttr('href');
74
+ $link.data('savedHref', $link.attr('href')).removeAttr('href').attr('tabindex', 0);
75
75
  $link.children('[data-submenu]')
76
76
  .attr({
77
77
  'aria-hidden': true,
@@ -188,13 +188,14 @@ class Drilldown {
188
188
  $element.parent('li').parent('ul').parent('li').children('a').first().focus();
189
189
  }, 1);
190
190
  });
191
+ return true;
191
192
  } else if ($element.is(_this.$submenuAnchors)) {
192
193
  _this._show($element.parent('li'));
193
194
  $element.parent('li').one(Foundation.transitionend($element), function(){
194
195
  $element.parent('li').find('ul li a').filter(_this.$menuItems).first().focus();
195
196
  });
197
+ return true;
196
198
  }
197
- return true;
198
199
  },
199
200
  handled: function(preventDefault) {
200
201
  if (preventDefault) {
@@ -237,6 +238,12 @@ class Drilldown {
237
238
  e.stopImmediatePropagation();
238
239
  // console.log('mouseup on back');
239
240
  _this._hide($elem);
241
+
242
+ // If there is a parent submenu, call show
243
+ let parentSubMenu = $elem.parent('li').parent('ul').parent('li');
244
+ if (parentSubMenu.length) {
245
+ _this._show(parentSubMenu);
246
+ }
240
247
  });
241
248
  }
242
249
 
@@ -264,7 +271,8 @@ class Drilldown {
264
271
  * @param {jQuery} $elem - the current element with a submenu to open, i.e. the `li` tag.
265
272
  */
266
273
  _show($elem) {
267
- $elem.children('[data-submenu]').addClass('is-active');
274
+ $elem.attr('aria-expanded', true);
275
+ $elem.children('[data-submenu]').addClass('is-active').attr('aria-hidden', false);
268
276
  /**
269
277
  * Fires when the submenu has opened.
270
278
  * @event Drilldown#open
@@ -280,7 +288,8 @@ class Drilldown {
280
288
  */
281
289
  _hide($elem) {
282
290
  var _this = this;
283
- $elem.addClass('is-closing')
291
+ $elem.parent('li').attr('aria-expanded', false);
292
+ $elem.attr('aria-hidden', true).addClass('is-closing')
284
293
  .one(Foundation.transitionend($elem), function(){
285
294
  $elem.removeClass('is-active is-closing');
286
295
  $elem.blur();
@@ -299,13 +308,15 @@ class Drilldown {
299
308
  * @private
300
309
  */
301
310
  _getMaxDims() {
302
- var max = 0, result = {};
303
- this.$submenus.add(this.$element).each(function(){
304
- var numOfElems = $(this).children('li').length;
305
- max = numOfElems > max ? numOfElems : max;
311
+ var biggest = 0
312
+ var result = {};
313
+
314
+ this.$submenus.add(this.$element).each((i, elem) => {
315
+ var height = elem.getBoundingClientRect().height;
316
+ if (height > biggest) biggest = height;
306
317
  });
307
318
 
308
- result['min-height'] = `${max * this.$menuItems[0].getBoundingClientRect().height}px`;
319
+ result['min-height'] = `${biggest}px`;
309
320
  result['max-width'] = `${this.$element[0].getBoundingClientRect().width}px`;
310
321
 
311
322
  return result;
@@ -327,6 +338,7 @@ class Drilldown {
327
338
  });
328
339
  this.$element.find('a').each(function(){
329
340
  var $link = $(this);
341
+ $link.removeAttr('tabindex');
330
342
  if($link.data('savedHref')){
331
343
  $link.attr('href', $link.data('savedHref')).removeData('savedHref');
332
344
  }else{ return; }
@@ -41,7 +41,7 @@ class Dropdown {
41
41
  _init() {
42
42
  var $id = this.$element.attr('id');
43
43
 
44
- this.$anchor = $(`[data-toggle="${$id}"]`) || $(`[data-open="${$id}"]`);
44
+ this.$anchor = $(`[data-toggle="${$id}"]`).length ? $(`[data-toggle="${$id}"]`) : $(`[data-open="${$id}"]`);
45
45
  this.$anchor.attr({
46
46
  'aria-controls': $id,
47
47
  'data-is-focus': false,
@@ -71,9 +71,10 @@ class Dropdown {
71
71
  getPositionClass() {
72
72
  var verticalPosition = this.$element[0].className.match(/(top|left|right|bottom)/g);
73
73
  verticalPosition = verticalPosition ? verticalPosition[0] : '';
74
- var horizontalPosition = /float-(\S+)\s/.exec(this.$anchor[0].className);
74
+ var horizontalPosition = /float-(\S+)/.exec(this.$anchor[0].className);
75
75
  horizontalPosition = horizontalPosition ? horizontalPosition[1] : '';
76
76
  var position = horizontalPosition ? horizontalPosition + ' ' + verticalPosition : verticalPosition;
77
+
77
78
  return position;
78
79
  }
79
80
 
@@ -168,12 +169,14 @@ class Dropdown {
168
169
 
169
170
  if(this.options.hover){
170
171
  this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')
171
- .on('mouseenter.zf.dropdown', function(){
172
- clearTimeout(_this.timeout);
173
- _this.timeout = setTimeout(function(){
174
- _this.open();
175
- _this.$anchor.data('hover', true);
176
- }, _this.options.hoverDelay);
172
+ .on('mouseenter.zf.dropdown', function(){
173
+ if($('body[data-whatinput="mouse"]').is('*')) {
174
+ clearTimeout(_this.timeout);
175
+ _this.timeout = setTimeout(function(){
176
+ _this.open();
177
+ _this.$anchor.data('hover', true);
178
+ }, _this.options.hoverDelay);
179
+ }
177
180
  }).on('mouseleave.zf.dropdown', function(){
178
181
  clearTimeout(_this.timeout);
179
182
  _this.timeout = setTimeout(function(){
@@ -59,6 +59,11 @@ class DropdownMenu {
59
59
  this.changed = false;
60
60
  this._events();
61
61
  };
62
+
63
+ _isVertical() {
64
+ return this.$tabs.css('display') === 'block';
65
+ }
66
+
62
67
  /**
63
68
  * Adds event listeners to elements within the menu
64
69
  * @private
@@ -87,10 +92,15 @@ class DropdownMenu {
87
92
  } else {
88
93
  e.preventDefault();
89
94
  e.stopImmediatePropagation();
90
- _this._show($elem.children('.is-dropdown-submenu'));
95
+ _this._show($sub);
91
96
  $elem.add($elem.parentsUntil(_this.$element, `.${parClass}`)).attr('data-is-click', true);
92
97
  }
93
- } else { return; }
98
+ } else {
99
+ if(_this.options.closeOnClickInside){
100
+ _this._hide($elem);
101
+ }
102
+ return;
103
+ }
94
104
  };
95
105
 
96
106
  if (this.options.clickOpen || hasTouch) {
@@ -172,42 +182,51 @@ class DropdownMenu {
172
182
  };
173
183
 
174
184
  if (isTab) {
175
- if (_this.$element.hasClass(_this.options.verticalClass)) { // vertical menu
176
- if (_this.options.alignment === 'left') { // left aligned
185
+ if (_this._isVertical()) { // vertical menu
186
+ if (Foundation.rtl()) { // right aligned
177
187
  $.extend(functions, {
178
188
  down: nextSibling,
179
189
  up: prevSibling,
180
- next: openSub,
181
- previous: closeSub
190
+ next: closeSub,
191
+ previous: openSub
182
192
  });
183
- } else { // right aligned
193
+ } else { // left aligned
184
194
  $.extend(functions, {
185
195
  down: nextSibling,
186
196
  up: prevSibling,
187
- next: closeSub,
188
- previous: openSub
197
+ next: openSub,
198
+ previous: closeSub
189
199
  });
190
200
  }
191
201
  } else { // horizontal menu
192
- $.extend(functions, {
193
- next: nextSibling,
194
- previous: prevSibling,
195
- down: openSub,
196
- up: closeSub
197
- });
202
+ if (Foundation.rtl()) { // right aligned
203
+ $.extend(functions, {
204
+ next: prevSibling,
205
+ previous: nextSibling,
206
+ down: openSub,
207
+ up: closeSub
208
+ });
209
+ } else { // left aligned
210
+ $.extend(functions, {
211
+ next: nextSibling,
212
+ previous: prevSibling,
213
+ down: openSub,
214
+ up: closeSub
215
+ });
216
+ }
198
217
  }
199
218
  } else { // not tabs -> one sub
200
- if (_this.options.alignment === 'left') { // left aligned
219
+ if (Foundation.rtl()) { // right aligned
201
220
  $.extend(functions, {
202
- next: openSub,
203
- previous: closeSub,
221
+ next: closeSub,
222
+ previous: openSub,
204
223
  down: nextSibling,
205
224
  up: prevSibling
206
225
  });
207
- } else { // right aligned
226
+ } else { // left aligned
208
227
  $.extend(functions, {
209
- next: closeSub,
210
- previous: openSub,
228
+ next: openSub,
229
+ previous: closeSub,
211
230
  down: nextSibling,
212
231
  up: prevSibling
213
232
  });
@@ -378,6 +397,12 @@ DropdownMenu.defaults = {
378
397
  * @example true
379
398
  */
380
399
  closeOnClick: true,
400
+ /**
401
+ * Allow clicks on leaf anchor links to close any open submenus.
402
+ * @option
403
+ * @example true
404
+ */
405
+ closeOnClickInside: true,
381
406
  /**
382
407
  * Class applied to vertical oriented menus, Foundation default is `vertical`. Update this if using your own class.
383
408
  * @option