beyond_canvas 0.12.0.pre → 0.15.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) 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 +106 -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 -18
  41. data/app/controllers/beyond_canvas/system_controller.rb +24 -0
  42. data/app/controllers/concerns/beyond_canvas/locale_management.rb +10 -7
  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 +5 -0
  49. data/app/{assets/javascripts/beyond_canvas → javascript/beyond_canvas/initializers}/buttons.js +34 -14
  50. data/app/{assets/javascripts/beyond_canvas → javascript/beyond_canvas/initializers}/flash.js +10 -7
  51. data/app/javascript/beyond_canvas/initializers/inputs.js +38 -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 +105 -65
  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 -25
  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/_layouts.sass +0 -5
  90. data/app/assets/stylesheets/beyond_canvas/components/_links.sass +0 -13
  91. data/app/assets/stylesheets/beyond_canvas/components/_main.sass +0 -28
  92. data/app/assets/stylesheets/beyond_canvas/components/_margins.sass +0 -7
  93. data/app/assets/stylesheets/beyond_canvas/components/_markdown.sass +0 -60
  94. data/app/assets/stylesheets/beyond_canvas/components/_notices.sass +0 -41
  95. data/app/assets/stylesheets/beyond_canvas/components/_relative.sass +0 -2
  96. data/app/assets/stylesheets/beyond_canvas/components/_spinner.sass +0 -38
  97. data/app/assets/stylesheets/beyond_canvas/components/_tables.sass +0 -25
  98. data/app/assets/stylesheets/beyond_canvas/components/_texts.sass +0 -6
  99. data/app/assets/stylesheets/beyond_canvas/mailer.sass +0 -5
  100. data/app/assets/stylesheets/beyond_canvas/settings/_typography.sass +0 -53
  101. data/app/assets/stylesheets/beyond_canvas/settings/_variables.sass +0 -145
  102. data/app/assets/stylesheets/beyond_canvas/utilities/_mixins.sass +0 -19
  103. data/app/views/beyond_canvas/custom/_public_head.html.slim +0 -0
  104. data/app/views/beyond_canvas/shared/_flash.html.slim +0 -6
  105. data/app/views/beyond_canvas/shared/_head.html.slim +0 -20
  106. data/app/views/beyond_canvas/shared/_locale_switch.html.slim +0 -6
  107. data/app/views/beyond_canvas/shared/_logo.html.slim +0 -2
  108. data/app/views/layouts/beyond_canvas/public.html.slim +0 -12
  109. data/config/initializers/beyond_canvas/assets.rb +0 -5
  110. data/lib/generators/beyond_canvas/install_generator.rb +0 -13
  111. data/lib/generators/templates/beyond_canvas.rb +0 -8
  112. data/lib/generators/templates/beyond_canvas_form_utils.rb +0 -23
