Skip to content

Commit

Permalink
feat: 💄 Initial files for flowbite view components embedded gem
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsadam committed Oct 18, 2024
1 parent f31ef53 commit ad42561
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 10 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ gem 'faraday-net_http_persistent', '~> 2.0'
# gem "sassc-rails"

# Tailwind CSS [https://tailwindcss.com]
gem 'flowbite_view_components', path: './embedded_gems/flowbite'
gem 'tailwindcss-rails', '~> 2.7'
gem 'view_component', '~> 3.15'

Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ GIT
net-http-persistent (~> 4.0)
nokogiri (~> 1, >= 1.10.8)

PATH
remote: embedded_gems/flowbite
specs:
flowbite_view_components (0.0.1)
view_component (~> 3.15)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -650,6 +656,7 @@ DEPENDENCIES
faraday
faraday-multipart
faraday-net_http_persistent (~> 2.0)
flowbite_view_components!
fx
good_job (~> 4.1, >= 4.1.1)
google-cloud-storage (~> 1.11)
Expand Down
9 changes: 0 additions & 9 deletions app/embedded_gems/flowbite_gem/flowbit_gem.gemspec

This file was deleted.

1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_relative 'boot'

require 'rails/all'
require 'flowbite_view_components'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand Down
13 changes: 13 additions & 0 deletions embedded_gems/flowbite/app/components/flowbite/component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Flowbite
# @private
# :nocov:
class Component < ViewComponent::Base
erb_template <<-ERB
<div class="bg-red-500">
<%= content %>
</div>
ERB
end
end
19 changes: 19 additions & 0 deletions embedded_gems/flowbite/flowbite.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'flowbite/view_components/version'

Gem::Specification.new do |spec|
spec.name = 'flowbite_view_components'
spec.authors = ['Bioinformatics and Computational Biology Unit, Public Health Agency of Canada']
spec.email = ['[email protected]']
spec.version = Flowbite::ViewComponents::Version::STRING
spec.summary = 'Flowbite View Components'
spec.license = 'MIT'
spec.files = Dir['lib/**/*', 'app/**/*']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.2.0'
spec.add_dependency 'view_component', '~> 3.15'
spec.metadata['rubygems_mfa_required'] = 'true'
end
15 changes: 15 additions & 0 deletions embedded_gems/flowbite/lib/flowbite/view_components/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Flowbite
module ViewComponents
module Version
MAJOR = 0
MINOR = 0
PATCH = 1

STRING = [MAJOR, MINOR, PATCH].join('.').freeze
end
end
end

puts Flowbite::ViewComponents::Version::STRING if __FILE__ == $PROGRAM_NAME
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<%= form_with do |form| %>
<%= render ListFilterComponent.new(form:, filters: []) %>
<% end %>
<%= render Flowbite::Component.new do %>
Hello World
<% end %>
<% end %>

0 comments on commit ad42561

Please sign in to comment.