beyond_canvas 0.11.2.pre → 0.15.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -20
  3. data/app/assets/images/icons/checkbox_checked.svg +1 -0
  4. data/app/assets/images/icons/checkbox_unchecked.svg +1 -0
  5. data/app/assets/images/icons/file.svg +1 -0
  6. data/app/assets/images/icons/flash_checkbox.svg +1 -0
  7. data/app/assets/images/icons/flash_close.svg +1 -0
  8. data/app/assets/images/icons/flash_error.svg +1 -0
  9. data/app/assets/images/icons/flash_info.svg +1 -0
  10. data/app/assets/images/icons/flash_warning.svg +1 -0
  11. data/app/assets/images/icons/radiobutton_checked.svg +1 -0
  12. data/app/assets/images/icons/radiobutton_unchecked.svg +1 -0
  13. data/app/assets/javascripts/beyond_canvas/base.js +94 -0
  14. data/app/assets/stylesheets/beyond_canvas/base.scss +28 -0
  15. data/app/assets/stylesheets/beyond_canvas/components/_actions.scss +6 -0
  16. data/app/assets/stylesheets/beyond_canvas/components/_buttons.scss +112 -0
  17. data/app/assets/stylesheets/beyond_canvas/components/_cards.scss +34 -0
  18. data/app/assets/stylesheets/beyond_canvas/components/_comments.scss +6 -0
  19. data/app/assets/stylesheets/beyond_canvas/components/_containers.scss +37 -0
  20. data/app/assets/stylesheets/beyond_canvas/components/_flash.scss +66 -0
  21. data/app/assets/stylesheets/beyond_canvas/components/_forms.scss +43 -0
  22. data/app/assets/stylesheets/beyond_canvas/components/_inputs.scss +143 -0
  23. data/app/assets/stylesheets/beyond_canvas/components/_layouts.scss +7 -0
  24. data/app/assets/stylesheets/beyond_canvas/components/_links.scss +17 -0
  25. data/app/assets/stylesheets/beyond_canvas/components/_main.scss +39 -0
  26. data/app/assets/stylesheets/beyond_canvas/components/_margins.scss +9 -0
  27. data/app/assets/stylesheets/beyond_canvas/components/_markdown.scss +74 -0
  28. data/app/assets/stylesheets/beyond_canvas/components/_notices.scss +58 -0
  29. data/app/assets/stylesheets/beyond_canvas/components/_relative.scss +3 -0
  30. data/app/assets/stylesheets/beyond_canvas/components/_spinner.scss +48 -0
  31. data/app/assets/stylesheets/beyond_canvas/components/_tables.scss +31 -0
  32. data/app/assets/stylesheets/beyond_canvas/components/_texts.scss +7 -0
  33. data/app/assets/stylesheets/beyond_canvas/mailer.scss +5 -0
  34. data/app/assets/stylesheets/beyond_canvas/settings/_breakpoints.scss +6 -0
  35. data/app/assets/stylesheets/beyond_canvas/settings/{_reset_css.sass → _reset_css.scss} +29 -21
  36. data/app/assets/stylesheets/beyond_canvas/settings/_typography.scss +67 -0
  37. data/app/assets/stylesheets/beyond_canvas/settings/_variables.scss +171 -0
  38. data/app/assets/stylesheets/beyond_canvas/utilities/_functions.scss +15 -0
  39. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.scss +24 -0
  40. data/app/controllers/beyond_canvas/application_controller.rb +2 -2
  41. data/app/controllers/beyond_canvas/system_controller.rb +24 -0
  42. data/app/controllers/concerns/beyond_canvas/locale_management.rb +18 -20
  43. data/app/controllers/concerns/beyond_canvas/request_validation.rb +37 -0
  44. data/app/controllers/concerns/beyond_canvas/status_codes.rb +17 -0
  45. data/app/form_builders/beyond_canvas/form_builder.rb +74 -13
  46. data/app/helpers/beyond_canvas/application_helper.rb +17 -18
  47. data/app/helpers/beyond_canvas/locale_switch_helper.rb +1 -1
  48. data/app/javascript/beyond_canvas/base.js +6 -0
  49. data/app/{assets/javascripts/beyond_canvas → javascript/beyond_canvas/initializers}/buttons.js +19 -14
  50. data/app/{assets/javascripts/beyond_canvas → javascript/beyond_canvas/initializers}/flash.js +11 -7
  51. data/app/javascript/beyond_canvas/initializers/inputs.js +39 -0
  52. data/app/views/beyond_canvas/custom/_public_head.html.erb +1 -0
  53. data/app/views/beyond_canvas/locales/_edit.html.erb +8 -0
  54. data/app/views/beyond_canvas/mailer/_header.html.erb +2 -2
  55. data/app/views/beyond_canvas/shared/_flash.html.erb +13 -0
  56. data/app/views/beyond_canvas/shared/_head.html.erb +29 -0
  57. data/app/views/beyond_canvas/shared/_logo.html.erb +2 -0
  58. data/app/views/layouts/beyond_canvas/public.html.erb +16 -0
  59. data/config/initializers/beyond_canvas/filter_parameter_logging.rb +9 -0
  60. data/config/routes.rb +1 -1
  61. data/lib/beyond_canvas.rb +13 -16
  62. data/lib/beyond_canvas/asset_registration.rb +29 -0
  63. data/lib/beyond_canvas/configuration.rb +27 -0
  64. data/lib/beyond_canvas/engine.rb +12 -1
  65. data/lib/beyond_canvas/version.rb +1 -1
  66. data/lib/generators/beyond_canvas/assets/assets_generator.rb +14 -0
  67. data/lib/generators/beyond_canvas/assets/templates/beyond_canvas.js +1 -0
  68. data/lib/generators/beyond_canvas/assets/templates/beyond_canvas.scss +1 -0
  69. data/lib/generators/beyond_canvas/beyond_api/beyond_api_generator.rb +19 -0
  70. data/lib/generators/beyond_canvas/{custom_styles_generator.rb → custom_styles/custom_styles_generator.rb} +2 -2
  71. data/lib/generators/{templates → beyond_canvas/custom_styles/templates}/beyond_canvas_custom_styles.sass +0 -0
  72. data/lib/generators/beyond_canvas/install/install_generator.rb +35 -0
  73. data/lib/generators/beyond_canvas/install/templates/beyond_canvas.rb.erb +40 -0
  74. data/lib/generators/beyond_canvas/webpacker/plugins/jquery.js +7 -0
  75. data/lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.js +3 -0
  76. data/lib/generators/beyond_canvas/webpacker/templates/beyond_canvas.scss +1 -0
  77. data/lib/generators/beyond_canvas/webpacker/webpacker_generator.rb +26 -0
  78. metadata +107 -66
  79. data/app/assets/javascripts/beyond_canvas.js +0 -3
  80. data/app/assets/javascripts/beyond_canvas/inputs.js +0 -28
  81. data/app/assets/stylesheets/beyond_canvas.sass +0 -24
  82. data/app/assets/stylesheets/beyond_canvas/components/_actions.sass +0 -5
  83. data/app/assets/stylesheets/beyond_canvas/components/_buttons.sass +0 -86
  84. data/app/assets/stylesheets/beyond_canvas/components/_cards.sass +0 -26
  85. data/app/assets/stylesheets/beyond_canvas/components/_comments.sass +0 -5
  86. data/app/assets/stylesheets/beyond_canvas/components/_flash.sass +0 -51
  87. data/app/assets/stylesheets/beyond_canvas/components/_forms.sass +0 -32
  88. data/app/assets/stylesheets/beyond_canvas/components/_inputs.sass +0 -79
  89. data/app/assets/stylesheets/beyond_canvas/components/_links.sass +0 -13
  90. data/app/assets/stylesheets/beyond_canvas/components/_main.sass +0 -28
  91. data/app/assets/stylesheets/beyond_canvas/components/_margins.sass +0 -7
  92. data/app/assets/stylesheets/beyond_canvas/components/_markdown.sass +0 -60
  93. data/app/assets/stylesheets/beyond_canvas/components/_notices.sass +0 -41
  94. data/app/assets/stylesheets/beyond_canvas/components/_relative.sass +0 -2
  95. data/app/assets/stylesheets/beyond_canvas/components/_spinner.sass +0 -38
  96. data/app/assets/stylesheets/beyond_canvas/components/_tables.sass +0 -25
  97. data/app/assets/stylesheets/beyond_canvas/components/_texts.sass +0 -6
  98. data/app/assets/stylesheets/beyond_canvas/mailer.sass +0 -5
  99. data/app/assets/stylesheets/beyond_canvas/settings/_typography.sass +0 -53
  100. data/app/assets/stylesheets/beyond_canvas/settings/_variables.sass +0 -145
  101. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.sass +0 -19
  102. data/app/views/beyond_canvas/custom/_public_head.html.slim +0 -0
  103. data/app/views/beyond_canvas/shared/_flash.html.slim +0 -6
  104. data/app/views/beyond_canvas/shared/_head.html.slim +0 -20
  105. data/app/views/beyond_canvas/shared/_locale_switch.html.slim +0 -6
  106. data/app/views/beyond_canvas/shared/_logo.html.slim +0 -2
  107. data/app/views/layouts/beyond_canvas/public.html.slim +0 -12
  108. data/config/initializers/beyond_canvas/assets.rb +0 -5
  109. data/lib/generators/beyond_canvas/install_generator.rb +0 -13
  110. data/lib/generators/templates/beyond_canvas.rb +0 -8
  111. data/lib/generators/templates/beyond_canvas_form_utils.rb +0 -23
