chr 0.2.8 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/Gruntfile.coffee +33 -27
  3. data/README.md +6 -1
  4. data/app/assets/javascripts/chr.coffee +18 -16
  5. data/app/assets/javascripts/chr/core/chr.coffee +41 -76
  6. data/app/assets/javascripts/chr/core/chr_router.coffee +141 -0
  7. data/app/assets/javascripts/chr/core/item.coffee +36 -49
  8. data/app/assets/javascripts/chr/core/list.coffee +26 -71
  9. data/app/assets/javascripts/chr/core/list_config.coffee +28 -13
  10. data/app/assets/javascripts/chr/core/list_pagination.coffee +56 -13
  11. data/app/assets/javascripts/chr/core/list_reorder.coffee +2 -2
  12. data/app/assets/javascripts/chr/core/list_search.coffee +2 -2
  13. data/app/assets/javascripts/chr/core/module.coffee +24 -93
  14. data/app/assets/javascripts/chr/core/utils.coffee +4 -0
  15. data/app/assets/javascripts/chr/core/view.coffee +123 -43
  16. data/app/assets/javascripts/chr/core/view_local-storage.coffee +58 -0
  17. data/app/assets/javascripts/chr/store/{_array-store.coffee → array-store.coffee} +3 -1
  18. data/app/assets/javascripts/chr/store/{_object-store.coffee → object-store.coffee} +0 -0
  19. data/app/assets/javascripts/chr/store/rails-array-store.coffee +39 -0
  20. data/app/assets/javascripts/chr/store/{mongosteen-object-store.coffee → rails-form-object-parser.coffee} +11 -20
  21. data/app/assets/javascripts/chr/store/rails-object-store.coffee +35 -0
  22. data/app/assets/javascripts/chr/store/rest-array-store.coffee +3 -5
  23. data/app/assets/javascripts/chr/store/rest-object-store.coffee +1 -1
  24. data/app/assets/javascripts/form/expandable-group.coffee +30 -0
  25. data/app/assets/javascripts/{chr/form → form}/form.coffee +3 -1
  26. data/app/assets/javascripts/{chr/form → form}/input-checkbox.coffee +1 -1
  27. data/app/assets/javascripts/{chr/form → form}/input-color.coffee +2 -0
  28. data/app/assets/javascripts/{chr/form → form}/input-date.coffee +0 -0
  29. data/app/assets/javascripts/{chr/form → form}/input-file.coffee +28 -1
  30. data/app/assets/javascripts/{chr/form → form}/input-form.coffee +14 -5
  31. data/app/assets/javascripts/{chr/form → form}/input-form_reorder.coffee +0 -0
  32. data/app/assets/javascripts/{chr/form → form}/input-hidden.coffee +9 -9
  33. data/app/assets/javascripts/{chr/form → form}/input-list.coffee +61 -53
  34. data/app/assets/javascripts/{chr/form → form}/input-list_reorder.coffee +2 -0
  35. data/app/assets/javascripts/form/input-list_typeahead.coffee +55 -0
  36. data/app/assets/javascripts/{chr/form → form}/input-password.coffee +1 -0
  37. data/app/assets/javascripts/{chr/form → form}/input-select.coffee +10 -11
  38. data/app/assets/javascripts/form/input-select2.coffee +33 -0
  39. data/app/assets/javascripts/{chr/form → form}/input-string.coffee +45 -2
  40. data/app/assets/javascripts/{chr/form → form}/input-text.coffee +6 -3
  41. data/app/assets/javascripts/input-html.coffee +8 -5
  42. data/app/assets/javascripts/input-markdown.coffee +10 -5
  43. data/app/assets/javascripts/input-redactor.coffee +1 -61
  44. data/app/assets/javascripts/redactor/input-redactor.coffee +53 -0
  45. data/app/assets/javascripts/redactor/input-redactor_character.coffee +83 -0
  46. data/app/assets/javascripts/redactor/input-redactor_images.coffee +166 -0
  47. data/app/assets/javascripts/{chr/vendor → vendor}/ace.js +0 -0
  48. data/app/assets/javascripts/{chr/vendor → vendor}/jquery.scrollparent.js +0 -0
  49. data/app/assets/javascripts/{chr/vendor → vendor}/jquery.textarea_autosize.js +0 -0
  50. data/app/assets/javascripts/{chr/vendor → vendor}/jquery.typeahead.js +0 -0
  51. data/app/assets/javascripts/{chr/vendor → vendor}/marked.js +0 -0
  52. data/app/assets/javascripts/{chr/vendor → vendor}/mode-html.js +0 -0
  53. data/app/assets/javascripts/{chr/vendor → vendor}/mode-markdown.js +0 -0
  54. data/app/assets/javascripts/{chr/vendor → vendor}/redactor.fixedtoolbar.js +1 -1
  55. data/app/assets/javascripts/vendor/select2.js +5274 -0
  56. data/app/assets/javascripts/{chr/vendor → vendor}/slip.js +0 -0
  57. data/app/assets/stylesheets/_chr.scss +11 -13
  58. data/app/assets/stylesheets/_input-redactor.scss +17 -16
  59. data/app/assets/stylesheets/{core → chr}/_icons.scss +1 -1
  60. data/app/assets/stylesheets/chr/_main.scss +110 -0
  61. data/app/assets/stylesheets/{core → chr}/_mixins.scss +58 -34
  62. data/app/assets/stylesheets/{core → chr}/_settings.scss +7 -1
  63. data/app/assets/stylesheets/form/_expandable-group.scss +16 -0
  64. data/app/assets/stylesheets/form/_input-select2.scss +94 -0
  65. data/app/assets/stylesheets/form/_main.scss +180 -0
  66. data/app/assets/stylesheets/vendor/select2.css +258 -0
  67. data/bower.json +2 -2
  68. data/dist/chr.js +2292 -2030
  69. data/dist/input-ace.js +18 -8
  70. data/dist/input-redactor.js +0 -156
  71. data/docs/bootstrap.md +1 -1
  72. data/docs/rails.md +10 -10
  73. data/lib/chr.rb +1 -8
  74. data/lib/chr/version.rb +1 -1
  75. data/lib/mongoid/character.rb +30 -0
  76. data/package.json +1 -1
  77. metadata +49 -43
  78. data/app/assets/javascripts/chr/store/mongosteen-array-store.coffee +0 -55
  79. data/app/assets/stylesheets/core/_list.scss +0 -39
  80. data/app/assets/stylesheets/core/_main.scss +0 -49
  81. data/app/assets/stylesheets/core/_responsive.scss +0 -62
  82. data/app/assets/stylesheets/form/_form.scss +0 -41
  83. data/app/assets/stylesheets/form/_input-checkbox.scss +0 -18
  84. data/app/assets/stylesheets/form/_input-color.scss +0 -10
  85. data/app/assets/stylesheets/form/_input-file.scss +0 -29
  86. data/app/assets/stylesheets/form/_input-form.scss +0 -26
  87. data/app/assets/stylesheets/form/_input-list.scss +0 -36
  88. data/app/assets/stylesheets/form/_input-string.scss +0 -8
