codelation_ui 1.0.1 → 1.0.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/codelation_ui/_base_resources/app.js +54 -5
  3. data/app/assets/javascripts/codelation_ui/base.js +1 -0
  4. data/app/assets/javascripts/codelation_ui/extended/checkmark.js +31 -0
  5. data/app/assets/javascripts/codelation_ui/extended/code.js +64 -0
  6. data/app/assets/javascripts/codelation_ui/extended/fail.js +31 -0
  7. data/app/assets/javascripts/codelation_ui/extended/radial_progress_bar.js +267 -0
  8. data/app/assets/javascripts/codelation_ui/extended/slider.js +636 -639
  9. data/app/assets/javascripts/codelation_ui/extended/spinner.js +103 -0
  10. data/app/assets/javascripts/codelation_ui/forms/components/input.js +417 -388
  11. data/app/assets/javascripts/codelation_ui/forms/interfaces/form.js +35 -30
  12. data/app/assets/javascripts/codelation_ui/std.js +3 -1
  13. data/app/assets/javascripts/codelation_ui/std/components/info.js +22 -0
  14. data/app/assets/javascripts/codelation_ui/std/components/transition.js +26 -0
  15. data/app/assets/javascripts/codelation_ui/std/computed_interfaces/mockAPI.js +17 -0
  16. data/app/assets/javascripts/codelation_ui/std/interfaces/array.js +28 -0
  17. data/app/assets/javascripts/codelation_ui/std/interfaces/content_formatters.js +37 -10
  18. data/app/assets/javascripts/codelation_ui/std/interfaces/date.js +8 -0
  19. data/app/assets/javascripts/codelation_ui/std/interfaces/number.js +20 -0
  20. data/app/assets/javascripts/codelation_ui/std/interfaces/rest_api.js +104 -0
  21. data/app/assets/javascripts/codelation_ui/std/interfaces/string.js +29 -0
  22. data/app/assets/javascripts/codelation_ui/vue.js +25 -8
  23. data/app/assets/javascripts/codelation_ui/vue_pages.js +35 -10
  24. data/app/assets/stylesheets/codelation_ui.scss +1 -3
  25. data/app/assets/stylesheets/codelation_ui/_base_resources/_turbolinks.scss +11 -0
  26. data/app/assets/stylesheets/codelation_ui/_base_resources/mixins/button.scss +185 -33
  27. data/app/assets/stylesheets/codelation_ui/base.scss +3 -0
  28. data/app/assets/stylesheets/codelation_ui/colors.scss +2 -0
  29. data/app/assets/stylesheets/codelation_ui/extended/checkmark.scss +53 -0
  30. data/app/assets/stylesheets/codelation_ui/extended/code.scss +153 -0
  31. data/app/assets/stylesheets/codelation_ui/extended/fail.scss +50 -0
  32. data/app/assets/stylesheets/codelation_ui/extended/radial_progress_bar.scss +70 -0
  33. data/app/assets/stylesheets/codelation_ui/extended/slider.scss +2 -2
  34. data/app/assets/stylesheets/codelation_ui/extended/spinner.scss +100 -0
  35. data/app/assets/stylesheets/codelation_ui/std.scss +1 -1
  36. data/app/assets/stylesheets/codelation_ui/std/info.scss +51 -0
  37. data/app/assets/stylesheets/codelation_ui/vue_transitions.scss +94 -0
  38. data/app/helpers/action_view/helpers/url_helper.rb +22 -0
  39. data/lib/generators/ui/component/USAGE +22 -0
  40. data/lib/generators/ui/component/component_generator.rb +41 -0
  41. data/lib/generators/ui/component/templates/javascript.js.erb +20 -0
  42. data/lib/generators/ui/component/templates/page_javascript.js.erb +20 -0
  43. data/lib/generators/ui/component/templates/page_stylesheet.scss.erb +3 -0
  44. data/lib/generators/ui/component/templates/stylesheet.scss.erb +3 -0
  45. data/lib/generators/ui/component/templates/template.html.erb +5 -0
  46. data/lib/generators/ui/mixin/USAGE +8 -0
  47. data/lib/generators/ui/mixin/mixin_generator.rb +11 -0
  48. data/lib/generators/ui/mixin/templates/javascript.js.erb +8 -0
  49. data/lib/generators/ui/pages/USAGE +23 -0
  50. data/lib/generators/ui/pages/pages_generator.rb +48 -0
  51. data/lib/generators/ui/pages/templates/controller.rb +2 -0
  52. data/lib/generators/ui/pages/templates/javascript.js.erb +22 -0
  53. data/lib/generators/ui/pages/templates/stylesheet.scss.erb +3 -0
  54. data/lib/generators/ui/pages/templates/template.html.erb +3 -0
  55. data/vendor/assets/javascripts/highlight.pack.js +2 -0
  56. data/vendor/assets/javascripts/pluralize.js +1 -0
  57. data/vendor/assets/javascripts/vue.js +4 -10232
  58. metadata +107 -11
  59. data/app/assets/javascripts/codelation_ui/std/index.js +0 -2