@@ -0,0 +1,43 @@
1
+ %form__actions {
2
+ align-items: center;
3
+ display: flex;
4
+ }
5
+
6
+ .form {
7
+ &__row,
8
+ &__actions {
9
+ width: 100%;
10
+
11
+ &:not(:last-child) {
12
+ margin-bottom: 30px;
13
+ }
14
+ }
15
+
16
+ &__actions {
17
+ &--spaced {
18
+ @extend %form__actions;
19
+
20
+ justify-content: space-between;
21
+ }
22
+
23
+ &--left {
24
+ @extend %form__actions;
25
+
26
+ justify-content: flex-start;
27
+
28
+ *:not(:last-child) {
29
+ margin-right: 30px;
30
+ }
31
+ }
32
+
33
+ &--right {
34
+ @extend %form__actions;
35
+
36
+ justify-content: flex-end;
37
+
38
+ *:not(:first-child) {
39
+ margin-left: 30px;
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,143 @@
1
+ $controls: checkbox, radio;
2
+
3
+ #{$all-text-inputs},
4
+ select {
5
+ background-color: $white;
6
+ border: 1px solid $input-border-color;
7
+ border-radius: 3px;
8
+ box-sizing: border-box;
9
+ outline: none;
10
+ padding: 6px 8px;
11
+ width: 100%;
12
+ }
13
+
14
+ #{$all-text-inputs} {
15
+ line-height: 1;
16
+ }
17
+
18
+ #{$all-text-inputs-focus},
19
+ select:focus {
20
+ border-color: $input-border-color-focus;
21
+ }
22
+
23
+ select {
24
+ @include prefixer(appearance, none, ("webkit", "moz"));
25
+
26
+ background-image: linear-gradient(45deg, transparent 50%, gray 50%), linear-gradient(135deg, gray 50%, transparent 50%), linear-gradient(to right, $input-border-color, $input-border-color);
27
+ background-position: calc(100% - 19px) calc(1em + -1px), calc(100% - 15px) calc(1em + -1px), calc(100% - 2.5em) 0.5em;
28
+ background-size: 4px 4px, 4px 4px, 0 0;
29
+ background-repeat: no-repeat;
30
+ }
31
+
32
+ #{$all-text-inputs},
33
+ select {
34
+ &.input__error {
35
+ border-left: 2px solid $input-errors-color;
36
+
37
+ &:focus {
38
+ border: 1px solid $input-border-color-focus;
39
+ }
40
+ }
41
+ }
42
+
43
+ .input {
44
+ &__label {
45
+ color: $label-color;
46
+ display: block;
47
+ font-size: 13px;
48
+ font-weight: bold;
49
+ }
50
+
51
+ &__hint {
52
+ color: $hint-color;
53
+ font-size: 13px;
54
+ margin-top: 1px;
55
+ }
56
+
57
+ @each $control in $controls {
58
+
59
+ &__#{$control} {
60
+ display: flex;
61
+ align-items: center;
62
+
63
+ .input__#{$control}__control {
64
+ @if $control == checkbox {
65
+ @include size(16px);
66
+ } @else if $control == radio {
67
+ @include size(18px);
68
+ }
69
+
70
+ cursor: pointer;
71
+ margin-right: 7px;
72
+ }
73
+
74
+ input[type=#{$control}] + .input__#{$control}__control {
75
+ @if $control == checkbox {
76
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $checkbox-unchecked-background, '#', '%23')};' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $checkbox-unchecked-color, '#', '%23')}' d='M0 0v24h24V0H0zm21.5 21.5h-19v-19h19v19z'%3E%3C/path%3E%3C/svg%3E%0A");
77
+ } @else if $control == radio {
78
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $radio-unchecked-background, '#', '%23')};' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $radio-unchecked-color, '#', '%23')}' d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.6 0 12 0zm0 21.6c-5.3 0-9.6-4.3-9.6-9.6S6.7 2.4 12 2.4s9.6 4.3 9.6 9.6-4.3 9.6-9.6 9.6z'%3E%3C/path%3E%3C/svg%3E");
79
+ }
80
+ }
81
+
82
+ input[type=#{$control}]:checked + .input__#{$control}__control {
83
+ @if $control == checkbox {
84
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $checkbox-checked-background, '#', '%23')};' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $checkbox-checked-color, '#', '%23')}' d='M0 0v24h24V0H0zm9.6 18.4l-5.8-5.6 2-2.1 3.7 3.6L18 5.6l2.1 2.1L9.6 18.4z'%3E%3C/path%3E%3C/svg%3E%0A");
85
+ } @else if $control == radio {
86
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' style='background: #{str-replace('' + $radio-checked-background, '#', '%23')};' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='#{str-replace('' + $radio-checked-color, '#', '%23')}' d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.6 0 12 0zm0 21.6c-5.3 0-9.6-4.3-9.6-9.6S6.7 2.4 12 2.4s9.6 4.3 9.6 9.6-4.3 9.6-9.6 9.6zm0-15.9c-3.4 0-6.3 2.8-6.3 6.3s2.8 6.2 6.3 6.2 6.2-2.8 6.2-6.2-2.8-6.3-6.2-6.3z'%3E%3C/path%3E%3C/svg%3E");
87
+ }
88
+ }
89
+
90
+ + div .input__label {
91
+ line-height: 1;
92
+ }
93
+
94
+ + div .input__hint {
95
+ line-height: 1;
96
+ margin-top: 4px;
97
+ }
98
+ }
99
+ }
100
+
101
+ &__file {
102
+ display: flex;
103
+ align-items: center;
104
+
105
+ &__control {
106
+ display: inline-block;
107
+ }
108
+
109
+ &__text {
110
+ display: flex;
111
+ margin-left: 20px;
112
+ font-weight: 500;
113
+ text-overflow: ellipsis;
114
+ overflow: hidden;
115
+ white-space: nowrap;
116
+ max-width: 200px;
117
+ }
118
+
119
+ &__icon {
120
+ color: $main-color;
121
+ width: 14px;
122
+ margin-right: 5px;
123
+ }
124
+ }
125
+ }
126
+
127
+ label.input__error {
128
+ @include padding(5px 7px);
129
+ @include position(absolute, calc(100% + 8px) null null 0);
130
+
131
+ background-color: $input-errors-color;
132
+ border-radius: 3px;
133
+ color: $white;
134
+ font-size: 13px;
135
+ z-index: 1;
136
+
137
+ &::before {
138
+ @include position(absolute, null null 100% 8px);
139
+ @include triangle("up", 12px, 6px, $input-errors-color);
140
+
141
+ content: "";
142
+ }
143
+ }
@@ -0,0 +1,7 @@
1
+ .body--public {
2
+ .select--locale {
3
+ @include position(absolute, 40px 40px null null);
4
+
5
+ width: 200px;
6
+ }
7
+ }
@@ -0,0 +1,17 @@
1
+ .link {
2
+ &__icon {
3
+ margin-right: 10px;
4
+ }
5
+
6
+ &--primary {
7
+ @include color-darken($link-primary-color, 10%);
8
+ }
9
+
10
+ &--secondary {
11
+ @include color-darken($link-secondary-color, 10%);
12
+ }
13
+
14
+ &--danger {
15
+ @include color-darken($link-danger-color, 10%);
16
+ }
17
+ }
@@ -0,0 +1,39 @@
1
+ %body {
2
+ background-color: $main-background;
3
+ }
4
+
5
+ .body--public {
6
+ @extend %body;
7
+
8
+ .main-wrapper {
9
+ @include margin(32px auto);
10
+
11
+ max-width: 531px;
12
+ width: 94%;
13
+
14
+ .logo {
15
+ @include margin($logo-margin-top-public auto $logo-margin-bottom-public);
16
+
17
+ display: block;
18
+ width: 238px;
19
+ }
20
+ }
21
+ }
22
+
23
+ .body--single-page {
24
+ @extend %body;
25
+
26
+ .main-wrapper {
27
+ @include margin(32px auto);
28
+
29
+ max-width: 876px;
30
+ width: 94%;
31
+
32
+ .logo {
33
+ @include margin($logo-margin-top-public auto $logo-margin-bottom-public);
34
+
35
+ display: block;
36
+ width: 238px;
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,9 @@
1
+ .margin {
2
+ &--top {
3
+ margin-top: 30px;
4
+ }
5
+
6
+ &--bottom {
7
+ margin-bottom: 30px;
8
+ }
9
+ }
@@ -0,0 +1,74 @@
1
+ .markdown {
2
+ > :first-child {
3
+ margin-top: 0 !important;
4
+ }
5
+
6
+ > :last-child {
7
+ margin-bottom: 0;
8
+ }
9
+
10
+ > *:not(:last-child) {
11
+ margin-bottom: 16px;
12
+ }
13
+
14
+ h1, h2, h3, h4 {
15
+ margin-top: 24px;
16
+ }
17
+
18
+ h1 {
19
+ font-size: 2em;
20
+ }
21
+
22
+ h2 {
23
+ font-size: 1.5em;
24
+ }
25
+
26
+ h3 {
27
+ font-size: 1.25em;
28
+ }
29
+
30
+ h4 {
31
+ font-size: 1em;
32
+ }
33
+
34
+ ul,
35
+ ol {
36
+ padding-left: 2em;
37
+
38
+ ul {
39
+ margin-bottom: 0;
40
+ }
41
+ }
42
+
43
+ table {
44
+ thead {
45
+ background-color: $markdown-table-head-background;
46
+ font-weight: 700;
47
+ }
48
+
49
+ thead,
50
+ tbody {
51
+ tr {
52
+ th,
53
+ td {
54
+ border: 1px solid $markdown-table-border-color;
55
+ padding: 0.4em 0.8em;
56
+ }
57
+ }
58
+ }
59
+ }
60
+
61
+ blockquote {
62
+ border-left: 0.25em solid $markdown-blockquote-border-color;
63
+ color: $markdown-blockquote-font-color;
64
+ padding: 0 1em;
65
+ }
66
+
67
+ hr {
68
+ background-color: $markdown-hr-background;
69
+ border: 0;
70
+ height: 4px;
71
+ margin: 24px 0 !important;
72
+ padding: 0;
73
+ }
74
+ }
@@ -0,0 +1,58 @@
1
+ .notice {
2
+ border-radius: $notice-border-radius;
3
+ border: 1px solid;
4
+ box-sizing: border-box;
5
+ display: flex;
6
+
7
+ &--success {
8
+ border-color: $notice-success-background;
9
+
10
+ .notice__icon {
11
+ background-color: $notice-success-background;
12
+ }
13
+ }
14
+
15
+ &--info {
16
+ border-color: $notice-info-background;
17
+
18
+ .notice__icon {
19
+ background-color: $notice-info-background;
20
+ }
21
+ }
22
+
23
+ &--warning {
24
+ border-color: $notice-warning-background;
25
+
26
+ .notice__icon {
27
+ background-color: $notice-warning-background;
28
+ }
29
+ }
30
+
31
+ &--error {
32
+ border-color: $notice-error-background;
33
+
34
+ .notice__icon {
35
+ background-color: $notice-error-background;
36
+ }
37
+ }
38
+
39
+ &__icon {
40
+ @include padding(10px 8px);
41
+
42
+ display: flex;
43
+
44
+ > svg {
45
+ @include size(18px);
46
+
47
+ fill: $white;
48
+ }
49
+ }
50
+
51
+ &__content {
52
+ @include padding(8px 14px);
53
+
54
+ color: $notice-color;
55
+ display: flex;
56
+ align-items: center;
57
+ }
58
+ }
@@ -0,0 +1,3 @@
1
+ .relative {
2
+ position: relative;
3
+ }
@@ -0,0 +1,48 @@
1
+ .spinner {
2
+ display: flex;
3
+ margin-right: 12px;
4
+ width: 24px;
5
+ text-align: center;
6
+
7
+ > div {
8
+ margin: 0 !important;
9
+ width: 8px;
10
+ height: 8px;
11
+ border-radius: 100%;
12
+ display: inline-block;
13
+ -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
14
+ animation: sk-bouncedelay 1.4s infinite ease-in-out both;
15
+ }
16
+
17
+ .bounce1 {
18
+ -webkit-animation-delay: -0.32s;
19
+ animation-delay: -0.32s;
20
+ }
21
+
22
+ .bounce2 {
23
+ -webkit-animation-delay: -0.16s;
24
+ animation-delay: -0.16s;
25
+ }
26
+ }
27
+
28
+ @-webkit-keyframes sk-bouncedelay {
29
+ 0%, 80%, 100% {
30
+ -webkit-transform: scale(0);
31
+ }
32
+
33
+ 40% {
34
+ -webkit-transform: scale(1);
35
+ }
36
+ }
37
+
38
+ @keyframes sk-bouncedelay {
39
+ 0%, 80%, 100% {
40
+ -webkit-transform: scale(0);
41
+ transform: scale(0);
42
+ }
43
+
44
+ 40% {
45
+ -webkit-transform: scale(1);
46
+ transform: scale(1);
47
+ }
48
+ }