@@ -1,16 +1,14 @@
1
1
  @import "bourbon";
2
2
 
3
- @import "core/settings";
4
- @import "core/mixins";
5
- @import "core/icons";
6
- @import "core/main";
7
- @import "core/list";
8
- @import "core/responsive";
3
+ @import "chr/settings";
4
+ @import "chr/mixins";
5
+ @import "chr/icons";
6
+ @import "chr/main";
7
+
8
+ @import "form/input-select2";
9
+ @import "form/expandable-group";
10
+ @import "form/main";
11
+
12
+
13
+
9
14
 
10
- @import "form/form";
11
- @import "form/input-checkbox";
12
- @import "form/input-color";
13
- @import "form/input-file";
14
- @import "form/input-form";
15
- @import "form/input-list";
16
- @import "form/input-string";
@@ -5,30 +5,31 @@
5
5
  .input-inverter,
6
6
  .input-redactor {
7
7
  .redactor-box { margin-bottom: 0; }
8
- .redactor-toolbar { box-shadow: none; border-bottom: 2px solid $contrastColor; }
9
- .redactor-editor { border: 1px solid $contrastColor; border-top: 0; }
10
- }
11
-
12
-
13
- // fullscreen
14
- .redactor-box-fullscreen {
15
- .redactor-toolbar { box-shadow: none; border-bottom: 2px solid $contrastColor; }
16
- .redactor-placeholder:after { content: ''; }
17
- .redactor-editor { padding-bottom: 5em; border: none; }
8
+ .redactor-toolbar { box-shadow: none; border-bottom: 2px solid $neutralColor; }
9
+ .redactor-editor { border: 0; padding: 1em .5em 0 .5em; }
18
10
  }
