dvl-core 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.hound.yml +5 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +2 -0
  6. data/LICENSE.md +20 -0
  7. data/README.md +35 -0
  8. data/circle.yml +7 -0
  9. data/dvl-core.gemspec +30 -0
  10. data/lib/dvl/core.rb +11 -0
  11. data/lib/dvl/core/version.rb +5 -0
  12. data/preview/app.rb +252 -0
  13. data/script/bootstrap +45 -0
  14. data/script/cibuild +3 -0
  15. data/script/preview +3 -0
  16. data/script/release +38 -0
  17. data/spec/dvl_core_spec.rb +30 -0
  18. data/vendor/assets/javascripts/dvl/core.js +4 -0
  19. data/vendor/assets/javascripts/dvl/core/buttons.js +116 -0
  20. data/vendor/assets/javascripts/dvl/core/dropdowns.js +161 -0
  21. data/vendor/assets/javascripts/dvl/core/modals.js +281 -0
  22. data/vendor/assets/javascripts/dvl/core/tooltips.js +478 -0
  23. data/vendor/assets/stylesheets/dvl/core.scss +21 -0
  24. data/vendor/assets/stylesheets/dvl/core/buttons.scss +152 -0
  25. data/vendor/assets/stylesheets/dvl/core/code.scss +31 -0
  26. data/vendor/assets/stylesheets/dvl/core/dropdowns.scss +309 -0
  27. data/vendor/assets/stylesheets/dvl/core/forms.scss +434 -0
  28. data/vendor/assets/stylesheets/dvl/core/grid.scss +87 -0
  29. data/vendor/assets/stylesheets/dvl/core/includes.scss +163 -0
  30. data/vendor/assets/stylesheets/dvl/core/labels.scss +31 -0
  31. data/vendor/assets/stylesheets/dvl/core/legacy.scss +287 -0
  32. data/vendor/assets/stylesheets/dvl/core/links.scss +53 -0
  33. data/vendor/assets/stylesheets/dvl/core/lists.scss +30 -0
  34. data/vendor/assets/stylesheets/dvl/core/media.scss +24 -0
  35. data/vendor/assets/stylesheets/dvl/core/modals.scss +173 -0
  36. data/vendor/assets/stylesheets/dvl/core/pagination.scss +70 -0
  37. data/vendor/assets/stylesheets/dvl/core/print.scss +69 -0
  38. data/vendor/assets/stylesheets/dvl/core/progress.scss +16 -0
  39. data/vendor/assets/stylesheets/dvl/core/resets.scss +92 -0
  40. data/vendor/assets/stylesheets/dvl/core/shame.scss +35 -0
  41. data/vendor/assets/stylesheets/dvl/core/sidebar.scss +101 -0
  42. data/vendor/assets/stylesheets/dvl/core/tables.scss +122 -0
  43. data/vendor/assets/stylesheets/dvl/core/tooltips.scss +87 -0
  44. data/vendor/assets/stylesheets/dvl/core/typography.scss +158 -0
  45. metadata +228 -0
