material-sass 4.0.0.alpha6 → 4.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +36 -8
  4. data/Rakefile +16 -3
  5. data/app/assets/javascripts/material-sprockets.js +6 -1
  6. data/app/assets/javascripts/material.js +654 -417
  7. data/app/assets/javascripts/material.min.js +1 -0
  8. data/app/assets/javascripts/material/addons/picker.date.js +234 -0
  9. data/app/assets/javascripts/material/addons/picker.js +172 -0
  10. data/app/assets/javascripts/material/addons/textarea-autosize.js +20 -2
  11. data/app/assets/javascripts/material/addons/waves.js +127 -0
  12. data/app/assets/javascripts/material/components/floating-label.js +92 -0
  13. data/app/assets/javascripts/material/components/navdrawer.js +353 -0
  14. data/app/assets/javascripts/material/components/selection-control-focus.js +47 -0
  15. data/app/assets/javascripts/material/components/tab-switch.js +148 -0
  16. data/app/assets/javascripts/material/components/util.js +133 -0
  17. data/app/assets/javascripts/material/initializers/picker.js +171 -0
  18. data/app/assets/javascripts/material/initializers/textarea-autosize.js +10 -0
  19. data/app/assets/javascripts/material/initializers/waves.js +13 -0
  20. data/app/assets/stylesheets/material/_colours.scss +324 -0
  21. data/app/assets/stylesheets/material/_functions.scss +65 -0
  22. data/app/assets/stylesheets/material/_mixins.scss +23 -23
  23. data/app/assets/stylesheets/material/_print.scss +102 -0
  24. data/app/assets/stylesheets/material/_utilities.scss +21 -17
  25. data/app/assets/stylesheets/material/_variables.scss +13 -42
  26. data/app/assets/stylesheets/material/base/_base.scss +420 -5
  27. data/app/assets/stylesheets/material/base/_grid.scss +34 -33
  28. data/app/assets/stylesheets/material/base/_typography.scss +165 -174
  29. data/app/assets/stylesheets/material/bootstrap/_alert.scss +32 -39
  30. data/app/assets/stylesheets/material/bootstrap/_badge.scss +34 -0
  31. data/app/assets/stylesheets/material/bootstrap/_breadcrumb.scss +18 -18
  32. data/app/assets/stylesheets/material/bootstrap/_carousel.scss +127 -142
  33. data/app/assets/stylesheets/material/bootstrap/_close.scss +18 -19
  34. data/app/assets/stylesheets/material/bootstrap/_code.scss +10 -7
  35. data/app/assets/stylesheets/material/bootstrap/_custom-form.scss +50 -56
  36. data/app/assets/stylesheets/material/bootstrap/_form.scss +159 -129
  37. data/app/assets/stylesheets/material/bootstrap/_image.scss +19 -16
  38. data/app/assets/stylesheets/material/bootstrap/_jumbotron.scss +10 -7
  39. data/app/assets/stylesheets/material/bootstrap/_nav.scss +71 -69
  40. data/app/assets/stylesheets/material/bootstrap/_pagination.scss +34 -26
  41. data/app/assets/stylesheets/material/bootstrap/_popover.scss +26 -59
  42. data/app/assets/stylesheets/material/bootstrap/_responsive-embed.scss +4 -4
  43. data/app/assets/stylesheets/material/bootstrap/_transition.scss +10 -8
  44. data/app/assets/stylesheets/material/material.scss +75 -62
  45. data/app/assets/stylesheets/material/material/_button-flat.scss +26 -39
  46. data/app/assets/stylesheets/material/material/_button-float.scss +10 -14
  47. data/app/assets/stylesheets/material/material/_button-group.scss +268 -0
  48. data/app/assets/stylesheets/material/material/_button.scss +133 -189
  49. data/app/assets/stylesheets/material/material/_card.scss +300 -248
  50. data/app/assets/stylesheets/material/material/_chip.scss +65 -64
  51. data/app/assets/stylesheets/material/material/_data-table.scss +135 -45
  52. data/app/assets/stylesheets/material/material/_dialog.scss +141 -110
  53. data/app/assets/stylesheets/material/material/_expansion-panel.scss +86 -119
  54. data/app/assets/stylesheets/material/material/_menu.scss +308 -228
  55. data/app/assets/stylesheets/material/material/_navdrawer.scss +239 -234
  56. data/app/assets/stylesheets/material/material/_picker.scss +157 -155
  57. data/app/assets/stylesheets/material/material/_progress-circular.scss +80 -80
  58. data/app/assets/stylesheets/material/material/_progress.scss +180 -115
  59. data/app/assets/stylesheets/material/material/_selection-control.scss +132 -139
  60. data/app/assets/stylesheets/material/material/_stepper.scss +94 -93
  61. data/app/assets/stylesheets/material/material/_tab.scss +74 -93
  62. data/app/assets/stylesheets/material/material/_text-field-floating-label.scss +29 -20
  63. data/app/assets/stylesheets/material/material/_text-field-input-group.scss +94 -24
  64. data/app/assets/stylesheets/material/material/_text-field-textarea.scss +13 -26
  65. data/app/assets/stylesheets/material/material/_text-field.scss +127 -118
  66. data/app/assets/stylesheets/material/material/_toolbar.scss +308 -313
  67. data/app/assets/stylesheets/material/material/_tooltip.scss +23 -62
  68. data/app/assets/stylesheets/material/mixins/_background-variant.scss +6 -6
  69. data/app/assets/stylesheets/material/mixins/_border-radius.scss +17 -17
  70. data/app/assets/stylesheets/material/mixins/_breakpoint.scss +32 -2
  71. data/app/assets/stylesheets/material/mixins/_clearfix.scss +1 -1
  72. data/app/assets/stylesheets/material/mixins/_form.scss +62 -25
  73. data/app/assets/stylesheets/material/mixins/_grid-framework.scss +8 -16
  74. data/app/assets/stylesheets/material/mixins/_grid.scss +40 -64
  75. data/app/assets/stylesheets/material/mixins/_material-icons.scss +36 -0
  76. data/app/assets/stylesheets/material/mixins/_nav-divider.scss +1 -1
  77. data/app/assets/stylesheets/material/mixins/_reset-text.scss +2 -21
  78. data/app/assets/stylesheets/material/mixins/_screenreader.scss +14 -12
  79. data/app/assets/stylesheets/material/mixins/_text-alignment.scss +23 -0
  80. data/app/assets/stylesheets/material/mixins/_text-emphasis.scss +6 -6
  81. data/app/assets/stylesheets/material/mixins/_transition.scss +42 -10
  82. data/app/assets/stylesheets/material/utilities/_background.scss +18 -18
  83. data/app/assets/stylesheets/material/utilities/_border.scss +88 -41
  84. data/app/assets/stylesheets/material/utilities/_display.scss +63 -30
  85. data/app/assets/stylesheets/material/utilities/_flex.scss +139 -134
  86. data/app/assets/stylesheets/material/utilities/_material-icons.scss +3 -5
  87. data/app/assets/stylesheets/material/utilities/_position.scss +19 -22
  88. data/app/assets/stylesheets/material/utilities/_sizing.scss +11 -12
  89. data/app/assets/stylesheets/material/utilities/_spacing.scss +51 -56
  90. data/app/assets/stylesheets/material/utilities/_text.scss +80 -75
  91. data/app/assets/stylesheets/material/utilities/_visibility.scss +5 -46
  92. data/app/assets/stylesheets/material/utilities/_waves.scss +11 -18
  93. data/app/assets/stylesheets/material/variables/_elevation-shadow.scss +89 -82
  94. data/app/assets/stylesheets/material/variables/_grid.scss +29 -26
  95. data/app/assets/stylesheets/material/variables/_palette.scss +45 -0
  96. data/app/assets/stylesheets/material/variables/_spacer.scss +34 -88
  97. data/app/assets/stylesheets/material/variables/_transition.scss +29 -0
  98. data/app/assets/stylesheets/material/variables/_typography.scss +88 -74
  99. data/app/assets/stylesheets/material/variables/_variable-bootstrap.scss +196 -133
  100. data/app/assets/stylesheets/material/variables/_variable-material.scss +481 -429
  101. data/lib/material-sass/version.rb +1 -1
  102. data/material-sass.gemspec +3 -3
  103. metadata +26 -21
  104. data/app/assets/javascripts/material/addons-materialise/pickadate.js +0 -139
  105. data/app/assets/javascripts/material/addons-materialise/textarea-autosize.js +0 -11
  106. data/app/assets/javascripts/material/addons-materialise/wave.js +0 -15
  107. data/app/assets/javascripts/material/addons/pickadate.js +0 -7
  108. data/app/assets/javascripts/material/addons/wave.js +0 -5
  109. data/app/assets/javascripts/material/src/floating-label.js +0 -91
  110. data/app/assets/javascripts/material/src/navdrawer.js +0 -352
  111. data/app/assets/javascripts/material/src/tab-switch.js +0 -133
  112. data/app/assets/javascripts/material/src/util.js +0 -138
  113. data/app/assets/stylesheets/material/base/_normalize.scss +0 -253
  114. data/app/assets/stylesheets/material/base/_reboot.scss +0 -239
  115. data/app/assets/stylesheets/material/bootstrap/_button-group.scss +0 -134
  116. data/app/assets/stylesheets/material/mixins/_tab-focus.scss +0 -5
  117. data/app/assets/stylesheets/material/mixins/_transform.scss +0 -9
  118. data/app/assets/stylesheets/material/variables/_animation.scss +0 -22
  119. data/app/assets/stylesheets/material/variables/_colour.scss +0 -389
