railwind 0.1.24 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/railwind/generators/checkbox_generator.rb +12 -0
- data/lib/railwind/generators/progress_generator.rb +12 -0
- data/lib/railwind/generators/templates/checkbox/_checkbox_component.html.erb +11 -0
- data/lib/railwind/generators/templates/checkbox/checkbox_component.rb +12 -0
- data/lib/railwind/generators/templates/progress/_progress_component.html.erb +17 -0
- data/lib/railwind/generators/templates/progress/progress_component.rb +6 -0
- data/lib/railwind/version.rb +1 -1
- data/lib/railwind.rb +3 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31b0592762410534c3e2049c97ca2ebc4ff1e11e294ad0537ef4b7d9a095fbaf
|
4
|
+
data.tar.gz: 7791bc2120f8850ff53b6d6b9805ab1774d5c7e2caa98d0bd9694c7b0e6b7a4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,12 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Railwind
|
4
|
+
class ProgressGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path('templates', __dir__)
|
6
|
+
|
7
|
+
def create_component_file
|
8
|
+
copy_file "progress/progress_component.rb", "app/components/progress_component.rb"
|
9
|
+
copy_file "progress/_progress_component.html.erb", "app/components/progress_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
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="relative w-full">
|
2
|
+
<div class="flex mb-2 items-center justify-between">
|
3
|
+
<div>
|
4
|
+
<span class="text-xs font-semibold inline-block py-1 px-2 uppercase rounded-full text-zinc-600 bg-zinc-200">
|
5
|
+
<%= @label %>
|
6
|
+
</span>
|
7
|
+
</div>
|
8
|
+
<div class="text-right">
|
9
|
+
<span class="text-xs font-semibold inline-block text-zinc-600"><%= @value %>%</span>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<div class="overflow-hidden h-2 mb-4 text-xs flex rounded bg-zinc-200">
|
13
|
+
<div
|
14
|
+
class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-zinc-600"
|
15
|
+
style="width: <%= @value %>%" ></div>
|
16
|
+
</div>
|
17
|
+
</div>
|
data/lib/railwind/version.rb
CHANGED
data/lib/railwind.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "railwind/version"
|
4
|
+
|
5
|
+
require_relative "railwind/generators/progress_generator"
|
4
6
|
require_relative "railwind/generators/button_generator"
|
5
7
|
require_relative "railwind/generators/card_generator"
|
6
8
|
require_relative "railwind/generators/tab_generator"
|
7
9
|
require_relative "railwind/generators/callout_generator"
|
8
|
-
require_relative "railwind/generators/
|
10
|
+
require_relative "railwind/generators/checkbox_generator"
|
9
11
|
|
10
12
|
module Railwind
|
11
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.
|
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-
|
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,8 @@ 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
|
61
|
+
- lib/railwind/generators/progress_generator.rb
|
60
62
|
- lib/railwind/generators/tab_generator.rb
|
61
63
|
- lib/railwind/generators/templates/button/_button_component.html.erb
|
62
64
|
- lib/railwind/generators/templates/button/button_component.rb
|
@@ -64,6 +66,10 @@ files:
|
|
64
66
|
- lib/railwind/generators/templates/callout/callout_component.rb
|
65
67
|
- lib/railwind/generators/templates/card/_card_component.html.erb
|
66
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
|
71
|
+
- lib/railwind/generators/templates/progress/_progress_component.html.erb
|
72
|
+
- lib/railwind/generators/templates/progress/progress_component.rb
|
67
73
|
- lib/railwind/generators/templates/tabs/_tab_component.html.erb
|
68
74
|
- lib/railwind/generators/templates/tabs/tab_component.rb
|
69
75
|
- lib/railwind/generators/templates/tabs/tabs_controller.js
|