wilday_ui 0.1.0 → 0.2.1

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: d9a81a71dc979b91c1437051a2924dc22d1c9ef0cc0923f6606d409b76b6e790
4
- data.tar.gz: ae05eaf824740f4b843b13f606a91ac49948eb9c3d68703fc5fb2cee3f0045fe
3
+ metadata.gz: 79a771a319530faa8a85e619e1a83c3d56919eeb2e85070aabacd93dd311b96d
4
+ data.tar.gz: 10b4ee8fb6827353eec9acd863e860e5aea1eff14b70d1c6469b747812a4538e
5
5
  SHA512:
6
- metadata.gz: 7e09f450b47502c3b8e479c8df576b0226ed14bcb5e8d8534b36b9b55862326c7822d30438ccd5a690c439ae835730f580bb58577362a261241b8847f392769e
7
- data.tar.gz: 8087d892f850e81b23da8f3e0a1adb143fc65d63c265f1a3154972ec6baeb02885ab406d855f0f442d5e7cb362faea6f04aa1e56499664456b88cab5adef8656
6
+ metadata.gz: '096ea33edd7f08b16d2390d281a7ffe5c9510f01cfc913dd343ca6816e81ad7bec5ff86ee65ec0e7c4fc8b56f21fe77ded317e0888b730be318508580519043a'
7
+ data.tar.gz: 474957ce2da073bdd13ca68c20e2b36da33a6d8fdc0bf79fca60e8398a560cbf811f7b5c22e043c2b444f482ecebb1ee098a6250a04c8abe1694a12543276e1f
data/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # Wilday UI
2
2
 
3
- Wilday UI is a simple, customizable UI component library for Ruby on Rails projects. It includes ready-to-use components such as buttons with customizable styles, sizes, and radii, making it easy to create beautiful, consistent UI elements.
3
+ Wilday UI is a simple, customizable UI component library for Ruby on Rails projects. It provides a collection of prebuilt, reusable components with customizable styles and options, making it easy to build beautiful, consistent, and maintainable user interfaces.
4
4
 
5
5
  ---
6
6
 
7
7
  ## Features
8
8
 
9
- - Prebuilt, customizable button component
10
- - Flexible variants, sizes, and border radii
11
- - Easy integration with Rails as an engine
9
+ - Prebuilt, customizable UI components for common needs
10
+ - Flexible styling options with variants, sizes, and layouts
11
+ - Support for seamless integration with Rails as an engine
12
+ - Built for extensibility and framework compatibility
12
13
 
13
14
  ---
14
15
 
@@ -17,6 +18,7 @@ Wilday UI is a simple, customizable UI component library for Ruby on Rails proje
17
18
  1. **Flexibility**: Users can style component without being restricted to predefined classes.
18
19
  2. **Extensibility**: Users can add attributes or integrate component with JavaScript, analytics, or accessibility tools.
19
20
  3. **Framework Integration**: Supports utility classes from frameworks like Bootstrap or Tailwind.
21
+ 4. **Library Integration**: Support to use with other libraries like Font Awesome, Bootstrap Icons, etc.
20
22
 
21
23
  ## Installation
22
24
 
@@ -99,5 +101,3 @@ Contributions are welcome! If you’d like to help improve Wilday UI, feel free
99
101
  Wilday UI is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
100
102
 
101
103
  ---
102
-
103
- This version makes the README user-friendly and focused on practical usage, while being concise for developers exploring the gem. Let me know if you’d like further tweaks! 🚀
@@ -75,3 +75,18 @@
75
75
  .w-button-square {
76
76
  border-radius: 0; /* No rounding */
77
77
  }
78
+
79
+ /* Icon Button Styles */
80
+ .w-button-icon-left {
81
+ margin-right: 0.5rem;
82
+ }
83
+
84
+ .w-button-icon-right {
85
+ margin-left: 0.5rem;
86
+ }
87
+
88
+ .w-button-icon-left,
89
+ .w-button-icon-right {
90
+ display: inline-flex;
91
+ align-items: center;
92
+ }
@@ -6,6 +6,8 @@ module WildayUi
6
6
  variant: :primary,
7
7
  size: :medium,
8
8
  radius: :rounded,
9
+ icon: nil,
10
+ icon_position: :left,
9
11
  disabled: false,
10
12
  additional_classes: "",
11
13
  **options
@@ -35,6 +37,8 @@ module WildayUi
35
37
  variant_class: variant_class,
36
38
  size_class: size_class,
37
39
  radius_class: radius_class,
40
+ icon: icon,
41
+ icon_position: icon_position,
38
42
  additional_classes: additional_classes,
39
43
  disabled: disabled,
40
44
  attributes: options.map { |key, value| "#{key}='#{value}'" }.join(" ")
@@ -3,5 +3,11 @@
3
3
  <%= attributes %>
4
4
  <%= "disabled" if disabled %>
5
5
  >
6
+ <% if icon_position == :left && icon.present? %>
7
+ <i class="w-button-icon-left <%= icon %>"></i>
8
+ <% end %>
6
9
  <%= content %>
7
- </button>
10
+ <% if icon_position == :right && icon.present? %>
11
+ <i class="w-button-icon-right <%= icon %>"></i>
12
+ <% end %>
13
+ </button>
@@ -1,7 +1,16 @@
1
+ require "wilday_ui/version_check"
2
+
1
3
  module WildayUi
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace WildayUi
4
6
 
7
+ # Automatically check for updates
8
+ initializer "wilday_ui.version_check" do
9
+ ActiveSupport.on_load(:after_initialize) do
10
+ WildayUi::VersionCheck.check_for_update
11
+ end
12
+ end
13
+
5
14
  # Automatically include helpers in views
6
15
  initializer "wilday_ui.helpers" do
7
16
  ActiveSupport.on_load(:action_view) do
@@ -1,3 +1,3 @@
1
1
  module WildayUi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,30 @@
1
+ require "net/http"
2
+ require "json"
3
+
4
+ module WildayUi
5
+ class VersionCheck
6
+ def self.check_for_update
7
+ current_version = WildayUi::VERSION
8
+ latest_version = fetch_latest_version
9
+
10
+ if latest_version && Gem::Version.new(latest_version) > Gem::Version.new(current_version)
11
+ Rails.logger.warn <<~WARNING
12
+ [Wilday UI] You are using version #{current_version}, but the latest version is #{latest_version}.
13
+ To update, run `bundle update wilday_ui` or update your Gemfile to the latest version.
14
+ WARNING
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def self.fetch_latest_version
21
+ url = URI("https://rubygems.org/api/v1/gems/wilday_ui.json")
22
+ response = Net::HTTP.get(url)
23
+ data = JSON.parse(response)
24
+ data["version"]
25
+ rescue StandardError => e
26
+ Rails.logger.info "[Wilday UI] Could not check for updates: #{e.message}"
27
+ nil
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wilday_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - davidwinalda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-09 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,7 +37,6 @@ executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []
39
39
  files:
40
- - MIT-LICENSE
41
40
  - README.md
42
41
  - Rakefile
43
42
  - app/assets/builds/index.css
@@ -61,6 +60,7 @@ files:
61
60
  - lib/wilday_ui.rb
62
61
  - lib/wilday_ui/engine.rb
63
62
  - lib/wilday_ui/version.rb
63
+ - lib/wilday_ui/version_check.rb
64
64
  homepage: https://github.com/davidwinalda/wildayui
65
65
  licenses:
66
66
  - MIT
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright davidwinalda
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.