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
@@ -1,3 +0,0 @@
1
- //= require beyond_canvas/buttons
2
- //= require beyond_canvas/flash
3
- //= require beyond_canvas/inputs
@@ -1,28 +0,0 @@
1
- (function($) {
2
- $(document).on('ready page:load turbolinks:load', function() {
3
- $('input[type="file"]').each(function() {
4
- var $input = $(this),
5
- $label = $(`.input__file__text.${$input.attr('id')}`),
6
- labelVal = $label.html();
7
-
8
- $input.on('change', function(e) {
9
- var fileName = '';
10
-
11
- if (this.files && this.files.length > 1)
12
- fileName = (this.getAttribute('data-multiple-caption') || '').replace('{count}', this.files.length);
13
- else if (e.target.value)
14
- fileName = e.target.value.split('\\').pop();
15
-
16
- if (fileName)
17
- $label.html(`<i class="far fa-file input__file__icon"></i>${fileName}`);
18
- else
19
- $label.html(labelVal);
20
- });
21
-
22
- // Firefox bug fix
23
- $input
24
- .on('focus', function() { $input.addClass('has-focus'); })
25
- .on('blur', function() { $input.removeClass('has-focus'); });
26
- });
27
- });
28
- })(jQuery);
@@ -1,24 +0,0 @@
1
- @import 'bourbon'
2
-
3
- @import 'beyond_canvas/settings/variables'
4
- @import 'beyond_canvas/settings/reset_css'
5
- @import 'beyond_canvas/settings/typography'
6
-
7
- @import 'beyond_canvas/utilities/mixins'
8
-
9
- @import 'beyond_canvas/components/actions'
10
- @import 'beyond_canvas/components/buttons'
11
- @import 'beyond_canvas/components/cards'
12
- @import 'beyond_canvas/components/comments'
13
- @import 'beyond_canvas/components/flash'
14
- @import 'beyond_canvas/components/forms'
15
- @import 'beyond_canvas/components/inputs'
16
- @import 'beyond_canvas/components/links'
17
- @import 'beyond_canvas/components/main'
18
- @import 'beyond_canvas/components/margins'
19
- @import 'beyond_canvas/components/notices'
20
- @import 'beyond_canvas/components/relative'
21
- @import 'beyond_canvas/components/tables'
22
- @import 'beyond_canvas/components/spinner'
23
- @import 'beyond_canvas/components/texts'
24
- @import 'beyond_canvas/components/markdown'
@@ -1,5 +0,0 @@
1
- .actions
2
-
3
- &--disabled
4
- cursor: not-allowed
5
- pointer-events: none
@@ -1,86 +0,0 @@
1
- %button
2
- +padding($button-padding)
3
- @if $button-box-shadow != true
4
- padding-top: 7px
5
- align-items: center
6
- border-radius: $button-border-radius
7
- border-width: 1px
8
- border-style: solid
9
- cursor: pointer
10
- display: flex
11
- font-weight: $button-font-weight
12
- justify-content: flex-end
13
- line-height: 1
14
- outline: none
15
- transition: $main-transition
16
-
17
- @mixin button-solid($background, $color)
18
- +background-color-darken($background, 10%)
19
- color: $color
20
-
21
- .spinner
22
- display: none
23
-
24
- > div
25
- background-color: $color
26
-
27
- &:hover
28
- border-color: darken($background, 10%)
29
-
30
- @mixin button-transparent($background)
31
- background-color: transparent
32
- border-color: $background
33
- color: $background
34
-
35
- .spinner
36
- display: none
37
-
38
- > div
39
- background-color: $background
40
-
41
- &:hover
42
- background-color: lighten($background, 40%)
43
-
44
- @mixin button-border($background)
45
- border-color: $background
46
-
47
- @if $button-box-shadow == true
48
- border-bottom-width: 2px
49
- border-bottom-color: darken($background, 10%)
50
-
51
-
52
- .button
53
-
54
- &__solid
55
-
56
- &--primary
57
- @extend %button
58
- +button-solid($button-primary-background, $button-primary-color)
59
- +button-border($button-primary-background)
60
-
61
- &--secondary
62
- @extend %button
63
- +button-solid($button-secondary-background, $button-secondary-color)
64
- +button-border($button-secondary-background)
65
-
66
- &--danger
67
- @extend %button
68
- +button-solid($button-danger-background, $button-danger-color)
69
- +button-border($button-danger-background)
70
-
71
- &__transparent
72
-
73
- &--primary
74
- @extend %button
75
- +button-transparent($button-primary-background)
76
- +button-border($button-primary-background)
77
-
78
- &--secondary
79
- @extend %button
80
- +button-transparent($button-secondary-background)
81
- +button-border($button-secondary-background)
82
-
83
- &--danger
84
- @extend %button
85
- +button-transparent($button-danger-background)
86
- +button-border($button-danger-background)
@@ -1,26 +0,0 @@
1
- .card
2
- background: $white
3
- border-radius: $card-border-radius
4
- box-shadow: $card-box-shadow
5
-
6
- &:not(:last-child)
7
- margin-bottom: $card-margin
8
-
9
- &--relative
10
- position: relative
11
-
12
- &--padding
13
- +padding($card-padding)
14
- box-sizing: border-box
15
-
16
- &__separator
17
- +margin($card-separator-spacing null)
18
- border-bottom: 1px solid $card-separator-color
19
- left: -#{$card-padding}
20
- position: relative
21
- width: calc(100% + 2 * #{$card-padding})
22
-
23
- &__headline
24
- color: $card-title-color
25
- font-size: 20px
26
- margin-bottom: 20px
@@ -1,5 +0,0 @@
1
- .comment
2
- padding: 20px
3
- box-sizing: border-box
4
- background: $comment-background
5
- color: $comment-color
@@ -1,51 +0,0 @@
1
- .flash
2
- +position(fixed, 70px null null null)
3
- background-color: $white
4
- border-radius: $flash-border-radius
5
- box-shadow: $flash-box-shadow
6
- display: flex
7
- overflow: hidden
8
- transition: .7s linear
9
- z-index: 9999
10
-
11
- &--shown
12
- // sass-lint:disable no-important
13
- right: 25px !important
14
- // sass-lint:enable no-important
15
- transition: .4s linear
16
-
17
- &__icon
18
- align-items: center
19
- box-sizing: border-box
20
- color: $white
21
- display: flex
22
- font-size: 18px
23
- justify-content: center
24
- min-width: 34px
25
- padding: 11px 8px
26
-
27
- &--success
28
- background-color: $flash-success
29
-
30
- &--info
31
- background-color: $flash-info
32
-
33
- &--warning
34
- background-color: $flash-warning
35
-
36
- &--error
37
- background-color: $flash-error
38
-
39
- &__message
40
- +padding(10px 15px)
41
- box-sizing: border-box
42
- color: $flash-color
43
-
44
- &__close
45
- +padding(10px 15px)
46
- align-items: center
47
- box-sizing: border-box
48
- color: $flash-color
49
- cursor: pointer
50
- display: flex
51
- font-size: 10px
@@ -1,32 +0,0 @@
1
- %form__actions
2
- align-items: center
3
- display: flex
4
-
5
- .form
6
-
7
- &__row,
8
- &__actions
9
- width: 100%
10
-
11
- &:not(:last-child)
12
- margin-bottom: 30px
13
-
14
- &__actions
15
-
16
- &--spaced
17
- @extend %form__actions
18
- justify-content: space-between
19
-
20
- &--left
21
- @extend %form__actions
22
- justify-content: flex-start
23
-
24
- *:not(:last-child)
25
- margin-right: 30px
26
-
27
- &--right
28
- @extend %form__actions
29
- justify-content: flex-end
30
-
31
- *:not(:first-child)
32
- margin-left: 30px
@@ -1,79 +0,0 @@
1
- #{$all-text-inputs},
2
- select
3
- background-color: $white
4
- border: 1px solid $input-border-color
5
- border-radius: 3px
6
- box-sizing: border-box
7
- outline: none
8
- padding: 6px 8px
9
- width: 100%
10
-
11
- #{$all-text-inputs}
12
- line-height: 1
13
-
14
- #{$all-text-inputs-focus},
15
- select:focus
16
- border-color: $input-border-color-focus
17
-
18
- select
19
- +prefixer(appearance, none, ('webkit', 'moz'))
20
- 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)
21
- background-position: calc(100% - 19px) calc(1em + -1px), calc(100% - 15px) calc(1em + -1px), calc(100% - 2.5em) 0.5em
22
- background-size: 4px 4px, 4px 4px, 0 0
23
- background-repeat: no-repeat
24
-
25
- #{$all-text-inputs},
26
- select
27
-
28
- &.input__error
29
- border-left: 2px solid $input-errors-color
30
-
31
- &:focus
32
- border: 1px solid $input-border-color-focus
33
-
34
- .input
35
-
36
- &__label
37
- color: $label-color
38
- display: block
39
- font-size: 13px
40
- font-weight: bold
41
-
42
- &__hint
43
- color: $hint-color
44
- font-size: 13px
45
- margin-top: 1px
46
-
47
- &__file
48
- display: flex
49
- align-items: center
50
-
51
- &__label
52
- display: inline-block
53
-
54
- &__text
55
- margin-left: 20px
56
- font-weight: 500
57
-
58
- &__icon
59
- margin-right: 5px
60
- position: relative
61
- top: 1px
62
-
63
-
64
- // &__with-error
65
- // border-left: 2px solid $input-errors-color
66
-
67
- label.input__error
68
- +padding(5px 7px)
69
- +position(absolute, calc(100% + 8px) null null 0)
70
- background-color: $input-errors-color
71
- border-radius: 3px
72
- color: $white
73
- font-size: 13px
74
- z-index: 1
75
-
76
- &::before
77
- +position(absolute, null null 100% 8px)
78
- +triangle('up', 12px, 6px, $input-errors-color)
79
- content: ''
@@ -1,13 +0,0 @@
1
- .link
2
-
3
- &__icon
4
- margin-right: 10px
5
-
6
- &--primary
7
- +color-darken($link-primary-color, 10%)
8
-
9
- &--secondary
10
- +color-darken($link-secondary-color, 10%)
11
-
12
- &--danger
13
- +color-darken($link-danger-color, 10%)
@@ -1,28 +0,0 @@
1
- %body
2
- background-color: $main-background
3
-
4
- .body--public
5
- @extend %body
6
-
7
- .main-wrapper
8
- +margin(32px auto)
9
- max-width: 531px
10
- width: 94%
11
-
12
- .logo
13
- +margin($logo-margin-top-public auto $logo-margin-bottom-public)
14
- display: block
15
- width: 238px
16
-
17
- .body--single-page
18
- @extend %body
19
-
20
- .main-wrapper
21
- +margin(32px auto)
22
- max-width: 876px
23
- width: 94%
24
-
25
- .logo
26
- +margin($logo-margin-top-public auto $logo-margin-bottom-public)
27
- display: block
28
- width: 238px
@@ -1,7 +0,0 @@
1
- .margin
2
-
3
- &--top
4
- margin-top: 30px
5
-
6
- &--bottom
7
- margin-bottom: 30px
@@ -1,60 +0,0 @@
1
- .markdown
2
-
3
- > :first-child
4
- margin-top: 0 !important
5
-
6
- > :last-child
7
- margin-bottom: 0
8
-
9
- > *:not(:last-child)
10
- margin-bottom: 16px
11
-
12
- h1, h2, h3, h4
13
- margin-top: 24px
14
-
15
- h1
16
- font-size: 2em
17
-
18
- h2
19
- font-size: 1.5em
20
-
21
- h3
22
- font-size: 1.25em
23
-
24
- h4
25
- font-size: 1em
26
-
27
- ul,
28
- ol
29
- padding-left: 2em
30
-
31
- ul
32
- margin-bottom: 0
33
-
34
- table
35
-
36
- thead
37
- background-color: $markdown-table-head-background
38
- font-weight: 700
39
-
40
- thead,
41
- tbody
42
-
43
- tr
44
-
45
- th,
46
- td
47
- border: 1px solid $markdown-table-border-color
48
- padding: .4em .8em
49
-
50
- blockquote
51
- border-left: .25em solid $markdown-blockquote-border-color
52
- color: $markdown-blockquote-font-color
53
- padding: 0 1em
54
-
55
- hr
56
- background-color: $markdown-hr-background
57
- border: 0
58
- height: 4px
59
- margin: 24px 0 !important
60
- padding: 0