@@ -1,16 +1,41 @@
1
1
  (function() {
2
2
  "use strict";
3
3
 
4
- App.register('component').enter(function() {
5
- App.vue.currentPage = new Vue({
6
- mixin: [App.vue.interfaces.contentFormatters],
7
- el: "body",
8
- methods: {
9
- numeral: numeral,
10
- moment: moment
11
- }
12
- })
4
+ App.register('first').enter(function() {
5
+ // All vue components inherit this. Used to show the vue page after the js loads
6
+ Vue.mixin({
7
+ mixins: App.vue.config.main.includedInterfaces,
8
+ components: App.vue.globalComponents
9
+ });
10
+ });
11
+
12
+ App.register('last').enter(function() {
13
+
14
+ // Outputs the vue object
15
+ if (App.vue.config.main.showInterfaces) {
16
+ console.warn("Loaded Vue")
17
+ console.warn(App.vue);
18
+ }
19
+
20
+ if (App.vue.root === null && $(App.vue.config.main.rootComponentNode || 'body').length) {
21
+ App.vue.root = new Vue({
22
+ el: App.vue.config.main.rootComponentNode || 'body',
23
+ components: App.vue.extend,
24
+ data: function() {
25
+ return {
26
+ pageLoadedClass: "vue-page-loaded"
27
+ }
28
+ }
29
+ });
30
+ }
13
31
  }).exit(function() {
14
- App.vue.currentPage = null;
32
+ // Destroy Root
33
+ App.vue.root.$destroy();
34
+ App.vue.root = null;
35
+
36
+ // Reinit Extends
37
+ App.vue.extend = {
38
+ _info: 'Used to hold references to per page components and attach to the root component if you did not define one.'
39
+ };
15
40
  });
16
41
  })();
@@ -1,4 +1,2 @@
1
1
  @import "codelation_ui/base";
2
- @import "codelation_ui/std";
3
- @import "codelation_ui/forms";
4
- @import "codelation_ui/extended";
2
+ @import "codelation_ui/**/*";
@@ -0,0 +1,11 @@
1
+ @if variable-exists(accent-color) {
2
+ $progress-bar-color: $accent-color !default;
3
+ html.turbolinks-progress-bar::before {
4
+ background-color: $progress-bar-color !important;
5
+ }
6
+ }@else{
7
+ $progress-bar-color: $default-ui-color !default;
8
+ html.turbolinks-progress-bar::before {
9
+ background-color: $progress-bar-color !important;
10
+ }
11
+ }
@@ -1,47 +1,199 @@
1
- $accent-color: $blue !default;
1
+ @mixin button(
2
+ $background-color: $default-ui-color,
3
+ $color: #fff,
4
+ $options: (),
5
+ $padding: 6px 12px,
6
+ $border-radius: 2px,
7
+ $border-color: $background-color,
8
+ $box-shadow: none,
9
+ $box-shadow-hover: none,
10
+ $float-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1),
11
+ $float-box-shadow-hover: (0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)),
12
+ $font-size: 14px,
13
+ $transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
14
+ $height: false,
15
+ $width: false,
16
+ $line-height: false,
17
+ $font-weight: normal,
18
+ $outline: none,
19
+ $text-decoration: none,
20
+ $text-transform: none,
21
+ $cursor: pointer,
22
+ $display: inline-block) {
2
23
 
3
- @mixin button($background-color: color($grey, 100), $color: color($grey, 800), $active-background-color: $accent-color, $active-color: text-color($accent-color)) {
4
- background-image: linear-gradient(to bottom, $background-color, darken($background-color, 8%));
5
- border: 0;
6
- border-radius: 2px;
7
- box-shadow: rgba(0, 0, 0, 0.14902) 0 0 0 1px inset;
8
- color: $color;
9
- display: inline-block;
10
- font-size: 11px;
11
- height: 26px;
12
- line-height: 25px;
13
- margin-bottom: 4px;
14
- outline: none;
15
- padding: 0 12px;
16
- text-align: center;
17
- text-decoration: none;
18
- vertical-align: middle;
19
- white-space: nowrap;
20
-
21
- i {
22
- font-size: 13px;
23
- line-height: 11px;
24
- margin-right: 2px;
24
+
25
+ $float-box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
26
+ $float-box-shadow-hover: (0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12));
27
+
28
+ @if $height {
29
+ height: $height;
30
+ }
31
+
32
+ @if $width {
33
+ width: $width;
34
+ }
35
+
36
+ @if $line-height {
37
+ line-height: $line-height;
25
38
  }
26
39
 
40
+ @include transition($transition);
41
+ background-color: $background-color;
42
+ border: 1px solid $border-color;
43
+ border-radius: $border-radius;
44
+ box-shadow: $box-shadow;
45
+ color: $color;
46
+ cursor: pointer;
47
+ display: $display;
48
+ font-size: $font-size;
49
+ -webkit-font-smoothing: antialiased;
50
+ font-weight: $font-weight;
51
+ outline: $outline;
52
+ padding: $padding;
53
+ text-decoration: $text-decoration;
54
+ text-transform: $text-transform;
55
+
27
56
  &:hover {
28
- background-image: linear-gradient(to bottom, lighten($background-color, 5%), darken($background-color, 3.5%));
57
+ @include transition($transition);
29
58
  color: $color;
59
+ box-shadow: $box-shadow-hover;
30
60
  }
31
61
 
32
- &:active {
33
- background-image: linear-gradient(to bottom, lighten($active-background-color, 3%), darken($active-background-color, 5%));
34
- color: $active-color;
62
+ &:active,
63
+ &.active {
64
+ @include transition($transition);
65
+ background-color: lighten($background-color, 7%);
66
+ color: $color;
67
+ cursor: wait;
35
68
  }
36
69
 
37
70
  &:disabled {
38
- cursor: default;
39
- opacity: 0.5;
71
+ background-color: desaturate($background-color, 20%);
72
+ border-color: desaturate($background-color, 20%);
73
+ box-shadow: none;
74
+ cursor: not-allowed;
75
+ opacity: 0.6;
76
+ }
77
+
78
+ &.negative {
79
+ background-color: $color;
80
+ border-color: $color;
81
+ color: $background-color;
82
+
83
+ &:hover {
84
+ color: $background-color;
85
+ }
86
+
87
+ &:disabled {
88
+ background-color: desaturate($color, 20%);
89
+ border-color: desaturate($color, 20%);
90
+ }
91
+ }
92
+
93
+ &.transparent {
94
+ background-color: transparent;
95
+ border-color: transparent;
96
+
97
+ &:hover {
98
+ background-color: rgba($black, 0.2);
99
+ border-color: transparent;
100
+ }
101
+
102
+ &:disabled {
103
+ background-color: transparent;
104
+ border-color: transparent;
105
+ }
106
+ }
107
+
108
+ &.float {
109
+ box-shadow: $float-box-shadow;
110
+
111
+ &:hover {
112
+ box-shadow: $float-box-shadow-hover;
113
+ }
114
+ }
115
+
116
+ &.large {
117
+ font-size: 1.2em;
118
+ }
119
+
120
+ &.small {
121
+ font-size: 0.8em;
122
+ }
123
+
124
+ &.wide {
125
+ padding: 0.625em 2.250em;
126
+ }
127
+
128
+ &.border-less,
129
+ &.borderless {
130
+ border: 0;
131
+ }
132
+
133
+ @each $option in $options {
134
+ @if $option == "negative" {
135
+ background-color: $color;
136
+ border-color: $color;
137
+ color: $background-color;
138
+
139
+ &:hover {
140
+ color: $background-color;
141
+ }
142
+
143
+ &:disabled {
144
+ background-color: desaturate($color, 20%);
145
+ border-color: desaturate($color, 20%);
146
+ }
147
+ }
148
+
149
+ @if $option == "transparent" {
150
+ background-color: transparent;
151
+ border-color: transparent;
152
+
153
+ &:hover {
154
+ background-color: rgba($black, 0.2);
155
+ border-color: transparent;
156
+ }
157
+
158
+ &:disabled {
159
+ background-color: transparent;
160
+ border-color: transparent;
161
+ }
162
+ }
163
+
164
+ @if $option == "float" {
165
+ box-shadow: $box-shadow;
166
+
167
+ &:hover {
168
+ box-shadow: $box-shadow-hover;
169
+ }
170
+ }
171
+
172
+ @if $option == "large" {
173
+ font-size: 1.2em;
174
+ }
175
+
176
+ @if $option == "small" {
177
+ font-size: 0.8em;
178
+ }
179
+
180
+ @if $option == "wide" {
181
+ padding: 0.625em 2.250em;
182
+ }
183
+
184
+ @if $option == "borderless" or $option == "border-less" {
185
+ border: 0;
186
+ }
187
+
188
+ @if $option == "link" {
189
+ background-color: transparent;
190
+ opacity: 0.8;
191
+ text-decoration: underline;
40
192
 
41
- &:hover,
42
- &:active {
43
- background-image: linear-gradient(to bottom, $background-color, darken($background-color, 8%));
44
- color: $color;
193
+ &:hover {
194
+ background-color: transparent;
195
+ opacity: 1;
196
+ }
45
197
  }
46
198
  }
47
199
  }
@@ -4,6 +4,9 @@
4
4
  // Used to set the max-width with the outer-container mixin
5
5
  $max-width: 1024px !default;
6
6
 
7
+ $default-ui-color: #0366d6 !default;
8
+
9
+
7
10
  // Used for has-cards, has-columns, and has-grid mixins. When the
8
11
  // viewport reaches the mobile-breakpoint, the columns will be stacked.
9
12
  $mobile-breakpoint: 767px !default;
@@ -0,0 +1,2 @@
1
+ @import "./_base_resources/functions/color";
2
+ @import "./_base_resources/functions/text_color";
@@ -0,0 +1,53 @@
1
+ $vue-checkmark-color: $green !default;
2
+ $curve: cubic-bezier(0.650, 0.000, 0.450, 1.000);
3
+
4
+ .vue-checkmark {
5
+ width: 100%;
6
+ height: 100%;
7
+ border-radius: 50%;
8
+ display: block;
9
+ stroke: #fff;
10
+ stroke-miterlimit: 10;
11
+ margin: 10% auto;
12
+ box-shadow: inset 0px 0px 0px $vue-checkmark-color;
13
+ @include animation(vue-checkmark-fill .4s ease-in-out .4s forwards, vue-checkmark-scalescale .3s ease-in-out .9s both);
14
+
15
+ .vue-checkmark-circle {
16
+ stroke-dasharray: 166;
17
+ stroke-dashoffset: 166;
18
+ stroke-miterlimit: 10;
19
+ stroke: $vue-checkmark-color;
20
+ fill: none;
21
+ @include animation(vue-checkmark-stroke .6s $curve forwards);
22
+ }
23
+
24
+ .vue-checkmark-check {
25
+ transform-origin: 50% 50%;
26
+ stroke-dasharray: 48;
27
+ stroke-dashoffset: 48;
28
+ @include animation(vue-checkmark-stroke .3s $curve .8s forwards);
29
+ }
30
+ }
31
+
32
+
33
+
34
+ @keyframes vue-checkmark-stroke {
35
+ 100% {
36
+ stroke-dashoffset: 0;
37
+ }
38
+ }
39
+
40
+ @keyframes vue-checkmark-scale {
41
+ 0%, 100% {
42
+ @include transform(none);
43
+ }
44
+ 50% {
45
+ @include transform(scale3d(1.1, 1.1, 1));
46
+ }
47
+ }
48
+
49
+ @keyframes vue-checkmark-fill {
50
+ 100% {
51
+ box-shadow: inset 0px 0px 0px 30px $vue-checkmark-color;
52
+ }
53
+ }
@@ -0,0 +1,153 @@
1
+ .vue-code {
2
+
3
+ &.vue-code-inline {
4
+ display: inline-block;
5
+ }
6
+
7
+ .hljs {
8
+ color: #383a42;
9
+ background: #fafafa;
10
+ }
11
+
12
+ .hljs-comment,
13
+ .hljs-quote {
14
+ color: #a0a1a7;
15
+ }
16
+
17
+ .hljs-doctag,
18
+ .hljs-keyword,
19
+ .hljs-formula {
20
+ color: #a626a4;
21
+ }
22
+
23
+ .hljs-section,
24
+ .hljs-name,
25
+ .hljs-selector-tag,
26
+ .hljs-deletion,
27
+ .hljs-subst {
28
+ color: #e45649;
29
+ }
30
+
31
+ .hljs-literal {
32
+ color: #0184bb;
33
+ }
34
+
35
+ .hljs-string,
36
+ .hljs-regexp,
37
+ .hljs-addition,
38
+ .hljs-attribute,
39
+ .hljs-meta-string {
40
+ color: #50a14f;
41
+ }
42
+
43
+ .hljs-built_in,
44
+ .hljs-class .hljs-title {
45
+ color: #c18401;
46
+ }
47
+
48
+ .hljs-attr,
49
+ .hljs-variable,
50
+ .hljs-template-variable,
51
+ .hljs-type,
52
+ .hljs-selector-class,
53
+ .hljs-selector-attr,
54
+ .hljs-selector-pseudo,
55
+ .hljs-number {
56
+ color: #986801;
57
+ }
58
+
59
+ .hljs-symbol,
60
+ .hljs-bullet,
61
+ .hljs-link,
62
+ .hljs-meta,
63
+ .hljs-selector-id,
64
+ .hljs-title {
65
+ color: #4078f2;
66
+ }
67
+
68
+ &.vue-code-dark {
69
+ .hljs {
70
+ color: #abb2bf;
71
+ background: #282c34;
72
+ }
73
+
74
+ .hljs-comment,
75
+ .hljs-quote {
76
+ color: #5c6370;
77
+ }
78
+
79
+ .hljs-doctag,
80
+ .hljs-keyword,
81
+ .hljs-formula {
82
+ color: #c678dd;
83
+ }
84
+
85
+ .hljs-section,
86
+ .hljs-name,
87
+ .hljs-selector-tag,
88
+ .hljs-deletion,
89
+ .hljs-subst {
90
+ color: #e06c75;
91
+ }
92
+
93
+ .hljs-literal {
94
+ color: #56b6c2;
95
+ }
96
+
97
+ .hljs-string,
98
+ .hljs-regexp,
99
+ .hljs-addition,
100
+ .hljs-attribute,
101
+ .hljs-meta-string {
102
+ color: #98c379;
103
+ }
104
+
105
+ .hljs-built_in,
106
+ .hljs-class .hljs-title {
107
+ color: #e6c07b;
108
+ }
109
+
110
+ .hljs-attr,
111
+ .hljs-variable,
112
+ .hljs-template-variable,
113
+ .hljs-type,
114
+ .hljs-selector-class,
115
+ .hljs-selector-attr,
116
+ .hljs-selector-pseudo,
117
+ .hljs-number {
118
+ color: #d19a66;
119
+ }
120
+
121
+ .hljs-symbol,
122
+ .hljs-bullet,
123
+ .hljs-link,
124
+ .hljs-meta,
125
+ .hljs-selector-id,
126
+ .hljs-title {
127
+ color: #61aeee;
128
+ }
129
+ }
130
+
131
+ .hljs {
132
+ display: block;
133
+ overflow-x: auto;
134
+ padding: 0.5em;
135
+ }
136
+
137
+ .hljs-comment,
138
+ .hljs-quote {
139
+ font-style: italic;
140
+ }
141
+
142
+ .hljs-emphasis {
143
+ font-style: italic;
144
+ }
145
+
146
+ .hljs-strong {
147
+ font-weight: bold;
148
+ }
149
+
150
+ .hljs-link {
151
+ text-decoration: underline;
152
+ }
153
+ }