railwind 0.1.25 → 0.1.26

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: 85f1ad6b80de9ce7f54fa24193750d0eaa04ba4d45c770e21621146883ba3594
4
- data.tar.gz: bc108d03b6be068224ed227bc4160589b022957744e3afd2294b26b2cee2cacc
3
+ metadata.gz: 31b0592762410534c3e2049c97ca2ebc4ff1e11e294ad0537ef4b7d9a095fbaf
4
+ data.tar.gz: 7791bc2120f8850ff53b6d6b9805ab1774d5c7e2caa98d0bd9694c7b0e6b7a4b
5
5
  SHA512:
6
- metadata.gz: ff81827ad27518d6982ede30e184e40b9376fa13dda8ecdb5a19d706b61ca993cd1e7c6973d5675634984168ca0bbe5ee02195ac31a512149ab9fa2488b92039
7
- data.tar.gz: 8cbdeb310acbd900cb88c40712631e1d0a0623d4cc1171d08a4a8188577a99fa7389c87c1735ab3839ef2a4ce2507b65b2617bf59a4e59afc50e78843e1f4536
6
+ metadata.gz: c10596fbf7d85156164468c329faca6df9b5d87dad84c9f6ba1d98fe1ab489459bcf90f8c16b11bc4c7e14d71649290b2fc01432604180f466aec3668f0dcb10
7
+ data.tar.gz: 15c39cdf52f8ef2cc84123905033f028fc63838b104a663d6112ba36bc296722397fb9ca4ff551884cf4132d697d436f7b5fa72cca96ee3c70ddb09b23930267
@@ -0,0 +1,12 @@
1
+ require 'rails/generators'
2
+
3
+ module Railwind
4
+ class CheckboxGenerator < Rails::Generators::Base
5
+ source_root File.expand_path('templates', __dir__)
6
+
7
+ def create_component_file
8
+ copy_file "checkbox/checkbox_component.rb", "app/components/checkbox_component.rb"
9
+ copy_file "checkbox/_checkbox_component.html.erb", "app/components/checkbox_component.html.erb"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ <div class="space-y-5">
2
+ <div class="relative flex items-start">
3
+ <div class="flex h-6 items-center">
4
+ <input id="<%= @name%>" aria-describedby="<%= @name %>-description" name="<%= @name %>" type="checkbox" <%= 'checked' if @checked %> <%= 'disabled' if @disabled %> class="h-4 w-4 rounded border-black text-black focus:ring-black disabled:cursor-not-allowed <%= 'opacity-50' if @disabled %>">
5
+ </div>
6
+ <div class="ml-3 leading-6 <%= 'opacity-50' if @disabled %>">
7
+ <label for="<%= @name %>" class="font-medium text-black text-md"><%= @label %></label>
8
+ <p id="<%= @name %>-description" class="text-gray-600 text-sm"><%= @description %></p>
9
+ </div>
10
+ </div>
11
+ </div>
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CheckboxComponent < ViewComponent::Base
4
+ def initialize(name:, label: , description: "", checked: false, disabled: false)
5
+ @name = name
6
+ @label = label
7
+ @description = description
8
+ @checked = checked
9
+ @disabled = disabled
10
+ end
11
+ end
12
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Railwind
4
- VERSION = "0.1.25"
4
+ VERSION = "0.1.26"
5
5
  end
data/lib/railwind.rb CHANGED
@@ -7,6 +7,7 @@ require_relative "railwind/generators/button_generator"
7
7
  require_relative "railwind/generators/card_generator"
8
8
  require_relative "railwind/generators/tab_generator"
9
9
  require_relative "railwind/generators/callout_generator"
10
+ require_relative "railwind/generators/checkbox_generator"
10
11
 
11
12
  module Railwind
12
13
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railwind
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Bryant
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-02 00:00:00.000000000 Z
11
+ date: 2023-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -57,6 +57,7 @@ files:
57
57
  - lib/railwind/generators/button_generator.rb
58
58
  - lib/railwind/generators/callout_generator.rb
59
59
  - lib/railwind/generators/card_generator.rb
60
+ - lib/railwind/generators/checkbox_generator.rb
60
61
  - lib/railwind/generators/progress_generator.rb
61
62
  - lib/railwind/generators/tab_generator.rb
62
63
  - lib/railwind/generators/templates/button/_button_component.html.erb
@@ -65,6 +66,8 @@ files:
65
66
  - lib/railwind/generators/templates/callout/callout_component.rb
66
67
  - lib/railwind/generators/templates/card/_card_component.html.erb
67
68
  - lib/railwind/generators/templates/card/card_component.rb
69
+ - lib/railwind/generators/templates/checkbox/_checkbox_component.html.erb
70
+ - lib/railwind/generators/templates/checkbox/checkbox_component.rb
68
71
  - lib/railwind/generators/templates/progress/_progress_component.html.erb
69
72
  - lib/railwind/generators/templates/progress/progress_component.rb
70
73
  - lib/railwind/generators/templates/tabs/_tab_component.html.erb