19
11
 
12
+ // toolbar
13
+ .redactor-toolbar li a:hover { background-color: $positiveColor; }
14
+ .redactor-dropdown a:hover { background-color: $positiveColor; }
20
15
 
21
16
  // placeholder
22
- .redactor-placeholder:after { color: $lightColor!important; }
23
-
17
+ .redactor-placeholder:after { color: $lightColor!important; left: .5em; top: 18px; }
24
18
 
25
19
  // scrollbars
26
- .redactor-editor, textarea.redactor { @include customScrollbar(); }
27
-
20
+ .redactor-editor, textarea.redactor { @include custom-scrollbar; }
28
21
 
29
22
  // line-height issue fix
30
23
  .redactor-editor { line-height: inherit !important; }
31
24
 
32
-
33
-
25
+ // modal
26
+ #redactor-modal-close { line-height: 30px; text-align: center; }
27
+ #redactor-modal footer button {
28
+ &.redactor-modal-close-btn { background-color: $lightColor;
29
+ &:hover { background-color: $lightColor; opacity: .75; } }
30
+ &.redactor-modal-action-btn { background-color: $positiveColor;
31
+ &:hover { background-color: $positiveColor; opacity: .75; color: $white; } }
32
+ &.redactor-modal-delete-btn { background-color: $assertiveColor;
33
+ &:hover { background-color: $assertiveColor; opacity: .75; color: $white; } }
34
+ }
34
35
 
@@ -60,7 +60,7 @@
60
60
  position: relative;
61
61
  width: 12px;
62
62
  height: 20px;
63
- margin-top: -4px;
63
+ margin-top: -5px;
64
64
  background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'><path d='M10,0l2,2l-8,8l8,8l-2,2L0,10L10,0z' fill='%23007aff'/></svg>");
65
65
  }
66
66
  &:hover { opacity: .5; }