@@ -1,41 +0,0 @@
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
- &--info
14
- border-color: $notice-info-background
15
-
16
- .notice__icon
17
- background-color: $notice-info-background
18
-
19
- &--warning
20
- border-color: $notice-warning-background
21
-
22
- .notice__icon
23
- background-color: $notice-warning-background
24
-
25
- &--error
26
- border-color: $notice-error-background
27
-
28
- .notice__icon
29
- background-color: $notice-error-background
30
-
31
- &__icon
32
- +padding(10px 8px)
33
- color: $white
34
- display: flex
35
- font-size: 18px
36
-
37
- &__content
38
- +padding(8px 14px)
39
- color: $notice-color
40
- display: flex
41
- align-items: center
@@ -1,2 +0,0 @@
1
- .relative
2
- position: relative
@@ -1,38 +0,0 @@
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
- .bounce1
17
- -webkit-animation-delay: -0.32s
18
- animation-delay: -0.32s
19
-
20
- .bounce2
21
- -webkit-animation-delay: -0.16s
22
- animation-delay: -0.16s
23
-
24
- @-webkit-keyframes sk-bouncedelay
25
- 0%, 80%, 100%
26
- -webkit-transform: scale(0)
27
-
28
- 40%
29
- -webkit-transform: scale(1)
30
-
31
- @keyframes sk-bouncedelay
32
- 0%, 80%, 100%
33
- -webkit-transform: scale(0)
34
- transform: scale(0)
35
-
36
- 40%
37
- -webkit-transform: scale(1)
38
- transform: scale(1)
@@ -1,25 +0,0 @@
1
- .table
2
- width: 100%
3
- border-collapse: collapse
4
-
5
- th, td
6
- padding: 15px
7
- text-align: left
8
-
9
- thead
10
-
11
- tr
12
- font-weight: 700
13
-
14
- &:first-child
15
- background-color: $table-header-background
16
-
17
- &:nth-child(2)
18
- border-bottom: 2px solid $table-border-color
19
-
20
- tbody
21
-
22
- tr
23
-
24
- &:not(:last-child)
25
- border-bottom: 1px solid $table-border-color
@@ -1,6 +0,0 @@
1
- .text
2
-
3
- &__align
4
-
5
- &--center
6
- text-align: center
@@ -1,5 +0,0 @@
1
- @import 'bourbon'
2
-
3
- @import 'settings/variables'
4
-
5
- @import 'components/markdown'
@@ -1,53 +0,0 @@
1
- // sass-lint:disable single-line-per-selector, no-vendor-prefixes
2
-
3
- html
4
- font-size: 62.5%
5
-
6
- body, #{$all-text-inputs}, #{$all-buttons}, select
7
- -moz-osx-font-smoothing: grayscale
8
- -webkit-font-smoothing: antialiased
9
- font-family: unquote($main-font-family)
10
- font-size: $main-font-size
11
- font-weight: normal
12
-
13
- body, #{$all-text-inputs}, select
14
- color: $main-color
15
-
16
- body, #{$all-text-inputs}
17
- line-height: $main-line-height
18
-
19
- select
20
- line-height: initial
21
-
22
- h1, h2, h3, h4, h5, h6
23
- color: $headline-color
24
- font-weight: bold
25
- line-height: $headline-line-height
26
-
27
- h1
28
- font-size: 56px
29
-
30
- h2
31
- font-size: 40px
32
-
33
- h3
34
- font-size: 32px
35
-
36
- h4
37
- font-size: 24px
38
-
39
- h5
40
- font-size: 16px
41
-
42
- p
43
- font-size: $main-font-size
44
-
45
- a
46
- color: $main-color
47
- outline: none
48
- text-decoration: none
49
-
50
- strong
51
- font-weight: bold
52
-
53
- // sass-lint:enable single-line-per-selector, no-vendor-prefixes
@@ -1,145 +0,0 @@
1
- // ************************************************************
2
- // Colors
3
- // ************************************************************
4
-
5
- $white: rgb(255, 255, 255) !global
6
- $black: rgb(0, 0, 0) !global
7
- $palette-primary: rgb(78, 183, 168) !default
8
- $palette-secondary: rgb(28, 53, 69) !default
9
- $palette-cancel: rgb(153, 153, 153) !default
10
- $palette-danger: rgb(218, 60, 60) !default
11
-
12
- // ************************************************************
13
- // General styles
14
- // ************************************************************
15
-
16
- $main-background: rgb(233, 232, 220) !default
17
- $main-transition: .125s ease-in !global
18
-
19
- // ************************************************************
20
- // Typography
21
- // ************************************************************
22
-
23
- $main-font-family: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif' !global
24
- $main-color: rgb(62, 62, 62) !default
25
- $main-line-height: 1.5 !global
26
- $main-font-size: 14px !global
27
-
28
- // ************************************************************
29
- // Headlines
30
- // ************************************************************
31
-
32
- $headline-color: rgb(122, 118, 76) !default
33
- $headline-line-height: 1 !global
34
-
35
- // ************************************************************
36
- // Links
37
- // ************************************************************
38
-
39
- $link-primary-color: darken($palette-primary, 10%) !default
40
- $link-secondary-color: darken($palette-cancel, 10%) !default
41
- $link-danger-color: darken($palette-danger, 10%) !default
42
-
43
- // ************************************************************
44
- // Buttons
45
- // ************************************************************
46
-
47
- $button-primary-background: $palette-primary !default
48
- $button-primary-color: $white !default
49
-
50
- $button-secondary-background: $palette-cancel !default
51
- $button-secondary-color: $white !default
52
-
53
- $button-danger-background: $palette-danger !default
54
- $button-danger-color: $white !default
55
-
56
- $button-border-radius: 3px !default
57
- $button-box-shadow: true !default
58
- $button-font-weight: 700 !global
59
- $button-padding: 6px 12px 7px !global
60
-
61
- // ************************************************************
62
- // Cards
63
- // ************************************************************
64
-
65
- $card-border-radius: 3px !default
66
- $card-box-shadow: 0 2px 7px rgba($black, .2) !default
67
- $card-padding: 40px !global
68
- $card-margin: 30px !global
69
- $card-separator-color: rgb(222, 222, 222) !default
70
- $card-separator-spacing: 50px !global
71
- $card-title-color: rgb(247, 133, 96) !default
72
-
73
- // ************************************************************
74
- // Labels
75
- // ************************************************************
76
-
77
- $label-color: rgb(128, 128, 128) !default
78
-
79
- // ************************************************************
80
- // Inputs
81
- // ************************************************************
82
-
83
- $input-border-color: rgb(217, 216, 195) !default
84
- $input-border-color-focus: $palette-primary !default
85
- $input-errors-color: $palette-danger !default
86
-
87
- // ************************************************************
88
- // Hints
89
- // ************************************************************
90
-
91
- $hint-color: rgb(158, 158, 158) !default
92
-
93
- // ************************************************************
94
- // Logo
95
- // ************************************************************
96
-
97
- $logo-margin-top-public: 0 !default
98
- $logo-margin-bottom-public: 34px !default
99
-
100
- // ************************************************************
101
- // Flash
102
- // ************************************************************
103
-
104
- $flash-success: rgb(123, 170, 81) !default
105
- $flash-info: rgb(90, 129, 171) !default
106
- $flash-warning: rgb(193, 179, 26) !default
107
- $flash-error: rgb(162, 66, 60) !default
108
- $flash-border-radius: 4px !default
109
- $flash-box-shadow: 0 1px 2px 0 rgba($black, 0.2) !default
110
- $flash-color: rgb(128, 128, 128) !default
111
-
112
- // ************************************************************
113
- // Tables
114
- // ************************************************************
115
-
116
- $table-header-background: rgb(243, 242, 236) !default
117
- $table-border-color: rgb(233, 232, 220) !default
118
-
119
- // ************************************************************
120
- // Comments
121
- // ************************************************************
122
-
123
- $comment-background: rgb(246, 246, 243) !default
124
- $comment-color: rgb(170, 169, 156) !default
125
-
126
- // ************************************************************
127
- // Notices
128
- // ************************************************************
129
-
130
- $notice-success-background: rgb(123, 170, 81) !default
131
- $notice-info-background: rgb(153, 153, 153) !default
132
- $notice-warning-background: rgb(235, 183, 92) !default
133
- $notice-error-background: rgb(162, 66, 60) !default
134
- $notice-border-radius: 4px !default
135
- $notice-color: rgb(153, 153, 153) !default
136
-
137
- // ************************************************************
138
- // Markdown
139
- // ************************************************************
140
-
141
- $markdown-table-head-background: #f6f8fa
142
- $markdown-table-border-color: #dfe2e5
143
- $markdown-blockquote-font-color: #6a737d
144
- $markdown-blockquote-border-color: #dfe2e5
145
- $markdown-hr-background: #e1e4e8
@@ -1,19 +0,0 @@
1
- @mixin background-color-darken($color, $percent)
2
- background-color: $color
3
- transition: $main-transition
4
-
5
- &:hover
6
- background-color: darken($color, $percent)
7
- transition: $main-transition
8
-
9
- @mixin color-darken($color, $percent)
10
- color: $color
11
- transition: $main-transition
12
-
13
- &:hover
14
- color: darken($color, $percent)
15
- transition: $main-transition
16
-
17
- @mixin background-color-lighten($color, $percent)
18
- background-color: lighten($color, $percent)
19
- transition: $main-transition
@@ -1,6 +0,0 @@
1
- - flash.each do |key, value|
2
- .flash
3
- i.flash__icon class="flash__icon--#{key} #{get_flash_icon(key)}"
4
-
5
- .flash__message = value
6
- i.fas.fa-times.flash__close
@@ -1,20 +0,0 @@
1
- head
2
- = csrf_meta_tags
3
- meta content='width=device-width, initial-scale=1.0' name='viewport' /
4
-
5
- link crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" rel="stylesheet" /
6
- script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"
7
-
8
- title = full_title(yield :title)
9
-
10
- - stylesheet_link_tag = BeyondCanvas.configuration.stylesheet_link_tag
11
- - javascript_include_tag = BeyondCanvas.configuration.javascript_include_tag
12
-
13
- - if defined?(Turbolinks)
14
- = stylesheet_link_tag stylesheet_link_tag, 'data-turbolinks-track' => true
15
- = javascript_include_tag javascript_include_tag, 'data-turbolinks-track' => true
16
- - else
17
- = stylesheet_link_tag stylesheet_link_tag
18
- = javascript_include_tag javascript_include_tag
19
-
20
- = render 'beyond_canvas/custom/public_head'
@@ -1,6 +0,0 @@
1
- - if defined?(I18n) && I18n.available_locales.count > 1
2
- = form_for :app, url: beyond_canvas.update_locale_path, method: :put do |f|
3
- = f.select :locale, I18n.available_locales.collect { |l| [translate_locale(l), l] },
4
- { selected: I18n.locale },
5
- class: 'select--locale',
6
- onchange: 'this.form.submit()'
@@ -1,2 +0,0 @@
1
- - logo = BeyondCanvas.configuration.public_logo
2
- = logo_image_tag(logo) unless logo.nil?
@@ -1,12 +0,0 @@
1
- doctype html
2
-
3
- html
4
- = render 'beyond_canvas/shared/head'
5
-
6
- body.body--public
7
- main.main class=("#{params[:controller].gsub(/[\/_]/, "-")}--#{params[:action]}")
8
- = render 'beyond_canvas/shared/flash'
9
- = render 'beyond_canvas/shared/locale_switch'
10
- .main-wrapper
11
- = render 'beyond_canvas/shared/logo'
12
- = yield
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Rails.application.config.assets.precompile += %w( beyond_canvas/mailer.css )
4
- Rails.application.config.assets.precompile += %w( beyond_canvas.css )
5
- Rails.application.config.assets.precompile += %w( beyond_canvas.js )
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BeyondCanvas
4
- module Generators
5
- class InstallGenerator < Rails::Generators::Base
6
- source_root File.expand_path('../templates', __dir__)
7
-
8
- def copy_initializer
9
- template 'beyond_canvas.rb', 'config/initializers/beyond_canvas.rb'
10
- end
11
- end
12
- end
13
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- BeyondCanvas.setup do |config|
4
- # config.public_logo = "logo.png"
5
-
6
- # config.stylesheet_link_tag = 'application'
7
- # config.javascript_include_tag = 'application'
8
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Adds form__error class to the inputs after sending a form when errors
4
- ActionView::Base.field_error_proc = proc do |html_tag, _instance|
5
- include ActionView::Helpers::SanitizeHelper
6
-
7
- if html_tag =~ /<(input|textarea|select)/
8
- error_class = 'form__error'
9
-
10
- doc = Nokogiri::XML(html_tag)
11
- doc.children.each do |field|
12
- next if field['type'] == 'hidden'
13
-
14
- next if field['class'] =~ /\berror\b/
15
-
16
- field['class'] = "#{field['class']} #{error_class}".strip
17
- end
18
-
19
- sanitize doc.to_html
20
- else
21
- html_tag
22
- end
23
- end