alveole 0.0.1 → 1.0.0.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +21 -26
  4. data/Rakefile +6 -8
  5. data/app/assets/config/alveole_manifest.js +5 -0
  6. data/app/assets/images/alveole/icons/favicon-150.png +0 -0
  7. data/app/assets/javascripts/alveole/application.js +10 -0
  8. data/app/assets/stylesheets/alveole/application.css +15 -0
  9. data/app/assets/stylesheets/application.tailwind.css +13 -0
  10. data/app/components/alveole/button_component.html.erb +10 -0
  11. data/app/components/alveole/button_component.rb +46 -0
  12. data/app/components/alveole/chip_component.html.erb +3 -0
  13. data/app/components/alveole/chip_component.rb +23 -0
  14. data/app/components/alveole/dropdown/menu_item_component.html.erb +2 -0
  15. data/app/components/alveole/dropdown/menu_item_component.rb +5 -0
  16. data/app/components/alveole/dropdown_component.html.erb +27 -0
  17. data/app/components/alveole/dropdown_component.rb +21 -0
  18. data/app/components/alveole/footer/link_component.html.erb +6 -0
  19. data/app/components/alveole/footer/link_component.rb +8 -0
  20. data/app/components/alveole/footer_component.html.erb +14 -0
  21. data/app/components/alveole/footer_component.rb +9 -0
  22. data/app/components/alveole/form_layout_component.html.erb +32 -0
  23. data/app/components/alveole/form_layout_component.rb +43 -0
  24. data/app/components/alveole/icon_component.html.erb +1 -0
  25. data/app/components/alveole/icon_component.rb +20 -0
  26. data/app/components/alveole/input/avatar_component.html.erb +16 -0
  27. data/app/components/alveole/input/avatar_component.rb +4 -0
  28. data/app/components/alveole/input/base_component.rb +16 -0
  29. data/app/components/alveole/input/comment_component.html.erb +153 -0
  30. data/app/components/alveole/input/comment_component.rb +5 -0
  31. data/app/components/alveole/input/counter_component.html.erb +16 -0
  32. data/app/components/alveole/input/counter_component.rb +4 -0
  33. data/app/components/alveole/input/email_component.html.erb +17 -0
  34. data/app/components/alveole/input/email_component.rb +4 -0
  35. data/app/components/alveole/input/file_component.html.erb +4 -0
  36. data/app/components/alveole/input/file_component.rb +4 -0
  37. data/app/components/alveole/input/search_component.html.erb +7 -0
  38. data/app/components/alveole/input/search_component.rb +5 -0
  39. data/app/components/alveole/input/select_component.html.erb +4 -0
  40. data/app/components/alveole/input/select_component.rb +12 -0
  41. data/app/components/alveole/input/text_component.html.erb +17 -0
  42. data/app/components/alveole/input/text_component.rb +4 -0
  43. data/app/components/alveole/input/textarea_component.html.erb +16 -0
  44. data/app/components/alveole/input/textarea_component.rb +4 -0
  45. data/app/components/alveole/mega_menu_component.html.erb +107 -0
  46. data/app/components/alveole/mega_menu_component.rb +6 -0
  47. data/app/components/alveole/sidebar/divider_component.html.erb +5 -0
  48. data/app/components/alveole/sidebar/divider_component.rb +5 -0
  49. data/app/components/alveole/sidebar/group_component.html.erb +7 -0
  50. data/app/components/alveole/sidebar/group_component.rb +37 -0
  51. data/app/components/alveole/sidebar/heading_component.html.erb +3 -0
  52. data/app/components/alveole/sidebar/heading_component.rb +8 -0
  53. data/app/components/alveole/sidebar/item_component.html.erb +14 -0
  54. data/app/components/alveole/sidebar/item_component.rb +17 -0
  55. data/app/components/alveole/sidebar_component.html.erb +13 -0
  56. data/app/components/alveole/sidebar_component.rb +40 -0
  57. data/app/controllers/alveole/application_controller.rb +4 -0
  58. data/app/helpers/alveole/application_helper.rb +4 -0
  59. data/app/jobs/alveole/application_job.rb +4 -0
  60. data/app/mailers/alveole/application_mailer.rb +6 -0
  61. data/app/models/alveole/application_record.rb +5 -0
  62. data/app/views/layouts/alveole/application.html.erb +28 -0
  63. data/config/importmap.rb +7 -0
  64. data/config/routes.rb +2 -0
  65. data/config/tailwind.config.js +42 -0
  66. data/lib/alveole/engine.rb +18 -21
  67. data/lib/alveole/version.rb +1 -1
  68. data/lib/alveole.rb +2 -12
  69. data/lib/tasks/alveole_tasks.rake +14 -0
  70. metadata +110 -110
  71. data/.gitignore +0 -8
  72. data/.gitlab-ci.yml +0 -55
  73. data/.rubocop.yml +0 -63
  74. data/.rubocop_todo.yml +0 -12
  75. data/.travis.yml +0 -6
  76. data/CODE_OF_CONDUCT.md +0 -74
  77. data/Gemfile +0 -7
  78. data/Gemfile.lock +0 -171
  79. data/LICENSE.txt +0 -21
  80. data/alveole.gemspec +0 -35
  81. data/bin/console +0 -14
  82. data/bin/setup +0 -8
  83. data/lib/alveole/components/avatar_component/avatar_component.html.slim +0 -6
  84. data/lib/alveole/components/avatar_component.rb +0 -9
  85. data/lib/alveole/components/badge_component/badge_component.html.slim +0 -2
  86. data/lib/alveole/components/badge_component.rb +0 -8
  87. data/lib/alveole/components/breadcrumb_component/breadcrumb_component.html.slim +0 -2
  88. data/lib/alveole/components/breadcrumb_component.rb +0 -8
  89. data/lib/alveole/components/breadcrumbs_component.rb +0 -7
  90. data/lib/alveole/components/button_component/button_component.html.slim +0 -5
  91. data/lib/alveole/components/button_component.rb +0 -15
  92. data/lib/alveole/components/definition_component/definition_component.html.slim +0 -4
  93. data/lib/alveole/components/definition_component.rb +0 -13
  94. data/lib/alveole/components/form_component/form_component.html.slim +0 -3
  95. data/lib/alveole/components/form_component.rb +0 -3
  96. data/lib/alveole/components/form_submit_component/form_submit_component.html.slim +0 -1
  97. data/lib/alveole/components/form_submit_component.rb +0 -7
  98. data/lib/alveole/components/heading_component/heading_component.html.slim +0 -4
  99. data/lib/alveole/components/heading_component.rb +0 -8
  100. data/lib/alveole/components/input_component/input_component.html.slim +0 -17
  101. data/lib/alveole/components/input_component.rb +0 -42
  102. data/lib/alveole/components/notice_component/notice_component.html.slim +0 -5
  103. data/lib/alveole/components/notice_component.rb +0 -15
  104. data/lib/alveole/components/page_component/page_component.html.slim +0 -10
  105. data/lib/alveole/components/page_component.rb +0 -4
  106. data/lib/alveole/components/sidebar_component/sidebar_component.html.slim +0 -7
  107. data/lib/alveole/components/sidebar_component.rb +0 -4
  108. data/lib/alveole/components/table_column_component/table_column_component.html.slim +0 -3
  109. data/lib/alveole/components/table_column_component.rb +0 -12
  110. data/lib/alveole/components/table_component/table_component.html.slim +0 -7
  111. data/lib/alveole/components/table_component.rb +0 -3
  112. data/lib/alveole/components/table_header_component/table_header_component.html.slim +0 -2
  113. data/lib/alveole/components/table_header_component.rb +0 -8
  114. data/lib/alveole/components/table_row_component/table_row_component.html.slim +0 -4
  115. data/lib/alveole/components/table_row_component.rb +0 -3
  116. data/lib/alveole/components/toolbar_component/toolbar_component.html.slim +0 -7
  117. data/lib/alveole/components/toolbar_component.rb +0 -4
  118. data/lib/alveole/concerns/bem.rb +0 -21
  119. data/lib/alveole/helpers/method_helper.rb +0 -31
  120. data/lib/alveole/javascript/components.js +0 -5
  121. data/lib/alveole/previews/avatar_component_preview.rb +0 -11
  122. data/lib/alveole/previews/badge_component_preview.rb +0 -11
  123. data/lib/alveole/previews/breadcrumb_component_preview.rb +0 -15
  124. data/lib/alveole/previews/button_component_preview.rb +0 -7
  125. data/lib/alveole/previews/definition_component_preview.rb +0 -33
  126. data/lib/alveole/previews/form_component_preview.rb +0 -18
  127. data/lib/alveole/previews/form_submit_component_preview.rb +0 -7
  128. data/lib/alveole/previews/heading_component_preview.rb +0 -11
  129. data/lib/alveole/previews/input_component_preview.rb +0 -32
  130. data/lib/alveole/previews/notice_component_preview.rb +0 -15
  131. data/lib/alveole/previews/page_component_preview.rb +0 -33
  132. data/lib/alveole/previews/sidebar_component_preview.rb +0 -33
  133. data/lib/alveole/previews/table_column_component_preview.rb +0 -36
  134. data/lib/alveole/previews/table_component_preview.rb +0 -12
  135. data/lib/alveole/previews/table_header_component_preview.rb +0 -27
  136. data/lib/alveole/previews/table_row_component_preview.rb +0 -18
  137. data/lib/alveole/previews/toolbar_component_preview.rb +0 -33
  138. data/lib/generators/alveole/config_generator.rb +0 -17
  139. data/lib/generators/alveole/templates/alveole_config.rb +0 -1
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at marinesourin@live.fr. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [https://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: https://contributor-covenant.org
74
- [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in alveole.gemspec
4
- gemspec
5
-
6
- gem 'minitest', '~> 5.0'
7
- gem 'rake', '~> 12.0'
data/Gemfile.lock DELETED
@@ -1,171 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- alveole (0.0.1)
5
- actionview
6
- activesupport (>= 4.1.0)
7
- rails
8
- view_component (~> 2.35)
9
-
10
- GEM
11
- remote: https://rubygems.org/
12
- specs:
13
- actioncable (6.1.4.1)
14
- actionpack (= 6.1.4.1)
15
- activesupport (= 6.1.4.1)
16
- nio4r (~> 2.0)
17
- websocket-driver (>= 0.6.1)
18
- actionmailbox (6.1.4.1)
19
- actionpack (= 6.1.4.1)
20
- activejob (= 6.1.4.1)
21
- activerecord (= 6.1.4.1)
22
- activestorage (= 6.1.4.1)
23
- activesupport (= 6.1.4.1)
24
- mail (>= 2.7.1)
25
- actionmailer (6.1.4.1)
26
- actionpack (= 6.1.4.1)
27
- actionview (= 6.1.4.1)
28
- activejob (= 6.1.4.1)
29
- activesupport (= 6.1.4.1)
30
- mail (~> 2.5, >= 2.5.4)
31
- rails-dom-testing (~> 2.0)
32
- actionpack (6.1.4.1)
33
- actionview (= 6.1.4.1)
34
- activesupport (= 6.1.4.1)
35
- rack (~> 2.0, >= 2.0.9)
36
- rack-test (>= 0.6.3)
37
- rails-dom-testing (~> 2.0)
38
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
39
- actiontext (6.1.4.1)
40
- actionpack (= 6.1.4.1)
41
- activerecord (= 6.1.4.1)
42
- activestorage (= 6.1.4.1)
43
- activesupport (= 6.1.4.1)
44
- nokogiri (>= 1.8.5)
45
- actionview (6.1.4.1)
46
- activesupport (= 6.1.4.1)
47
- builder (~> 3.1)
48
- erubi (~> 1.4)
49
- rails-dom-testing (~> 2.0)
50
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
51
- activejob (6.1.4.1)
52
- activesupport (= 6.1.4.1)
53
- globalid (>= 0.3.6)
54
- activemodel (6.1.4.1)
55
- activesupport (= 6.1.4.1)
56
- activerecord (6.1.4.1)
57
- activemodel (= 6.1.4.1)
58
- activesupport (= 6.1.4.1)
59
- activestorage (6.1.4.1)
60
- actionpack (= 6.1.4.1)
61
- activejob (= 6.1.4.1)
62
- activerecord (= 6.1.4.1)
63
- activesupport (= 6.1.4.1)
64
- marcel (~> 1.0.0)
65
- mini_mime (>= 1.1.0)
66
- activesupport (6.1.4.1)
67
- concurrent-ruby (~> 1.0, >= 1.0.2)
68
- i18n (>= 1.6, < 2)
69
- minitest (>= 5.1)
70
- tzinfo (~> 2.0)
71
- zeitwerk (~> 2.3)
72
- ast (2.4.2)
73
- builder (3.2.4)
74
- concurrent-ruby (1.1.9)
75
- crass (1.0.6)
76
- erubi (1.10.0)
77
- globalid (0.5.2)
78
- activesupport (>= 5.0)
79
- i18n (1.8.10)
80
- concurrent-ruby (~> 1.0)
81
- loofah (2.12.0)
82
- crass (~> 1.0.2)
83
- nokogiri (>= 1.5.9)
84
- mail (2.7.1)
85
- mini_mime (>= 0.1.1)
86
- marcel (1.0.1)
87
- method_source (1.0.0)
88
- mini_mime (1.1.1)
89
- minitest (5.14.4)
90
- nio4r (2.5.8)
91
- nokogiri (1.12.3-arm64-darwin)
92
- racc (~> 1.4)
93
- parallel (1.20.1)
94
- parser (3.0.1.1)
95
- ast (~> 2.4.1)
96
- racc (1.5.2)
97
- rack (2.2.3)
98
- rack-test (1.1.0)
99
- rack (>= 1.0, < 3)
100
- rails (6.1.4.1)
101
- actioncable (= 6.1.4.1)
102
- actionmailbox (= 6.1.4.1)
103
- actionmailer (= 6.1.4.1)
104
- actionpack (= 6.1.4.1)
105
- actiontext (= 6.1.4.1)
106
- actionview (= 6.1.4.1)
107
- activejob (= 6.1.4.1)
108
- activemodel (= 6.1.4.1)
109
- activerecord (= 6.1.4.1)
110
- activestorage (= 6.1.4.1)
111
- activesupport (= 6.1.4.1)
112
- bundler (>= 1.15.0)
113
- railties (= 6.1.4.1)
114
- sprockets-rails (>= 2.0.0)
115
- rails-dom-testing (2.0.3)
116
- activesupport (>= 4.2.0)
117
- nokogiri (>= 1.6)
118
- rails-html-sanitizer (1.4.1)
119
- loofah (~> 2.3)
120
- railties (6.1.4.1)
121
- actionpack (= 6.1.4.1)
122
- activesupport (= 6.1.4.1)
123
- method_source
124
- rake (>= 0.13)
125
- thor (~> 1.0)
126
- rainbow (3.0.0)
127
- rake (12.3.3)
128
- regexp_parser (2.1.1)
129
- rexml (3.2.5)
130
- rubocop (1.18.3)
131
- parallel (~> 1.10)
132
- parser (>= 3.0.0.0)
133
- rainbow (>= 2.2.2, < 4.0)
134
- regexp_parser (>= 1.8, < 3.0)
135
- rexml
136
- rubocop-ast (>= 1.7.0, < 2.0)
137
- ruby-progressbar (~> 1.7)
138
- unicode-display_width (>= 1.4.0, < 3.0)
139
- rubocop-ast (1.7.0)
140
- parser (>= 3.0.1.1)
141
- ruby-progressbar (1.11.0)
142
- sprockets (4.0.2)
143
- concurrent-ruby (~> 1.0)
144
- rack (> 1, < 3)
145
- sprockets-rails (3.2.2)
146
- actionpack (>= 4.0)
147
- activesupport (>= 4.0)
148
- sprockets (>= 3.0.0)
149
- thor (1.1.0)
150
- tzinfo (2.0.4)
151
- concurrent-ruby (~> 1.0)
152
- unicode-display_width (2.0.0)
153
- view_component (2.38.0)
154
- activesupport (>= 5.0.0, < 8.0)
155
- method_source (~> 1.0)
156
- websocket-driver (0.7.5)
157
- websocket-extensions (>= 0.1.0)
158
- websocket-extensions (0.1.5)
159
- zeitwerk (2.4.2)
160
-
161
- PLATFORMS
162
- ruby
163
-
164
- DEPENDENCIES
165
- alveole!
166
- minitest (~> 5.0)
167
- rake (~> 12.0)
168
- rubocop (~> 1.18)
169
-
170
- BUNDLED WITH
171
- 2.2.22
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 Marine Sourin
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/alveole.gemspec DELETED
@@ -1,35 +0,0 @@
1
- require_relative 'lib/alveole/version'
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = 'alveole'
5
- spec.version = Alveole::VERSION
6
- spec.authors = ['Marine Sourin', 'Marine Domine', 'Cedric Feyaerts', 'Thomas Kienlen']
7
- spec.email = ['marinesourin@live.fr', 'marine@captive.fr', 'c.feyaerts@captive.fr', 't.kienlen@captive.fr']
8
-
9
- spec.summary = 'Components and generator for the Alveole design system'
10
- spec.homepage = 'https://git.captive.fr' # TODO: fix this
11
- spec.license = 'MIT'
12
- spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
13
-
14
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
15
-
16
- spec.metadata['homepage_uri'] = spec.homepage
17
- spec.metadata['source_code_uri'] = 'https://git.captive.fr' # TODO: fix this
18
- spec.metadata['changelog_uri'] = 'https://git.captive.fr' # TODO: fix this
19
-
20
- # Specify which files should be added to the gem when it is released.
21
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
- end
25
- spec.bindir = 'exe'
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
- spec.require_paths = ['lib']
28
-
29
- spec.add_dependency 'actionview'
30
- spec.add_dependency 'activesupport', '>= 4.1.0'
31
- spec.add_dependency 'rails'
32
- spec.add_dependency 'view_component', '~> 2.35'
33
-
34
- spec.add_development_dependency 'rubocop', '~> 1.18'
35
- end
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'bundler/setup'
4
- require 'alveole'
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require 'irb'
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,6 +0,0 @@
1
- .avatar *@options
2
- - if @url
3
- = link_to(@url)
4
- .avatar__content style="background-image: url(#{@image})"
5
- - else
6
- .avatar__content style="background-image: url(#{@image})"
@@ -1,9 +0,0 @@
1
- class AvatarComponent < ViewComponent::Base
2
- def initialize(image:, url: nil, options: {})
3
- super
4
-
5
- @image = image
6
- @url = url
7
- @options = options
8
- end
9
- end
@@ -1,2 +0,0 @@
1
- .badge *@options
2
- = @label
@@ -1,8 +0,0 @@
1
- class BadgeComponent < ViewComponent::Base
2
- def initialize(label:, options: {})
3
- super
4
-
5
- @label = label
6
- @options = options
7
- end
8
- end
@@ -1,2 +0,0 @@
1
- span.breadcrumb
2
- = link_to_if @url, @label, @url, class: 'breadcrumb__link'
@@ -1,8 +0,0 @@
1
- class BreadcrumbComponent < ViewComponent::Base
2
- def initialize(label:, url: nil)
3
- super
4
-
5
- @url = url
6
- @label = label
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- class BreadcrumbsComponent < ViewComponent::Base
2
- def call
3
- tag.div(class: 'breadcrumbs') do
4
- content
5
- end
6
- end
7
- end
@@ -1,5 +0,0 @@
1
- = link_to @url, @options.merge(class: ['button'] + @bem_classes) do
2
- - if @icon
3
- i.button__icon { class=@icon }
4
- - unless @modifiers.include? :icon_only
5
- span.button__label = @label
@@ -1,15 +0,0 @@
1
- class ButtonComponent < ViewComponent::Base
2
- include Alveole::Concerns::Bem
3
-
4
- MODIFIERS = %i[small icon_only primary].freeze
5
-
6
- def initialize(url:, label:, icon: nil, modifiers: [], options: {})
7
- super
8
-
9
- @url = url
10
- @label = label
11
- @icon = icon
12
- @options = options
13
- self.modifiers = modifiers
14
- end
15
- end
@@ -1,4 +0,0 @@
1
- dl.definition
2
- dt.definition__label = @label
3
- dd.definition__value *@options
4
- = content || @value
@@ -1,13 +0,0 @@
1
- class DefinitionComponent < ViewComponent::Base
2
- def initialize(label: nil, value: nil, obj: nil, fieldname: nil, options: {})
3
- super
4
-
5
- @obj = obj
6
- @fieldname = fieldname
7
- @value = value || obj&.send(fieldname)
8
- @value = ApplicationController.helpers.format_value(@value, options)
9
- @value = '---' if @value.blank?
10
- @label = label || ApplicationController.helpers.label_for(obj, fieldname)
11
- @options = options
12
- end
13
- end
@@ -1,3 +0,0 @@
1
- .form
2
- fieldset.form__inputs = content
3
- fieldset.form__actions = actions
@@ -1,3 +0,0 @@
1
- class FormComponent < ViewComponent::Base
2
- renders_one :actions
3
- end
@@ -1 +0,0 @@
1
- input[type="submit" name="commit" value=@label class='form__action button button--primary']
@@ -1,7 +0,0 @@
1
- class FormSubmitComponent < ViewComponent::Base
2
- def initialize(label:)
3
- super
4
-
5
- @label = label
6
- end
7
- end
@@ -1,4 +0,0 @@
1
- h1.heading
2
- = @heading
3
- = content
4
- h2.heading--sub = @sub
@@ -1,8 +0,0 @@
1
- class HeadingComponent < ViewComponent::Base
2
- def initialize(heading: nil, sub: nil)
3
- super
4
-
5
- @heading = heading
6
- @sub = sub
7
- end
8
- end
@@ -1,17 +0,0 @@
1
- .input class=@bem_classes
2
- = @form.label @fieldname, @label, class: 'input__label'
3
- - case @type
4
- - when :text
5
- = @form.text_field @fieldname, @options.merge(class: 'input__input')
6
- - when :date
7
- = @form.text_field @fieldname, @options.merge(class: 'input__input datepicker')
8
- - when :color
9
- = @form.color_field @fieldname, @options
10
- - when :select
11
- = @form.select @fieldname, @collection, @options, @options.merge(class: 'input__input')
12
- - when :file
13
- = @form.file_field @fieldname, @options.merge(class: 'input__input')
14
- - when :text_area
15
- = @form.text_area @fieldname, @options.merge(class: 'input__input')
16
- - if @error_message
17
- .input__errors = @error_message
@@ -1,42 +0,0 @@
1
- class InputComponent < ViewComponent::Base
2
- include Alveole::Concerns::Bem
3
-
4
- MODIFIERS = %i[disabled error].freeze
5
-
6
- def initialize(type: nil, label: nil,
7
- value: nil,
8
- form: nil,
9
- fieldname: nil,
10
- collection: nil,
11
- modifiers: [],
12
- options: {})
13
- super
14
-
15
- @label = label
16
- @form = form
17
- @fieldname = fieldname
18
- @collection = collection
19
- @options = options
20
- @options[:value] = value if value
21
- @type = type || :text
22
- @error_message = error_message
23
-
24
- modifiers << :error if error?
25
- modifiers << :disabled if options[:disabled]
26
- self.modifiers = modifiers
27
- end
28
-
29
- private
30
-
31
- def error?
32
- return false unless @form.object.respond_to? :errors
33
-
34
- @error ||= @form.object.errors.include?(@fieldname.to_s.sub(/_id$/, ''))
35
- end
36
-
37
- def error_message
38
- return unless error?
39
-
40
- @error_message ||= @form.object.errors.messages_for(@fieldname.to_s.sub(/_id$/, '')).join(', ')
41
- end
42
- end
@@ -1,5 +0,0 @@
1
- .notice class="notice--#{@type}"
2
- .notice__title = @title
3
- ul.notice__messages
4
- - @messages.each do |message|
5
- .notice__message = message
@@ -1,15 +0,0 @@
1
- class NoticeComponent < ViewComponent::Base
2
- TYPES = %w[notice alert].freeze
3
- def initialize(title:, messages: [], type: nil)
4
- super
5
-
6
- @type = type if TYPES.include?(type)
7
- @type ||= 'alert'
8
- @title = title
9
- @messages = messages
10
- end
11
-
12
- def render?
13
- @messages.any?
14
- end
15
- end
@@ -1,10 +0,0 @@
1
- .page
2
- .page__header_wrapper
3
- .page__header
4
- = header
5
- .page__content_wrapper
6
- .page__content
7
- = content
8
- .page__actions_wrapper
9
- .page__actions
10
- = actions
@@ -1,4 +0,0 @@
1
- class PageComponent < ViewComponent::Base
2
- renders_one :actions
3
- renders_one :header
4
- end
@@ -1,7 +0,0 @@
1
- aside.sidebar
2
- section.sidebar__start
3
- = top
4
- section.sidebar__middle
5
- = content
6
- section.sidebar__end
7
- = bottom
@@ -1,4 +0,0 @@
1
- class SidebarComponent < ViewComponent::Base
2
- renders_one :top
3
- renders_one :bottom
4
- end
@@ -1,3 +0,0 @@
1
- td.table__column
2
- = link_to_if @url, @value, @url
3
- = content
@@ -1,12 +0,0 @@
1
- class TableColumnComponent < ViewComponent::Base
2
- def initialize(value: nil, obj: nil, fieldname: nil, url: nil, options: {})
3
- super
4
-
5
- @obj = obj
6
- @fieldname = fieldname
7
- @value = value || obj&.send(fieldname)
8
- @value = ApplicationController.helpers.format_value(@value, options)
9
- @url = url
10
- @options = options
11
- end
12
- end
@@ -1,7 +0,0 @@
1
- table.table
2
- thead
3
- tr
4
- = headers
5
- th
6
- tbody
7
- = content
@@ -1,3 +0,0 @@
1
- class TableComponent < ViewComponent::Base
2
- renders_one :headers
3
- end
@@ -1,2 +0,0 @@
1
- th.table__header
2
- = link_to_if @url, @label, @url
@@ -1,8 +0,0 @@
1
- class TableHeaderComponent < ViewComponent::Base
2
- def initialize(label: nil, url: nil, obj: nil, fieldname: nil)
3
- super
4
-
5
- @label = label || ApplicationController.helpers.label_for(obj, fieldname)
6
- @url = url
7
- end
8
- end
@@ -1,4 +0,0 @@
1
- tr.table__row
2
- = content
3
- td.table__column
4
- = actions
@@ -1,3 +0,0 @@
1
- class TableRowComponent < ViewComponent::Base
2
- renders_one :actions
3
- end
@@ -1,7 +0,0 @@
1
- .toolbar
2
- section.toolbar__start
3
- = left
4
- section.toolbar__middle
5
- = content
6
- section.toolbar__end
7
- = right
@@ -1,4 +0,0 @@
1
- class ToolbarComponent < ViewComponent::Base
2
- renders_one :left
3
- renders_one :right
4
- end