fleetio_spark 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +43 -0
  4. data/app/assets/javascripts/spark/_cookie.js +23 -0
  5. data/app/assets/javascripts/spark/_esvg.js +73 -0
  6. data/app/assets/javascripts/spark/_icons.js +19 -0
  7. data/app/assets/javascripts/spark/_modal.js +421 -0
  8. data/app/assets/javascripts/spark/_search.js +79 -0
  9. data/app/assets/javascripts/spark/_sidebar.js +13 -0
  10. data/app/assets/javascripts/spark/_stack.js +248 -0
  11. data/app/assets/javascripts/spark/_tree.js +68 -0
  12. data/app/assets/javascripts/spark/shims/_dataset.js +241 -0
  13. data/app/assets/javascripts/spark/spark.js +31 -0
  14. data/app/assets/stylesheets/spark/_icons.scss +15 -0
  15. data/app/assets/stylesheets/spark/_index.scss +5 -0
  16. data/app/assets/stylesheets/spark/components/_index.scss +6 -0
  17. data/app/assets/stylesheets/spark/components/_modal.scss +73 -0
  18. data/app/assets/stylesheets/spark/components/_nav-menu.scss +102 -0
  19. data/app/assets/stylesheets/spark/components/_sidebar.scss +280 -0
  20. data/app/assets/stylesheets/spark/components/_tooltip.scss +42 -0
  21. data/app/assets/stylesheets/spark/components/_tree-nav.scss +13 -0
  22. data/app/assets/stylesheets/spark/components/header/_app-admin-header.scss +82 -0
  23. data/app/assets/stylesheets/spark/components/header/_app-nav-header.scss +154 -0
  24. data/app/assets/stylesheets/spark/components/header/_index.scss +5 -0
  25. data/app/assets/stylesheets/spark/components/header/_search-results.scss +29 -0
  26. data/app/assets/stylesheets/spark/components/header/_search.scss +195 -0
  27. data/app/assets/stylesheets/spark/components/header/_trial-status.scss +43 -0
  28. data/app/assets/stylesheets/spark/core/_animations.scss +154 -0
  29. data/app/assets/stylesheets/spark/core/_base.scss +11 -0
  30. data/app/assets/stylesheets/spark/core/_colors.scss +94 -0
  31. data/app/assets/stylesheets/spark/core/_index.scss +7 -0
  32. data/app/assets/stylesheets/spark/core/_layout.scss +39 -0
  33. data/app/assets/stylesheets/spark/core/_mixins.scss +86 -0
  34. data/app/assets/stylesheets/spark/core/_text.scss +5 -0
  35. data/app/assets/stylesheets/spark/core/_vars.scss +76 -0
  36. data/app/assets/stylesheets/spark/form/_base.scss +124 -0
  37. data/app/assets/stylesheets/spark/form/_check-switch.scss +99 -0
  38. data/app/assets/stylesheets/spark/form/_index.scss +2 -0
  39. data/app/assets/stylesheets/spark/spark.scss +1 -0
  40. data/app/assets/svgs/spark/add.svg +3 -0
  41. data/app/assets/svgs/spark/admin-user.svg +5 -0
  42. data/app/assets/svgs/spark/chevron-down.svg +3 -0
  43. data/app/assets/svgs/spark/chevron-up.svg +3 -0
  44. data/app/assets/svgs/spark/close.svg +3 -0
  45. data/app/assets/svgs/spark/contact.svg +6 -0
  46. data/app/assets/svgs/spark/dashboard.svg +3 -0
  47. data/app/assets/svgs/spark/fuel.svg +3 -0
  48. data/app/assets/svgs/spark/inspection.svg +3 -0
  49. data/app/assets/svgs/spark/issue.svg +3 -0
  50. data/app/assets/svgs/spark/leaderboard.svg +5 -0
  51. data/app/assets/svgs/spark/logo.svg +1 -0
  52. data/app/assets/svgs/spark/map.svg +4 -0
  53. data/app/assets/svgs/spark/nav-menu.svg +5 -0
  54. data/app/assets/svgs/spark/part.svg +6 -0
  55. data/app/assets/svgs/spark/place.svg +5 -0
  56. data/app/assets/svgs/spark/question.svg +10 -0
  57. data/app/assets/svgs/spark/reminder.svg +3 -0
  58. data/app/assets/svgs/spark/report.svg +5 -0
  59. data/app/assets/svgs/spark/search.svg +3 -0
  60. data/app/assets/svgs/spark/service.svg +3 -0
  61. data/app/assets/svgs/spark/settings.svg +3 -0
  62. data/app/assets/svgs/spark/trip.svg +4 -0
  63. data/app/assets/svgs/spark/vehicle.svg +3 -0
  64. data/app/assets/svgs/spark/vendor.svg +4 -0
  65. data/app/helpers/spark/application_helper.rb +42 -0
  66. data/app/helpers/spark/icon_helper.rb +40 -0
  67. data/app/helpers/spark/input_helper.rb +163 -0
  68. data/app/helpers/spark/menu_helper.rb +113 -0
  69. data/app/helpers/spark/modal_helper.rb +52 -0
  70. data/app/helpers/spark/nav_menu_helper.rb +167 -0
  71. data/app/helpers/spark/tag_helper.rb +27 -0
  72. data/app/helpers/spark/trial_helper.rb +23 -0
  73. data/app/views/layouts/spark/application.html.slim +28 -0
  74. data/app/views/layouts/spark/blank.html.slim +9 -0
  75. data/app/views/layouts/spark/default.html.slim +13 -0
  76. data/config/autoprefixer.yml +4 -0
  77. data/config/esvg.yml +20 -0
  78. data/lib/fleetio_spark.rb +14 -0
  79. data/lib/fleetio_spark/helper.rb +163 -0
  80. data/lib/fleetio_spark/version.rb +3 -0
  81. data/public/spark-0.1.0.css +1442 -0
  82. data/public/spark-0.1.0.css.gz +0 -0
  83. data/public/spark-0.1.0.js +11927 -0
  84. data/public/spark-0.1.0.js.gz +0 -0
  85. metadata +211 -0
