componeer 0.0.1a → 0.0.3a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3c4b85f711607615e138a7a1f4e8daf968027a526397ac84049a771861ac1c1
4
- data.tar.gz: b622a354a38801d06acd42905bbd93f5f5448bf093e21b11db75f5525fe74660
3
+ metadata.gz: afdc2b92bfe721aac15e09b76df81c3ee63a18b7d478ea62e1db11f63474a19e
4
+ data.tar.gz: 379da8e30d7a2094641d788746ad9b855b9df0f5406b53c492b98861c4c19147
5
5
  SHA512:
6
- metadata.gz: e73e90c188ccb86131457881a389a080b1b914378ce885a15cb75ac1e4278a19553905d48c76403603e64f70a0635b93e4b041a3b2028438bd43f6cda7a41a11
7
- data.tar.gz: 2d4efb986f449539532ff30342e71cccf375c514ab2383d30d83bd5599c89748cf3d4965aad102917de3a80ef0da8933c8e6b34c37d9056ae7bbed465d94e9cd
6
+ metadata.gz: e874ca5ebced2250072cbb1f26ae5b3a4b663f3943f0fc154792af23486d7dffc04a2a03a96eaf7ad330aa366d4b4a9e7e71163de832731e6978242fc1691ffd
7
+ data.tar.gz: 226e38839c21e874963bf1f724fa94fed7955acac69d4235e5dff2fa093a1577dc86434f3ebf89d86bc6c094f40d0d6e7be80dde0a09b521b05a9799433064a8
@@ -0,0 +1,6 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12 9V11M12 15H12.01M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603
3
+ 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33978 16C2.56998
4
+ 17.3333 3.53223 19 5.07183 19Z"
5
+ stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd"
3
+ d="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2
4
+ 10 2C14.4183 2 18 5.58172 18 10ZM11 6C11 6.55228 10.5523 7 10 7C9.44772 7 9 6.55228 9
5
+ 6C9 5.44772 9.44772 5 10 5C10.5523 5 11 5.44772 11 6ZM9 9C8.44772 9 8 9.44772 8
6
+ 10C8 10.5523 8.44772 11 9 11V14C9 14.5523 9.44772 15 10 15H11C11.5523 15 12 14.5523 12
7
+ 14C12 13.4477 11.5523 13 11 13V10C11 9.44772 10.5523 9 10 9H9Z"
8
+ fill="currentColor"/>
9
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
2
+ stroke="currentColor">
3
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
4
+ </svg>
@@ -1,9 +1,9 @@
1
1
  module Componeer
2
2
  class BaseComponent < ViewComponent::Base
3
- def self.register_as(name)
4
- name = name.to_s.to_sym
3
+ include Componeer::Helpers
5
4
 
6
- Componeer.register(name.to_sym, self)
5
+ def self.register_as(name)
6
+ Componeer.register(name.to_s.to_sym, self)
7
7
  end
8
8
 
9
9
  def resolve_params(content_or_options, options)
@@ -0,0 +1,28 @@
1
+ <div class="flex flex-col py-12 justify-center items-center bg-gray-50 rounded-md">
2
+ <% if @icon %>
3
+ <div><%= inline_svg_tag("#{@icon}.svg", class: 'mx-auto h-12 w-12 text-gray-400') %></div>
4
+ <% end %>
5
+
6
+ <h3 class="text-sm font-medium text-gray-900">No <%= @resource_name.pluralize %></h3>
7
+ <% if @description %>
8
+ <p class="text-sm text-gray-500"><%= @description %></p>
9
+ <% end %>
10
+ <% if @new_resource_path %>
11
+ <div class="flex flex-col items-center space-y-2">
12
+ <p class="text-sm text-gray-500">
13
+ Get started by creating a new <%= @resource_name %>.
14
+ </p>
15
+ <div>
16
+ <%= componeer.button(size: :small) do %>
17
+ <%= link_to @new_resource_path do %>
18
+ <div class="flex items-center space-x-2">
19
+ <%= inline_svg_tag('plus.svg', class: 'h-5 w-5') %>
20
+
21
+ <span>New <%= @resource_name %></span>
22
+ </div>
23
+ <% end %>
24
+ <% end %>
25
+ </div>
26
+ </div>
27
+ <% end %>
28
+ </div>
@@ -0,0 +1,14 @@
1
+ module Componeer
2
+ module EmptyStates
3
+ class EmptyStateComponent < BaseComponent
4
+ register_as :empty_state
5
+
6
+ def initialize(resource_name:, icon: :exclamation, new_resource_path: nil, description: nil)
7
+ @resource_name = resource_name
8
+ @icon = icon
9
+ @new_resource_path = new_resource_path
10
+ @description = description
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ InlineSvg.configure do |config|
2
+ config.asset_file = InlineSvg::CachedAssetFile.new(
3
+ paths: ['gems/componeer/app/assets/images/icons/'],
4
+ filters: /\.svg/
5
+ )
6
+ end
@@ -1,3 +1,3 @@
1
1
  module Componeer
2
- VERSION = '0.0.1a'.freeze
2
+ VERSION = '0.0.3a'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: componeer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1a
4
+ version: 0.0.3a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Rodrigues
@@ -68,14 +68,20 @@ extra_rdoc_files: []
68
68
  files:
69
69
  - Rakefile
70
70
  - app/assets/config/componeer_manifest.js
71
+ - app/assets/images/icons/exclamation.svg
72
+ - app/assets/images/icons/information_circle.svg
73
+ - app/assets/images/icons/plus.svg
71
74
  - app/assets/stylesheets/componeer/application.css
72
75
  - app/components/componeer/base_component.rb
73
76
  - app/components/componeer/buttons/button_component.html.erb
74
77
  - app/components/componeer/buttons/button_component.rb
75
78
  - app/components/componeer/buttons/styles.yml
79
+ - app/components/componeer/empty_states/empty_state_component.html.erb
80
+ - app/components/componeer/empty_states/empty_state_component.rb
76
81
  - app/controllers/application_controller.rb
77
82
  - app/controllers/componeer/application_controller.rb
78
83
  - app/helpers/componeer/application_helper.rb
84
+ - config/initializers/inline_svg.rb
79
85
  - config/routes.rb
80
86
  - lib/componeer.rb
81
87
  - lib/componeer/configuration.rb