@@ -0,0 +1,21 @@
1
+ @import "core/includes";
2
+ @import "core/resets";
3
+ @import "core/links";
4
+ @import "core/typography";
5
+ @import "core/labels";
6
+ @import "core/lists";
7
+ @import "core/pagination";
8
+ @import "core/code";
9
+ @import "core/media";
10
+ @import "core/forms";
11
+ @import "core/tables";
12
+ @import "core/sidebar";
13
+ @import "core/dropdowns";
14
+ @import "core/modals";
15
+ @import "core/progress";
16
+ @import "core/grid";
17
+ @import "core/buttons";
18
+ @import "core/tooltips";
19
+ @import "core/legacy";
20
+ @import "core/shame";
21
+ @import "core/print";
@@ -0,0 +1,152 @@
1
+ // Buttons
2
+
3
+ @mixin dark_button_color($base_color, $font_color: #fff) {
4
+ background: $base_color;
5
+ color: $font_color;
6
+ border: 1px solid darken($base_color, 5%);
7
+ &:hover {
8
+ background: darken($base_color, 5%);
9
+ color: $font_color;
10
+ }
11
+ }
12
+
13
+ @mixin light_button_color($base_color, $font_color: #333) {
14
+ background: $base_color;
15
+ font-weight: 600;
16
+ border: 1px solid darken($base_color, 5%);
17
+ color: $font_color;
18
+ &:hover {
19
+ background: darken($base_color, 3%);
20
+ color: $font_color;
21
+ }
22
+ }
23
+
24
+ // Default
25
+ .button {
26
+ display: inline-block;
27
+ margin: 0;
28
+ padding: 0.5rem 1rem;
29
+ border: 0;
30
+ background: $lightGray;
31
+ color: $darkestGray;
32
+ text-align: center;
33
+ text-decoration: none;
34
+ font-size: 1rem;
35
+ cursor: pointer;
36
+ border-radius: $radius;
37
+ white-space: nowrap;
38
+ &.uppercase {
39
+ border: 0 !important;
40
+ border-radius: 0;
41
+ text-transform: uppercase;
42
+ font-size: 0.85rem;
43
+ }
44
+ &.arrow_l:before {
45
+ content: "\f0d9";
46
+ font-family: 'FontAwesome';
47
+ margin-right: 1rem;
48
+ }
49
+ &.arrow:after {
50
+ content: "\f0da";
51
+ font-family: 'FontAwesome';
52
+ margin-left: 1rem;
53
+ }
54
+ &.long_arrow:after {
55
+ content: "\f178";
56
+ font-family: 'FontAwesome';
57
+ margin-left: 1rem;
58
+ }
59
+ &.loading {
60
+ opacity: 0.65;
61
+ cursor: default !important;
62
+ i {
63
+ margin-left: 0.5rem;
64
+ }
65
+ &.arrow:after {
66
+ display: none;
67
+ }
68
+ }
69
+ // #todo find an example of button.primary
70
+ &.primary {
71
+ @include dark_button_color(#e75845);
72
+ }
73
+ &.success {
74
+ @include dark_button_color($successColor);
75
+ }
76
+ &.error {
77
+ @include dark_button_color($errorColor);
78
+ }
79
+ &.info {
80
+ @include dark_button_color(#1fa3ec);
81
+ }
82
+ &.white {
83
+ @include light_button_color(#fff);
84
+ }
85
+ &.darker_gray {
86
+ @include light_button_color(#ccc);
87
+ }
88
+ &.light_gray {
89
+ @include light_button_color(#eeeff0, $blueGray);
90
+ }
91
+ &.gray {
92
+ @include light_button_color($lighterGray);
93
+ }
94
+ &:hover {
95
+ background: $gray;
96
+ text-decoration: none;
97
+ }
98
+ &:active {
99
+ box-shadow: inset 0 2px 3px hsla(0, 0%, 0%, 0.2);
100
+ }
101
+ &:focus {
102
+ outline: thin dotted $darkestGray;
103
+ outline: 5px auto -webkit-focus-ring-color;
104
+ outline-offset: -2px;
105
+ }
106
+ // Sizes
107
+ // #todo refactor and catalog these sizes
108
+ &.mini {
109
+ padding: 0.238rem 0.563rem;
110
+ font-size: 0.8125rem;
111
+ }
112
+ &.small {
113
+ padding: 0.317rem 0.75rem;
114
+ font-size: 0.875rem;
115
+ }
116
+ &.large,
117
+ &.block {
118
+ padding: 1rem 1.333rem;
119
+ font-size: 1.125rem;
120
+ line-height: 1.333;
121
+ }
122
+ &.block {
123
+ display: block;
124
+ }
125
+ // States
126
+ &[disabled],
127
+ &.disabled,
128
+ &.disabled:active {
129
+ box-shadow: none !important;
130
+ text-shadow: none !important;
131
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=65)";
132
+ opacity: 0.65;
133
+ cursor: default !important;
134
+ }
135
+ }
136
+
137
+ // Link-styled buttons
138
+
139
+ .button_link {
140
+ font-size: inherit;
141
+ background: none;
142
+ padding: 0;
143
+ line-height: inherit;
144
+ border: 0;
145
+ color: $linkColor;
146
+ &:focus {
147
+ outline: 0;
148
+ }
149
+ &:hover {
150
+ text-decoration: underline;
151
+ }
152
+ }
@@ -0,0 +1,31 @@
1
+ // Code
2
+
3
+ // Correct `font-family` set oddly in Safari 5 and Chrome
4
+
5
+ code, pre {
6
+ color: $darkestGray;
7
+ @include monospace;
8
+ }
9
+
10
+ code {
11
+ padding: 0 0.5rem;
12
+ border: 1px solid $lightGray;
13
+ border-radius: $radius;
14
+ background: $lightestGray;
15
+ white-space: nowrap;
16
+ // Increase `padding` at larger viewport widths
17
+ @media only screen and (min-width: 480px) {
18
+ padding: 0.25rem 0.5rem;
19
+ }
20
+ }
21
+
22
+ pre {
23
+ position: relative;
24
+ overflow: auto;
25
+ padding: 1rem;
26
+ background: $black;
27
+ color: $gray;
28
+ white-space: pre;
29
+ word-wrap: normal;
30
+ word-break: normal;
31
+ }
@@ -0,0 +1,309 @@
1
+ .dropdown {
2
+ position: relative;
3
+ }
4
+ span.dropdown {
5
+ display: inline-block;
6
+ }
7
+ .dropdown-toggle:focus {
8
+ outline: 0;
9
+ }
10
+
11
+ // The dropdown menu (ul)
12
+ .dropdown_menu {
13
+ position: absolute;
14
+ top: 100%;
15
+ left: 0;
16
+ z-index: 1000;
17
+ display: none;
18
+ float: left;
19
+ min-width: 160px;
20
+ margin-top: 3px;
21
+ background-color: #fff;
22
+ box-shadow: 0 1px 0 rgba(#000,0.14);
23
+ border: 1px solid #dadada;
24
+ border-radius: $radius;
25
+ background-clip: padding-box;
26
+ // Right-aligns menu
27
+ &.dropdown_right {
28
+ right: 0;
29
+ left: auto;
30
+ }
31
+ h3 {
32
+ margin: 0;
33
+ background: #efefef;
34
+ text-align: center;
35
+ min-height: 2.5rem;
36
+ line-height: 1.25rem;
37
+ padding: 0.625rem 0.5rem;
38
+ @include border_top_radius($radius - 1);
39
+ color: #444;
40
+ font-size: 0.9rem;
41
+ text-transform: uppercase;
42
+ letter-spacing: 0.03rem;
43
+ }
44
+ }
45
+
46
+ // Links
47
+ .dropdown_body {
48
+ max-height: 350px;
49
+ overflow: scroll;
50
+ > li {
51
+ > a,
52
+ > span {
53
+ display: block;
54
+ height: 2.5rem;
55
+ font-size: 0.9rem;
56
+ line-height: 2.5rem;
57
+ padding: 0 0.5rem;
58
+ clear: both;
59
+ }
60
+ a {
61
+ color: #333;
62
+ &:hover,
63
+ &:focus {
64
+ text-decoration: none;
65
+ color: #fff;
66
+ background-color: #428bca;
67
+ }
68
+ }
69
+ }
70
+ // Active state
71
+ > .active {
72
+ > a,
73
+ > a:hover,
74
+ > a:focus {
75
+ color: #fff;
76
+ text-decoration: none;
77
+ outline: 0;
78
+ background-color: #428bca;
79
+ }
80
+ }
81
+ // Disabled state
82
+ > .disabled {
83
+ > a,
84
+ > a:hover,
85
+ > a:focus {
86
+ color: #ccc;
87
+ }
88
+ // Override hover/focus effects
89
+ > a:hover,
90
+ > a:focus {
91
+ text-decoration: none;
92
+ background-color: transparent;
93
+ background-image: none;
94
+ cursor: not-allowed;
95
+ }
96
+ }
97
+ }
98
+
99
+ .dropdown_menu_form li {
100
+ label {
101
+ font-weight: normal;
102
+ padding: 0.25rem 0.5rem;
103
+ display: block;
104
+ }
105
+ }
106
+
107
+ .dropdown_header {
108
+ padding: 0.5rem;
109
+ color: $darkGray;
110
+ font-size: 0.85rem;
111
+ text-transform: uppercase;
112
+ font-weight: 600;
113
+ }
114
+
115
+ // Open state for the dropdown
116
+ .open {
117
+ // Show the menu
118
+ > .dropdown_menu {
119
+ display: block;
120
+ }
121
+ // Remove the outline when :focus is triggered
122
+ > a {
123
+ outline: 0;
124
+ }
125
+ }
126
+
127
+ // Backdrop to catch body clicks on mobile, etc.
128
+ .dropdown_backdrop {
129
+ position: fixed;
130
+ left: 0;
131
+ right: 0;
132
+ bottom: 0;
133
+ top: 0;
134
+ z-index: 990;
135
+ }
136
+
137
+ li.dropdown_more a {
138
+ font-size: 0.8rem;
139
+ color: #888;
140
+ }
141
+
142
+ // Enhanced dropdowns:
143
+ // Multiple lines of text, images, etc.
144
+
145
+ .dropdown_toggle_button {
146
+ position: relative;
147
+ padding: 0.25rem 2rem 0.25rem 1rem;
148
+ background-color: #fff;
149
+ color: $darkestGray;
150
+ border: 1px solid $gray;
151
+ font-weight: 600;
152
+ font-size: 0.875rem;
153
+ display: inline-block;
154
+ margin: 0;
155
+ text-decoration: none;
156
+ cursor: pointer;
157
+ border-radius: $radius - 1;
158
+ &.disabled {
159
+ opacity: 0.7;
160
+ cursor: default;
161
+ }
162
+ &:hover {
163
+ text-decoration: none;
164
+ background-color: $lightestGray;
165
+ }
166
+ &:after {
167
+ font-family: 'FontAwesome';
168
+ content: '\f0d7';
169
+ position: absolute;
170
+ top: 0;
171
+ line-height: 1.875rem;
172
+ right: 0.75rem;
173
+ color: $darkerGray;
174
+ pointer-events: none;
175
+ }
176
+ &.gray {
177
+ background-color: $lighterGray;
178
+ color: $darkestGray;
179
+ &:hover {
180
+ background-color: $lightGray;
181
+ &.disabled {
182
+ background-color: $lighterGray;
183
+ }
184
+ }
185
+ }
186
+ .open & {
187
+ box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
188
+ background-color: #e2e2e2;
189
+ &.gray {
190
+ background-color: $lightGray;
191
+ }
192
+ }
193
+ }
194
+
195
+ // ## Dropdown list styles
196
+
197
+
198
+ // Single line
199
+
200
+ .drop_sng {
201
+ @include ellipses;
202
+ }
203
+
204
+ // Master / detail:
205
+ // Square item (checkbox, color legend, image) on left,
206
+ // description on right
207
+
208
+ .drop_master,
209
+ .drop_master_multiline,
210
+ .drop_detail,
211
+ .drop_detail_multiline {
212
+ float: left;
213
+ }
214
+
215
+ .drop_master,
216
+ .drop_master_multiline {
217
+ width: 1.5rem;
218
+ margin-right: 0.5rem;
219
+ img,
220
+ span {
221
+ border-radius: 50%;
222
+ }
223
+ i {
224
+ font-size: 1.25rem;
225
+ line-height: 2.5rem;
226
+ color: #888;
227
+ width: 100%;
228
+ text-align: center;
229
+ vertical-align: middle;
230
+ .active &,
231
+ a:hover & {
232
+ color: #fff;
233
+ }
234
+ }
235
+ }
236
+
237
+ .drop_detail,
238
+ .drop_detail_multiline {
239
+ width: 80%;
240
+ }
241
+
242
+ .drop_detail {
243
+ @include ellipses;
244
+ label {
245
+ font-weight: normal;
246
+ }
247
+ }
248
+
249
+ .drop_master_multiline {
250
+ line-height: 1;
251
+ i {
252
+ line-height: 1;
253
+ }
254
+ }
255
+
256
+ .drop_detail_multiline {
257
+ line-height: 1.25rem;
258
+ }
259
+
260
+ .drop_master_color {
261
+ display: inline-block;
262
+ width: 1.5rem;
263
+ height: 1.5rem;
264
+ margin-top: 0.5rem;
265
+ float: left;
266
+ }
267
+
268
+
269
+ // Dropdown item with arrow at right
270
+
271
+ .drop_rt_item,
272
+ .drop_rt_arrow {
273
+ float: left;
274
+ }
275
+ .drop_rt_item {
276
+ width: 87%;
277
+ margin-right: 3%;
278
+ float: left;
279
+ @include ellipses;
280
+ }
281
+ .drop_rt_arrow {
282
+ width: 10%;
283
+ text-align: center;
284
+ }
285
+
286
+ // Nav dropdowns
287
+
288
+ .dropdown_nav {
289
+ li a,
290
+ .drop_sng {
291
+ padding: 0 1.5rem;
292
+ line-height: 3rem;
293
+ height: 3rem;
294
+ @include cf;
295
+ }
296
+ .all {
297
+ .drop_rt_item,
298
+ .drop_rt_arrow {
299
+ width: auto;
300
+ float: none;
301
+ }
302
+ .drop_rt_item {
303
+ max-width: 87%;
304
+ }
305
+ .drop_rt_arrow {
306
+ max-width: 10%;
307
+ }
308
+ }
309
+ }