@@ -1,133 +0,0 @@
1
- /*!
2
- * tab indicator animation
3
- * requires bootstrap's (v4.0.0-alpha.6) tab.js
4
- */
5
- const TabSwitch = (($) => {
6
- // constants >>>
7
- const DATA_KEY = 'md.tabswitch';
8
- const NAME = 'tabswitch';
9
- const NO_CONFLICT = $.fn[NAME];
10
- const TRANSITION_DURATION = 300;
11
-
12
- const ClassName = {
13
- ANIMATE : 'animate',
14
- INDICATOR : 'nav-tabs-indicator',
15
- MATERIAL : 'nav-tabs-material',
16
- SCROLLABLE : 'nav-tabs-scrollable',
17
- SHOW : 'show'
18
- };
19
-
20
- const Event = {
21
- SHOW_BS_TAB : 'show.bs.tab'
22
- };
23
-
24
- const Selector = {
25
- DATA_TOGGLE : '.nav-tabs [data-toggle="tab"]',
26
- NAV : '.nav-tabs',
27
- NAV_ITEM : '.nav-item'
28
- };
29
- // <<< constants
30
-
31
- class TabSwitch {
32
- constructor(nav) {
33
- if (typeof $.fn.tab === 'undefined') {
34
- throw new Error('Material\'s JavaScript requires Bootstrap\'s tab.js');
35
- };
36
-
37
- this._nav = nav;
38
- this._navindicator = null;
39
- }
40
-
41
- switch(element, relatedTarget) {
42
- let supportsTransition = Util.supportsTransitionEnd();
43
-
44
- if (!this._navindicator) {
45
- this._createIndicator();
46
- }
47
-
48
- let elLeft = $(element).closest(Selector.NAV_ITEM).offset().left;
49
- let elWidth = $(element).closest(Selector.NAV_ITEM).outerWidth();
50
- let navLeft = $(this._nav).offset().left;
51
- let navScrollLeft = $(this._nav).scrollLeft();
52
- let navWidth = $(this._nav).outerWidth();
53
-
54
- if (relatedTarget !== undefined) {
55
- let relatedLeft = $(relatedTarget).closest(Selector.NAV_ITEM).offset().left;
56
- let relatedWidth = $(relatedTarget).closest(Selector.NAV_ITEM).outerWidth();
57
-
58
- $(this._navindicator).css({
59
- left : ((relatedLeft + navScrollLeft) - navLeft),
60
- right : (navWidth - ((relatedLeft + navScrollLeft) - navLeft + relatedWidth))
61
- });
62
-
63
- $(this._navindicator).addClass(ClassName.SHOW);
64
- Util.reflow(this._navindicator);
65
-
66
- if (supportsTransition) {
67
- $(this._nav).addClass(ClassName.ANIMATE);
68
- }
69
- }
70
-
71
- $(this._navindicator).css({
72
- left : ((elLeft + navScrollLeft) - navLeft),
73
- right : (navWidth - ((elLeft + navScrollLeft) - navLeft + elWidth))
74
- });
75
-
76
- let complete = () => {
77
- $(this._nav).removeClass(ClassName.ANIMATE);
78
- $(this._navindicator).removeClass(ClassName.SHOW);
79
- }
80
-
81
- if (!supportsTransition) {
82
- complete();
83
- return;
84
- }
85
-
86
- $(this._navindicator)
87
- .one(Util.TRANSITION_END, complete)
88
- .emulateTransitionEnd(TRANSITION_DURATION);
89
- }
90
-
91
- _createIndicator() {
92
- this._navindicator = document.createElement('div');
93
-
94
- $(this._navindicator)
95
- .addClass(ClassName.INDICATOR)
96
- .appendTo(this._nav);
97
-
98
- $(this._nav).addClass(ClassName.MATERIAL);
99
- }
100
-
101
- static _jQueryInterface(relatedTarget) {
102
- return this.each(function () {
103
- let nav = $(this).closest(Selector.NAV)[0];
104
-
105
- if (!nav) {
106
- return;
107
- }
108
-
109
- let data = $(nav).data(DATA_KEY);
110
-
111
- if (!data) {
112
- data = new TabSwitch(nav);
113
- $(nav).data(DATA_KEY, data);
114
- }
115
-
116
- data.switch(this, relatedTarget);
117
- });
118
- }
119
- }
120
-
121
- $(document).on(Event.SHOW_BS_TAB, Selector.DATA_TOGGLE, function (event) {
122
- TabSwitch._jQueryInterface.call($(event.target), event.relatedTarget);
123
- });
124
-
125
- $.fn[NAME] = TabSwitch._jQueryInterface;
126
- $.fn[NAME].Constructor = TabSwitch;
127
- $.fn[NAME].noConflict = function () {
128
- $.fn[NAME] = NO_CONFLICT;
129
- return TabSwitch._jQueryInterface;
130
- };
131
-
132
- return TabSwitch;
133
- })(jQuery);
@@ -1,138 +0,0 @@
1
- /*!
2
- * global util js
3
- * based on bootstrap's (v4.0.0-alpha.6) util.js
4
- */
5
- const Util = (($) => {
6
- let transition = false;
7
-
8
- const TransitionEndEvent = {
9
- WebkitTransition : 'webkitTransitionEnd',
10
- MozTransition : 'transitionend',
11
- OTransition : 'oTransitionEnd otransitionend',
12
- transition : 'transitionend'
13
- };
14
-
15
- function getSpecialTransitionEndEvent() {
16
- return {
17
- bindType : transition.end,
18
- delegateType : transition.end,
19
- handle(event) {
20
- if ($(event.target).is(this)) {
21
- return event.handleObj.handler.apply(this, arguments);
22
- }
23
- return undefined;
24
- }
25
- };
26
- }
27
-
28
- function isElement(obj) {
29
- return (obj[0] || obj).nodeType;
30
- }
31
-
32
- function setTransitionEndSupport() {
33
- transition = transitionEndTest();
34
-
35
- $.fn.emulateTransitionEnd = transitionEndEmulator;
36
-
37
- if (Util.supportsTransitionEnd()) {
38
- $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
39
- }
40
- }
41
-
42
- function toType(obj) {
43
- return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
44
- }
45
-
46
- function transitionEndEmulator(duration) {
47
- let called = false;
48
-
49
- $(this).one(Util.TRANSITION_END, () => {
50
- called = true;
51
- });
52
-
53
- setTimeout(() => {
54
- if (!called) {
55
- Util.triggerTransitionEnd(this);
56
- }
57
- }, duration);
58
-
59
- return this;
60
- }
61
-
62
- function transitionEndTest() {
63
- if (window.QUnit) {
64
- return false;
65
- }
66
-
67
- let el = document.createElement('material');
68
-
69
- for (let name in TransitionEndEvent) {
70
- if (el.style[name] !== undefined) {
71
- return { end: TransitionEndEvent[name] };
72
- }
73
- };
74
-
75
- return false;
76
- }
77
-
78
- let Util = {
79
- TRANSITION_END: 'mdTransitionEnd',
80
-
81
- getSelectorFromElement(element) {
82
- let selector = element.getAttribute('data-target');
83
-
84
- if (!selector) {
85
- selector = element.getAttribute('href') || '';
86
- selector = /^#[a-z]/i.test(selector) ? selector : null;
87
- }
88
-
89
- return selector;
90
- },
91
-
92
- getUID(prefix) {
93
- do {
94
- prefix += ~~(Math.random() * 1000000);
95
- } while (document.getElementById(prefix))
96
- return prefix;
97
- },
98
-
99
- reflow(element) {
100
- new Function('md', 'return md')(element.offsetHeight);
101
- },
102
-
103
- supportsTransitionEnd() {
104
- return Boolean(transition);
105
- },
106
-
107
- triggerTransitionEnd(element) {
108
- $(element).trigger(transition.end);
109
- },
110
-
111
- typeCheckConfig(componentName, config, configTypes) {
112
- for (let property in configTypes) {
113
- if (configTypes.hasOwnProperty(property)) {
114
- let expectedTypes = configTypes[property];
115
- let value = config[property];
116
- let valueType;
117
-
118
- if (value && isElement(value)) {
119
- valueType = 'element';
120
- } else {
121
- valueType = toType(value);
122
- }
123
-
124
- if (!new RegExp(expectedTypes).test(valueType)) {
125
- throw new Error(
126
- `${componentName.toUpperCase()}: ` +
127
- `Option "${property}" provided type "${valueType}" ` +
128
- `but expected type "${expectedTypes}".`);
129
- }
130
- }
131
- };
132
- }
133
- }
134
-
135
- setTransitionEndSupport();
136
-
137
- return Util;
138
- })(jQuery);
@@ -1,253 +0,0 @@
1
- /* normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
2
-
3
- // document
4
- body {
5
- margin: 0;
6
- }
7
-
8
- html {
9
- font-family: sans-serif;
10
- line-height: 1.15;
11
- -webkit-text-size-adjust: 100%;
12
- -ms-text-size-adjust: 100%;
13
- }
14
-
15
- // embedded content
16
- audio,
17
- video {
18
- display: inline-block;
19
- }
20
-
21
- audio:not([controls]) {
22
- display: none;
23
- height: 0;
24
- }
25
-
26
- img {
27
- border-style: none;
28
- }
29
-
30
- svg:not(:root) {
31
- overflow: hidden;
32
- }
33
-
34
- // form
35
- button,
36
- input,
37
- optgroup,
38
- select,
39
- textarea {
40
- font-family: sans-serif;
41
- font-size: 100%;
42
- line-height: 1.15;
43
- margin: 0;
44
- }
45
-
46
- button,
47
- input {
48
- overflow: visible;
49
- }
50
-
51
- button,
52
- select {
53
- text-transform: none;
54
- }
55
-
56
- button,
57
- [type="reset"],
58
- [type="submit"] {
59
- -webkit-appearance: button;
60
- }
61
-
62
- html [type="button"] {
63
- -webkit-appearance: button;
64
- }
65
-
66
- button::-moz-focus-inner,
67
- [type="button"]::-moz-focus-inner,
68
- [type="reset"]::-moz-focus-inner,
69
- [type="submit"]::-moz-focus-inner {
70
- border-style: none;
71
- padding: 0;
72
- }
73
-
74
- button:-moz-focusring,
75
- [type="button"]:-moz-focusring,
76
- [type="reset"]:-moz-focusring,
77
- [type="submit"]:-moz-focusring {
78
- outline: 1px dotted ButtonText;
79
- }
80
-
81
- fieldset {
82
- border: 1px solid #c0c0c0;
83
- margin: 0 2px;
84
- padding: 0.35em 0.625em 0.75em;
85
- }
86
-
87
- legend {
88
- box-sizing: border-box;
89
- color: inherit;
90
- display: table;
91
- max-width: 100%;
92
- padding: 0;
93
- white-space: normal;
94
- }
95
-
96
- progress {
97
- display: inline-block;
98
- vertical-align: baseline;
99
- }
100
-
101
- textarea {
102
- overflow: auto;
103
- }
104
-
105
- [type="checkbox"],
106
- [type="radio"] {
107
- box-sizing: border-box;
108
- padding: 0;
109
- }
110
-
111
- [type="number"]::-webkit-inner-spin-button,
112
- [type="number"]::-webkit-outer-spin-button {
113
- height: auto;
114
- }
115
-
116
- [type="search"] {
117
- outline-offset: -2px;
118
- -webkit-appearance: textfield;
119
- }
120
-
121
- [type="search"]::-webkit-search-cancel-button,
122
- [type="search"]::-webkit-search-decoration {
123
- -webkit-appearance: none;
124
- }
125
-
126
- ::-webkit-file-upload-button {
127
- font: inherit;
128
- -webkit-appearance: button;
129
- }
130
-
131
- // grouping content
132
- figcaption,
133
- figure,
134
- main {
135
- display: block;
136
- }
137
-
138
- figure {
139
- margin: 1em 40px;
140
- }
141
-
142
- hr {
143
- box-sizing: content-box;
144
- height: 0;
145
- overflow: visible;
146
- }
147
-
148
- pre {
149
- font-family: monospace, monospace;
150
- font-size: 1em;
151
- }
152
-
153
- // hidden
154
- [hidden] {
155
- display: none;
156
- }
157
-
158
- // interactive
159
- details,
160
- menu {
161
- display: block;
162
- }
163
-
164
- summary {
165
- display: list-item;
166
- }
167
-
168
- // section
169
- article,
170
- aside,
171
- footer,
172
- header,
173
- nav,
174
- section {
175
- display: block;
176
- }
177
-
178
- h1 {
179
- font-size: 2em;
180
- margin: 0.67em 0;
181
- }
182
-
183
- // scripting
184
- canvas {
185
- display: inline-block;
186
- }
187
-
188
- template {
189
- display: none;
190
- }
191
-
192
- // text-level semantics
193
- a {
194
- background-color: transparent;
195
- -webkit-text-decoration-skip: objects;
196
- }
197
-
198
- a:active,
199
- a:hover {
200
- outline-width: 0;
201
- }
202
-
203
- abbr[title] {
204
- border-bottom: none;
205
- text-decoration: underline;
206
- text-decoration: underline dotted;
207
- }
208
-
209
- b,
210
- strong {
211
- font-weight: inherit;
212
- }
213
-
214
- b,
215
- strong {
216
- font-weight: bolder;
217
- }
218
-
219
- code,
220
- kbd,
221
- samp {
222
- font-family: monospace monospace;
223
- font-size: 1em;
224
- }
225
-
226
- dfn {
227
- font-style: italic;
228
- }
229
-
230
- mark {
231
- background-color: #ff0;
232
- color: #000;
233
- }
234
-
235
- small {
236
- font-size: 80%;
237
- }
238
-
239
- sub,
240
- sup {
241
- font-size: 75%;
242
- line-height: 0;
243
- position: relative;
244
- vertical-align: baseline;
245
- }
246
-
247
- sub {
248
- bottom: -0.25em;
249
- }
250
-
251
- sup {
252
- top: -0.5em;
253
- }