storybook_engine 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a34a1c5541c948fc0c962e848d39e38b40e01b5f1e8215c76a01efb6cc9d0fe
4
- data.tar.gz: 1b535a733bd7b4fe9674d4b3f183fa923ceebc087bee1df4050db40b6becd914
3
+ metadata.gz: 464a25dc1e8c7cbeee56b889ad85d03a20d1d6300a5b269395e0be23b5c40878
4
+ data.tar.gz: 92d454785ddbcecbd4c4c88e8f5d04c200acbce4743e32acaf1178d77b785fa5
5
5
  SHA512:
6
- metadata.gz: ab7d2e4cb20b42d5c05c88bb42803855a4cfd140cd7a04fe02db705ecf0c3bfe8a6bbd62b4778774bd0254f45a7d956812883995b0ad7e58a675f65daa6a6411
7
- data.tar.gz: d85c914074f59195c16f6a4d7c9f18fc4ed56e0b6b60955a8e9d5e4a1072745756de83526db8bf568c181827760b1eefe2f45d9c1804eeb012b11903fed49109
6
+ metadata.gz: 44ecbc7025733af308a0a743e46e522fbd21305c1c49af6e251e569f957b64af0b5b46a3d59ad58b2a8800043bfab8d3ec872e6ba625940cbdbb2a62cc3d604d
7
+ data.tar.gz: c7fc8f4da56516eccf094d16431c87b066da8fc46e25306bb70227e91afdeaa5bb910fc0db9fde6772aeb593fb7c9d637d898503fa2c86b561128c26d7cad02a
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # StorybookEngine
2
- Short description and motivation.
2
+ Storybook with view components rails engine
3
3
 
4
4
  ## Usage
5
- How to use my plugin.
6
-
5
+ ##### Button
6
+ ```ruby
7
+ = render(ButtonComponent.new(options: {type: "submit"},classes: "w-100")) { "Save" }
8
+ ```
7
9
  ## Installation
8
10
  Add this line to your application's Gemfile:
9
11
 
@@ -21,8 +23,10 @@ Or install it yourself as:
21
23
  $ gem install storybook_engine
22
24
  ```
23
25
 
24
- ## Contributing
25
- Contribution directions go here.
26
+ After add gem please add this line into your applications.scss:
27
+ ```bash
28
+ @import "storybook_engine/application";
29
+ ```
26
30
 
27
31
  ## License
28
32
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1,2 +1,2 @@
1
1
  %button{{class: classes}.merge(@options)}
2
- = content
2
+ = content
@@ -0,0 +1,5 @@
1
+ .form-group
2
+ - if !@options[:label].nil?
3
+ %label{class: @options[:label_classes]}
4
+ = @options[:label]
5
+ %input{class: classes,"name" => @options[:field_name],"value"=> @options[:default_value],"placeholder"=>@options[:placeholder]}
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ class InputComponent < ViewComponent::Base
4
+ BASE_CLASSES = "form-control"
5
+
6
+ def initialize(options:,classes: '')
7
+ @options = options
8
+ @classes = classes
9
+ end
10
+
11
+ def classes
12
+ "#{@classes} #{BASE_CLASSES}"
13
+ end
14
+
15
+ end
@@ -0,0 +1,2 @@
1
+ %label{{class: @classes }.merge(@options)}
2
+ = content
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class LabelComponent < ViewComponent::Base
4
+ def initialize(options:, classes: '')
5
+ @options = options
6
+ @classes = classes
7
+ end
8
+
9
+ end
@@ -0,0 +1,2 @@
1
+ %a{{class: classes}.merge(@options)}
2
+ = content
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ class LinkComponent < ViewComponent::Base
4
+ BASE_CLASSES = "zenhr-link"
5
+
6
+ def initialize(options:, classes: '')
7
+ @options = options
8
+ @classes = classes
9
+ end
10
+
11
+ def classes
12
+ "#{BASE_CLASSES} #{@classes}"
13
+ end
14
+
15
+ end
@@ -1,3 +1,3 @@
1
1
  module StorybookEngine
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storybook_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amr Abu Aza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-25 00:00:00.000000000 Z
11
+ date: 2021-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -48,6 +48,12 @@ files:
48
48
  - app/assets/stylesheets/storybook_engine/helpers/_mixins.scss
49
49
  - app/components/storybook_engine/button_component.html.haml
50
50
  - app/components/storybook_engine/button_component.rb
51
+ - app/components/storybook_engine/input_component.html.haml
52
+ - app/components/storybook_engine/input_component.rb
53
+ - app/components/storybook_engine/label_component.html.haml
54
+ - app/components/storybook_engine/label_component.rb
55
+ - app/components/storybook_engine/link_component.html.haml
56
+ - app/components/storybook_engine/link_component.rb
51
57
  - app/controllers/storybook_engine/application_controller.rb
52
58
  - app/helpers/storybook_engine/application_helper.rb
53
59
  - app/jobs/storybook_engine/application_job.rb