@@ -0,0 +1,31 @@
1
+ // Require modules, add code, etc
2
+ require( './shims/_dataset' )
3
+ var esvg = require( './_esvg' )
4
+ var icons = require( './_icons' )
5
+ var toggler = require( 'compose-toggler' )
6
+ var toolbox = require( 'compose-toolbox' )
7
+ var modal = require( './_modal' )
8
+ var stack = require( './_stack' )
9
+ var search = require( './_search' )
10
+ var tree = require( './_tree' )
11
+ var cookie = require( './_cookie' )
12
+
13
+ require( './_sidebar' )
14
+
15
+ modal.setup()
16
+ stack.setup()
17
+ tree.setup()
18
+
19
+ window.spark = module.exports = toolbox.merge({
20
+ esvg: esvg,
21
+ toggler: toggler,
22
+ modal: modal,
23
+ stack: stack,
24
+ cookie: cookie,
25
+ bean: require( 'bean' )
26
+ }, toolbox )
27
+
28
+ // Simple ignore click on anchor triggers
29
+ toolbox.event.on( document, 'click', '[href="#"]', function( event ) {
30
+ event.preventDefault();
31
+ })
@@ -0,0 +1,15 @@
1
+ .inline-icon {
2
+ position: relative;
3
+ height: 1em;
4
+ display: inline-flex;
5
+
6
+ svg {
7
+ position: relative;
8
+ bottom: -0.125em;
9
+ width: auto;
10
+ }
11
+ }
12
+
13
+ svg {
14
+ fill: currentColor;
15
+ }
@@ -0,0 +1,5 @@
1
+ // Design System Stylesheets index
2
+ @import 'icons';
3
+ @import 'core/index';
4
+ @import 'form/index';
5
+ @import 'components/index';
@@ -0,0 +1,6 @@
1
+ @import "modal";
2
+ @import "nav-menu";
3
+ @import "sidebar";
4
+ @import "tree-nav";
5
+ @import "tooltip";
6
+ @import "header/index";
@@ -0,0 +1,73 @@
1
+ $modal-panel-padding: 16px;
2
+ $modal-panel-height: 80vh;
3
+ $modal-panel-border: rgba(#000, .1);
4
+
5
+ .modal-panel {
6
+ border-radius: 5px;
7
+ border: 1px solid rgba(#000, .2);
8
+ background: $fl-white;
9
+ @include elevation(6);
10
+ position: absolute;
11
+ left: 0;
12
+ right: 0;
13
+
14
+ &[aria-hidden=true] {
15
+ display: none;
16
+ }
17
+
18
+ &[aria-hidden=false] {
19
+ z-index: 1000;
20
+ }
21
+
22
+ &-header, &-footer {
23
+ padding: $modal-panel-padding / 2 $modal-panel-padding;
24
+ font-size: 11px;
25
+ color: #78858A;
26
+ }
27
+
28
+ &-header {
29
+ display: flex;
30
+ padding: $pad-lg $pad-lg $pad-base;
31
+ border-bottom: 1px solid $fl-gray-100;
32
+ margin-bottom: -1px;
33
+ position: relative;
34
+ z-index: 2;
35
+
36
+ [data-stack-nav] {
37
+ align-self: flex-start;
38
+ width: 0;
39
+ overflow: visible;
40
+ white-space: pre;
41
+ order: -1;
42
+ color: inherit;
43
+ line-height: 1.1em;
44
+ text-decoration: none;
45
+
46
+ &:hover,&:focus {
47
+ color: #0091E6;
48
+ outline: none;
49
+ }
50
+ }
51
+ }
52
+ &-title {
53
+ text-transform: uppercase;
54
+ font-size: 11px;
55
+ font-weight: normal;
56
+ margin: 0 auto;
57
+ }
58
+ &-footer {
59
+ border-top: 1px solid $modal-panel-border;
60
+ }
61
+
62
+ [aria-hidden=true] {
63
+ height: 0;
64
+ overflow: hidden;
65
+ }
66
+ }
67
+
68
+ .modal-is-opening {
69
+ animation: modal-open $duration $timing;
70
+ }
71
+ .modal-is-closing {
72
+ animation: modal-close $duration $timing;
73
+ }
@@ -0,0 +1,102 @@
1
+ .nav-menu {
2
+ &[aria-hidden=true] {
3
+ height: 0;
4
+ }
5
+ $focus-color: mix($fl-blue-25, $fl-blue-50);
6
+
7
+ // If inside of a modal panel
8
+ .modal-panel & {
9
+ max-height: $modal-panel-height;
10
+ overflow-y: auto;
11
+ }
12
+
13
+ &-group {
14
+ list-style: none;
15
+ margin: 0;
16
+ border: 1px solid $modal-panel-border {
17
+ left-color: transparent;
18
+ right-color: transparent;
19
+ }
20
+
21
+ >*:last-child {
22
+ .nav-menu-item-content {
23
+ border-bottom-color: transparent;
24
+ }
25
+ }
26
+ &:last-child {
27
+ border-bottom-color: transparent;
28
+ }
29
+ }
30
+
31
+ &-header {
32
+ display: flex;
33
+ padding: $pad-lg $pad-lg $pad-base;
34
+ background: $fl-gray-25;
35
+
36
+ .nav-menu-title {
37
+ margin: 0;
38
+ text-transform: uppercase;
39
+ font-size: 11px;
40
+ font-weight: normal;
41
+ }
42
+ }
43
+
44
+ &-wrapper {
45
+ display: flex;
46
+ }
47
+ // menu <a>
48
+ &-item {
49
+ background: $fl-white;
50
+ padding-left: $modal-panel-padding;
51
+ text-decoration: none;
52
+ color: inherit;
53
+ display: flex;
54
+ width: 100%;
55
+
56
+ &-content {
57
+ padding: $pad-base { left: 0 };
58
+ flex-grow: 1;
59
+ border-bottom: 1px solid $modal-panel-border;
60
+ }
61
+
62
+ &:hover, &:focus {
63
+ background-color: $focus-color;
64
+ outline: none;
65
+ position: relative;
66
+ z-index: 1;
67
+ box-shadow: 0 0 0 1px $focus-color;
68
+
69
+ .nav-menu-item-content {
70
+ border-color: transparent;
71
+ }
72
+
73
+ }
74
+
75
+ }
76
+ &-more {
77
+ color: $fl-blue-300;
78
+ font-size: 12px;
79
+ }
80
+ }
81
+
82
+ [data-stack='root'] {
83
+ overflow: hidden;
84
+ }
85
+
86
+
87
+ // Transition to form step
88
+ .enter {
89
+ &[data-direction=forward] nav { animation: fade-in-right .12s forwards; }
90
+ &[data-direction=reverse] nav { animation: fade-in-left .12s forwards; }
91
+
92
+ .modal-panel-header * { animation: fade-in .12s forwards; }
93
+ }
94
+
95
+ // Transition away from form step
96
+ .exit {
97
+ &[data-direction=forward] nav { animation: fade-out-left .12s forwards; }
98
+ &[data-direction=reverse] nav { animation: fade-out-right .12s forwards; }
99
+
100
+ .modal-panel-header * { animation: fade-out .12s forwards; }
101
+ }
102
+
@@ -0,0 +1,280 @@
1
+ // Sidebar Navigation
2
+ .sidebar-nav {
3
+ height: 100%;
4
+ background-color: $primary-sidebar-bg;
5
+ position: fixed;
6
+ width: $primary-sidebar-width;
7
+ top: 0;
8
+ left: 0;
9
+ height: 100%;
10
+ @include font-smoothing;
11
+
12
+
13
+ .nav-wrapper {
14
+ position: relative;
15
+ width: auto;
16
+ height: 100%;
17
+ }
18
+
19
+ .nav-tree {
20
+ list-style: none;
21
+ overflow: auto;
22
+ position: absolute;
23
+ top: 0;
24
+ left: 0;
25
+ right: 0;
26
+ bottom: 0;
27
+ margin: 0;
28
+ padding: 0 0 ($app-nav-header-height + $pad-lg);
29
+
30
+ }
31
+
32
+ .nav-tree-item-icon {
33
+ flex-shrink: 0;
34
+ width: 18px;
35
+ height: 18px;
36
+
37
+ + .nav-tree-item-content {
38
+ margin-left: $pad-lg;
39
+ }
40
+ }
41
+ .nav-tree-item-content {
42
+ border: none;
43
+ }
44
+
45
+ .nav-tree-item {
46
+ display: flex;
47
+ align-items: center;
48
+ position: relative;
49
+ background-color: transparent;
50
+ color: rgba($fl-white, 0.8);
51
+ padding: ($pad-base + 1) 20px;
52
+ text-decoration: none;
53
+ font-size: 14px;
54
+ font-weight: 500;
55
+ transition: color $duration-short $timing;
56
+
57
+ &:hover,
58
+ &:focus {
59
+ color: $fl-white;
60
+ outline: none;
61
+ background-color: lighten($primary-sidebar-bg, 2%);
62
+
63
+ .expand-icon {
64
+ color: inherit;
65
+ }
66
+ }
67
+
68
+ .expand-icon {
69
+ display: flex;
70
+ flex-shrink: 0;
71
+ height: 9px;
72
+ width: 9px;
73
+ transition: opacity $duration $timing;
74
+ color: rgba($fl-white, 0.5);
75
+ }
76
+
77
+ &.active {
78
+ color: $fl-white;
79
+ background-color: darken($primary-sidebar-bg, 3%);
80
+
81
+ + .nav-tree-group {
82
+ background-color: darken($primary-sidebar-bg, 3%);
83
+ }
84
+ }
85
+ }
86
+
87
+ .nav-tree-item-content {
88
+ width: 100%;
89
+ min-width: 0;
90
+ white-space: nowrap;
91
+ text-overflow: ellipsis;
92
+ overflow: hidden;
93
+ }
94
+
95
+ .nav-tree-group {
96
+ list-style: none;
97
+ opacity: 0;
98
+
99
+ .nav-tree-item {
100
+ padding: $pad-sm;
101
+ padding-left: 54px;
102
+ color: rgba($fl-white, 0.55);
103
+ font-size: 13px;
104
+
105
+ &:hover,
106
+ &:focus {
107
+ color: $fl-white;
108
+ background-color: transparent;
109
+ }
110
+ }
111
+
112
+ .active { color: $fl-white; }
113
+
114
+ .new,.active {
115
+ &:before {
116
+ content: "";
117
+ position: absolute;
118
+ display: block;
119
+ z-index: 1;
120
+ left: 26px;
121
+ top: 10px;
122
+ width: 6px;
123
+ height: 6px;
124
+ border-radius: 50%;
125
+ }
126
+ }
127
+
128
+ .new:before {
129
+ background-color: $fl-yellow-600;
130
+ }
131
+ .new {
132
+ .nav-tree-item-content:after {
133
+ content: " New";
134
+ font-size: 85%;
135
+ letter-spacing: .02em;
136
+ color: $fl-yellow-600;
137
+ margin-left: $pad-xs;
138
+ }
139
+ }
140
+
141
+ .active:before {
142
+ background-color: $fl-blue-500;
143
+ }
144
+ }
145
+
146
+ .triggered .nav-tree-group {
147
+ transition-property: max-height, opacity, padding;
148
+ transition-duration: $duration;
149
+ transition-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
150
+ }
151
+
152
+ [aria-expanded=true] {
153
+ > .nav-tree-group {
154
+ max-height: 800px;
155
+ opacity: 1;
156
+ padding: $pad-xs 0 $pad-base;
157
+ transition-timing-function: cubic-bezier(0.47, 0, 0.745, 0.715);
158
+ }
159
+ }
160
+ }
161
+
162
+ .sidebar-nav-header {
163
+ > a {
164
+ display: flex;
165
+ flex: 1;
166
+ align-items: center;
167
+ color: $fl-white;
168
+ height: $app-nav-header-height;
169
+ padding: 0 20px;
170
+ text-decoration: none;
171
+ transition: background-color $duration $timing;
172
+ background-color: darken($primary-sidebar-bg, 3%);
173
+ line-height: 1.4;
174
+
175
+ &:hover,
176
+ &:focus {
177
+ color: $fl-white;
178
+ background-color: darken($primary-sidebar-bg, 6%);
179
+
180
+ .dropdown-icon {
181
+ color: inherit
182
+ }
183
+ }
184
+ }
185
+
186
+ .dropdown-icon {
187
+ margin: 0 $pad-base;
188
+ color: rgba($fl-white, 0.5);
189
+ transition: color $duration $timing;
190
+ }
191
+
192
+ .details {
193
+ display: flex;
194
+ flex-direction: column;
195
+ margin-right: auto;
196
+ line-height: 1.5;
197
+ padding-right: $pad-base;
198
+
199
+ &, * {
200
+ white-space: nowrap;
201
+ overflow: hidden;
202
+ min-width: 0;
203
+ text-overflow: ellipsis;
204
+ }
205
+
206
+ .account-name {
207
+ font-weight: 700;
208
+ }
209
+
210
+ .user-name {
211
+ font-size: 12px;
212
+ opacity: .75;
213
+ font-weight: 500;
214
+ }
215
+ }
216
+
217
+ .user-avatar img {
218
+ width: 100%;
219
+ max-width: none;
220
+ vertical-align: middle;
221
+ border-radius: 50%;
222
+ width: 32px;
223
+ height: 32px;
224
+ }
225
+
226
+ // Styling for bootstrap dropdown until we replace with spark component
227
+ .dropdown-menu {
228
+ border: 1px solid transparent;
229
+ max-height: 85vh;
230
+ overflow-y: auto;
231
+ min-width: 260px;
232
+ @include elevation(4);
233
+ border-radius: 6px;
234
+ margin-top: -$pad-sm;
235
+ margin-left: $pad-lg;
236
+ padding: $pad-md $pad-base;
237
+
238
+ .divider {
239
+ margin: $pad-base;
240
+
241
+ &.full-width {
242
+ margin-left: -$pad-base;
243
+ margin-right: -$pad-base;
244
+ }
245
+ }
246
+
247
+ .user-name {
248
+ padding: 0 $pad-base;
249
+ margin: $pad-md 0;
250
+ }
251
+
252
+ .user-avatar {
253
+ width: 40px;
254
+ height: 40px;
255
+ }
256
+
257
+ > li {
258
+ > a,
259
+ > label {
260
+ font-size: 14px;
261
+ border-radius: 3px;
262
+ padding: 5px $pad-base 6px;
263
+ margin-bottom: 0;
264
+ color: $fl-gray-800;
265
+ }
266
+
267
+ // Existing Material icons styling (will replace with svg in future)
268
+ i {
269
+ font-size: 16px;
270
+ margin-right: $pad-md;
271
+ }
272
+ .pull-right {
273
+ i {
274
+ font-size: 14px;
275
+ margin-right: 0;
276
+ }
277
+ }
278
+ }
279
+ }
280
+ }