@@ -0,0 +1,110 @@
1
+ /* Global ------------------------------------------------------------------ */
2
+ *, *:before, *:after { box-sizing: border-box; }
3
+ html { @include antialiased; font-family: $fontFamily; color: $black; }
4
+ html a { text-decoration: none; }
5
+
6
+
7
+ /* Menu -------------------------------------------------------------------- */
8
+ .menu { font-size: .8em; letter-spacing: 1px; text-transform: uppercase; }
9
+ .menu:before { @include menu-title($contrastColor); content: 'CHARACTER'; }
10
+
11
+
12
+ /* Header ------------------------------------------------------------------ */
13
+ .header { height: 40px; background-color: rgba(255,255,255,.9); text-align: center;
14
+ .title { @include truncate; display: inline-block; max-width: 70%; font-weight: 500; line-height: 2.5; }
15
+ .back, .close { @include header-back-arrow; }
16
+ .new { @include position(absolute, 0 0 null null); @extend .icon-plus; }
17
+ .new + .search { @include position(absolute, 0 40px inherit inherit); }
18
+ .spinner { @include spinner; @include hide; position: absolute; margin: 6px 0 0 -36px; }
19
+ .save { @include position(absolute, 0 1em null null); @include header-button($stableColor); font-weight: 500; }
20
+ }
21
+
22
+ .view.has-unsaved-changes .save { color: $positiveColor; }
23
+ .show-spinner .spinner { display: inline-block; }
24
+
25
+
26
+ /* Item -------------------------------------------------------------------- */
27
+ .menu a, .item { @include list-item($black, $neutralColor, $neutralColor); }
28
+
29
+ .item .icon-reorder { top: 50%; margin-top: -20px; right: 0; }
30
+
31
+ .item.is-folder { font-weight: 400; }
32
+ .item.has-subtitle { padding: .6em 1em; }
33
+ .item.has-thumbnail { padding-left: 4.1em; }
34
+ .item.has-thumbnail .item-title { line-height: 2.15; }
35
+ .item.has-thumbnail.has-subtitle { padding: 1em 1em .75em 4.1em; }
36
+ .item.has-thumbnail.has-subtitle .item-title { line-height: 1.2; }
37
+ .item.reorderable { padding-right: 2.5em; }
38
+
39
+ .item-title { @include truncate; }
40
+ .item-subtitle { @include truncate; color: $stableColor; font-size: .8em; line-height: 1.5; }
41
+ .item-thumbnail { @include position(absolute, .5em 0 0 .5em); width: 3.1em; height: 3.1em; }
42
+ .item-thumbnail img { width: 100%; border-radius: 25px; }
43
+
44
+
45
+ /* Search ------------------------------------------------------------------ */
46
+ .search { @include position(absolute, 0 0 null null); width: 40px; height: 40px; overflow: hidden;
47
+ .icon { @include position(absolute, 0 null null 0); @extend .icon-search; }
48
+ input, .cancel { @include hide; }
49
+ }
50
+
51
+ .list-search {
52
+ .item.is-folder, .item.is-nested_object { @include hide; }
53
+ .new + .search { @include position(absolute, 0 0 null 0); }
54
+ .search { @include position(absolute, 0 null null null); width: 100%; background-color: $white;
55
+ .cancel { display: inline; @include header-button; @include position(absolute, 0 1em null null); }
56
+ input { display: block; width: 100%; height: 40px; padding: 0 5em 0 2.5em; @include no-outline; }
57
+ .icon { &:hover { opacity: 1; } &:before { border-color: $stableColor; } &:after { background-color: $stableColor; } }
58
+ }
59
+ }
60
+
61
+
62
+ /* View -------------------------------------------------------------------- */
63
+ .view-delete { display: block; text-align: center; margin: 5em 0; line-height: 2.5em;
64
+ color: $assertiveColor; border: 1px solid $assertiveColor; border-left: none; border-right: none;
65
+ &:hover, &:active { background-color: $assertiveColor; color: #fff; } }
66
+
67
+ .view-saving .save { @include hide(); }
68
+ .view-saving .spinner { display: inline-block; }
69
+
70
+
71
+ /* Mobile ------------------------------------------------------------------ */
72
+ .header { @include position(fixed, 0 null null null); z-index: 10; width: 100%; }
73
+ .view, .list { @include position(absolute, 0 0 null 0); background-color: $white; z-index: 1; padding-top: 41px; min-height: 100%; }
74
+ .list.scroll-lock { overflow: hidden; bottom: 0; }
75
+ .content, .items { padding-bottom: 5em; position: relative; z-index: 0; }
76
+
77
+
78
+ /* Tablet ------------------------------------------------------------------ */
79
+ @media #{$tablet} {
80
+ body { overflow: hidden; }
81
+ .sidebar { @include position(absolute, 0 null 0 0); width: 9em; }
82
+ .module { @include position(absolute, 0 0 0 9em); z-index: 1; @include border-shadow; }
83
+ .view,
84
+ .list { @include position(absolute, 0 0 0 0); overflow: hidden; background-color: #fff; padding-top: 0px; }
85
+ .header { @include position(relative); }
86
+ .items,
87
+ .content { @include position(absolute, 41px 0 0 0); @include scrollable(); }
88
+
89
+ .view .close { @include header-back-label; }
90
+ .module .list:first-child .back { @include hide; }
91
+ }
92
+
93
+
94
+ /* Desktop ----------------------------------------------------------------- */
95
+ @media #{$desktop} {
96
+ .sidebar { width: 10em; }
97
+ .module { left: 10em; }
98
+ .list { width: 22em; }
99
+ .list.list-aside { left: 22em; right: 0; width: auto; }
100
+ .list .header { border-right: 1px solid $neutralColor; }
101
+ .view { left: 22em; @include border-shadow; }
102
+ .view.fullsize { left: 0em; @include no-border-shadow; }
103
+
104
+ .list.list-aside .back { @include header-back-label; }
105
+ .input-text textarea, .content, .items { @include custom-scrollbar; }
106
+ }
107
+
108
+
109
+
110
+
@@ -1,56 +1,61 @@
1
1
  /* Mixins ------------------------------------------------------------------ */
2
- @mixin absolutePosition($coordinates: null null null null) {
3
- position: absolute; top: nth($coordinates, 1); right: nth($coordinates, 2); bottom: nth($coordinates, 3); left: nth($coordinates, 4); }
4
2
 
5
- @mixin truncate {
6
- text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
3
+ @mixin hide { display: none; }
7
4
 
8
- @mixin user-select-none {
9
- -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none;
10
- }
5
+ @mixin truncate { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
11
6
 
12
- @mixin border($color) {
13
- &:after { content: ''; display: block; height: 1px;
14
- background-color: $color; @include position(absolute, 0px 0px null 1em); }
15
- }
7
+ @mixin scrollable { overflow: hidden; overflow-y: scroll; -webkit-overflow-scrolling: touch; }
16
8
 
17
- @mixin noBorder { &:after { display: none; } }
9
+ @mixin antialiased { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
18
10
 
19
- @mixin noFocus { &:focus { outline: none; } }
11
+ @mixin no-focus-outline { &:focus { outline: none; } }
20
12
 
21
- @mixin customScrollbar {
22
- &::-webkit-scrollbar { width: 6px; background-color: $neutralColor; }
23
- &::-webkit-scrollbar-thumb { background-color: $contrastColor; border-radius: 3px; }
24
- }
13
+ @mixin no-outline { @include no-focus-outline; outline: none; border: none; }
25
14
 
26
- @mixin scrollable { overflow: hidden; overflow-y: scroll; -webkit-overflow-scrolling: touch; }
15
+ @mixin border-shadow { box-shadow: 0 0 2px rgba(0, 0, 0, 0.2); }
27
16
 
28
- @mixin spinner {
29
- border: .25em solid rgba($positiveColor, 0.2);
30
- border-left: .25em solid $positiveColor;
31
- -webkit-animation: spinning 1.1s infinite linear; animation: spinning 1.1s infinite linear;
32
- &, &:after { border-radius: 50%; width: 1.75em; height: 1.75em; }
17
+ @mixin no-border-shadow { box-shadow: none; }
18
+
19
+ @mixin header-back-arrow { @include position(absolute, 0 null null 0); @extend .icon-back; overflow: hidden; height: 40px; }
20
+
21
+ @mixin header-back-label { @include position(absolute, 0 null null 1em); @include header-button; width: auto; &:before { @include hide; } }
22
+
23
+ @mixin header-button($color: $positiveColor) {
24
+ display: inline-block; height: 40px; line-height: 2.5; color: $color;
25
+ @include no-focus-outline; &:hover { opacity: .5; }
33
26
  }
34
27
 
35
- @-webkit-keyframes spinning {
36
- 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
37
- 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
28
+ @mixin custom-scrollbar {
29
+ &::-webkit-scrollbar { width: 6px; background-color: $neutralColor; }
30
+ &::-webkit-scrollbar-thumb { background-color: $contrastColor; border-radius: 3px; }
38
31
  }
39
32
 
40
- @keyframes spinning {
41
- 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
42
- 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
33
+
34
+ /* Menu Title --------------------------------------------- */
35
+ @mixin menu-title($color) {
36
+ display: block; position: relative; padding: 1.5em 0 .75em 1em; font-weight: 800; color: $color;
37
+ // TODO: fix size for mobile, menu items too small
43
38
  }
44
39
 
45
- @mixin headerButton($color: $positiveColor) {
46
- color: $color; &:hover { opacity: .5; }
40
+
41
+ /* Menu Item & List Item ---------------------------------- */
42
+ @mixin bottom-border($color) {
43
+ &:after { content: ''; display: block; height: 1px; background-color: $color;
44
+ @include position(absolute, null 0px 0px 1em); }
47
45
  }
48
46
 
49
- @mixin shadow {
50
- box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
47
+ @mixin no-bottom-border { &:after { @include hide; } }
48
+
49
+ @mixin list-item($color, $activeBgColor, $borderColor) {
50
+ display: block; position: relative; padding: 1em; color: $color; font-weight: 300;
51
+ margin-top: -1px; @include bottom-border($borderColor);
52
+ &.active { background-color: $activeBgColor; z-index: 1; }
53
+ &:last-child { @include no-bottom-border; }
51
54
  }
52
55
 
53
- @mixin switchControl() {
56
+
57
+ /* Switch ------------------------------------------------- */
58
+ @mixin switch {
54
59
  $switch-width: 52px;
55
60
  $switch-padding: 2px;
56
61
  $switch-height: 32px;
@@ -126,5 +131,24 @@
126
131
  }
127
132
 
128
133
 
134
+ /* Spinner ------------------------------------------------ */
135
+ @mixin spinner {
136
+ border: .25em solid rgba($contrastColor, 0.2);
137
+ border-left: .25em solid $contrastColor;
138
+ -webkit-animation: spinning 1.1s infinite linear; animation: spinning 1.1s infinite linear;
139
+ &, &:after { border-radius: 50%; width: 1.75em; height: 1.75em; }
140
+ }
141
+
142
+ @-webkit-keyframes spinning {
143
+ 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
144
+ 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
145
+ }
146
+
147
+ @keyframes spinning {
148
+ 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
149
+ 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
150
+ }
151
+
152
+
129
153
 
130
154
 
@@ -6,4 +6,10 @@ $assertiveColor: rgb(239, 78, 58) !default;
6
6
  $neutralColor: rgb(246,246,246) !default;
7
7
  $contrastColor: rgb(230,230,230) !default;
8
8
  $white: rgb(255,255,255) !default;
9
- $black: #333 !default;
9
+ $black: #333 !default;
10
+
11
+ $fontFamily: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
12
+
13
+ /* Layouts ----------------------------------------------------------------- */
14
+ $tablet: "screen and (min-width:768px)";
15
+ $desktop: "screen and (min-width:1024px)";
@@ -0,0 +1,16 @@
1
+
2
+ // expandable group
3
+ .group-edit { color: $stableColor; font-size: .9em; @include position(absolute, null .5em null null); text-transform: lowercase; margin-top: -1.5em;
4
+ &:hover { color: $positiveColor; }
5
+ }
6
+
7
+ .group-edit:before {
8
+ content: '-';
9
+ display: block; width: 1em; height: 1em;
10
+ @include position(absolute, null null null -.75em);
11
+ }
12
+
13
+ .group-edit.hidden:before { content: '+'; }
14
+ .group-edit.hidden + .group { display: none; }
15
+
16
+ .form .group .input-stacked:last-child { @include bottom-border($neutralColor); }
@@ -0,0 +1,94 @@
1
+ @import "vendor/select2";
2
+
3
+
4
+ .input-stacked.input-select2 {
5
+ padding-bottom: .3em;
6
+ }
7
+
8
+ .select2-dropdown,
9
+ .select2-container--default .select2-selection--single {
10
+ border-color: $neutralColor;
11
+ border-radius: 0;
12
+ }
13
+
14
+ .select2-container--default .select2-selection--single {
15
+ border: 0;
16
+ }
17
+
18
+ .select2-container--open .select2-dropdown--above {
19
+ border: 1px solid $neutralColor; border-top: none;
20
+ }
21
+
22
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
23
+ line-height: 1.4em;
24
+ color: $black;
25
+ }
26
+
27
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
28
+ border-color: $positiveColor transparent transparent transparent;
29
+ }
30
+
31
+ .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
32
+ border-color: transparent transparent $positiveColor transparent;
33
+ }
34
+
35
+ .select2-container--default .select2-search--dropdown .select2-search__field {
36
+ border-color: $contrastColor;
37
+ &:focus {
38
+ border-color: $stableColor;
39
+ }
40
+ }
41
+
42
+ .select2-container--default * {
43
+ &:focus {
44
+ outline: none;
45
+ }
46
+ }
47
+
48
+ .select2-container--default .select2-results__option[aria-selected=true] {
49
+ background-color: $neutralColor;
50
+ color: $black;
51
+ }
52
+
53
+ .select2-results__option {
54
+ font-weight: 300;
55
+ }
56
+
57
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
58
+ background-color: $positiveColor;
59
+ color: $white;
60
+ }
61
+
62
+ .select2-container--default .select2-results__option[aria-selected=true] {
63
+ &:hover {
64
+ background-color: $positiveColor;
65
+ color: $white;
66
+ }
67
+ }
68
+
69
+ .select2-container--default .select2-results > .select2-results__options {
70
+ @include custom-scrollbar();
71
+ }
72
+
73
+ .select2-dropdown--below {
74
+ top: -4px;
75
+ }
76
+
77
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
78
+ left: 1px;
79
+ top: -1px;
80
+ }
81
+
82
+ .select2-container .select2-selection--single .select2-selection__rendered {
83
+ padding-left: 20px;
84
+ padding-right: 8px;
85
+ }
86
+
87
+ .select2-search--dropdown {
88
+ padding: 0;
89
+ margin: 0 -1px;
90
+ }
91
+
92
+
93
+
94
+
@@ -0,0 +1,180 @@
1
+
2
+ .form {
3
+ // label
4
+ label { display: block; }
5
+
6
+
7
+ // general
8
+ .input-stacked {
9
+ @include position(relative); padding: .5em 1em .9em;
10
+ @include bottom-border($neutralColor); &:last-child { @include no-bottom-border; }
11
+
12
+ textarea, input { width: 100%; @include no-outline; @include placeholder { color: $lightColor; } }
13
+
14
+ .label { display: block; line-height: 1.8; color: $stableColor; }
15
+ }
16
+
17
+
18
+ // validation error
19
+ .error-message { color: $assertiveColor; font-size: .8em; margin-left: .5em; }
20
+
21
+
22
+ // nested form
23
+ .nested-forms {
24
+ & > .label { margin-bottom: .25em; }
25
+ & > ul { margin: 0; padding: 0; }
26
+ & > ul > li { list-style-type: none; margin-top: 1em; @include position(relative); border: 1px solid $neutralColor; }
27
+ & > ul > li:first-child { margin-top: 0; }
28
+ & > ul > li > .icon-reorder { left: 0; top: 1em; }
29
+ & > ul li.reorderable { background-color: $white; }
30
+ & > ul li.reorderable > .input-stacked:first-child { padding-left: 2.4em; }
31
+ }
32
+
33
+ .nested-form-new {
34
+ color: $positiveColor; margin-top: .75em; display: inline-block; font-size: .9em;
35
+ &:hover { opacity: .5; }
36
+ }
37
+
38
+ .nested-form-delete {
39
+ @include position(absolute, .35em .3em null null); border-radius: 1em;
40
+ @include hide-text; width: 1.5em; height: 1.5em; background-color: rgba(0,0,0,.05);
41
+ &:before { content: '\00d7'; color: $stableColor; line-height: 1.35em; @include position(absolute, null 7px null null); }
42
+ &:hover { background-color: $positiveColor; &:before { color: $white; } }
43
+ }
44
+
45
+
46
+ // required
47
+ .input-required .label:before { content: '*'; color: $assertiveColor; @include position(absolute, null null null .38em); }
48
+
49
+
50
+ // disabled
51
+ .input-disabled { textarea, input { color: $stableColor; } }
52
+
53
+
54
+ // string
55
+ .input-string {
56
+ .twitter-typeahead { width: 100%; }
57
+ .tt-suggestions { padding: .1em .5em; margin: 0 0 0 -.5em; background: rgba(255,255,255, .95); }
58
+ .tt-suggestion { cursor: pointer; opacity: .5;
59
+ p { line-height: 1.5; margin: 0; }
60
+ &.tt-cursor { opacity: 1; }
61
+ }
62
+ }
63
+
64
+ // character counter
65
+ .input-character-counter { font-size: .8em; margin-left: .5em; &.exceeds { color: $assertiveColor; } }
66
+
67
+
68
+ // text
69
+ .input-text { min-height: 82px;
70
+ textarea { resize: none; overflow: auto; box-sizing: border-box; min-height: 20px; }
71
+ }
72
+
73
+
74
+ // select
75
+ .input-select select { margin-top: 0.15em; }
76
+
77
+
78
+ // checkbox
79
+ .input-checkbox { padding: .8em 1em 1em;
80
+ input { display: inline; width: auto; margin-right: .5em; }
81
+ .label { display: inline; cursor: pointer; }
82
+ }
83
+
84
+
85
+ // switch
86
+ .input-switch { padding-top: .75em;
87
+ .label { cursor: pointer; }
88
+ .switch { @include switch; float: right; }
89
+ }
90
+
91
+
92
+ // color
93
+ .input-color {
94
+ position: relative; padding-left: 4.75em;
95
+
96
+ .preview {
97
+ @include position(absolute, .65em null null 1em);
98
+ width: 50px; height: 50px; border-radius: 4px; background-color: #eee;
99
+ }
100
+ }
101
+
102
+
103
+ // list
104
+ .input-list {
105
+ input { padding-left: 2em; margin-top: .1em; }
106
+ ul { line-height: 1.5; margin: 0 0 0 2em; list-style: none; padding: 0; }
107
+ ul li { @include user-select(none); position: relative; }
108
+ ul li a { color: $assertiveColor; font-size: .75em; }
109
+
110
+ .slip-reordering { color: $positiveColor; }
111
+
112
+ .icon-reorder {
113
+ width: 25px;
114
+ height: 25px;
115
+ left: -1.75em;
116
+ &:before { left: 0; top: 9px; }
117
+ &:after { left: 0; top: 14px; }
118
+ }
119
+
120
+ .twitter-typeahead { width: 100%; }
121
+ .twitter-typeahead:after {
122
+ content: '+';
123
+ display: block;
124
+ width: 40px;
125
+ height: 24px;
126
+ position: absolute; left: 12px; top: -3px;
127
+ font-size: 22px;
128
+ color: $contrastColor;
129
+ }
130
+
131
+ .tt-suggestions { padding: .1em .5em; margin: 0 0 0 1.55em; background: rgba(255,255,255, .95); }
132
+ .tt-suggestion { cursor: pointer; opacity: .5;
133
+ p { line-height: 1.5; margin: 0; }
134
+ &.tt-cursor { opacity: 1; }
135
+ }
136
+ }
137
+
138
+
139
+ // file
140
+ .input-file { min-height: 102px; // NOTE: calculated based on image thumbnail size
141
+
142
+ a { color: $positiveColor; @include truncate; }
143
+ a:hover { text-decoration: underline; }
144
+
145
+ input[type=file] { margin-top: .5em; margin-left: 1.75em; }
146
+ input[type=checkbox] { display: inline; width: auto; margin-right: .5em; margin-left: 1em; }
147
+ label { display: inline; font-size: .8em; }
148
+
149
+ &.empty {
150
+ img, a, label, input[type=checkbox] { @include hide; }
151
+ input[type=file] { margin-top: .2em; }
152
+ }
153
+ }
154
+
155
+ .input-file-clear {
156
+ display: inline-block; width: 1.5em; height: 1.5em; background-color: rgba(0,0,0,.05);
157
+ @include position(absolute); border-radius: 1em; margin-top: -22px;
158
+ &:before { content: '\00d7'; color: $stableColor; line-height: 1.35em; @include position(absolute, null 7px null null); }
159
+ &:hover { background-color: $positiveColor; &:before { color: $white; } }
160
+ }
161
+
162
+
163
+ // input
164
+ .input-image { @extend .input-file; }
165
+ .input-image:not(.empty) {
166
+ padding-left: 6.5em;
167
+ position: relative;
168
+ img {
169
+ position: absolute;
170
+ border-radius: 4px;
171
+ left: 1em;
172
+ top: .8em;
173
+ width: 4.7em;
174
+ }
175
+ }
176
+ }
177
+
178
+
179
+
180
+